/* =========================================================
   ACCOUNTING APPLICATION - GLOBAL STYLES
   ASP.NET Core Razor Pages + Bootstrap
   ========================================================= */

/* ---------- Root Variables ---------- */

:root {
    --app-primary: #2563eb;
    --app-primary-dark: #1d4ed8;
    --app-secondary: #64748b;
    --app-success: #16a34a;
    --app-warning: #f59e0b;
    --app-danger: #dc2626;
    --app-info: #0891b2;
    --app-bg: #f5f7fb;
    --app-card: #ffffff;
    --app-border: #e5e7eb;
    --app-text: #1e293b;
    --app-muted: #64748b;
    --app-radius: 10px;
    --app-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
    --app-shadow-hover: 0 6px 18px rgba(15, 23, 42, 0.10);
}


/* ---------- Body ---------- */
/* Apple / San Francisco style font */
html,
body,
button,
input,
select,
textarea {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
}

/* ---------- Thin scrollbars, everywhere ---------- */
html {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

::-webkit-scrollbar {
    width: 7px;
    height: 7px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background-color: #94a3b8;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
    font-weight: 600;
    letter-spacing: -0.2px;
}

/* Normal text */
body {
    font-size: 14px;
    font-weight: 400;
    letter-spacing: -0.1px;
}

/* Form controls */
.form-control,
.form-select,
.btn {
    font-family: inherit;
    font-size: 14px;
}

/* Navigation */
.accounting-navbar,
.accounting-toolbar {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
}

body {
    font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
}


/* ---------- Headings ---------- */

h1,
h2,
h3,
h4,
h5,
h6 {
    color: #172033;
    font-weight: 600;
}

h2 {
    font-size: 1.5rem;
}

h3 {
    font-size: 1.25rem;
}


/* =========================================================
   CARDS
   ========================================================= */

.card {
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    background: var(--app-card);
    box-shadow: var(--app-shadow);
}

.card-stat {
    border: none;
    border-radius: 12px;
    box-shadow: var(--app-shadow);
    transition: all 0.2s ease;
}

    .card-stat:hover {
        box-shadow: var(--app-shadow-hover);
        transform: translateY(-1px);
    }

.card-header {
    background: #fff;
    border-bottom: 1px solid var(--app-border);
    font-weight: 600;
    padding: 0.9rem 1rem;
}

.card-body {
    padding: 1.1rem;
}


/* =========================================================
   FORMS
   ========================================================= */

.form-label {
    font-weight: 500;
    color: #334155;
    margin-bottom: 0.4rem;
}

.form-control,
.form-select {
    min-height: 40px;
    border: 1px solid #d6dbe3;
    border-radius: 7px;
    color: #1e293b;
    background-color: #fff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

    .form-control:focus,
    .form-select:focus {
        border-color: var(--app-primary);
        box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.12);
    }

    .form-control::placeholder {
        color: #9ca3af;
    }

textarea.form-control {
    min-height: 90px;
    resize: vertical;
}

.form-check-input {
    cursor: pointer;
}

    .form-check-input:checked {
        background-color: var(--app-primary);
        border-color: var(--app-primary);
    }


/* ---------- Validation ---------- */

.text-danger {
    font-size: 0.85rem;
}

.validation-summary-errors {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 7px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    color: var(--app-danger);
}

.field-validation-error {
    display: block;
    margin-top: 0.3rem;
}


/* =========================================================
   BUTTONS
   ========================================================= */

.btn {
    border-radius: 7px;
    font-weight: 500;
    padding: 0.45rem 0.9rem;
    transition: all 0.15s ease;
}

.btn-primary {
    background-color: var(--app-primary);
    border-color: var(--app-primary);
}

    .btn-primary:hover {
        background-color: var(--app-primary-dark);
        border-color: var(--app-primary-dark);
    }

.btn-success {
    background-color: var(--app-success);
    border-color: var(--app-success);
}

.btn-danger {
    background-color: var(--app-danger);
    border-color: var(--app-danger);
}

.btn-warning {
    color: #fff;
}

.btn-outline-secondary {
    border-color: #cbd5e1;
    color: #475569;
}

    .btn-outline-secondary:hover {
        background: #f1f5f9;
        color: #1e293b;
    }


/* ---------- Small Action Buttons ---------- */

.btn-sm {
    border-radius: 6px;
    padding: 0.3rem 0.65rem;
}


/* =========================================================
   TABLES
   ========================================================= */

.table {
    margin-bottom: 0;
    color: var(--app-text);
}

    .table thead th {
        background: #f8fafc;
        color: #475569;
        font-size: 0.82rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.02em;
        border-bottom: 1px solid var(--app-border);
        white-space: nowrap;
    }

    .table tbody td {
        border-color: #edf0f3;
    }

.table-sm td,
.table-sm th {
    vertical-align: middle;
}

.table-hover tbody tr:hover {
    background-color: #f8fafc;
}

.table-responsive {
    border-radius: var(--app-radius);
}


/* =========================================================
   BADGES / STATUS
   ========================================================= */

.badge {
    font-weight: 500;
    padding: 0.4em 0.65em;
    border-radius: 6px;
}

.badge-status-Draft {
    background-color: #64748b;
    color: #fff;
}

.badge-status-Posted {
    background-color: #2563eb;
    color: #fff;
}

.badge-status-PartiallyPaid {
    background-color: #f59e0b;
    color: #fff;
}

.badge-status-Paid {
    background-color: #16a34a;
    color: #fff;
}

.badge-status-Void {
    background-color: #dc2626;
    color: #fff;
}

.badge-status-Pending {
    background-color: #f59e0b;
    color: #fff;
}

.badge-status-Cancelled {
    background-color: #dc2626;
    color: #fff;
}


/* =========================================================
   ACCOUNTING SPECIFIC
   ========================================================= */

/* Debit amount */

.amount-debit {
    color: #dc2626;
    font-weight: 600;
}

/* Credit amount */

.amount-credit {
    color: #16a34a;
    font-weight: 600;
}

/* Positive amount */

.amount-positive {
    color: #16a34a;
    font-weight: 600;
}

/* Negative amount */

.amount-negative {
    color: #dc2626;
    font-weight: 600;
}

/* Total amount */

.amount-total {
    font-size: 1.05rem;
    font-weight: 700;
}


/* =========================================================
   PAGE HEADER
   ========================================================= */

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    gap: 1rem;
}

    .page-header h2 {
        margin: 0;
    }


/* =========================================================
   FILTER / SEARCH AREA
   ========================================================= */

.filter-card {
    background: #fff;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: var(--app-shadow);
}

.search-box {
    position: relative;
}

    .search-box .form-control {
        padding-left: 2.3rem;
    }


/* =========================================================
   DASHBOARD STAT CARDS
   ========================================================= */

.stat-card {
    background: #fff;
    border: 1px solid var(--app-border);
    border-radius: 12px;
    padding: 1.1rem;
    box-shadow: var(--app-shadow);
}

.stat-title {
    color: var(--app-muted);
    font-size: 0.85rem;
    font-weight: 500;
}

.stat-value {
    color: #172033;
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 0.3rem;
}

.stat-icon {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: #eff6ff;
    color: var(--app-primary);
}


/* =========================================================
   MODALS
   ========================================================= */

.modal-content {
    border: none;
    border-radius: 12px;
    box-shadow: 0 15px 40px rgba(15, 23, 42, 0.18);
}

.modal-header {
    border-bottom: 1px solid var(--app-border);
}

.modal-footer {
    border-top: 1px solid var(--app-border);
}


/* =========================================================
   ALERTS
   ========================================================= */

.alert {
    border-radius: 8px;
    border-width: 1px;
}

.alert-success {
    color: #166534;
    background-color: #f0fdf4;
    border-color: #bbf7d0;
}

.alert-danger {
    color: #991b1b;
    background-color: #fef2f2;
    border-color: #fecaca;
}

.alert-warning {
    color: #92400e;
    background-color: #fffbeb;
    border-color: #fde68a;
}

.alert-info {
    color: #155e75;
    background-color: #ecfeff;
    border-color: #a5f3fc;
}


/* =========================================================
   SUBSCRIPTION EXPIRED BANNER
   ========================================================= */

.subscription-expired-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 10px 16px;
    background-color: var(--app-danger);
    color: #fff;
    font-weight: 600;
    font-size: 13.5px;
    text-align: center;
}

    .subscription-expired-banner .badge {
        font-weight: 600;
    }


/* =========================================================
   PAGINATION
   ========================================================= */

.pagination .page-link {
    color: var(--app-primary);
    border-color: var(--app-border);
}

.pagination .page-item.active .page-link {
    background-color: var(--app-primary);
    border-color: var(--app-primary);
}


/* =========================================================
   LINKS
   ========================================================= */

a {
    color: var(--app-primary);
    text-decoration: none;
}

    a:hover {
        color: var(--app-primary-dark);
    }


/* =========================================================
   DROPDOWN
   ========================================================= */

.dropdown-menu {
    border: 1px solid var(--app-border);
    border-radius: 8px;
    box-shadow: var(--app-shadow-hover);
    padding: 0.4rem;
}

.dropdown-item {
    border-radius: 6px;
    padding: 0.45rem 0.7rem;
}

    .dropdown-item:hover {
        background-color: #f1f5f9;
    }


/* =========================================================
   EMPTY STATES
   ========================================================= */

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--app-muted);
}

    .empty-state h5 {
        color: #475569;
        margin-bottom: 0.4rem;
    }


/* =========================================================
   FORM ACTIONS
   ========================================================= */

.form-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    padding-top: 0.5rem;
}


/* =========================================================
   LOGIN / AUTH PAGES
   ========================================================= */

.auth-container {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-card {
    width: 100%;
    max-width: 430px;
    background: #fff;
    border: 1px solid var(--app-border);
    border-radius: 14px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 768px) {

    body {
        font-size: 0.9rem;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

        .page-header .btn {
            width: 100%;
        }

    .card-body {
        padding: 0.9rem;
    }

    .table {
        white-space: nowrap;
    }

    .form-actions {
        flex-wrap: wrap;
    }

        .form-actions .btn {
            flex: 1;
        }
}


/* =========================================================
   WINDOWS STYLE ACCOUNTING NAVIGATION
   ========================================================= */
.accounting-navbar {
    width: 100%;
    background: #ffffff;
    border-bottom: 1px solid #cfd5dc;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    position: relative;
    z-index: 1000;
}


/* =========================================================
   TOP BAR
   ========================================================= */

.accounting-topbar {
    height: 46px;
    display: flex;
    align-items: center;
    padding: 0 10px;
    background: #ffffff;
}


/* Application Logo / Name */

.accounting-brand {
    height: 100%;
    min-width: 175px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #1f2937;
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    border-right: 1px solid #e5e7eb;
    padding-right: 15px;
    margin-right: 5px;
}

    .accounting-brand:hover {
        color: #1d4ed8;
    }

.brand-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #2563eb;
    color: white;
    border-radius: 4px;
    font-weight: 700;
    font-size: 16px;
}


/* =========================================================
   MAIN MENU
   ========================================================= */
/* Reset and base */
.accounting-menu {
    display: flex;
    align-items: center;
    position: relative;
    flex-wrap: wrap;
}

/* Each menu item container  this is the anchor for positioning */
.account-menu-item {
    position: relative; /* CRITICAL: makes the dropdown position relative to this container */
    display: inline-block;
}

    /* Style the button */
    .account-menu-item > button {
        background: transparent;
        border: none;
        padding: 8px 14px;
        font-size: 14px;
        font-weight: 500;
        color: #333;
        cursor: pointer;
        border-radius: 4px;
        transition: background 0.2s;
        white-space: nowrap;
    }

        .account-menu-item > button:hover {
            background: #e9ecef;
        }

/* The dropdown  positioned absolutely just below the button */
.account-dropdown {
    position: absolute;
    top: 100%; /* sits right below the parent container */
    left: 0;
    min-width: 200px;
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    padding: 6px 0;
    z-index: 1000;
    display: none; /* hidden by default */
    white-space: nowrap;
}

/* Show dropdown on hover (or you can use click with JS) */
.account-menu-item:hover .account-dropdown {
    display: block;
}

/* Dropdown links */
.account-dropdown a {
    display: block;
    padding: 6px 18px;
    font-size: 13px;
    color: #212529;
    text-decoration: none;
    transition: background 0.15s;
}

    .account-dropdown a:hover {
        background: #f1f3f5;
    }

/* Divider inside dropdown */
.account-divider {
    height: 1px;
    background: #e9ecef;
    margin: 4px 12px;
}

/* Direct menu links (like Platform Admin / Billing) */
.account-direct-menu {
    display: inline-block;
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.2s;
    margin-left: 4px;
}

    .account-direct-menu:hover {
        background: #e9ecef;
    }

/* Responsive tweak */
@media (max-width: 768px) {
    .accounting-menu {
        flex-wrap: wrap;
        gap: 2px;
    }

    .account-dropdown {
        min-width: 160px;
    }
}
/* =========================================================
   USER AREA
   ========================================================= */

.account-user {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}


.business-name {
    color: #0369a1;
    font-size: 12px;
    padding-right: 8px;
    border-right: 1px solid #e5e7eb;
}


.logged-user {
    color: #475569;
    font-size: 12px;
}


.logout-form {
    margin: 0;
}


.logout-btn {
    height: 28px;
    padding: 0 9px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    color: #475569;
    font-size: 12px;
    cursor: pointer;
}


    .logout-btn:hover {
        background: #f1f5f9;
        border-color: #94a3b8;
        color: #1e293b;
    }


.login-link {
    color: #475569;
    font-size: 13px;
    text-decoration: none;
    padding: 5px 8px;
}


    .login-link:hover {
        color: #1d4ed8;
    }


/* =========================================================
   QUICK ACCESS TOOLBAR
   ========================================================= */

.accounting-toolbar {
    display: flex;
    align-items: center;
    gap: 0; /* no gap between items */
    background: #f8f9fa;
    padding: 2px 8px; /* reduced padding */
    border-bottom: 1px solid #dee2e6;
    flex-wrap: wrap;
    min-height: 32px; /* shorter height */
}

.tool-button {
    display: inline-flex;
    align-items: center;
    gap: 3px; /* tiny gap between icon and text */
    padding: 4px 8px; /* compact padding */
    font-size: 12px; /* smaller font */
    color: #333;
    text-decoration: none;
    border-radius: 3px;
    transition: background 0.15s;
    white-space: nowrap;
    line-height: 1.2;
}

    .tool-button:hover {
        background: #e9ecef;
    }

    .tool-button span {
        font-size: 13px; /* icons slightly larger than text */
        line-height: 1;
    }

/* POS button accent */
.tool-pos {
    background: #28a745;
    color: #fff;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 4px;
}

    .tool-pos:hover {
        background: #218838;
        color: #fff;
    }

/* Separator  thinner */
.toolbar-separator {
    display: inline-block;
    width: 1px;
    height: 20px; /* shorter separator */
    background: #dee2e6;
    margin: 0 4px; /* minimal space around separator */
    flex-shrink: 0;
}

/* Responsive  stack if needed */
@media (max-width: 768px) {
    .accounting-toolbar {
        padding: 2px 4px;
        gap: 0;
    }

    .tool-button {
        padding: 3px 5px;
        font-size: 11px;
    }

    .toolbar-separator {
        margin: 0 2px;
        height: 16px;
    }
}


/* =========================================================
   PAGE CONTENT
   ========================================================= */

body {
    background: #f5f7fa;
}


.accounting-navbar + .container-fluid {
    padding-top: 15px;
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 1100px) {

    .accounting-brand {
        min-width: 145px;
    }

    .account-menu-item > button,
    .account-direct-menu {
        padding-left: 8px;
        padding-right: 8px;
    }

    .business-name {
        display: none;
    }
}


@media (max-width: 768px) {

    .accounting-topbar {
        height: auto;
        min-height: 44px;
        flex-wrap: wrap; /* menu drops to its own row */
        row-gap: 0;
        padding: 4px 6px;
        overflow: visible; /* was overflow-x: auto  kept, but see below */
    }

    /* Brand + user share the first row */
    .accounting-brand {
        order: 1;
    }

    .account-user {
        order: 2;
        margin-left: auto;
    }

    /* Menu becomes a full-width horizontal scroll strip on row 2 */
    .accounting-menu {
        display: flex !important;
        order: 3;
        flex: 1 0 100%;
        width: 100%;
        margin-top: 4px;
        border-top: 1px solid #e5e7eb;
        overflow: visible; /* <-- no clipping */
    }

    .accounting-menu-scroll {
        display: flex;
        align-items: center;
        width: 100%;
        overflow-x: auto; /* scroll here instead */
        overflow-y: visible; /* but this browser combo still clips see note */
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    .account-menu-item {
        flex: 0 0 auto;
    }

        .account-menu-item > button {
            font-size: 12.5px;
            padding: 7px 9px;
        }

    .account-direct-menu {
        flex: 0 0 auto;
        font-size: 12.5px;
        padding: 7px 9px;
    }

    /* Keep the dropdown positioned under the button, but let it
       be wider than the button and never overflow the viewport */
    .account-dropdown {
        min-width: 190px;
        max-width: calc(100vw - 50px);
        white-space: normal;
    }

    /* Touch devices: keep dropdown open while the button is focused.
       Add tabindex="0" to the <button> if it isn't focusable by tap
       on your target browser  but <button> already is. */
    .account-menu-item:focus-within .account-dropdown {
        display: block;
    }

}


/* =========================================================
   WINDOWS / DESKTOP STYLE BUTTONS
   ========================================================= */
.btn {
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    min-height: 32px;
    padding: 5px 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #c5ccd5;
    background: linear-gradient( to bottom, #ffffff 0%, #f3f4f6 100% );
    color: #374151;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
    transition: background 0.1s ease, border-color 0.1s ease, box-shadow 0.1s ease;
    cursor: pointer;
}


    /* ---------- Normal Button ---------- */

    .btn:hover {
        background: #eaf2ff;
        border-color: #9db8e4;
        color: #1d4ed8;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    }


    .btn:active {
        background: #dbeafe;
        box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.12);
        transform: translateY(1px);
    }


    .btn:focus {
        box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
    }


/* =========================================================
   PRIMARY
   ========================================================= */

.btn-primary {
    background: linear-gradient( to bottom, #3b82f6, #2563eb );
    border-color: #1d4ed8;
    color: #ffffff;
}


    .btn-primary:hover {
        background: linear-gradient( to bottom, #2563eb, #1d4ed8 );
        border-color: #1e40af;
        color: #ffffff;
    }


    .btn-primary:active {
        background: #1d4ed8;
        color: #ffffff;
    }


/* =========================================================
   SUCCESS
   ========================================================= */

.btn-success {
    background: linear-gradient( to bottom, #22c55e, #16a34a );
    border-color: #15803d;
    color: #ffffff;
}


    .btn-success:hover {
        background: linear-gradient( to bottom, #16a34a, #15803d );
        border-color: #166534;
        color: #ffffff;
    }


/* =========================================================
   DANGER
   ========================================================= */

.btn-danger {
    background: linear-gradient( to bottom, #ef4444, #dc2626 );
    border-color: #b91c1c;
    color: #ffffff;
}


    .btn-danger:hover {
        background: linear-gradient( to bottom, #dc2626, #b91c1c );
        border-color: #991b1b;
        color: #ffffff;
    }


/* =========================================================
   WARNING
   ========================================================= */

.btn-warning {
    background: linear-gradient( to bottom, #fbbf24, #f59e0b );
    border-color: #d97706;
    color: #ffffff;
}


    .btn-warning:hover {
        background: linear-gradient( to bottom, #f59e0b, #d97706 );
        border-color: #b45309;
        color: #ffffff;
    }


/* =========================================================
   INFO
   ========================================================= */

.btn-info {
    background: linear-gradient( to bottom, #22d3ee, #0891b2 );
    border-color: #0e7490;
    color: #ffffff;
}


    .btn-info:hover {
        background: linear-gradient( to bottom, #0891b2, #0e7490 );
        border-color: #155e75;
        color: #ffffff;
    }


/* =========================================================
   SECONDARY
   ========================================================= */

.btn-secondary {
    background: linear-gradient( to bottom, #ffffff, #f1f3f5 );
    border-color: #c5ccd5;
    color: #374151;
}


    .btn-secondary:hover {
        background: #e9eef5;
        border-color: #aeb7c2;
        color: #1f2937;
    }


/* =========================================================
   OUTLINE BUTTONS
   ========================================================= */

.btn-outline-primary,
.btn-outline-secondary,
.btn-outline-success,
.btn-outline-danger,
.btn-outline-warning,
.btn-outline-info {
    background: #ffffff;
}


/* Outline Primary */

.btn-outline-primary {
    border-color: #9db8e4;
    color: #2563eb;
}


    .btn-outline-primary:hover {
        background: #eaf2ff;
        border-color: #2563eb;
        color: #1d4ed8;
    }


/* Outline Secondary */

.btn-outline-secondary {
    border-color: #c5ccd5;
    color: #475569;
}


    .btn-outline-secondary:hover {
        background: #f1f5f9;
        border-color: #94a3b8;
        color: #1e293b;
    }


/* Outline Success */

.btn-outline-success {
    border-color: #86efac;
    color: #15803d;
}


    .btn-outline-success:hover {
        background: #f0fdf4;
        border-color: #16a34a;
        color: #166534;
    }


/* Outline Danger */

.btn-outline-danger {
    border-color: #fca5a5;
    color: #dc2626;
}


    .btn-outline-danger:hover {
        background: #fef2f2;
        border-color: #dc2626;
        color: #b91c1c;
    }


/* =========================================================
   SMALL BUTTONS
   ========================================================= */

.btn-sm {
    min-height: 28px;
    padding: 3px 9px;
    font-size: 12px;
    border-radius: 3px;
}


/* =========================================================
   LARGE BUTTONS
   ========================================================= */

.btn-lg {
    min-height: 38px;
    padding: 7px 17px;
    font-size: 14px;
    border-radius: 4px;
}


/* =========================================================
   BUTTON GROUP
   ========================================================= */

.btn-group .btn {
    border-radius: 0;
}


    .btn-group .btn:first-child {
        border-radius: 4px 0 0 4px;
    }


    .btn-group .btn:last-child {
        border-radius: 0 4px 4px 0;
    }


/* =========================================================
   DISABLED BUTTON
   ========================================================= */

.btn:disabled,
.btn.disabled {
    background: #f1f3f5;
    border-color: #d5d9de;
    color: #9ca3af;
    box-shadow: none;
    cursor: not-allowed;
    opacity: 1;
}


/* =========================================================
   FORM ACTION BUTTONS
   ========================================================= */

.form-actions {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 10px;
}


/* =========================================================
   ICON + TEXT BUTTON
   ========================================================= */

.btn-icon {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}


    .btn-icon span {
        font-size: 14px;
    }


/* =========================================================
   DELETE / CANCEL / SAVE CONVENTIONS
   ========================================================= */

.btn-save {
    background: linear-gradient( to bottom, #3b82f6, #2563eb );
    border-color: #1d4ed8;
    color: white;
}


.btn-cancel {
    background: linear-gradient( to bottom, #ffffff, #f3f4f6 );
    border-color: #c5ccd5;
    color: #475569;
}


.btn-delete {
    background: linear-gradient( to bottom, #ef4444, #dc2626 );
    border-color: #b91c1c;
    color: white;
}



/* =========================================================
   WINDOWS STYLE LOGIN PAGE
   Uses existing Bootstrap/Razor classes
   ========================================================= */
/* Login page background */
body {
    background: #eef1f5;
}


/* Login card */

.card-stat {
    border: 1px solid #c9ced6;
    border-radius: 5px;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.10);
    padding: 24px !important;
}


    /* Login title */

    .card-stat h3 {
        margin-bottom: 18px !important;
        padding-bottom: 10px;
        border-bottom: 1px solid #dfe3e8;
        color: #263238;
        font-size: 20px;
        font-weight: 600;
    }


    /* Labels */

    .card-stat .form-label {
        display: block;
        margin-bottom: 5px;
        color: #374151;
        font-size: 13px;
        font-weight: 500;
    }


    /* Input fields */

    .card-stat .form-control {
        height: 36px;
        padding: 5px 9px;
        border: 1px solid #bfc5cd;
        border-radius: 3px;
        background: #ffffff;
        color: #1f2937;
        font-size: 13px;
        box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
        transition: border-color 0.1s ease, box-shadow 0.1s ease;
    }


        /* Input hover */

        .card-stat .form-control:hover {
            border-color: #9da6b2;
        }


        /* Input focus */

        .card-stat .form-control:focus {
            border-color: #5b8fd8;
            outline: none;
            box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12), inset 0 1px 2px rgba(0, 0, 0, 0.04);
        }


        /* Placeholder */

        .card-stat .form-control::placeholder {
            color: #9ca3af;
        }


    /* =========================================================
   LOGIN BUTTON
   ========================================================= */

    .card-stat .btn-primary {
        height: 36px;
        border: 1px solid #1d4ed8;
        border-radius: 3px;
        background: linear-gradient( to bottom, #3b82f6, #2563eb );
        color: #ffffff;
        font-size: 13px;
        font-weight: 500;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.10);
    }


        .card-stat .btn-primary:hover {
            background: linear-gradient( to bottom, #2563eb, #1d4ed8 );
            border-color: #1e40af;
        }


        .card-stat .btn-primary:active {
            background: #1d4ed8;
            box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.15);
            transform: translateY(1px);
        }


    /* =========================================================
   HORIZONTAL LINE
   ========================================================= */

    .card-stat hr {
        margin: 20px 0 15px;
        border: 0;
        border-top: 1px solid #dfe3e8;
        opacity: 1;
    }


    /* =========================================================
   REGISTER LINK
   ========================================================= */

    .card-stat p.text-center {
        font-size: 13px;
    }


        .card-stat p.text-center a {
            color: #2563eb;
            text-decoration: none;
            font-size: 13px;
        }


            .card-stat p.text-center a:hover {
                color: #1d4ed8;
                text-decoration: underline;
            }


    /* =========================================================
   INFORMATION / DEFAULT ACCOUNT TEXT
   ========================================================= */

    .card-stat .text-muted {
        color: #6b7280 !important;
        font-size: 11px !important;
        line-height: 1.6;
    }


        .card-stat .text-muted strong {
            color: #374151;
            font-weight: 600;
        }


    /* =========================================================
   VALIDATION
   ========================================================= */

    .card-stat .text-danger {
        font-size: 12px;
    }


    .card-stat .validation-summary-errors {
        margin-bottom: 15px;
        padding: 8px 10px;
        border: 1px solid #f1b5b5;
        border-radius: 3px;
        background: #fff5f5;
        color: #b42318;
        font-size: 12px;
    }


/* =========================================================
   LOGIN PAGE POSITION
   ========================================================= */

.row.justify-content-center {
    min-height: calc(100vh - 130px);
    align-items: flex-start;
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 767px) {

    .row.justify-content-center {
        min-height: auto;
    }

    .col-md-4 {
        padding-left: 15px;
        padding-right: 15px;
    }

    .card-stat {
        margin-top: 20px;
        padding: 20px !important;
    }
}



/* =========================================================
   COMPACT ACCOUNTING FORM CONTROLS
   Windows Desktop / ERP Style
   ========================================================= */

/* Reduce overall form spacing */
.form-label {
    margin-bottom: 3px !important;
    font-size: 12.5px;
    line-height: 1.2;
}

/* Thin and compact input fields */
.form-control,
.form-select {
    min-height: 32px !important;
    height: 32px;
    padding: 4px 8px !important;
    font-size: 13px;
    border-radius: 3px;
}

/* Textarea should remain larger */
textarea.form-control {
    height: auto;
    min-height: 70px !important;
    padding: 6px 8px !important;
}

/* Reduce Bootstrap's default row gaps */
.row {
    --bs-gutter-x: 0.75rem;
    --bs-gutter-y: 0.5rem;
}

/* Reduce vertical spacing between form groups */
.mb-3 {
    margin-bottom: 0.55rem !important;
}

.mb-4 {
    margin-bottom: 0.75rem !important;
}

.mt-3 {
    margin-top: 0.55rem !important;
}

.mt-4 {
    margin-top: 0.75rem !important;
}

/* Compact cards */
.card-body {
    padding: 0.8rem !important;
}

.card-header {
    padding: 0.6rem 0.8rem !important;
}

/* Compact filter/search panels */
.filter-card {
    padding: 0.7rem !important;
    margin-bottom: 0.7rem !important;
}

/* Compact validation messages */
.field-validation-error {
    margin-top: 2px !important;
    font-size: 11px !important;
}

/* Compact checkboxes */
.form-check {
    min-height: 1.2rem;
    margin-bottom: 0.35rem;
}

.form-check-input {
    margin-top: 0.15em;
}

.form-check-label {
    font-size: 13px;
}

/* Compact buttons */
.btn {
    min-height: 30px !important;
    height: 30px;
    padding: 3px 10px !important;
    font-size: 12.5px !important;
}

/* Small buttons */
.btn-sm {
    min-height: 27px !important;
    height: 27px;
    padding: 2px 8px !important;
    font-size: 12px !important;
}

/* Form action area */
.form-actions {
    gap: 4px;
    margin-top: 7px;
    padding-top: 4px;
}

/* Make input groups compact */
.input-group .form-control,
.input-group .form-select,
.input-group .btn {
    height: 32px;
    min-height: 32px !important;
}

/* Compact tables */
.table td,
.table th {
    padding: 0.4rem 0.55rem;
    font-size: 13px;
}

/* Compact page header */
.page-header {
    margin-bottom: 0.7rem;
    gap: 0.5rem;
}

    /* Compact headings */
    .page-header h2 {
        font-size: 1.25rem;
    }

/* =========================================================
   REDUCE EXCESSIVE HORIZONTAL WIDTH
   ========================================================= */

/* Prevent forms from unnecessarily stretching across
   the entire screen */
.form-compact {
    max-width: 900px;
}

/* Useful for normal create/edit forms */
.form-narrow {
    max-width: 750px;
}

/* Individual fields can be kept at a sensible width */
.field-small {
    max-width: 250px;
}

.field-medium {
    max-width: 400px;
}

.field-large {
    max-width: 600px;
}

/* =========================================================
   COMPACT BOOTSTRAP GRID
   ========================================================= */

.form-row-compact {
    --bs-gutter-x: 0.6rem;
    --bs-gutter-y: 0.4rem;
}

    /* Remove excessive padding inside columns */
    .form-row-compact > [class*="col-"] {
        padding-left: 0.3rem;
        padding-right: 0.3rem;
    }

/* =========================================================
   WINDOWS ERP FIELD STYLE
   ========================================================= */

.form-control,
.form-select {
    border: 1px solid #bfc5cd;
    background-color: #fff;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.03);
}

    .form-control:hover,
    .form-select:hover {
        border-color: #9da6b2;
    }

    .form-control:focus,
    .form-select:focus {
        border-color: #5b8fd8;
        box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.10), inset 0 1px 2px rgba(0, 0, 0, 0.03);
    }

/* Select arrow area stays compact */
.form-select {
    padding-right: 2rem !important;
}

/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 768px) {

    .form-control,
    .form-select {
        height: 34px;
        min-height: 34px !important;
    }

    .card-body {
        padding: 0.65rem !important;
    }

    .row {
        --bs-gutter-x: 0.6rem;
        --bs-gutter-y: 0.45rem;
    }
}



/* =========================================================
   COMPACT WINDOWS / ERP DATA GRIDS
   ========================================================= */

.table {
    margin-bottom: 0 !important;
    width: 100%;
    font-size: 12.5px;
    border-collapse: collapse;
}

    /* Table Header */
    .table thead th {
        padding: 5px 7px !important;
        height: 30px;
        background: #f1f3f5;
        color: #374151;
        font-size: 11.5px;
        font-weight: 600;
        border: 1px solid #d5dae0;
        vertical-align: middle;
        white-space: nowrap;
    }

    /* Table Body */
    .table tbody td {
        padding: 4px 7px !important;
        height: 29px;
        border: 1px solid #e1e5e9;
        color: #374151;
        vertical-align: middle;
        line-height: 1.2;
    }

    /* Remove large Bootstrap spacing */
    .table > :not(caption) > * > * {
        padding: 4px 7px !important;
    }

    /* Compact table rows */
    .table tbody tr {
        height: 29px;
    }

/* Hover */
.table-hover tbody tr:hover {
    background-color: #eef5ff !important;
}

/* Selected / active row */
.table tbody tr.active,
.table tbody tr.selected {
    background-color: #dbeafe;
}

/* Smaller badges inside grids */
.table .badge {
    font-size: 10.5px;
    padding: 3px 6px;
    border-radius: 3px;
}

/* Buttons inside tables */
.table .btn {
    height: 26px !important;
    min-height: 26px !important;
    padding: 2px 7px !important;
    font-size: 11.5px !important;
    border-radius: 3px;
}

    /* Multiple action buttons should stay close */
    .table .btn + .btn {
        margin-left: 2px;
    }

/* Form controls inside editable grids */
.table .form-control,
.table .form-select {
    height: 28px !important;
    min-height: 28px !important;
    padding: 2px 6px !important;
    font-size: 12px !important;
    border-radius: 2px;
}

/* Checkbox inside grid */
.table .form-check-input {
    width: 14px;
    height: 14px;
    margin-top: 0;
}

/* Numeric columns */
.table .text-end {
    font-variant-numeric: tabular-nums;
}

/* Make action column compact */
.table th:last-child,
.table td:last-child {
    white-space: nowrap;
}

/* Compact table-responsive */
.table-responsive {
    margin-bottom: 0 !important;
    border: 1px solid #d5dae0;
    border-radius: 3px;
}

/* Remove excessive spacing around table card */
/* Let the card body scroll horizontally instead of clipping */
.card:has(.table),
.card:has(.table) .card-body {
    overflow: visible; /* was hidden  this was clipping */
}

/* The scroll container */
.table-responsive {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto !important;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    border: 1px solid #d5dae0; /* keep the frame you already had */
    border-radius: 4px;
}

/* The table itself: grows to fit content, never shrinks below viewport */
.table {
    width: auto;
    min-width: 100%;
    font-size: 11.5px;
    margin-bottom: 0;
}

    /* Give each cell a sensible minimum so columns don't collapse */
    .table thead th,
    .table tbody td {
        white-space: nowrap;
        vertical-align: middle;
    }

    /* Numeric columns keep right alignment but don't force huge width */
    .table .text-end {
        text-align: right;
    }

    /* Compact cell padding */
    .table > :not(caption) > * > * {
        padding: 5px 7px !important;
    }

    /* Action columns stay compact */
    .table th:last-child,
    .table td:last-child {
        white-space: nowrap;
    }

    /* Buttons / badges inside the grid shouldn't wrap */
    .table .btn,
    .table .badge {
        white-space: nowrap;
    }

/* Compact card containing a grid */
.card:has(.table) {
    border-radius: 4px;
}

/* =========================================================
   VERY COMPACT GRID
   Use class="table table-compact"
   ========================================================= */

.table-compact thead th {
    padding: 4px 6px !important;
    height: 27px;
    font-size: 11px;
}

.table-compact tbody td {
    padding: 3px 6px !important;
    height: 26px;
    font-size: 12px;
}

.table-compact tbody tr {
    height: 26px;
}

/* =========================================================
   GRID TOOLBAR
   ========================================================= */

.grid-toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 5px 6px;
    background: #f4f6f8;
    border: 1px solid #d5dae0;
    border-bottom: none;
    min-height: 36px;
}

    .grid-toolbar .btn {
        height: 27px !important;
        min-height: 27px !important;
        padding: 2px 8px !important;
        font-size: 11.5px !important;
    }

    /* Search box inside grid toolbar */
    .grid-toolbar .form-control {
        height: 27px !important;
        min-height: 27px !important;
        width: 220px;
        padding: 3px 7px !important;
        font-size: 12px;
    }

/* =========================================================
   GRID FOOTER / PAGINATION
   ========================================================= */

.grid-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 34px;
    padding: 4px 6px;
    background: #f4f6f8;
    border: 1px solid #d5dae0;
    border-top: none;
    font-size: 11.5px;
}

    .grid-footer .pagination {
        margin: 0;
    }

    .grid-footer .page-link {
        padding: 3px 7px;
        font-size: 11.5px;
    }





/* Help icon + popover ("!" button on each page, no JS  a native <details> element) */
.help-box {
    display: inline-block;
    position: relative;
    margin-left: 8px;
    vertical-align: middle;
}

    .help-box > summary {
        list-style: none;
        cursor: pointer;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 22px;
        height: 22px;
        border-radius: 50%;
        background-color: #f1f3f5;
        color: #6c757d;
        border: 1px solid #ced4da;
        font-weight: 700;
        font-size: 0.85rem;
        line-height: 1;
        user-select: none;
    }

        .help-box > summary::-webkit-details-marker,
        .help-box > summary::marker {
            display: none;
            content: "";
        }

    .help-box[open] > summary {
        background-color: #fd7e14;
        color: #fff;
        border-color: #fd7e14;
    }

.help-popover {
    position: absolute;
    z-index: 1055;
    top: 28px;
    left: 0;
    width: 300px;
    max-width: 80vw;
    background-color: #fff8f0;
    border: 1px solid #fd7e14;
    border-radius: 8px;
    padding: 12px 14px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.15);
    font-size: 0.82rem;
    color: #343a40;
    text-align: left;
    white-space: normal;
}

    .help-popover h6 {
        color: #c2410c;
        font-weight: 700;
        margin-bottom: 6px;
        font-size: 0.9rem;
    }

    .help-popover .help-benefit {
        background-color: #f1f3f5;
        border-left: 3px solid #fd7e14;
        padding: 6px 8px;
        border-radius: 4px;
    }

    .help-popover ol {
        padding-left: 18px;
    }

        .help-popover ol li {
            margin-bottom: 4px;
        }

/* ============================================================
     support β used by document Details pages (invoices,
   bills, orders, challans, notes) and the Reports pages.
   ============================================================ */

.btn-print {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: #fff;
    border: 1px solid #ced4da;
    color: #333;
    border-radius: 4px;
    padding: 6px 14px;
    font-size: 0.9rem;
    line-height: 1;
    cursor: pointer;
}

    .btn-print:hover {
        background-color: #f1f3f5;
        border-color: #adb5bd;
        color: #111;
    }

    .btn-print .btn-print-icon {
        font-size: 1rem;
        line-height: 1;
    }

@media print {
    /* Hide app chrome: top nav, quick-access toolbar, the little
       "!" help popovers, and every button/form on the page (the
       print button hides itself this way too β no extra class
       needed). */
    .accounting-navbar,
    .accounting-side-tools,
    .module-sidebar,
    .help-box,
    .btn,
    .btn-print,
    form,
    .no-print {
        display: none !important;
    }

    body.module-shell-active {
        padding-left: 0 !important;
    }

    .module-content {
        margin-left: 0 !important;
        height: auto !important;
        overflow: visible !important;
        padding: 0 !important;
    }

    body {
        background: #fff !important;
        margin: 0;
    }

    .container-fluid {
        padding: 0 !important;
        margin: 0 !important;
        max-width: 100% !important;
    }

    .card,
    .card-stat {
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
    }

    .alert {
        display: none !important;
    }
}


/* =========================================
   ACCOUNTING LEFT TOOLBAR
   ========================================= */

.accounting-side-tools {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 42px;
    background: #f4f5f7;
    border-right: 1px solid #d5d8dc;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 6px;
    z-index: 1050;
}


/* Icon buttons */

.side-tool {
    width: 34px;
    height: 34px;
    margin: 1px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: #343a40;
    text-decoration: none;
    font-size: 16px;
    cursor: pointer;
    transition: all .12s ease;
}


    /* Hover */

    .side-tool:hover {
        background: #e1e5e9;
        color: #000;
    }


    /* Active */

    .side-tool:active {
        background: #d3d7dc;
    }


/* Separator */

.side-tool-separator {
    width: 27px;
    height: 1px;
    background: #cfd3d7;
    margin: 7px 0;
}


/* Language */

.side-tool-dropdown {
    position: relative;
}

    .side-tool-dropdown .side-tool {
        padding: 0;
    }


/* Language popup */

.side-language-menu {
    margin-left: 7px !important;
    margin-top: -4px !important;
    min-width: 145px;
    padding: 4px 0;
    border: 1px solid #d3d7dc;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,.12);
    font-size: 13px;
}

    .side-language-menu .dropdown-item {
        padding: 7px 12px;
    }

        .side-language-menu .dropdown-item:hover {
            background: #e9ecef;
        }


/* User */

.side-user {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 1px 0;
    font-size: 16px;
}


/* Logout */

.side-logout-form {
    margin: 0;
    padding: 0;
}

.side-logout:hover {
    background: #f8d7da;
    color: #842029;
}


/* =========================================
   MAIN CONTENT OFFSET
   ========================================= */

body {
    padding-left: 42px;
}


/* =========================================
   MOBILE
   ========================================= */

@media (max-width: 768px) {

    .accounting-side-tools {
        width: 38px;
    }

    body {
        padding-left: 38px;
    }

    .side-tool {
        width: 32px;
        height: 32px;
        font-size: 15px;
    }
}


/* ===== EROPYA BRAND  HIGH CONTRAST VERSION ===== */
.eropya-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    padding: 4px 12px 4px 8px;
    background: rgba(255, 255, 255, 0.08); /* Subtle light background */
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: all 0.2s;
    min-height: 32px;
}

    .eropya-brand:hover {
        background: rgba(255, 255, 255, 0.14);
        border-color: rgba(255, 255, 255, 0.12);
        transform: scale(1.02);
    }

    /* ---- Icon mark ---- */
    .eropya-brand .brand-icon {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 26px;
        height: 26px;
        background: #059669;
        border-radius: 5px;
        flex-shrink: 0;
        box-shadow: 0 2px 8px rgba(5, 150, 105, 0.3);
    }

        .eropya-brand .brand-icon svg {
            width: 18px;
            height: 18px;
            fill: none;
            stroke: #ffffff;
            stroke-width: 2.5;
            stroke-linecap: round;
            stroke-linejoin: round;
        }

    /* ---- Brand name - HIGH CONTRAST ---- */
    .eropya-brand .brand-name {
        font-size: 17px;
        font-weight: 800;
        color: #1a2a4a; /* Pure white */
        letter-spacing: 0.5px;
        font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
        text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); /* Text shadow for readability */
    }

        .eropya-brand .brand-name span {
            color: #fbbf24; /* Brighter gold */
            text-shadow: 0 0 12px rgba(251, 191, 36, 0.3);
        }

    /* ---- Tagline ---- */
    .eropya-brand .brand-tagline {
        font-size: 8.5px;
        font-weight: 500;
        color: #cbd5e1; /* Light gray (visible) */
        text-transform: uppercase;
        letter-spacing: 1.5px;
        font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
        opacity: 0.85;
        padding-left: 2px;
        border-left: 1px solid rgba(255, 255, 255, 0.15);
        padding-left: 8px;
    }

/* ---- COMPACT VERSION (mobile) ---- */
@media (max-width: 768px) {
    .eropya-brand {
        padding: 3px 8px 3px 6px;
        gap: 5px;
        min-height: 28px;
    }

        .eropya-brand .brand-name {
            font-size: 14px;
        }

        .eropya-brand .brand-tagline {
            display: none; /* Hide tagline on mobile */
        }

        .eropya-brand .brand-icon {
            width: 22px;
            height: 22px;
        }

            .eropya-brand .brand-icon svg {
                width: 15px;
                height: 15px;
            }
}

@media (max-width: 480px) {
    .eropya-brand {
        padding: 2px 6px 2px 4px;
        gap: 4px;
        min-height: 24px;
        background: transparent; /* Remove background on very small screens */
        border: none;
    }

        .eropya-brand .brand-name {
            font-size: 12px;
        }

        .eropya-brand .brand-icon {
            width: 20px;
            height: 20px;
        }

            .eropya-brand .brand-icon svg {
                width: 13px;
                height: 13px;
            }
}

/* ===== ALTERNATIVE: ICON ONLY (for tight spaces) ===== */
.eropya-icon-only {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: #059669;
    border-radius: 6px;
    text-decoration: none;
    transition: transform 0.2s;
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.3);
}

    .eropya-icon-only:hover {
        transform: scale(1.08);
    }

    .eropya-icon-only svg {
        width: 20px;
        height: 20px;
        fill: none;
        stroke: #ffffff;
        stroke-width: 2.5;
        stroke-linecap: round;
        stroke-linejoin: round;
    }
/* ---------- Country Invoice Header β per-country print layouts ---------- */
/* India (.cih-in) intentionally has no overrides here β it uses the original
   generic block styling that predates the multi-country work. */

.country-invoice-header.cih-np {
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    overflow: hidden;
    background: var(--app-card);
}

.cih-np-bar {
    height: 6px;
    background: linear-gradient(90deg, #DC143C 0%, #DC143C 60%, #003893 60%, #003893 100%);
}

.cih-np-body {
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.cih-np-title {
    margin: 0;
    letter-spacing: 0.02em;
    color: #003893;
}

.cih-np-regbox {
    border: 1px solid var(--app-border);
    border-radius: 6px;
    padding: 0.35rem 0.6rem;
    font-size: 0.9rem;
    background: var(--app-bg);
}

.country-invoice-header.cih-sa {
    border: 1px solid #0b6e4f33;
    border-radius: var(--app-radius);
    background: var(--app-card);
    padding: 0.85rem 1rem;
}

.cih-sa-titles {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    border-bottom: 2px solid #0b6e4f;
    padding-bottom: 0.5rem;
    margin-bottom: 0.5rem;
}

.cih-sa-title-en {
    color: #0b6e4f;
}

.cih-sa-title-ar {
    color: #0b6e4f;
    font-size: 1.25rem;
    font-family: "Segoe UI", "Traditional Arabic", "Arial", sans-serif;
}

.cih-sa-taxrow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    font-size: 0.9rem;
}

.cih-sa-label-en {
    color: var(--app-muted);
}

.cih-sa-label-ar {
    color: var(--app-muted);
    font-family: "Segoe UI", "Traditional Arabic", "Arial", sans-serif;
}

.cih-sa-qr-block {
    border: 1px dashed #0b6e4f66;
    border-radius: 6px;
    padding: 0.5rem 0.65rem;
}

.cih-sa-qr-caption {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.cih-qr-image {
    display: block;
    image-rendering: pixelated;
    border: 1px solid var(--app-border);
    border-radius: 4px;
    padding: 4px;
    background: #fff;
}

.cih-qr-raw summary {
    cursor: pointer;
}

@media print {
    .cih-np-bar {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* ---------- User Manual page ---------- */

.um-checklist {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.um-check-item {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--app-border);
}

    .um-check-item:last-child {
        border-bottom: none;
    }

.um-check-icon {
    flex: 0 0 auto;
    line-height: 1.4;
}

.um-check-label {
    flex: 1 1 auto;
}

.um-check-done .um-check-label {
    color: var(--app-muted);
}

.um-check-cta {
    flex: 0 0 auto;
    align-self: center;
}

.um-flow {
    padding-left: 1.2rem;
    margin-bottom: 0.75rem;
}

    .um-flow li {
        margin-bottom: 0.35rem;
    }

.um-module {
    border-bottom: 1px solid var(--app-border);
    padding: 0.6rem 0;
}

    .um-module:last-of-type {
        border-bottom: none;
    }

    .um-module summary {
        cursor: pointer;
        font-weight: 600;
        color: var(--app-text);
    }

    .um-module p {
        margin: 0.5rem 0 0;
        color: var(--app-muted);
    }


.user-manual-blink {
    animation: blink 2s infinite;
}

@keyframes blink {
    0%, 70%, 100% {
        opacity: 1;
    }

    85% {
        opacity: 0.3;
    }
}





/* ================================
   Subscription Management
   ================================ */
.subscription-table {
    min-width: 850px;
}

    .subscription-table th {
        white-space: nowrap;
    }

/* Renewal panel */

.renewal-panel {
    width: 100%;
    max-width: 100%;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 16px;
    box-sizing: border-box;
}

.renewal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 1px solid #dee2e6;
}

/* Responsive grid */

.renewal-form {
    display: grid;
    grid-template-columns: minmax(180px, 1.5fr) minmax(130px, 1fr) minmax(130px, 1fr) minmax(130px, 1fr) minmax(150px, 1fr) minmax(150px, 1fr) minmax(180px, 1.3fr);
    gap: 12px;
    width: 100%;
    box-sizing: border-box;
}

.renew-field {
    min-width: 0;
}

    .renew-field .form-label {
        display: block;
        font-size: 0.78rem;
        font-weight: 600;
        color: #495057;
        margin-bottom: 4px;
    }

    .renew-field .form-control,
    .renew-field .form-select {
        width: 100%;
        min-width: 0;
    }

/* Plan gets slightly more space */
.plan-field {
    min-width: 0;
}

/* Note gets more space */
.note-field {
    min-width: 0;
}

/* Price calculation text */

.js-renew-breakdown {
    display: block;
    min-height: 18px;
    margin-top: 3px;
    font-size: 0.72rem;
    white-space: normal;
    overflow-wrap: anywhere;
}

/* Bottom action section */

.renewal-actions {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding-top: 12px;
    margin-top: 2px;
    border-top: 1px solid #dee2e6;
}

.renewal-options {
    display: flex;
    align-items: center;
    gap: 15px;
    min-width: 0;
}

    .renewal-options small {
        line-height: 1.4;
    }

.renewal-actions button {
    flex-shrink: 0;
    white-space: nowrap;
}


/* ==================================
   Tablet
   ================================== */

@media (max-width: 1200px) {

    .renewal-form {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .plan-field {
        grid-column: span 2;
    }

    .note-field {
        grid-column: span 2;
    }
}


/* ==================================
   Mobile / Small Tablet
   ================================== */

@media (max-width: 768px) {

    .renewal-panel {
        padding: 12px;
    }

    .renewal-form {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .plan-field,
    .note-field {
        grid-column: span 2;
    }

    .renewal-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .renewal-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .renewal-actions button {
        width: 100%;
    }
}


/* ==================================
   Small Mobile
   ================================== */

@media (max-width: 480px) {

    .renewal-form {
        grid-template-columns: 1fr;
    }

    .plan-field,
    .note-field {
        grid-column: span 1;
    }

    .renewal-panel {
        padding: 10px;
    }

    .renewal-header {
        align-items: flex-start;
    }
}

/* =========================================================
   FINAL RESPONSIVE OVERRIDES
   Mobile-first corrections for phones and small tablets
   Existing class names are preserved.
   ========================================================= */

html,
body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

img,
svg,
video,
canvas {
    max-width: 100%;
    height: auto;
}

.container-fluid {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.card,
.card-body,
.card-header,
.filter-card,
.stat-card,
.auth-card,
.renewal-panel {
    max-width: 100%;
    box-sizing: border-box;
}

/* ---------- Large tablet / small laptop ---------- */
@media (max-width: 1100px) {
    .accounting-topbar {
        min-width: 0;
    }

    .accounting-brand {
        min-width: 0;
        flex-shrink: 0;
    }

    .accounting-menu {
        min-width: 0;
    }

    .account-menu-item > button,
    .account-direct-menu {
        font-size: 13px;
        padding-left: 7px;
        padding-right: 7px;
    }

    .account-user {
        min-width: 0;
    }

    .logged-user {
        max-width: 160px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .grid-toolbar {
        flex-wrap: wrap;
    }

        .grid-toolbar .form-control {
            max-width: 100%;
        }

    .form-compact,
    .form-narrow,
    .form-row-compact {
        max-width: 100%;
    }
}

/* =========================================================
   TABLET
   ========================================================= */
@media (max-width: 900px) {
    .page-header {
        flex-wrap: wrap;
    }

        .page-header h2 {
            max-width: 100%;
            word-break: break-word;
        }

    .stat-card {
        padding: 0.85rem;
    }

    .stat-value {
        font-size: 1.3rem;
    }

    .filter-card {
        padding: 0.65rem !important;
    }

    .grid-toolbar {
        align-items: stretch;
    }

        .grid-toolbar .form-control {
            width: 100%;
            flex: 1 1 180px;
        }

    .grid-footer {
        flex-wrap: wrap;
        gap: 6px;
    }

    .help-popover {
        max-width: calc(100vw - 60px);
    }

    .subscription-expired-banner {
        flex-wrap: wrap;
        padding-left: 10px;
        padding-right: 10px;
    }
}

/* =========================================================
   MOBILE - 768px
   ========================================================= */
@media (max-width: 768px) {
    html,
    body {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    body {
        font-size: 13px;
        padding-left: 38px;
    }

    h1 {
        font-size: 1.55rem;
    }

    h2 {
        font-size: 1.3rem;
    }

    h3 {
        font-size: 1.15rem;
    }

    h4 {
        font-size: 1.05rem;
    }

    h5 {
        font-size: 1rem;
    }

    h6 {
        font-size: 0.9rem;
    }

    .container-fluid {
        width: 100%;
        max-width: 100%;
        padding-left: 8px !important;
        padding-right: 8px !important;
        margin-left: 0;
        margin-right: 0;
        overflow-x: hidden;
    }

    .accounting-navbar + .container-fluid {
        padding-top: 8px;
    }

    /* ---------- Top navigation ---------- */
    .accounting-navbar {
        width: 100%;
        max-width: 100%;
        overflow: visible;
    }

    .accounting-topbar {
        min-height: 44px;
        height: auto;
        width: 100%;
        max-width: 100%;
        padding: 4px 6px;
        gap: 4px;
        overflow: hidden;
        box-sizing: border-box;
    }

    
    .accounting-brand {
        min-width: 0;
        max-width: 55%;
        margin-right: 2px;
        padding-right: 7px;
        gap: 5px;
        font-size: 13px;
        overflow: hidden;
        white-space: nowrap;
    }

        .accounting-brand .brand-icon,
        .brand-icon {
            width: 24px;
            height: 24px;
            min-width: 24px;
            font-size: 14px;
        }

        .accounting-brand > span:not(.brand-icon) {
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

    .account-user {
        min-width: 0;
        max-width: 45%;
        gap: 4px;
        margin-left: auto;
        overflow: hidden;
    }

    .business-name,
    .logged-user {
        display: none !important;
    }

    .logout-btn {
        height: 28px;
        min-height: 28px;
        padding: 0 7px;
        font-size: 11px;
        white-space: nowrap;
    }

    .login-link {
        padding: 4px 5px;
        font-size: 12px;
        white-space: nowrap;
    }

    /* ---------- Quick toolbar ---------- */
    .accounting-toolbar {
        display: flex;
        width: 100%;
        max-width: 100%;
        min-height: 34px;
        padding: 3px 4px;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        box-sizing: border-box;
    }

    .tool-button {
        flex: 0 0 auto;
        padding: 4px 6px;
        font-size: 11px;
    }

        .tool-button span {
            font-size: 12px;
        }

    .tool-pos {
        padding: 4px 7px;
    }

    .toolbar-separator {
        flex: 0 0 1px;
        height: 17px;
        margin: 0 2px;
    }

    /* ---------- Left tool rail ---------- */
    .accounting-side-tools {
        width: 38px;
        max-width: 38px;
        overflow: visible;
    }

    .side-tool {
        width: 32px;
        height: 32px;
        font-size: 15px;
    }

    .side-tool-separator {
        width: 26px;
        margin: 5px 0;
    }

    .side-language-menu {
        position: fixed !important;
        left: 40px !important;
        min-width: 140px;
        max-width: calc(100vw - 50px);
        margin-left: 0 !important;
        z-index: 2000;
    }

    /* ---------- Page header ---------- */
    .page-header {
        width: 100%;
        margin-bottom: 0.65rem;
        gap: 0.45rem;
        align-items: stretch;
    }

        .page-header h2 {
            width: 100%;
            font-size: 1.2rem;
            line-height: 1.3;
        }

        .page-header .btn,
        .page-header > .btn,
        .page-header > form,
        .page-header > div {
            max-width: 100%;
        }

    /* ---------- Cards ---------- */
    .card {
        border-radius: 6px;
    }

    .card-header {
        padding: 0.55rem 0.65rem !important;
        line-height: 1.35;
        word-break: break-word;
    }

    .card-body {
        padding: 0.65rem !important;
        min-width: 0;
    }

    .card-stat {
        padding: 16px !important;
    }

    .stat-card {
        padding: 0.75rem;
        border-radius: 8px;
    }

    .stat-title {
        font-size: 0.78rem;
    }

    .stat-value {
        font-size: 1.25rem;
    }

    .stat-icon {
        width: 36px;
        height: 36px;
    }

    /* ---------- Forms ---------- */
    .row {
        --bs-gutter-x: 0.55rem;
        --bs-gutter-y: 0.45rem;
    }

    .form-label {
        font-size: 12px;
        line-height: 1.25;
        margin-bottom: 3px !important;
    }

    .form-control,
    .form-select {
        width: 100%;
        max-width: 100%;
        height: 36px;
        min-height: 36px !important;
        font-size: 13px;
        padding: 5px 8px !important;
        box-sizing: border-box;
    }

    textarea.form-control {
        height: auto;
        min-height: 75px !important;
    }

    .form-check-label {
        font-size: 12.5px;
        word-break: break-word;
    }

    .form-compact,
    .form-narrow,
    .field-small,
    .field-medium,
    .field-large {
        width: 100%;
        max-width: 100%;
    }

    .form-row-compact > [class*="col-"] {
        padding-left: 0.25rem;
        padding-right: 0.25rem;
    }

    .input-group {
        max-width: 100%;
        flex-wrap: nowrap;
    }

        .input-group .form-control,
        .input-group .form-select,
        .input-group .btn {
            min-width: 0;
        }

    /* ---------- Buttons ---------- */
    .btn {
        min-height: 34px !important;
        height: auto;
        min-width: 0;
        padding: 6px 10px !important;
        font-size: 12px !important;
        white-space: normal;
        line-height: 1.25;
    }

    .btn-sm {
        min-height: 30px !important;
        height: auto;
        padding: 4px 8px !important;
        font-size: 11.5px !important;
    }

    .btn-lg {
        min-height: 38px;
        padding: 7px 12px !important;
        font-size: 13px !important;
    }

    .btn-icon {
        gap: 4px;
    }

        .btn-icon span {
            font-size: 12px;
        }

    .form-actions {
        width: 100%;
        flex-wrap: wrap;
        gap: 5px;
    }

        .form-actions .btn {
            flex: 1 1 auto;
        }

    /* ---------- Filter/search ---------- */
    .filter-card {
        width: 100%;
        padding: 0.6rem !important;
        margin-bottom: 0.6rem !important;
    }

    .search-box {
        width: 100%;
    }

        .search-box .form-control {
            padding-left: 2rem;
        }

    /* ---------- Tables ---------- */
    .table-responsive {
        width: 100%;
        max-width: 100%;
        overflow-x: auto !important;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        margin-bottom: 0 !important;
    }

    .table {
        width: max-content;
        min-width: 100%;
        font-size: 11.5px;
    }

        .table thead th {
            padding: 5px 6px !important;
            font-size: 10.5px;
        }

        .table tbody td {
            padding: 4px 6px !important;
            font-size: 11.5px;
        }

        .table > :not(caption) > * > * {
            padding: 4px 6px !important;
        }

        .table .btn {
            height: 28px !important;
            min-height: 28px !important;
            padding: 3px 6px !important;
            font-size: 10.5px !important;
            white-space: nowrap;
        }

        .table .form-control,
        .table .form-select {
            height: 30px !important;
            min-height: 30px !important;
            font-size: 11px !important;
        }

        .table .badge {
            font-size: 9.5px;
            padding: 2px 5px;
        }

    .table-compact thead th {
        font-size: 10px;
        padding: 4px 5px !important;
    }

    .table-compact tbody td {
        font-size: 11px;
        padding: 3px 5px !important;
    }

    /* ---------- Grid toolbar/footer ---------- */
    .grid-toolbar {
        width: 100%;
        min-width: 0;
        padding: 5px;
        flex-wrap: wrap;
        gap: 4px;
        box-sizing: border-box;
    }

        .grid-toolbar .form-control {
            width: 100%;
            flex: 1 1 100%;
            max-width: 100%;
        }

    .grid-footer {
        width: 100%;
        min-width: 0;
        min-height: 34px;
        padding: 4px 5px;
        flex-wrap: wrap;
        gap: 5px;
    }

        .grid-footer .pagination {
            max-width: 100%;
            overflow-x: auto;
            flex-wrap: nowrap;
        }

        .grid-footer .page-link {
            padding: 3px 6px;
            font-size: 10.5px;
        }

    /* ---------- Pagination ---------- */
    .pagination {
        flex-wrap: wrap;
        gap: 2px;
    }

        .pagination .page-link {
            padding: 4px 7px;
            font-size: 11px;
        }

    /* ---------- Alerts ---------- */
    .alert {
        padding: 0.55rem 0.7rem;
        font-size: 12px;
        overflow-wrap: anywhere;
    }

    .subscription-expired-banner {
        min-height: 34px;
        padding: 7px 8px;
        gap: 6px;
        font-size: 11.5px;
        line-height: 1.35;
        flex-wrap: wrap;
    }

    /* ---------- Dropdowns ---------- */
    .dropdown-menu {
        max-width: calc(100vw - 50px);
        overflow-x: hidden;
    }

    .dropdown-item {
        font-size: 12px;
        padding: 0.45rem 0.6rem;
    }

    /* ---------- Empty states ---------- */
    .empty-state {
        padding: 2rem 0.7rem;
    }

        .empty-state h5 {
            font-size: 0.95rem;
        }

    /* ---------- Modal ---------- */
    .modal-dialog {
        width: auto;
        max-width: calc(100% - 16px);
        margin: 8px auto;
    }

    .modal-content {
        border-radius: 8px;
    }

    .modal-header,
    .modal-footer {
        padding: 0.65rem 0.75rem;
    }

    .modal-body {
        padding: 0.75rem;
        overflow-x: auto;
    }

    .modal-footer {
        flex-wrap: wrap;
        gap: 5px;
    }

        .modal-footer .btn {
            flex: 1 1 auto;
        }

    /* ---------- Help popover ---------- */
    .help-box {
        margin-left: 4px;
    }

    .help-popover {
        left: auto;
        right: 0;
        width: min(300px, calc(100vw - 55px));
        max-width: calc(100vw - 55px);
        padding: 10px 11px;
        font-size: 11.5px;
    }

    /* ---------- Login/auth ---------- */
    .auth-container {
        min-height: auto;
        width: 100%;
        padding: 15px 0;
        align-items: flex-start;
    }

    .auth-card {
        width: 100%;
        max-width: 100%;
        padding: 1rem;
        border-radius: 8px;
    }

    .row.justify-content-center {
        min-height: auto;
    }

    .col-md-4 {
        width: 100%;
        padding-left: 8px;
        padding-right: 8px;
    }

    .card-stat h3 {
        font-size: 18px;
        margin-bottom: 14px !important;
    }

    .card-stat .form-control {
        height: 38px;
        min-height: 38px !important;
    }

    .card-stat .btn-primary {
        height: 38px;
        min-height: 38px !important;
    }

    /* ---------- Brand ---------- */
    .eropya-brand {
        max-width: 100%;
    }

    /* ---------- Country invoice header ---------- */
    .cih-np-body,
    .cih-sa-titles,
    .cih-sa-taxrow {
        align-items: flex-start;
        flex-direction: column;
    }

    .cih-np-body {
        padding: 0.65rem 0.75rem;
        gap: 0.5rem;
    }

    .country-invoice-header.cih-sa {
        padding: 0.65rem 0.75rem;
    }

    .cih-sa-title-ar {
        font-size: 1.1rem;
    }

    .cih-sa-qr-block {
        width: 100%;
        box-sizing: border-box;
    }

    /* ---------- User manual ---------- */
    .um-check-item {
        gap: 0.45rem;
        flex-wrap: wrap;
    }

    .um-check-label {
        min-width: 0;
    }

    .um-check-cta {
        width: 100%;
        padding-left: 1.5rem;
    }

    /* ---------- Renewal ---------- */
    .renewal-panel {
        width: 100%;
        max-width: 100%;
        padding: 10px !important;
        overflow: hidden;
    }

    .renewal-header {
        flex-wrap: wrap;
        gap: 6px;
        margin-bottom: 10px;
        padding-bottom: 8px;
    }

    .renewal-form {
        width: 100%;
        grid-template-columns: 1fr !important;
        gap: 8px;
    }

    .plan-field,
    .note-field {
        grid-column: span 1 !important;
    }

    .renew-field {
        width: 100%;
        min-width: 0;
    }

        .renew-field .form-control,
        .renew-field .form-select {
            width: 100%;
        }

    .renewal-actions {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding-top: 9px;
    }

    .renewal-options {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .renewal-actions button {
        width: 100%;
    }
}

/* =========================================================
   SMALL PHONES - 576px
   ========================================================= */
@media (max-width: 576px) {
    body {
        font-size: 12.5px;
    }

    .container-fluid {
        padding-left: 6px !important;
        padding-right: 6px !important;
    }

    .accounting-topbar {
        min-height: 42px;
        padding: 3px 5px;
    }

    .accounting-brand {
        max-width: 52%;
        font-size: 12px;
        padding-right: 5px;
    }

    .account-user {
        max-width: 48%;
    }

    .logout-btn {
        padding: 0 6px;
        font-size: 10.5px;
    }

    .page-header h2 {
        font-size: 1.1rem;
    }

    .card-body {
        padding: 0.55rem !important;
    }

    .card-stat {
        padding: 13px !important;
    }

    .stat-card {
        padding: 0.65rem;
    }

    .stat-value {
        font-size: 1.15rem;
    }

    .form-control,
    .form-select {
        height: 35px;
        min-height: 35px !important;
        font-size: 12.5px;
    }

    .btn {
        font-size: 11.5px !important;
        padding: 5px 8px !important;
    }

    .form-actions .btn {
        flex: 1 1 100%;
    }

    .table {
        font-size: 11px;
    }

        .table thead th {
            font-size: 10px;
        }

        .table tbody td {
            font-size: 11px;
        }

    .grid-footer {
        align-items: flex-start;
        flex-direction: column;
    }

        .grid-footer .pagination {
            width: 100%;
        }

    .help-popover {
        width: calc(100vw - 50px);
        max-width: calc(100vw - 50px);
    }

    .subscription-expired-banner {
        font-size: 10.5px;
    }

    .renewal-panel {
        padding: 8px !important;
    }

    .auth-container {
        padding: 8px 0;
    }

    .auth-card {
        padding: 12px !important;
    }

    .card-stat h3 {
        font-size: 17px;
    }
}

/* =========================================================
   VERY SMALL PHONES - 480px
   ========================================================= */
@media (max-width: 480px) {
    body {
        padding-left: 36px;
        font-size: 12px;
    }

    .accounting-side-tools {
        width: 36px;
    }

    .side-tool {
        width: 30px;
        height: 30px;
        font-size: 14px;
    }

    .container-fluid {
        padding-left: 5px !important;
        padding-right: 5px !important;
    }

    .accounting-topbar {
        padding: 3px 4px;
    }

    .accounting-brand {
        max-width: 58%;
        min-width: 0;
    }

        .accounting-brand .brand-icon,
        .brand-icon {
            width: 22px;
            height: 22px;
            min-width: 22px;
            font-size: 13px;
        }

    .account-user {
        max-width: 42%;
    }

    .logout-btn {
        height: 27px;
        min-height: 27px;
        padding: 0 5px;
        font-size: 10px;
    }

    .tool-button {
        padding: 3px 5px;
        font-size: 10.5px;
    }

        .tool-button span {
            font-size: 11px;
        }

    .page-header h2 {
        font-size: 1rem;
    }

    .card-header {
        font-size: 12px;
    }

    .card-body {
        padding: 0.5rem !important;
    }

    .filter-card {
        padding: 0.5rem !important;
    }

    .form-label {
        font-size: 11.5px;
    }

    .form-control,
    .form-select {
        height: 34px;
        min-height: 34px !important;
        font-size: 12px;
    }

    textarea.form-control {
        min-height: 70px !important;
    }

    .btn {
        min-height: 33px !important;
        font-size: 11px !important;
        padding: 5px 7px !important;
    }

    .btn-sm {
        min-height: 29px !important;
        font-size: 10.5px !important;
    }

    .table thead th {
        font-size: 9.5px;
        padding: 4px 5px !important;
    }

    .table tbody td {
        font-size: 10.5px;
        padding: 4px 5px !important;
    }

    .table .btn {
        height: 27px !important;
        min-height: 27px !important;
        font-size: 10px !important;
        padding: 2px 5px !important;
    }

    .pagination .page-link {
        padding: 3px 5px;
        font-size: 10px;
    }

    .subscription-expired-banner {
        padding: 6px;
        font-size: 10px;
    }

    .renewal-header h4,
    .renewal-header h5,
    .renewal-header h6 {
        font-size: 0.95rem;
    }

    .auth-card,
    .card-stat {
        border-radius: 6px;
    }

    .card-stat {
        padding: 11px !important;
    }

        .card-stat h3 {
            font-size: 16px;
        }

    .help-box > summary {
        width: 20px;
        height: 20px;
        font-size: 0.75rem;
    }

    .help-popover {
        top: 25px;
        width: calc(100vw - 46px);
        max-width: calc(100vw - 46px);
        padding: 9px 10px;
        font-size: 10.5px;
    }
}

/* =========================================================
   EXTRA SMALL PHONES - 360px
   ========================================================= */
@media (max-width: 360px) {
    body {
        padding-left: 34px;
    }

    .accounting-side-tools {
        width: 34px;
    }

    .side-tool {
        width: 28px;
        height: 28px;
        font-size: 13px;
    }

    .accounting-brand {
        max-width: 55%;
    }

    .account-user {
        max-width: 45%;
    }

    .accounting-brand .brand-icon,
    .brand-icon {
        width: 20px;
        height: 20px;
        min-width: 20px;
        font-size: 12px;
    }

    .logout-btn {
        padding: 0 4px;
        font-size: 9.5px;
    }

    .tool-button {
        padding-left: 4px;
        padding-right: 4px;
        font-size: 10px;
    }

    .container-fluid {
        padding-left: 4px !important;
        padding-right: 4px !important;
    }

    .card-body {
        padding: 0.45rem !important;
    }

    .form-control,
    .form-select {
        font-size: 11.5px;
    }

    .btn {
        font-size: 10.5px !important;
    }

    .table thead th {
        font-size: 9px;
    }

    .table tbody td {
        font-size: 10px;
    }

    .grid-toolbar,
    .grid-footer {
        padding: 4px;
    }
}

/* =========================================================
   TOUCH DEVICES
   ========================================================= */
@media (hover: none) and (pointer: coarse) {
    .btn,
    .btn-sm,
    .logout-btn,
    .side-tool,
    .tool-button,
    .account-menu-item > button,
    .account-direct-menu,
    .dropdown-item,
    .login-link,
    .help-box > summary {
        -webkit-tap-highlight-color: transparent;
    }

        .btn:active,
        .side-tool:active,
        .tool-button:active {
            transform: none;
        }
}

/* =========================================================
   SAFE MOBILE WIDTH RULES
   ========================================================= */
@media (max-width: 768px) {
    .text-break,
    .text-wrap,
    .validation-summary-errors,
    .field-validation-error,
    .alert,
    .card,
    .card-body,
    .card-header,
    .empty-state,
    .renewal-panel,
    .renew-field,
    .js-renew-breakdown {
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .text-nowrap {
        white-space: nowrap !important;
    }

    [class*="col-"] {
        min-width: 0;
    }

    .card:has(.table) {
        max-width: 100%;
        overflow: hidden;
    }

        .card:has(.table) .card-body {
            max-width: 100%;
            overflow: hidden;
        }
}


/* =========================================================
   MOBILE NAV DROPDOWN  paint ABOVE toolbar & content
   Paste at the END of site.css
   ========================================================= */

/* Raise the whole navbar above the toolbar and page content */
.accounting-navbar {
    position: relative;
    z-index: 2000;
}

.accounting-toolbar {
    position: relative;
    z-index: 1;
}

/* Desktop: keep the hover dropdown, just make sure it's above everything */
.account-dropdown {
    z-index: 3000;
}

/* =========================================================
   MOBILE: escape the scroll container so the dropdown is
   not clipped by the menu strip's overflow.
   position: fixed is the only thing that reliably does this.
   ========================================================= */
@media (max-width: 768px) {

    /* Keep the menu strip scrollable horizontally */
    .accounting-menu {
        display: flex !important;
        order: 3;
        flex: 1 0 100%;
        width: 100%;
        margin-top: 4px;
        border-top: 1px solid #e5e7eb;
        overflow-x: auto;
        overflow-y: hidden;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    /* The dropdown breaks out of the clipping ancestor */
    .account-dropdown {
        position: fixed;
        top: 88px; /* just below brand row + menu row */
        left: 6px;
        right: 6px;
        width: auto;
        min-width: 0;
        max-width: none;
        margin: 0;
        z-index: 3000;
        max-height: calc(100vh - 100px);
        overflow-y: auto;
        border-radius: 8px;
        box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
        white-space: normal;
    }

    /* Open on tap (focus) as well as hover */
    .account-menu-item:focus-within .account-dropdown,
    .account-menu-item:hover .account-dropdown {
        display: block;
    }

    /* When the JS toggle is used, this class opens it */
    .account-dropdown.is-open {
        display: block;
    }
}



/* =========================================================
   MODULE SHELL β two-level sidebar layout (Sales Hub, etc.)
   Scoped entirely under body.module-shell-active so it can
   never affect any other page in the app.
   ========================================================= */

body.module-shell-active .accounting-navbar {
    position: sticky;
    top: 0;
    z-index: 1040;
}

body.module-shell-active #page-content {
    padding: 0 !important;
    max-width: none !important;
}

.module-shell {
    display: block;
    min-height: calc(100vh - var(--module-navbar-height, 46px));
}

.module-sidebar {
    position: fixed;
    top: var(--module-navbar-height, 46px);
    left: 42px;
    bottom: 0;
    z-index: 30;
    width: 220px;
    overflow-y: auto;
    background: var(--app-card);
    border-right: 1px solid var(--app-border);
    padding: 22px 0 40px;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.module-sidebar::-webkit-scrollbar {
    width: 6px;
}

.module-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.module-sidebar::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 6px;
}

.module-sidebar::-webkit-scrollbar-thumb:hover {
    background-color: #94a3b8;
}

.module-sidebar-header {
    padding: 0 24px 20px;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--app-border);
}

.module-sidebar-header .module-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--app-text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.module-sidebar-header .module-subtitle {
    font-size: 11.5px;
    color: var(--app-muted);
    margin-top: 3px;
}

.module-nav-group {
    margin-top: 24px;
}

.module-nav-group:first-child {
    margin-top: 4px;
}

.module-nav-group-title {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--app-muted);
    padding: 0 24px 10px;
}

.module-nav-link {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 24px;
    color: var(--app-text);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    border-left: 3px solid transparent;
    line-height: 1.3;
    transition: background .12s ease, border-color .12s ease, color .12s ease;
    cursor: pointer;
}

.module-nav-link .module-nav-icon {
    font-size: 14px;
    width: 16px;
    text-align: center;
    flex-shrink: 0;
    opacity: 0.85;
}

.module-nav-link:hover {
    background: #f1f5f9;
    color: var(--app-primary);
}

.module-nav-link.active {
    background: #eff6ff;
    border-left-color: var(--app-primary);
    color: var(--app-primary-dark);
    font-weight: 600;
}

.module-content {
    margin-left: 220px;
    min-width: 0;
    height: calc(100vh - var(--module-navbar-height, 46px));
    overflow-y: auto;
    padding: 22px 26px 40px;
    position: relative;
}

.module-content-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--app-muted);
    font-size: 14px;
    padding: 60px 0;
    justify-content: center;
}

/* Small, subtle animated brand mark used as the loading indicator wherever a page loads inside the
   module shell β a bar-chase across the icon's ascending arms rather than a generic spinner. Kept small
   and quick so it reinforces the brand without making fast loads feel slower than they are. */
.eropya-loader {
    display: inline-flex;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.eropya-loader svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: var(--app-primary, #2563eb);
    stroke-width: 2.5;
    stroke-linecap: round;
}

.eropya-loader svg line {
    animation: eropya-loader-chase 1.1s ease-in-out infinite;
}

.eropya-loader svg line:nth-child(1) { animation-delay: 0s; }
.eropya-loader svg line:nth-child(2) { animation-delay: 0.12s; }
.eropya-loader svg line:nth-child(3) { animation-delay: 0.24s; }
.eropya-loader svg line:nth-child(4) { animation-delay: 0.36s; }

@keyframes eropya-loader-chase {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .eropya-loader svg line {
        animation: none;
        opacity: 0.85;
    }
}

.module-content.is-loading {
    opacity: 0.45;
    pointer-events: none;
    transition: opacity .15s ease;
}

.module-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--app-muted);
    text-decoration: none;
    margin-bottom: 4px;
}

.module-back-link:hover {
    color: var(--app-primary);
}

@media (max-width: 900px) {
    .module-shell {
        display: block;
    }

    .module-sidebar {
        position: relative;
        top: 0;
        left: 0;
        bottom: auto;
        width: 100%;
        height: auto;
        max-height: 240px;
        border-right: none;
        border-bottom: 1px solid var(--app-border);
    }

    .module-content {
        margin-left: 0;
        height: auto;
        overflow-y: visible;
        padding: 16px;
    }
}
