@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@600;700&family=Raleway:wght@400;600;700;800&display=swap');

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
}

body {
    font-family: 'Arial', sans-serif;
    margin: 0;
    padding: 0;
    color: #333;
    background-image: url('by wirestock on Freepik.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    position: relative;
    scroll-behavior: smooth;
    overflow-x: hidden;
    max-width: 100vw;
}

img {
    max-width: 100%;
    height: auto;
}

/* Neutral dark overlay – lets the background image breathe */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(18, 35, 18, 0.74);
    z-index: -1;
}

.container {
    max-width: 1200px;
    width: 100%;
    margin: 40px auto;
    padding: clamp(1rem, 4vw, 2.5rem);
    background: linear-gradient(to bottom right, #ffffff, #f0f0f0);
    border-radius: 10px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
    border: 1px solid #e0e0e0;
}

h1 {
    text-align: center;
    color: #006600;
    margin-bottom: 30px;
    font-family: 'Oswald', 'Arial Narrow', 'Arial', sans-serif;
    font-size: clamp(1.4rem, 4vw, 2.2rem);
    font-weight: 700;
    letter-spacing: 1px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
    position: relative;
    padding-bottom: 15px;
}

.flag-icon {
    height: 1em;
    margin-right: 10px;
    vertical-align: middle;
    border-radius: 3px;
}

h1::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 25%;
    right: 25%;
    height: 3px;
    background: linear-gradient(to right, #000000, #CC0000, #006600);
}

/* Logo Container */
.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 0;
    margin-bottom: 10px;
}

.logo-container img {
    max-height: 130px;
    width: auto;
    object-fit: contain;
}

.logo-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px 30px;
    background: linear-gradient(135deg, #006600 0%, #009900 100%);
    color: white;
    border-radius: 8px;
    font-size: 1.3em;
    font-weight: bold;
    text-decoration: none;
    box-shadow: 0 2px 10px rgba(0, 102, 0, 0.2);
    transition: all 0.3s ease;
}

.logo-placeholder:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 102, 0, 0.3);
}

.logo-placeholder i {
    margin-right: 10px;
    font-size: 1.2em;
}

/* Navigation Menu */
.main-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 15px 0 25px 0;
    flex-wrap: wrap;
    position: sticky;
    top: 0;
    z-index: 100;
    background: linear-gradient(to bottom right, #ffffff, #f0f0f0);
    padding: 10px 5px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.main-nav a,
.main-nav .auth-link,
.main-nav .nav-dropdown-toggle {
    color: #006600;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 5px;
    border: 2px solid #006600;
    transition: all 0.3s;
    font-weight: bold;
    background-color: white;
    cursor: pointer;
    display: inline-block;
    position: relative;
    text-align: center;
}

.main-nav a:hover,
.main-nav .auth-link:hover,
.main-nav .nav-dropdown-toggle:hover {
    background-color: #006600;
    color: white;
}

.main-nav a.active {
    background-color: #006600;
    color: white;
}

/* Dropdown Container */
.nav-dropdown {
    position: relative;
    display: inline-block;
}

.nav-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 5px;
}

.nav-dropdown-toggle i {
    font-size: 0.8em;
    transition: transform 0.3s;
}

.nav-dropdown.open .nav-dropdown-toggle i {
    transform: rotate(180deg);
}

/* Dropdown Menu */
.nav-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 2px solid #006600;
    border-radius: 5px;
    margin-top: 5px;
    min-width: 200px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s;
    z-index: 1000;
}

.nav-dropdown.open .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-dropdown-menu a {
    display: block;
    padding: 12px 20px;
    color: #006600;
    text-decoration: none;
    border: none;
    border-bottom: 1px solid #e0e0e0;
    transition: all 0.3s;
    border-radius: 0;
    font-weight: normal;
    background-color: white;
}

.nav-dropdown-menu a:last-child {
    border-bottom: none;
    border-radius: 0 0 3px 3px;
}

.nav-dropdown-menu a:first-child {
    border-radius: 3px 3px 0 0;
}

.nav-dropdown-menu a:hover {
    background-color: #f0f0f0;
    color: #006600;
    padding-left: 25px;
}

.nav-dropdown-menu a.active {
    background-color: #006600;
    color: white;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: white;
    border: 2px solid #006600;
    border-radius: 8px;
    padding: 10px 15px;
    color: #006600;
    font-size: 1.4em;
    cursor: pointer;
    transition: all 0.25s;
    position: sticky;
    top: 8px;
    z-index: 101;
    margin: 15px auto 0;
    min-width: 44px;
    min-height: 44px;
}

.mobile-menu-toggle:hover {
    background-color: #006600;
    color: white;
}

/* Overlay backdrop for mobile drawer */
.nav-drawer-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 98;
    opacity: 0;
    transition: opacity 0.3s;
}
.nav-drawer-overlay.active {
    display: block;
    opacity: 1;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .main-nav {
        position: fixed;
        top: 0;
        left: 0;
        height: 100%;
        width: 80%;
        max-width: 300px;
        flex-direction: column;
        align-items: stretch;
        background: linear-gradient(to bottom right, #ffffff, #f0f0f0);
        box-shadow: 4px 0 16px rgba(0,0,0,0.18);
        border-radius: 0;
        margin: 0;
        padding: 60px 12px 24px;
        z-index: 99;
        overflow-y: auto;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        display: flex !important;
    }

    .main-nav.mobile-open {
        transform: translateX(0);
    }

    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .main-nav a,
    .main-nav .auth-link,
    .main-nav .nav-dropdown-toggle {
        width: 100%;
        text-align: left;
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    .nav-dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        margin-top: 5px;
        border: none;
        border-left: 3px solid #006600;
        box-shadow: none;
        background: #f9f9f9;
    }

    .nav-dropdown.open .nav-dropdown-menu {
        display: block;
    }

    .nav-dropdown:not(.open) .nav-dropdown-menu {
        display: none;
    }
}

.auth-links-container {
    display: flex;
    align-items: center;
}

/* User Profile Dropdown */
.user-profile {
    position: relative;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #006600, #009900);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.user-avatar:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 10px rgba(0, 102, 0, 0.3);
}

.user-dropdown {
    position: absolute;
    top: 50px;
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s;
    z-index: 1000;
}

.user-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown-item {
    padding: 12px 20px;
    cursor: pointer;
    transition: background 0.3s;
    border-bottom: 1px solid #f0f0f0;
    color: #333;
}

.user-dropdown-item:first-child {
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    cursor: default;
    background: #f9f9f9;
    font-weight: bold;
}

.user-dropdown-item:last-child {
    border-bottom: none;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

.user-dropdown-item:not(:first-child):hover {
    background: #f5f5f5;
}

.user-dropdown-item i {
    margin-right: 10px;
    color: #006600;
    width: 20px;
    text-align: center;
}

/* Intro Section */
.intro-section {
    background-color: white;
    padding: 20px;
    margin-bottom: 25px;
    border-radius: 8px;
    border-left: 4px solid #006600;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.intro-section p {
    margin: 10px 0;
    line-height: 1.6;
}

.intro-section ul {
    margin: 10px 0;
    padding-left: 25px;
}

.intro-section li {
    margin: 5px 0;
    line-height: 1.5;
}

/* Info Sections */
.info-section {
    background-color: white;
    padding: 20px;
    margin: 20px 0;
    border-radius: 8px;
    border-left: 4px solid #CC0000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.info-section h2 {
    color: #006600;
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.4em;
}

.info-section ul {
    margin: 10px 0;
    padding-left: 25px;
}

.info-section li {
    margin: 8px 0;
    line-height: 1.5;
}

.info-section p {
    margin: 10px 0;
    line-height: 1.6;
}

/* Trust Signal */
.trust-signal {
    background: linear-gradient(to right, #006600, #009900);
    color: white;
    padding: 15px;
    margin: 20px 0;
    border-radius: 8px;
    text-align: center;
    font-weight: bold;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.trust-signal p {
    margin: 0;
    font-size: 1.1em;
}

/* Button Link Styling */
.button-link {
    display: inline-block;
    margin-top: 10px;
    background: linear-gradient(to right, #006600, #009900);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    min-width: 120px;
    transition: all 0.3s;
    font-weight: bold;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    text-decoration: none;
    text-align: center;
}

.button-link:hover {
    background: linear-gradient(to right, #004400, #007700);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 102, 0, 0.2);
}

.input-section, .results-section {
    margin-bottom: 30px;
    padding: 25px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border-left: 4px solid #006600;
}

button {
    background: linear-gradient(to right, #006600, #009900);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    width: auto;
    min-width: 120px;
    transition: all 0.3s;
    font-weight: bold;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-top: 10px;
    display: inline-block;
}

button:hover {
    background: linear-gradient(to right, #004400, #007700);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 102, 0, 0.2);
}

.results-section::before {
    content: "";
    display: block;
    height: 8px;
    background: linear-gradient(90deg, 
        #000000 25%, 
        #FFFFFF 25% 30%, 
        #CC0000 30% 55%, 
        #FFFFFF 55% 60%, 
        #006600 60% 85%, 
        #FFFFFF 85% 90%, 
        #000000 90%);
    margin: -25px -25px 20px -25px;
    border-radius: 5px 5px 0 0;
}

.result-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px dashed #e0e0e0;
}

.total {
    font-weight: bold;
    font-size: 1.2em;
    color: #006600;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 2px solid #CC0000;
}

.disclaimer {
    font-size: 12px;
    color: #555;
    margin-top: 30px;
    padding: 15px;
    background-color: #f8f8f8;
    border-radius: 5px;
    border-left: 3px solid #CC0000;
}

footer {
    text-align: center;
    margin-top: 40px;
    padding: 20px 15px;
    font-size: 13px;
    color: #666;
    border-top: 2px solid #e0e0e0;
    background: linear-gradient(to right, rgba(0,102,0,0.04), rgba(0,153,0,0.04));
    border-radius: 0 0 8px 8px;
}

footer a {
    color: #006600;
    text-decoration: none;
    transition: color 0.2s;
    font-weight: 600;
}

footer a:hover {
    color: #009900;
    text-decoration: underline;
}

.harambee-star {
    color: #CC0000;
    display: inline-block;
    margin: 0 5px;
    font-size: 1.2em;
    text-shadow: 0 0 3px rgba(0,0,0,0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}


.input-highlight {
    border: 1px solid #006600 !important;
}

.result-highlight {
    color: #CC0000;
    font-weight: bold;
}

/* Tab Styles */
.tab-container {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tab-button {
    padding: 8px 15px;
    background: #f0f0f0;
    border: none;
    cursor: pointer;
    font-size: 14px;
    border-radius: 5px 5px 0 0;
    margin-right: 5px;
    transition: all 0.3s;
    border: 1px solid #ddd;
    border-bottom: none;
    white-space: nowrap;
    flex-shrink: 0;
}

.tab-button.active {
    background: linear-gradient(to right, #006600, #009900);
    color: white;
    font-weight: bold;
    border-color: #006600;
}

.tab-button:not(.active) {
    background: white;
    color: #333;
}

/* Lock icon inside tab buttons for auth-gated features */
.tab-lock-icon {
    font-size: 0.8em;
    margin-right: 4px;
}

/* Payslip Styles */
.payslip-container {
    background-color: #fff;
    border: 1px solid #491010;
    border-radius: 5px;
    padding: 25px;
    margin-top: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    max-width: 800px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    min-height: 175mm;
    padding: 10mm;
    box-sizing: border-box;
}

.company-branding {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 2px dashed #006600;
    padding-bottom: 15px;
}

.logo-placeholder {
    position: relative;
    width: 80px;
    height: 80px;
    border: 1px dashed #999;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 20px;
    background-color: #f9f9f9;
    flex-shrink: 0;
    overflow: hidden;
}

.logo-placeholder img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.logo-placeholder button {
    position: absolute;
    z-index: 2;
    background: rgba(255,255,255,0.8);
    border: 1px solid #006600;
    color: #006600;
    padding: 5px 10px;
    font-size: 12px;
    cursor: pointer;
}

.logo-placeholder:hover button {
    background: #006600;
    color: white;
}

.company-info {
    flex-grow: 1;
}

.company-name-input, .company-detail-input {
    width: 100%;
    border: none;
    text-align: center;
    font-size: 16px;
    margin-bottom: 5px;
    padding: 5px;
}

.company-name-input {
    font-weight: bold;
    font-size: 18px;
    color: #006600;
}

.payslip-header h2 {
    text-align: center;
    color: #006600;
    margin: 15px 0;
    font-size: 22px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.payslip-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.meta-item span:first-child {
    font-weight: bold;
    margin-right: 10px;
}

.employee-details {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 5px;
}

.detail-row {
    display: flex;
    margin-bottom: 8px;
}

.detail-row span:first-child {
    font-weight: bold;
    width: 150px;
}

.earnings-deductions {
    display: flex;
    flex-wrap: wrap;
    gap: 5mm;
    margin-bottom: 20px;
}

.earnings-section, .deductions-section {
    flex: 1;
    min-width: 60mm;
}

.payslip-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    table-layout: fixed;
}

.payslip-table th {
    background-color: #006600;
    color: white;
    padding: 8px;
    text-align: left;
    white-space: nowrap;
}

.payslip-table td {
    padding: 8px;
    border-bottom: 1px solid #eee;
}

.summary-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.summary-table th, .summary-table td {
    padding: 10px;
    text-align: left;
}

.summary-table th {
    background-color: #f0f0f0;
}

.net-pay-row th, .net-pay-row td {
    font-weight: bold;
    font-size: 16px;
    background-color: #e6f7e6;
}

.signature-section {
    margin-top: 20px;
    padding-top: 10px;
    border-top: 1px dashed #999;
}

.signature-line {
    height: 1px;
    background-color: #000;
    margin: 20px 0 5px;
}

.signature-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 5px;
}

.signature-input {
    display: inline-block;
    width: 45%;
}

.signature-field {
    border: none;
    border-bottom: 1px solid #000;
    text-align: center;
    width: 100%;
    padding: 5px;
    margin-top: 5px;
}

.payslip-footer {
    text-align: center;
    font-size: 12px;
    color: #666;
    margin-top: 20px;
    font-style: italic;
}

.editable-field {
    border: 1px dashed #ccc;
    padding: 3px;
    background-color: #fff;
    min-width: auto;
    width: 100%;
    max-width: 100px;
}

.donate-toggle {
    background: linear-gradient(to right, #000000, #CC0000, #006600);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    margin: 20px auto;
    display: block;
    width: fit-content;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transition: all 0.3s;
}

.donate-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 12px rgba(0,0,0,0.3);
}

.donate-method-tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 12px 0 16px;
}

.donate-method-tab {
    padding: 8px 22px;
    border: 2px solid #006600;
    background: white;
    color: #006600;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s;
}

.donate-method-tab.active,
.donate-method-tab:hover {
    background: #006600;
    color: white;
}

.donate-info {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-top: 10px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.payment-method {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 15px 0;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 6px;
}

.payment-number {
    font-weight: bold;
    font-size: 18px;
    color: #006600;
}

.paypal-donate-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #0070ba;
    color: white;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    text-decoration: none;
    margin: 15px 0;
    transition: all 0.3s;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.paypal-donate-btn:hover {
    background: #005ea6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.paypal-donate-btn i {
    font-size: 20px;
}

.donate-note {
    font-size: 14px;
    color: #666;
    margin-top: 10px;
}

.payment-note {
    font-style: italic;
    margin-top: 15px;
    color: #666;
}

/* Divider between PayPal and Mobile Payment */
.donate-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 18px 0;
    color: #aaa;
    font-size: 13px;
}

.donate-divider::before,
.donate-divider::after {
    content: '';
    flex: 1;
    border-top: 1px solid #ddd;
}

.donate-divider span {
    padding: 0 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Mobile payment panel */
.mobile-payment-panel {
    background: linear-gradient(135deg, #f0fff4, #e8f5e9);
    border: 1px solid #a5d6a7;
    border-radius: 10px;
    padding: 18px 20px;
    margin-top: 8px;
    text-align: left;
}

.mobile-payment-panel h4 {
    text-align: center;
    font-size: 16px;
    color: #2e7d32;
    margin: 0 0 12px;
}

.mobile-payment-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mobile-option {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    border: 1px solid #c8e6c9;
    border-radius: 8px;
    padding: 12px 14px;
    box-shadow: 0 1px 4px rgba(0,102,0,0.08);
}

.mobile-option-logo {
    width: 64px;
    height: 64px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.mobile-option-logo.mpesa {
    background: transparent;
}

.mobile-option-logo.airtel {
    background: transparent;
}

.mobile-option-logo svg {
    width: 64px;
    height: 64px;
    display: block;
}

.mobile-option-details {
    flex: 1;
}

.mobile-option-details .provider-name {
    font-weight: 700;
    font-size: 15px;
    color: #1b5e20;
    margin-bottom: 2px;
}

.phone-number-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.mobile-option-details .phone-number {
    font-size: clamp(1rem, 3vw, 1.125rem);
    font-weight: 800;
    color: #2e7d32;
    letter-spacing: 1px;
    font-family: monospace;
    user-select: text;
    cursor: text;
}

.copy-btn {
    background: none;
    border: 1px solid #a5d6a7;
    border-radius: 5px;
    cursor: pointer;
    padding: 3px 6px;
    color: #2e7d32;
    font-size: 13px;
    line-height: 1;
    transition: background 0.2s, color 0.2s;
    display: inline-flex;
    align-items: center;
}

.copy-btn:hover {
    background: #e8f5e9;
    color: #1b5e20;
}

.copy-btn.copied {
    background: #c8e6c9;
    color: #1b5e20;
    border-color: #81c784;
}

.mobile-option-details .recipient-name {
    font-size: 12px;
    color: #555;
    margin-top: 2px;
}

.mobile-payment-steps {
    margin: 14px 0 10px;
    padding: 12px 16px;
    background: #fff;
    border-left: 4px solid #43a047;
    border-radius: 0 8px 8px 0;
    text-align: left;
}

.mobile-payment-steps p {
    font-weight: 700;
    font-size: 13px;
    color: #2e7d32;
    margin: 0 0 6px;
}

.mobile-payment-steps ol {
    margin: 0;
    padding-left: 20px;
    font-size: 13px;
    color: #444;
    line-height: 1.7;
}

.mobile-thanks-msg {
    background: linear-gradient(135deg, #fff8e1, #fff3cd);
    border: 1px solid #ffe082;
    border-radius: 8px;
    padding: 12px 16px;
    margin-top: 12px;
    font-size: 14px;
    color: #5d4037;
    text-align: center;
    font-style: italic;
}

.mobile-thanks-msg span {
    font-size: 18px;
    vertical-align: middle;
    margin-right: 4px;
}

.disclaimer-banner {
    background: linear-gradient(90deg, #000000 0%, #006600 40%, #CC0000 70%, #000000 100%);
    color: white;
    padding: 10px;
    text-align: center;
    margin-bottom: 20px;
    border-radius: 5px;
    font-weight: bold;
}

.payslip-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    gap: 10px;
}   

.payslip-actions button {
    flex: 1;
    padding: 10px;
    font-size: 14px;
    font-weight: bold;
}

@media (max-width: 600px) {
    .container {
        padding: 15px;
    }

    .earnings-deductions {
        flex-direction: column;
    }

    .earnings-section, .deductions-section {
        min-width: 0;
    }

    .payslip-table th, .payslip-table td {
        font-size: 12px;
        padding: 6px;
    }

    .summary-table th, .summary-table td {
        padding: 7px;
        font-size: 13px;
    }

    .net-pay-row th, .net-pay-row td {
        font-size: 14px;
    }

    .payslip-meta {
        flex-direction: column;
        gap: 6px;
    }

    .payslip-actions {
        flex-direction: column;
    }

    .payslip-actions button {
        width: 100%;
    }

    .detail-row {
        flex-wrap: wrap;
        gap: 2px;
    }

    .detail-row span:first-child {
        width: auto;
        min-width: 110px;
        font-weight: bold;
    }

    .company-branding {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .editable-field {
        max-width: 100%;
    }

    /* Prevent iOS auto-zoom on form inputs */
    input, select, textarea {
        font-size: 16px;
    }
}

/* ── Year selector & rates badge ── */
.rates-year-group select {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
    cursor: pointer;
}

.rates-selector-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.rates-badge {
    background: #e8f5e9;
    color: #006600;
    border: 1px solid #a5d6a7;
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

/* ── Monthly / Annual breakdown table ── */
.breakdown-table-wrapper {
    overflow-x: auto;
    margin: 20px 0;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.breakdown-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.breakdown-table th {
    background: #006600;
    color: #fff;
    padding: 10px 14px;
    text-align: left;
    white-space: nowrap;
}

.breakdown-table td {
    padding: 9px 14px;
    border-bottom: 1px solid #f0f0f0;
}

.breakdown-table tr:nth-child(even) td {
    background: #f9f9f9;
}

.breakdown-table .deduction-row td {
    color: #CC0000;
}

.breakdown-table .net-row td {
    background: #e8f5e9;
    color: #006600;
    font-weight: bold;
    font-size: 15px;
}

/* ── Deductions chart ── */
.chart-container {
    margin: 30px auto;
    max-width: 340px;
    text-align: center;
}

.chart-container h3 {
    color: #006600;
    margin-bottom: 15px;
}

/* ── Salary Comparison inputs ── */
.comparison-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 20px;
}

.comparison-col {
    background: #f9f9f9;
    border-radius: 10px;
    padding: 18px;
    border: 1px solid #e0e0e0;
}

.comparison-col h3 {
    color: #006600;
    margin-bottom: 12px;
    font-size: 1.1em;
}

.comparison-result-table .highlight-diff {
    font-weight: bold;
}

@media (max-width: 600px) {
    .comparison-inputs {
        grid-template-columns: 1fr;
    }
}

/* ── Voluntary Deductions Toggle ── */
.voluntary-deductions-toggle {
    background: #f9fff9;
    border: 1px solid #c8e6c9;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
    cursor: pointer;
}
.voluntary-deductions-toggle summary {
    font-weight: 600;
    color: #006600;
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
}
.voluntary-deductions-toggle summary::-webkit-details-marker { display: none; }
.voluntary-deductions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 14px;
}
@media (max-width: 600px) {
    .voluntary-deductions-grid { grid-template-columns: 1fr; }
}

/* ── Employer Cost Section ── */
.employer-cost-section {
    margin-top: 24px;
    background: #f0f7f0;
    border: 1px solid #c8e6c9;
    border-radius: 10px;
    padding: 20px;
}
.employer-cost-section h3 {
    color: #006600;
    margin-bottom: 14px;
}
.employer-cost-note {
    font-size: 0.88em;
    color: #555;
    margin-top: 10px;
}

/* ── Share / Save Calculation ── */
.share-calc-section {
    margin-top: 24px;
    background: #e8f5e9;
    border: 1px solid #a5d6a7;
    border-radius: 10px;
    padding: 20px;
}
.share-calc-section h3 {
    color: #006600;
    margin-bottom: 10px;
}
.share-link-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 10px;
}
.share-link-input {
    flex: 1;
    min-width: 200px;
    padding: 10px 14px;
    border: 1px solid #a5d6a7;
    border-radius: 6px;
    font-size: 0.9em;
    background: white;
    color: #333;
}
.copy-link-btn {
    padding: 10px 18px;
    background: #006600;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}
.copy-link-btn:hover { background: #009900; }

/* Scroll To Top Button */
.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 48px;
    height: 48px;
    background: #006600;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2em;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 102, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.3s, visibility 0.3s, transform 0.3s, background 0.2s;
    z-index: 999;
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-to-top:hover {
    background: #009900;
    box-shadow: 0 6px 18px rgba(0, 102, 0, 0.5);
}

/* ── Global Advertisement Sidebar Styles ───────────────────────────── */

/* Keyframe animations for ad boxes */
@keyframes adPulse {
    0%, 100% { box-shadow: 0 2px 10px rgba(0,102,0,0.07); border-color: #009900; }
    50% { box-shadow: 0 4px 20px rgba(0,153,0,0.3); border-color: #00cc00; }
}

@keyframes adShimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

@keyframes adIconBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

@keyframes adSlideIn {
    0% { opacity: 0; transform: translateX(20px); }
    100% { opacity: 1; transform: translateX(0); }
}

@keyframes adGlow {
    0%, 100% { border-color: #009900; }
    33% { border-color: #CC0000; }
    66% { border-color: #006600; }
}

.custom-ad-box {
    background: #fff;
    border: 2px dashed #009900;
    border-radius: 10px;
    padding: 16px 12px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,102,0,0.07);
    margin-bottom: 18px;
    animation: adPulse 3s ease-in-out infinite, adSlideIn 0.5s ease-out;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.custom-ad-box:nth-child(2) {
    animation-delay: 1.5s;
}

.custom-ad-box:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 22px rgba(0,102,0,0.18);
    border-style: solid;
    animation: adGlow 2s linear infinite;
}

/* Shimmer overlay on the ad box */
.custom-ad-box::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(
        105deg,
        transparent 40%,
        rgba(255,255,255,0.6) 50%,
        transparent 60%
    );
    background-size: 200% 100%;
    animation: adShimmer 4s linear infinite;
    pointer-events: none;
    border-radius: 8px;
}

/* Animated ad placeholder banner (for future image/video ads) */
.animated-ad-banner {
    width: 100%;
    min-height: 120px;
    background: linear-gradient(135deg, #003300 0%, #006600 40%, #004400 60%, #CC0000 100%);
    background-size: 300% 300%;
    animation: adBgMove 6s ease infinite;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.78em;
    font-weight: bold;
    margin-bottom: 10px;
    position: relative;
    overflow: hidden;
}

@keyframes adBgMove {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.animated-ad-banner .ad-placeholder-text {
    font-size: 1.1em;
    letter-spacing: 1px;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
    animation: adIconBounce 2s ease-in-out infinite;
}

.animated-ad-banner .ad-placeholder-sub {
    font-size: 0.75em;
    opacity: 0.85;
    margin-top: 4px;
}

.custom-ad-box i.ad-icon {
    font-size: 1.8em;
    color: #009900;
    margin-bottom: 8px;
    display: block;
    animation: adIconBounce 2s ease-in-out infinite;
}

.custom-ad-box:nth-child(2) i.ad-icon {
    animation-delay: 0.5s;
}

.custom-ad-box p {
    color: #444;
    font-size: 0.82em;
    line-height: 1.5;
    margin: 5px 0;
}

.custom-ad-box a.ad-contact-btn {
    display: inline-block;
    margin-top: 8px;
    padding: 6px 12px;
    background: #006600;
    color: white;
    text-decoration: none;
    border-radius: 14px;
    font-size: 11px;
    font-weight: bold;
    transition: background 0.2s, transform 0.2s;
    position: relative;
    z-index: 1;
}

.custom-ad-box a.ad-contact-btn:hover {
    background: #004400;
    transform: scale(1.05);
}

/* Affiliate / Partner section */
.affiliate-section {
    background: linear-gradient(135deg, #f8fff8 0%, #fff8e1 100%);
    border: 1px solid #c8e6c9;
    border-radius: 12px;
    padding: 18px 14px;
    margin-bottom: 18px;
}

.affiliate-section h4 {
    color: #006600;
    font-size: 0.88em;
    margin: 0 0 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.affiliate-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    font-size: 0.8em;
    margin-bottom: 6px;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.affiliate-link:hover {
    border-color: #006600;
    color: #006600;
    transform: translateX(3px);
    box-shadow: 0 2px 8px rgba(0,102,0,0.12);
}

.affiliate-link i {
    color: #CC0000;
    font-size: 1.1em;
    flex-shrink: 0;
}

.affiliate-link .aff-badge {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.68em;
    background: #e8f5e9;
    color: #006600;
    padding: 2px 5px;
    border-radius: 4px;
    font-weight: bold;
}



/* Feature card hover animation */
.feature-card {
    transition: transform 0.25s, box-shadow 0.25s;
}
.feature-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 8px 28px rgba(0,102,0,0.13);
}

/* ── Quick Navigation Cards (homepage) ─────────────────────────────── */
.quick-nav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
    margin: 0 0 24px;
}
.quick-nav-card {
    text-decoration: none;
    background: #fff;
    border-radius: 10px;
    padding: 18px 14px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,102,0,0.09);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.quick-nav-card i {
    font-size: 1.8em;
    display: block;
}
.quick-nav-card span {
    color: #333;
    font-size: 0.88em;
    font-weight: 600;
    line-height: 1.4;
}
.quick-nav-card:hover {
    transform: translateY(-4px);
}
.quick-nav-card--green {
    border-top: 3px solid #006600;
}
.quick-nav-card--green i { color: #006600; }
.quick-nav-card--green:hover {
    box-shadow: 0 6px 18px rgba(0,102,0,0.15);
}
.quick-nav-card--red {
    border-top: 3px solid #CC0000;
}
.quick-nav-card--red i { color: #CC0000; }
.quick-nav-card--red:hover {
    box-shadow: 0 6px 18px rgba(204,0,0,0.12);
}

/* ── Global FAQ Accordion Styles ────────────────────────────────────── */
.faq-section h2 {
    color: #006600;
    font-family: 'Oswald', 'Arial Narrow', Arial, sans-serif;
    font-size: 1.5em;
    margin-bottom: 16px;
}

.faq-item {
    border-bottom: 1px solid #e5e7eb;
    padding: 4px 0;
}

.faq-item summary {
    font-weight: 600;
    cursor: pointer;
    color: #1a1a1a;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 4px;
    user-select: none;
    transition: color 0.2s;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::before {
    content: '\002B'; /* + */
    font-size: 1.25em;
    font-weight: 700;
    color: #CC0000;
    flex-shrink: 0;
    width: 22px;
    text-align: center;
    transition: transform 0.25s;
}

.faq-item[open] > summary::before {
    content: '\2212'; /* − */
    color: #006600;
}

.faq-item[open] > summary {
    color: #006600;
}

.faq-item p {
    margin: 0 0 14px 32px;
    color: #555;
    font-size: 0.95em;
    line-height: 1.7;
}


/* ── Enhanced Mobile Responsiveness ───────────────────────────────────── */

/* Small phones (< 400px) */
@media (max-width: 400px) {
    .container {
        margin: 10px auto;
        padding: 12px 14px;
        border-radius: 8px;
    }
    h1 { font-size: 1.6em; }
    .mobile-menu-toggle { font-size: 1.2em; padding: 8px 12px; }
    .logo-container img { max-height: 80px; }
    .company-branding { flex-direction: column; align-items: flex-start; gap: 10px; }
}

/* Standard mobile (< 600px) */
@media (max-width: 600px) {
    body { font-size: 15px; }
    .container { margin: 8px; padding: 14px; border-radius: 8px; }
    /* Touch-friendly minimum target sizes */
    button, .btn, a.cta-button, .blog-read-more, .sn-read-more,
    .gg-submit-btn, .gg-next-btn {
        min-height: 44px;
    }
    /* Share/social buttons - easier to tap */
    .twitter-share-btn, .wa-share-btn, .fb-share-btn, .li-share-btn {
        padding: 11px 14px;
        font-size: 13px;
    }
    /* Quick nav cards: auto-fill still works, force single-col on very small phones via xs rule below */
    .quick-nav-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
    .quick-nav-card { padding: 12px 8px; min-height: 44px; }
    .quick-nav-card i { font-size: 1.5em; }
    .quick-nav-card span { font-size: 0.78em; }
    /* Payslip/print fix */
    .payslip-table { font-size: 12px; }
    /* Share section */
    .share-link-row { flex-direction: column; }
    .share-link-input { min-width: auto; }
    /* Scroll to top closer to edge */
    .scroll-to-top { bottom: 70px; right: 16px; width: 42px; height: 42px; font-size: 1em; }
    /* Tab buttons on mobile */
    .tab-button { padding: 8px 10px; font-size: 12px; margin-right: 2px; }
    /* Payslip container on mobile */
    .payslip-container { padding: 15px; min-height: auto; }
}

/* xs: very small phones (< 480px) */
@media (max-width: 480px) {
    .quick-nav-grid { grid-template-columns: repeat(2, 1fr); }
    .tools-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Tablet (600–768px) */
@media (min-width: 601px) and (max-width: 768px) {
    .container { margin: 20px auto; padding: 20px; }
    .quick-nav-grid { grid-template-columns: repeat(4, 1fr); }
}

/* Make footer links easier to tap on mobile */
@media (max-width: 600px) {
    footer a { display: inline-block; padding: 6px 4px; }
    .blog-card-footer { flex-direction: column; align-items: flex-start; gap: 10px; }
    .sn-article-footer { flex-direction: column; align-items: flex-start; gap: 8px; }
}

/* ── Automated Updates Section ─────────────────────────────────────── */
.auto-updates-section {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin: 24px 0;
    box-shadow: 0 2px 12px rgba(0,0,0,0.07);
    border: 1px solid #e8f5e9;
}

.auto-updates-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}

.auto-updates-header h2 {
    color: #006600;
    font-size: 1.15em;
    margin: 0;
    font-family: 'Oswald', Arial, sans-serif;
}

.auto-updates-tabs {
    display: flex;
    gap: 6px;
}

.update-tab {
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    padding: 5px 12px;
    font-size: 0.78em;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
    color: #555;
}

.update-tab:hover {
    border-color: #006600;
    color: #006600;
    background: #e8f5e9;
}

.update-tab.active {
    background: #006600;
    color: white;
    border-color: #006600;
}

.updates-feed {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
    min-height: 80px;
}

.update-card {
    background: #fafafa;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 12px;
    text-decoration: none;
    color: #333;
    display: flex;
    flex-direction: column;
    gap: 5px;
    transition: all 0.2s;
    animation: updateCardIn 0.3s ease-out;
}

@keyframes updateCardIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.update-card:hover {
    border-color: #006600;
    background: #f0fff0;
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(0,102,0,0.1);
}

.update-card .uc-category {
    font-size: 0.68em;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 6px;
    border-radius: 4px;
    width: fit-content;
}

.uc-category.cat-news { background: #ffebee; color: #CC0000; }
.uc-category.cat-blog { background: #e8f5e9; color: #006600; }
.uc-category.cat-game { background: #e3f2fd; color: #1565c0; }
.uc-category.cat-update { background: #fff3e0; color: #e65100; }

.update-card .uc-title {
    font-size: 0.85em;
    font-weight: 600;
    color: #222;
    line-height: 1.4;
}

.update-card .uc-meta {
    font-size: 0.72em;
    color: #999;
}

.updates-more-link {
    display: inline-block;
    margin-top: 12px;
    font-size: 0.83em;
    color: #006600;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s;
}

.updates-more-link:hover { color: #004400; text-decoration: underline; }

@media (max-width: 600px) {
    .auto-updates-header { flex-direction: column; align-items: flex-start; }
    .updates-feed { grid-template-columns: 1fr; }
}

/* ── Medium screens (769px – 1024px) ───────────────────────────────── */
@media (min-width: 769px) and (max-width: 1024px) {
    .container { max-width: 95%; margin: 30px auto; padding: 24px; }
    .quick-nav-grid { grid-template-columns: repeat(4, 1fr); }
    .breakdown-table-wrapper { overflow-x: auto; }
}

/* ── Mobile: disable fixed background (iOS performance) ─────────────── */
@media (max-width: 768px) {
    body { background-attachment: scroll; }
}

/* ── Wide screens (≥1200px) ──────────────────────────────────────────── */
@media (min-width: 1200px) {
    .container { max-width: 1200px; }
}

/* ── Responsive table overflow ───────────────────────────────────────── */
table {
    max-width: 100%;
}

@media (max-width: 600px) {
    .result-item { flex-wrap: wrap; gap: 4px; }
    .result-item span:last-child { font-weight: 600; }
    .input-section, .results-section { padding: 16px; }
    .disclaimer-banner { font-size: 13px; padding: 8px 12px; }
    .rates-selector-row { gap: 8px; }
    .breakdown-table th, .breakdown-table td { font-size: 13px; padding: 7px 10px; }
    .donate-method-tabs { flex-wrap: wrap; }
    .comparison-result-table td, .comparison-result-table th { font-size: 13px; padding: 7px 8px; }
}

/* ── Database / Supabase Notification Banner ─────────────────────────── */
.db-notice-banner {
    background: linear-gradient(135deg, #004d00 0%, #006600 50%, #004d00 100%);
    color: #fff;
    padding: 14px 16px;
    text-align: center;
    position: relative;
    z-index: 200;
    font-size: 0.92em;
    line-height: 1.5;
    box-shadow: 0 2px 8px rgba(0,0,0,0.35);
    animation: db-notice-slide-in 0.5s ease-out;
}

@keyframes db-notice-slide-in {
    from { transform: translateY(-100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.db-notice-banner p {
    margin: 0 30px 0 0;
    display: inline;
}

.db-notice-banner strong {
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.db-notice-banner a {
    color: #ffe082;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.db-notice-banner a:hover {
    color: #fff176;
}

.db-notice-close {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #fff;
    font-size: 1.2em;
    cursor: pointer;
    line-height: 1;
    padding: 4px 8px;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.db-notice-close:hover {
    opacity: 1;
}

@media (max-width: 600px) {
    .db-notice-banner {
        font-size: 0.82em;
        padding: 12px 40px 12px 12px;
        text-align: left;
    }
    .db-notice-banner p {
        margin: 0;
        display: block;
    }
}

/* ── Enhanced mobile overflow guards ────────────────────────────────── */
@media (max-width: 600px) {
    /* Prevent any element from causing horizontal scroll */
    .overlay { overflow-x: hidden; }
    /* Shrink quick-nav from 3 to 2 columns on tiny phones */
    .overlay .quick-nav-grid { grid-template-columns: repeat(2, 1fr); }
    /* Make nav dropdown toggles and links wrap text instead of clipping */
    .nav-dropdown-toggle,
    .main-nav a { white-space: normal; }
    /* Salary / number input fields */
    input[type="number"],
    input[type="text"],
    select {
        max-width: 100%;
        box-sizing: border-box;
    }
    /* Feature cards full-width on mobile */
    .feature-card, .pricing-card { width: 100%; box-sizing: border-box; }
    /* Wrap rate-selector tabs on small screens */
    .rates-selector-row { flex-wrap: wrap; }
    /* Ensure comparison table doesn't overflow */
    .comparison-table-wrapper, .breakdown-table-wrapper { overflow-x: auto; max-width: 100%; }
    /* Share / social buttons row wrapping */
    .share-buttons-row { flex-wrap: wrap; gap: 8px; }
    /* Payslip actions stack on small screens */
    .payslip-actions { flex-direction: column; }
    .payslip-actions button { width: 100%; }
}

@media (max-width: 400px) {
    /* On very small phones, tighten the 2-col quick nav grid spacing */
    .overlay .quick-nav-grid { gap: 8px; }
    .quick-nav-card { padding: 10px 6px; }
    .quick-nav-card span { font-size: 0.72em; }
    /* Stack donate-method tabs */
    .donate-method-tabs { flex-direction: column; }
    /* Ensure the main container doesn't clip content */
    .container { padding: 10px 10px; }
}

/* ═══════════════════════════════════════════════════════════════════════
   MOBILE BOTTOM TAB BAR
   ═══════════════════════════════════════════════════════════════════════ */
.bottom-tab-bar {
    display: none;
}

@media (max-width: 768px) {
    .bottom-tab-bar {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: #fff;
        border-top: 1px solid #e0e0e0;
        box-shadow: 0 -2px 12px rgba(0,0,0,0.1);
        z-index: 200;
        height: 58px;
    }
    .bottom-tab-bar a {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        text-decoration: none;
        color: #666;
        font-size: 0.6rem;
        font-weight: 600;
        padding: 6px 2px;
        transition: color 0.2s;
        min-height: 44px;
        border-top: 2px solid transparent;
        -webkit-tap-highlight-color: transparent;
    }
    .bottom-tab-bar a i {
        font-size: 1.2rem;
        display: block;
    }
    .bottom-tab-bar a.active,
    .bottom-tab-bar a:hover {
        color: #006600;
        border-top-color: #006600;
    }
    /* Extra bottom padding so content isn't hidden behind the tab bar */
    .overlay > .container,
    .container {
        padding-bottom: 70px;
    }
    /* Ensure scroll-to-top button clears the tab bar */
    .scroll-to-top {
        bottom: 68px;
    }
    /* Prevent body scrolling when drawer is open */
    body.nav-open {
        overflow: hidden;
    }
}

/* ═══════════════════════════════════════════════════════════════════════
   DARK MODE — global (via body.dark-mode class from localStorage)
   ═══════════════════════════════════════════════════════════════════════ */
body.dark-mode {
    color: #e0e0e0;
}
body.dark-mode::before {
    background: rgba(5, 10, 5, 0.88);
}
body.dark-mode .container {
    background: linear-gradient(to bottom right, #1a1a2e, #16213e);
    border-color: #2a2a4e;
    color: #e0e0e0;
}
body.dark-mode .main-nav {
    background: linear-gradient(to bottom right, #1a1a2e, #16213e);
}
body.dark-mode .main-nav a,
body.dark-mode .main-nav .auth-link,
body.dark-mode .main-nav .nav-dropdown-toggle {
    background-color: #1a1a2e;
    border-color: #4caf50;
    color: #4caf50;
}
body.dark-mode .main-nav a:hover,
body.dark-mode .main-nav .nav-dropdown-toggle:hover {
    background-color: #4caf50;
    color: #1a1a2e;
}
body.dark-mode .main-nav a.active {
    background-color: #4caf50;
    color: #1a1a2e;
}
body.dark-mode .nav-dropdown-menu {
    background: #16213e;
    border-color: #4caf50;
}
body.dark-mode .nav-dropdown-menu a {
    background: #16213e;
    color: #4caf50;
    border-bottom-color: #2a2a4e;
}
body.dark-mode .nav-dropdown-menu a:hover {
    background: #0f3460;
}
body.dark-mode .input-section,
body.dark-mode .results-section,
body.dark-mode .intro-section,
body.dark-mode .info-section {
    background-color: #16213e;
    color: #e0e0e0;
}
body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3 { color: #4caf50; }
body.dark-mode .bottom-tab-bar {
    background: #16213e;
    border-top-color: #2a2a4e;
}
body.dark-mode .bottom-tab-bar a { color: #999; }
body.dark-mode .bottom-tab-bar a.active,
body.dark-mode .bottom-tab-bar a:hover {
    color: #4caf50;
    border-top-color: #4caf50;
}

/* ═══════════════════════════════════════════════════════════════════════
   LAZY-LOAD FADE-IN (used by Intersection Observer)
   ═══════════════════════════════════════════════════════════════════════ */
.lazy-section {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.lazy-section.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ── Payslip A5 Print Styles ─────────────────────────────────────────────── */
@media print {
    @page {
        size: A5 portrait;
        margin: 8mm 10mm;
    }

    body * {
        visibility: hidden;
    }

    .payslip-container,
    .payslip-container * {
        visibility: visible;
    }

    .payslip-container {
        position: static;
        top: 0;
        left: 0;
        width: 100%;
        background: white;
        box-shadow: none;
        border: none;
        padding: 0;
        font-size: 9pt;
    }

    .no-print,
    .payslip-actions,
    .logo-placeholder button {
        display: none !important;
    }

    .company-name-input {
        font-size: 11pt;
    }

    .company-detail-input {
        font-size: 8pt;
    }

    .payslip-header h2 {
        font-size: 13pt;
        margin: 6px 0;
    }

    .payslip-table th,
    .payslip-table td,
    .summary-table th,
    .summary-table td {
        padding: 4px 6px;
        font-size: 8.5pt;
    }

    .net-pay-row th,
    .net-pay-row td {
        font-size: 10pt;
    }

    .employee-details {
        padding: 8px;
        margin-bottom: 10px;
    }

    .detail-row {
        margin-bottom: 4px;
        font-size: 8.5pt;
    }

    .payslip-footer {
        font-size: 7pt;
        margin-top: 10px;
    }

    .editable-field {
        border: none;
        background: transparent;
        padding: 0;
    }

    .signature-field {
        border: none;
        border-bottom: 1px solid #000;
    }
}
