/* =====================================================
   SADHANA POS - SCREEN DESIGN
   -----------------------------------------------------
   Everything in this file is inside "@media screen", so
   it NEVER changes printed bills, thermal prints, PDFs
   or the Android print capture. Only the on-screen look.

   To change the main colours for the whole site, edit
   the variables in the first block below.
===================================================== */

@media screen {

    :root {
        --green: #176b3a;
        --green-dark: #0f5130;
        --green-soft: #e8f5ed;
        --green-line: #cfe6d8;
        --blue: #2563eb;
        --blue-soft: #e8efff;
        --amber: #b45309;
        --amber-soft: #fff4e0;
        --red: #c0392b;
        --red-soft: #fdecea;
        --purple: #7a4cc2;
        --purple-soft: #f1ebfb;

        --bg: #f3f5f4;
        --surface: #ffffff;
        --border: #e3e8e5;
        --text: #1d2a23;
        --muted: #66736c;

        --radius: 14px;
        --radius-sm: 10px;
        --shadow: 0 1px 2px rgba(16, 40, 28, 0.05), 0 4px 14px rgba(16, 40, 28, 0.05);
        --shadow-lift: 0 2px 4px rgba(16, 40, 28, 0.06), 0 10px 24px rgba(16, 40, 28, 0.08);

        --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
    }

    body {
        font-family: var(--font);
        background: var(--bg);
        color: var(--text);
        -webkit-font-smoothing: antialiased;
        font-size: 15px;
    }

    /* ---------------- TOP BAR ---------------- */

    .topbar {
        height: 62px;
        padding: 0 22px;
        background: linear-gradient(90deg, var(--green-dark), var(--green));
        box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
        position: sticky;
        top: 0;
        z-index: 1000;
    }

    .brand {
        display: flex;
        align-items: center;
        gap: 12px;
        color: #fff;
        text-decoration: none;
        font-size: 17px;
        font-weight: 800;
        letter-spacing: 0.3px;
        line-height: 1.15;
    }

    .brand .brand-mark {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 38px;
        height: 38px;
        margin: 0;
        border-radius: 11px;
        background: rgba(255, 255, 255, 0.16);
        font-size: inherit;
        flex: 0 0 auto;
    }

    .brand .brand-text {
        display: block;
        margin: 0;
        font-size: 17px;
        font-weight: 800;
    }

    .brand .brand-text span {
        display: block;
        margin-top: 2px;
        font-size: 11.5px;
        font-weight: 500;
        letter-spacing: 0.4px;
        opacity: 0.85;
    }

    .status-pill {
        padding: 6px 12px;
        font-size: 12.5px;
    }

    .status-pill.open::before,
    .status-pill.locked::before {
        content: "";
        display: inline-block;
        width: 7px;
        height: 7px;
        margin-right: 6px;
        border-radius: 50%;
        background: currentColor;
        vertical-align: 1px;
    }

    .status-date {
        font-weight: 600;
        opacity: 0.9;
    }

    /* ---------------- SIDEBAR ---------------- */

    .app-layout {
        min-height: calc(100vh - 62px);
    }

    .sidebar {
        width: 236px;
        flex: 0 0 236px;
        padding: 14px 12px 24px;
        background: var(--surface);
        border-right: 1px solid var(--border);
        position: sticky;
        top: 62px;
        height: calc(100vh - 62px);
        overflow-y: auto;
    }

    .side-group {
        margin: 16px 12px 6px;
        font-size: 11px;
        font-weight: 700;
        letter-spacing: 0.9px;
        text-transform: uppercase;
        color: #98a39d;
    }

    .sidebar a.side-link {
        display: flex;
        align-items: center;
        gap: 11px;
        padding: 9px 12px;
        margin: 1px 0;
        border-radius: var(--radius-sm);
        color: #34423a;
        font-size: 14.5px;
        font-weight: 500;
        text-decoration: none;
        transition: background 0.15s ease, color 0.15s ease;
    }

    .sidebar a.side-link svg {
        flex: 0 0 auto;
        color: #7c8a82;
        transition: color 0.15s ease;
    }

    .sidebar a.side-link:hover {
        background: #f1f5f3;
        color: var(--green);
    }

    .sidebar a.side-link:hover svg {
        color: var(--green);
    }

    .sidebar a.side-link.active {
        background: var(--green-soft);
        color: var(--green);
        font-weight: 700;
        box-shadow: inset 3px 0 0 var(--green);
    }

    .sidebar a.side-link.active svg {
        color: var(--green);
    }

    .sidebar a.side-logout:hover,
    .sidebar a.side-logout:hover svg {
        color: var(--red);
        background: var(--red-soft);
    }

    /* ---------------- MAIN ---------------- */

    .main-content {
        padding: 28px 32px 40px;
        min-width: 0;
    }

    .page-header {
        margin-bottom: 22px;
    }

    .page-header h1 {
        font-size: 28px;
        font-weight: 800;
        letter-spacing: -0.4px;
        color: var(--text);
    }

    .page-header p {
        color: var(--muted);
        font-size: 14.5px;
    }

    /* ---------------- CARDS ---------------- */

    .card {
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        box-shadow: var(--shadow);
    }

    .card h2 {
        font-size: 19px;
        font-weight: 750;
        letter-spacing: -0.2px;
    }

    /* ---------------- FORMS ---------------- */

    .form-group label {
        font-size: 13px;
        font-weight: 650;
        color: #3c4a42;
    }

    input[type="text"],
    input[type="number"],
    input[type="date"],
    input[type="password"],
    input[type="search"],
    input[type="month"],
    select,
    textarea {
        font-family: var(--font);
        font-size: 15px;
        border: 1px solid #d5ddd8;
        border-radius: var(--radius-sm);
        background: #fff;
        color: var(--text);
        transition: border-color 0.15s ease, box-shadow 0.15s ease;
    }

    input[type="text"]:focus,
    input[type="number"]:focus,
    input[type="date"]:focus,
    input[type="password"]:focus,
    input[type="search"]:focus,
    input[type="month"]:focus,
    select:focus,
    textarea:focus {
        outline: none;
        border-color: var(--green);
        box-shadow: 0 0 0 3px rgba(23, 107, 58, 0.14);
    }

    /* ---------------- BUTTONS ---------------- */

    button,
    .btn-primary,
    .btn-reset,
    .btn-clear,
    .btn-generate,
    .btn-print-summary {
        font-family: var(--font);
    }

    .btn-primary {
        background: var(--green);
        border-radius: var(--radius-sm);
        font-weight: 650;
        box-shadow: 0 1px 2px rgba(23, 107, 58, 0.25);
    }

    .btn-primary:hover {
        background: var(--green-dark);
    }

    .btn-generate {
        background: var(--green);
        border-radius: 12px;
        padding: 14px 28px;
        font-weight: 750;
        box-shadow: 0 6px 16px rgba(23, 107, 58, 0.22);
        transition: transform 0.15s ease, background 0.15s ease;
    }

    .btn-generate:hover:not(:disabled) {
        background: var(--green-dark);
        transform: translateY(-1px);
    }

    .btn-clear {
        background: #fff;
        color: #4b5852;
        border: 1px solid #d5ddd8;
        border-radius: var(--radius-sm);
        font-weight: 600;
    }

    .btn-clear:hover {
        background: var(--red-soft);
        color: var(--red);
        border-color: #f3c4bd;
    }

    .btn-reset {
        border-radius: var(--radius-sm);
    }

    /* ---------------- TABLES ---------------- */

    table {
        font-size: 14.5px;
    }

    th {
        background: #f6f8f7;
        color: #56645c;
        font-size: 12px;
        font-weight: 700;
        letter-spacing: 0.5px;
        text-transform: uppercase;
        border-bottom: 1px solid var(--border);
    }

    td {
        border-bottom: 1px solid #edf1ee;
    }

    tbody tr:hover td {
        background: #fafcfb;
    }

    .table-wrapper {
        border-radius: var(--radius-sm);
    }

    /* ---------------- ALERTS ---------------- */

    .alert {
        border-radius: var(--radius-sm);
        font-weight: 600;
    }

    /* ---------------- DASHBOARD ---------------- */

    .dashboard-header-card {
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        box-shadow: var(--shadow);
    }

    .dashboard-date {
        background: var(--green-soft);
        border: 1px solid var(--green-line);
        border-radius: 999px;
        box-shadow: none;
        color: var(--green);
    }

    .dashboard-grid .dashboard-card {
        position: relative;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        box-shadow: var(--shadow);
        padding: 22px 22px 20px;
        transition: transform 0.15s ease, box-shadow 0.15s ease;
    }

    .dashboard-grid .dashboard-card:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-lift);
    }

    .dashboard-card h3 {
        display: flex;
        align-items: center;
        gap: 10px;
        margin: 0 0 14px;
        font-size: 14px;
        font-weight: 650;
        color: var(--muted);
    }

    .stat-icon {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        border-radius: 10px;
        background: var(--green-soft);
        color: var(--green);
        flex: 0 0 auto;
    }

    .stat-icon.blue { background: var(--blue-soft); color: var(--blue); }
    .stat-icon.purple { background: var(--purple-soft); color: var(--purple); }
    .stat-icon.amber { background: var(--amber-soft); color: var(--amber); }

    .dashboard-amount {
        font-size: 27px;
        font-weight: 800;
        letter-spacing: -0.5px;
        color: var(--text);
        font-variant-numeric: tabular-nums;
    }

    .dashboard-card p {
        margin: 8px 0 0;
        color: var(--muted);
        font-size: 13.5px;
    }

    .dashboard-grid .outstanding-dashboard-card {
        background: linear-gradient(135deg, var(--green-dark), var(--green));
        border-color: transparent;
        color: #fff;
    }

    .outstanding-dashboard-card h3,
    .outstanding-dashboard-card p,
    .outstanding-dashboard-card .dashboard-amount {
        color: #fff;
    }

    .outstanding-dashboard-card h3 {
        opacity: 0.92;
    }

    .outstanding-dashboard-card .stat-icon {
        background: rgba(255, 255, 255, 0.18);
        color: #fff;
    }

    .dashboard-small-card,
    .dashboard-action-card {
        border: 1px solid var(--border);
        border-radius: var(--radius);
        box-shadow: var(--shadow);
        transition: transform 0.15s ease, box-shadow 0.15s ease;
    }

    .dashboard-small-card:hover,
    .dashboard-action-card:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-lift);
    }

    .dashboard-small-card strong {
        font-variant-numeric: tabular-nums;
    }

    .dashboard-action-card {
        background: var(--green-soft);
        border-color: var(--green-line);
    }

    .quick-action-grid .quick-action-button {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        background: #f6f8f7;
        border: 1px solid var(--border);
        border-radius: 12px;
        color: #2b3a32;
        font-weight: 650;
        transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    }

    .quick-action-grid .quick-action-button svg {
        color: var(--green);
    }

    .quick-action-grid .quick-action-button:hover {
        background: var(--green-soft);
        border-color: var(--green-line);
        color: var(--green);
    }

    /* ---------------- BILLING ---------------- */

    .retail-total-section strong {
        font-variant-numeric: tabular-nums;
        letter-spacing: -0.5px;
    }

    .bill-qty-input,
    .bill-rate-input {
        border-radius: 8px;
    }

    /* ---------------- LOGIN PAGE ---------------- */

    .login-page,
    body.login-body {
        background:
            radial-gradient(1200px 500px at 50% -10%, rgba(23, 107, 58, 0.16), transparent 60%),
            var(--bg);
    }

    /* ---------------- MOBILE ---------------- */

    @media (max-width: 768px) {

        body {
            font-size: 15px;
        }

        .topbar {
            position: sticky !important;
            height: 60px !important;
            min-height: 60px;
            padding: 0 14px 0 66px !important;
        }

        .brand .brand-mark {
            display: none;
        }

        .brand .brand-text {
            font-size: 15px;
        }

        .brand .brand-text span {
            font-size: 10.5px;
        }

        .topbar-status {
            gap: 6px;
            font-size: 12px;
        }

        .status-date {
            display: none;
        }

        .mobile-menu-button {
            top: 9px !important;
            left: 12px !important;
            width: 42px !important;
            height: 42px !important;
            border-radius: 11px !important;
            background: rgba(255, 255, 255, 0.16) !important;
            font-size: 22px !important;
        }

        .sidebar {
            top: 0 !important;
            height: 100vh !important;
            width: 272px !important;
            padding: 18px 12px !important;
            box-shadow: 8px 0 30px rgba(0, 0, 0, 0.18);
        }

        .sidebar a.side-link {
            display: flex !important;
            padding: 11px 12px !important;
            margin: 1px 0 !important;
        }

        .main-content {
            padding: 20px 14px 32px !important;
        }

        .page-header h1 {
            font-size: 24px;
        }

        .dashboard-amount {
            font-size: 24px;
        }

        .status-pill {
            white-space: nowrap;
            padding: 5px 10px;
        }

        .dashboard-header-card {
            display: flex !important;
            flex-direction: column !important;
            align-items: stretch !important;
            gap: 14px;
            padding: 16px !important;
        }

        .dashboard-date-selector,
        .dashboard-date {
            width: 100% !important;
        }

        .dashboard-date {
            border-radius: 12px;
            padding: 10px 14px !important;
            display: flex;
            flex-wrap: wrap;
            gap: 4px 8px;
        }

        .dashboard-grid .dashboard-card {
            padding: 18px !important;
        }

        .dashboard-card h3 {
            margin-bottom: 10px;
        }
    }
}

/* =====================================================
   DESIGN v2 - "Fresh Teal" premium look
   (dark sidebar, gradient welcome banner, colourful
   stat cards). Screen only - printing unaffected.
===================================================== */

@media screen {

    :root {
        --green: #0f766e;
        --green-dark: #0b4f4a;
        --green-soft: #e3f4f1;
        --green-line: #bfe3dd;
        --accent: #10b981;
        --amber: #d97706;
        --amber-soft: #fff4e0;
        --side-bg: #0c2f2c;
        --side-bg-2: #103a36;
        --bg: #f2f6f5;
        --grad: linear-gradient(135deg, #0f766e 0%, #10b981 100%);
        --grad-deep: linear-gradient(135deg, #0b3b37 0%, #0f766e 100%);
        --radius: 18px;
    }

    body {
        background:
            radial-gradient(900px 380px at 85% -120px, rgba(16, 185, 129, 0.10), transparent 70%),
            var(--bg);
        background-attachment: fixed;
    }

    /* ---------- top bar: clean white ---------- */

    .topbar {
        background: rgba(255, 255, 255, 0.92);
        backdrop-filter: saturate(160%) blur(10px);
        -webkit-backdrop-filter: saturate(160%) blur(10px);
        color: var(--text);
        border-bottom: 1px solid var(--border);
        box-shadow: none;
    }

    .brand {
        color: var(--text);
    }

    .brand .brand-mark {
        background: var(--grad);
        color: #fff;
        box-shadow: 0 6px 14px rgba(15, 118, 110, 0.28);
    }

    .brand .brand-text {
        color: #0b3b37;
    }

    .brand .brand-text span {
        color: var(--muted);
        opacity: 1;
    }

    .status-pill.open {
        background: var(--green-soft);
        color: var(--green);
    }

    .status-date {
        color: var(--muted);
    }

    /* ---------- dark sidebar ---------- */

    .sidebar {
        background: linear-gradient(180deg, var(--side-bg) 0%, var(--side-bg-2) 100%);
        border-right: none;
        padding-top: 18px;
    }

    .side-group {
        color: rgba(255, 255, 255, 0.38);
    }

    .sidebar a.side-link {
        color: rgba(255, 255, 255, 0.78);
        border-radius: 12px;
    }

    .sidebar a.side-link svg {
        color: rgba(255, 255, 255, 0.55);
    }

    .sidebar a.side-link:hover {
        background: rgba(255, 255, 255, 0.07);
        color: #fff;
    }

    .sidebar a.side-link:hover svg {
        color: #6ee7b7;
    }

    .sidebar a.side-link.active {
        background: var(--grad);
        color: #fff;
        box-shadow: 0 8px 18px rgba(16, 185, 129, 0.28);
    }

    .sidebar a.side-link.active svg {
        color: #fff;
    }

    .sidebar a.side-logout:hover,
    .sidebar a.side-logout:hover svg {
        background: rgba(239, 68, 68, 0.14);
        color: #fca5a5;
    }

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

    .sidebar::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.15);
        border-radius: 6px;
    }

    /* ---------- buttons ---------- */

    .btn-primary,
    .btn-generate {
        background: var(--grad);
        border: none;
        box-shadow: 0 6px 16px rgba(15, 118, 110, 0.25);
    }

    .btn-primary:hover,
    .btn-generate:hover:not(:disabled) {
        background: var(--grad-deep);
    }

    /* ---------- cards ---------- */

    .card,
    .dashboard-header-card {
        border-radius: var(--radius);
        border-color: #e4ebe9;
    }

    /* ---------- dashboard welcome banner ---------- */

    .dash-hero {
        position: relative;
        overflow: hidden;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 24px;
        flex-wrap: wrap;
        padding: 30px 32px;
        margin-bottom: 22px;
        border-radius: 22px;
        background: var(--grad);
        color: #fff;
        box-shadow: 0 18px 40px rgba(15, 118, 110, 0.28);
    }

    .dash-hero::before,
    .dash-hero::after {
        content: "";
        position: absolute;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.10);
        pointer-events: none;
    }

    .dash-hero::before {
        width: 340px;
        height: 340px;
        right: -90px;
        top: -170px;
    }

    .dash-hero::after {
        width: 220px;
        height: 220px;
        right: 220px;
        bottom: -150px;
        background: rgba(255, 255, 255, 0.07);
    }

    .dash-hero-text,
    .dash-hero-figure {
        position: relative;
        z-index: 1;
    }

    .dash-hero-eyebrow {
        display: inline-block;
        padding: 5px 12px;
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.18);
        font-size: 13px;
        font-weight: 650;
        letter-spacing: 0.2px;
    }

    .dash-hero h1 {
        margin: 12px 0 4px;
        font-size: 30px;
        font-weight: 850;
        letter-spacing: -0.6px;
        color: #fff;
    }

    .dash-hero p {
        margin: 0;
        font-size: 14.5px;
        opacity: 0.9;
    }

    .dash-hero-actions {
        display: flex;
        gap: 10px;
        margin-top: 18px;
        flex-wrap: wrap;
    }

    .hero-btn {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        padding: 10px 18px;
        border-radius: 12px;
        font-weight: 700;
        font-size: 14.5px;
        text-decoration: none;
        transition: transform 0.15s ease, box-shadow 0.15s ease;
    }

    .hero-btn:hover {
        transform: translateY(-1px);
    }

    .hero-btn-light {
        background: #fff;
        color: var(--green-dark);
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
    }

    .hero-btn-glass {
        background: rgba(255, 255, 255, 0.16);
        color: #fff;
        border: 1px solid rgba(255, 255, 255, 0.35);
    }

    .dash-hero-figure {
        min-width: 260px;
        padding: 20px 24px;
        border-radius: 18px;
        background: rgba(255, 255, 255, 0.14);
        border: 1px solid rgba(255, 255, 255, 0.28);
        backdrop-filter: blur(6px);
        -webkit-backdrop-filter: blur(6px);
    }

    .dash-hero-figure span {
        display: block;
        font-size: 13px;
        font-weight: 650;
        text-transform: uppercase;
        letter-spacing: 0.8px;
        opacity: 0.85;
    }

    .dash-hero-figure strong {
        display: block;
        margin: 6px 0 4px;
        font-size: 36px;
        font-weight: 850;
        letter-spacing: -0.8px;
        font-variant-numeric: tabular-nums;
    }

    .dash-hero-figure small {
        font-size: 13px;
        opacity: 0.88;
    }

    /* ---------- stat cards ---------- */

    .dashboard-grid {
        gap: 18px;
    }

    .dashboard-grid .dashboard-card {
        overflow: hidden;
        border: 1px solid #e4ebe9;
        min-width: 0;
    }

    .dashboard-grid .dashboard-card::after {
        content: "";
        position: absolute;
        left: 0;
        right: 0;
        top: 0;
        height: 4px;
        background: var(--grad);
    }

    .dashboard-grid .dashboard-card:nth-child(2)::after { background: linear-gradient(90deg, #2563eb, #60a5fa); }
    .dashboard-grid .dashboard-card:nth-child(3)::after { background: linear-gradient(90deg, #7c3aed, #c084fc); }

    .stat-icon {
        width: 40px;
        height: 40px;
        border-radius: 12px;
        background: var(--grad);
        color: #fff;
        box-shadow: 0 6px 14px rgba(15, 118, 110, 0.25);
    }

    .stat-icon.blue {
        background: linear-gradient(135deg, #2563eb, #60a5fa);
        color: #fff;
        box-shadow: 0 6px 14px rgba(37, 99, 235, 0.25);
    }

    .stat-icon.purple {
        background: linear-gradient(135deg, #7c3aed, #c084fc);
        color: #fff;
        box-shadow: 0 6px 14px rgba(124, 58, 237, 0.25);
    }

    .dashboard-amount {
        font-size: clamp(18px, 1.75vw, 27px);
        white-space: nowrap;
    }

    /* The welcome banner already shows the selected dates */
    .dashboard-header-card .dashboard-date {
        display: none;
    }

    .dashboard-grid .outstanding-dashboard-card {
        background: linear-gradient(135deg, #0c2f2c 0%, #0f5f58 100%);
    }

    .dashboard-grid .outstanding-dashboard-card::after {
        background: linear-gradient(90deg, #f59e0b, #fbbf24);
    }

    .outstanding-dashboard-card .stat-icon {
        background: linear-gradient(135deg, #f59e0b, #fbbf24);
        color: #3b2604;
        box-shadow: 0 6px 14px rgba(245, 158, 11, 0.3);
    }

    .outstanding-dashboard-card .dashboard-amount {
        color: #fde68a;
    }

    .dashboard-small-card strong,
    .dashboard-action-card strong {
        color: var(--green);
    }

    .dashboard-action-card {
        background: linear-gradient(135deg, #e6f6f2, #f2fbf8);
    }

    .quick-action-grid .quick-action-button {
        background: #fff;
        padding: 16px;
    }

    .quick-action-grid .quick-action-button svg {
        color: var(--green);
    }

    /* ---------- mobile ---------- */

    @media (max-width: 768px) {

        .mobile-menu-button {
            background: var(--grad) !important;
            color: #fff !important;
            box-shadow: 0 6px 14px rgba(15, 118, 110, 0.3);
        }

        .topbar {
            padding-left: 64px !important;
        }

        .dash-hero {
            padding: 22px 20px;
            border-radius: 18px;
        }

        .dash-hero h1 {
            font-size: 23px;
        }

        .dash-hero-figure {
            min-width: 0;
            width: 100%;
        }

        .dash-hero-figure strong {
            font-size: 30px;
        }

        .dashboard-amount {
            font-size: 24px;
        }
    }
}

/* =====================================================
   DESIGN v2 - polish for all other pages
===================================================== */

@media screen {

    /* links styled as buttons: no underline anywhere */
    a.btn-primary,
    a.btn-reset,
    a.btn-edit,
    a.btn-new-bill,
    a.btn-print-summary,
    a.btn-clear,
    a.hero-btn,
    a.quick-action-button {
        text-decoration: none !important;
    }

    /* small table action buttons (Edit / Disable / Save) */
    .btn-edit {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 6px 12px;
        border-radius: 8px;
        background: #eef2f1;
        color: #2b3a32;
        border: 1px solid #dbe3e0;
        font-size: 13px;
        font-weight: 650;
        text-decoration: none;
        cursor: pointer;
    }

    .btn-edit:hover {
        background: var(--green-soft);
        border-color: var(--green-line);
        color: var(--green);
    }

    .btn-delete {
        border-radius: 8px;
    }

    .btn-print-summary {
        border-radius: var(--radius-sm);
        font-weight: 650;
    }

    .btn-new-bill {
        border-radius: var(--radius-sm);
        font-weight: 650;
        background: var(--grad);
    }

    /* big "total" banners (Outstanding page, Company reports) */
    .outstanding-total-card,
    .summary-card.summary-due-card {
        background: linear-gradient(135deg, #0c2f2c 0%, #0f5f58 100%) !important;
        color: #fff !important;
        border: none !important;
        border-radius: var(--radius) !important;
        box-shadow: 0 14px 30px rgba(12, 47, 44, 0.22);
    }

    .outstanding-total-card span,
    .summary-card.summary-due-card span {
        color: rgba(255, 255, 255, 0.82) !important;
    }

    .outstanding-total-card strong,
    .summary-card.summary-due-card strong {
        color: #fde68a !important;
        font-variant-numeric: tabular-nums;
    }

    .summary-card {
        border-radius: var(--radius);
        border: 1px solid #e4ebe9;
        box-shadow: var(--shadow);
    }

    .summary-card strong {
        font-variant-numeric: tabular-nums;
    }

    /* view bill page: Print Bill as a normal button, not a circle */
    .bill-view-actions {
        align-items: flex-start;
        gap: 14px;
    }

    .bill-view-actions > .btn-primary {
        width: auto;
        height: auto;
        padding: 12px 26px;
        border-radius: 12px;
        font-size: 15px;
        white-space: nowrap;
    }

    .pos-bill {
        border-radius: var(--radius);
        border: 1px solid #e4ebe9;
        box-shadow: var(--shadow-lift);
    }

    /* ledger / statement money columns line up */
    td,
    th {
        font-variant-numeric: tabular-nums;
    }

    /* ---------------- LOGIN ---------------- */

    body.login-page {
        min-height: 100vh;
        margin: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 24px;
        background:
            radial-gradient(700px 420px at 15% 10%, rgba(16, 185, 129, 0.35), transparent 60%),
            radial-gradient(700px 420px at 90% 90%, rgba(15, 118, 110, 0.45), transparent 60%),
            linear-gradient(160deg, #0b2f2c 0%, #0f4d48 100%);
        font-family: var(--font);
    }

    body.login-page .login-container {
        width: 100%;
        max-width: 400px;
        min-height: 0;
        padding: 0;
        background: none;
    }

    body.login-page .login-card {
        width: 100%;
        padding: 34px 30px 30px;
        border-radius: 22px;
        background: rgba(255, 255, 255, 0.97);
        box-shadow: 0 30px 60px rgba(0, 0, 0, 0.35);
        border: none;
    }

    body.login-page .login-logo {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 62px;
        height: 62px;
        margin: 0 auto 14px;
        border-radius: 18px;
        background: var(--grad);
        color: #fff;
        box-shadow: 0 10px 22px rgba(15, 118, 110, 0.35);
    }

    body.login-page .login-header h1 {
        margin: 0;
        font-size: 26px;
        font-weight: 850;
        letter-spacing: 1px;
        color: #0b3b37;
    }

    body.login-page .login-header h2 {
        margin: 2px 0 6px;
        font-size: 15px;
        font-weight: 700;
        letter-spacing: 3px;
        color: var(--green);
    }

    body.login-page .login-header p {
        margin: 0 0 22px;
        color: var(--muted);
        font-size: 13.5px;
    }

    body.login-page .login-form-group label {
        font-size: 13px;
        font-weight: 650;
        color: #3c4a42;
    }

    body.login-page .login-form-group input {
        height: 48px;
        border-radius: 12px;
        border: 1px solid #d5ddd8;
        font-size: 15px;
        font-family: var(--font);
    }

    body.login-page .login-form-group input:focus {
        outline: none;
        border-color: var(--green);
        box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
    }

    body.login-page button[type="submit"] {
        height: 50px;
        border-radius: 12px;
        border: none;
        background: var(--grad);
        font-size: 16px;
        font-weight: 750;
        letter-spacing: 0.3px;
        box-shadow: 0 10px 22px rgba(15, 118, 110, 0.3);
        cursor: pointer;
    }

    body.login-page button[type="submit"]:hover {
        background: var(--grad-deep);
    }

    body.login-page .login-footer-note {
        margin-top: 18px;
        text-align: center;
        font-size: 12px;
        color: rgba(255, 255, 255, 0.7);
    }

    /* Company reports filter: let fields wrap instead of overflowing */
    .summary-date-form.company-report-filters {
        flex-wrap: wrap;
    }

    .summary-date-form.company-report-filters .form-group {
        min-width: 170px;
        flex: 1 1 170px;
    }

    .summary-date-form.company-report-filters > button {
        white-space: nowrap;
    }

    @media (max-width: 768px) {
        .bill-view-actions > .btn-primary {
            width: 100%;
        }
    }
}

/* =====================================================
   WHATSAPP SHARE + DUE REMINDERS
===================================================== */

@media screen {

    .btn-whatsapp {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        padding: 10px 16px;
        border-radius: var(--radius-sm);
        background: #1faa59;
        color: #fff !important;
        font-weight: 700;
        font-size: 14px;
        text-decoration: none !important;
        border: none;
        cursor: pointer;
        white-space: nowrap;
        box-shadow: 0 6px 14px rgba(31, 170, 89, 0.25);
        transition: background 0.15s ease, transform 0.15s ease;
    }

    .btn-whatsapp:hover {
        background: #178a48;
        transform: translateY(-1px);
    }

    .ledger-whatsapp {
        margin-top: 10px;
    }

    .outstanding-actions {
        display: flex;
        justify-content: flex-end;
        margin: -8px 0 14px;
    }

    /* ---------- Due Reminders page ---------- */

    .due-filter-form {
        display: flex;
        flex-wrap: wrap;
        gap: 14px;
        align-items: flex-end;
    }

    .due-filter-form .form-group {
        flex: 1 1 180px;
        min-width: 160px;
    }

    .due-summary {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
        margin: 18px 0;
    }

    .due-summary-card {
        padding: 18px 20px;
        border-radius: var(--radius);
        background: var(--surface);
        border: 1px solid #e4ebe9;
        box-shadow: var(--shadow);
    }

    .due-summary-card span {
        display: block;
        color: var(--muted);
        font-size: 13px;
        font-weight: 650;
    }

    .due-summary-card strong {
        font-size: 26px;
        font-weight: 850;
        font-variant-numeric: tabular-nums;
    }

    .due-summary-total {
        background: linear-gradient(135deg, #0c2f2c 0%, #0f5f58 100%);
        border: none;
    }

    .due-summary-total span {
        color: rgba(255, 255, 255, 0.8);
    }

    .due-summary-total strong {
        color: #fde68a;
    }

    .due-list {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .due-item {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto auto;
        align-items: center;
        gap: 18px;
        padding: 16px 20px;
        background: var(--surface);
        border: 1px solid #e4ebe9;
        border-left: 5px solid #10b981;
        border-radius: var(--radius);
        box-shadow: var(--shadow);
    }

    .due-item.due-amber { border-left-color: #f59e0b; }
    .due-item.due-red { border-left-color: #ef4444; }

    .due-shop strong {
        font-size: 16.5px;
    }

    .due-shop span {
        margin-left: 8px;
        color: var(--muted);
        font-size: 13px;
    }

    .due-meta {
        display: flex;
        flex-wrap: wrap;
        gap: 6px 14px;
        margin-top: 6px;
        font-size: 13px;
        color: var(--muted);
    }

    .due-chip {
        padding: 2px 10px;
        border-radius: 999px;
        background: #ecfdf5;
        color: #047857;
        font-weight: 700;
    }

    .due-amber .due-chip { background: #fff7e6; color: #b45309; }
    .due-red .due-chip { background: #fdecec; color: #b91c1c; }

    .due-amount {
        text-align: right;
    }

    .due-amount span {
        display: block;
        font-size: 12px;
        color: var(--muted);
        font-weight: 650;
    }

    .due-amount strong {
        font-size: 21px;
        font-weight: 850;
        font-variant-numeric: tabular-nums;
        white-space: nowrap;
    }

    .due-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        justify-content: flex-end;
        align-items: center;
        max-width: 280px;
    }

    .due-no-number {
        flex-basis: 100%;
        text-align: right;
        font-size: 12px;
        color: var(--amber);
    }

    .due-empty {
        text-align: center;
        padding: 30px;
    }

    .due-empty p {
        color: var(--muted);
        margin: 6px 0 0;
    }

    @media (max-width: 768px) {

        .due-item {
            grid-template-columns: 1fr auto;
            gap: 10px 14px;
            padding: 14px 16px;
        }

        .due-actions {
            grid-column: 1 / -1;
            max-width: none;
            justify-content: stretch;
        }

        .due-actions .btn-whatsapp {
            flex: 1 1 auto;
        }

        .due-no-number {
            text-align: left;
        }

        .outstanding-actions {
            margin-top: 0;
        }

        .outstanding-actions .btn-whatsapp {
            width: 100%;
        }

        .due-summary {
            grid-template-columns: 1fr;
            gap: 10px;
        }

        .due-summary-card {
            display: flex;
            align-items: baseline;
            justify-content: space-between;
            padding: 14px 16px;
        }

        .due-summary-card strong {
            font-size: 22px;
            white-space: nowrap;
        }

        .due-chip {
            white-space: nowrap;
        }
    }
}

/* Never print the share buttons */
@media print {
    .btn-whatsapp,
    .due-actions,
    .outstanding-actions {
        display: none !important;
    }
}

/* =====================================================
   SALES REPORTS
   Series colours validated (colour-blind safe, 3:1 contrast):
   wholesale = teal #0d9488 (slot 1), retail = orange #eb6834 (slot 2)
===================================================== */

@media screen {

    :root {
        --sr-wholesale: #0d9488;
        --sr-retail: #eb6834;
        --sr-grid: #e8edeb;
        --sr-axis: #c9d3cf;
        --sr-ink-2: #5b6a63;
    }

    .sr-filter-form {
        display: flex;
        flex-wrap: wrap;
        gap: 14px;
        align-items: flex-end;
    }

    .sr-filter-form .form-group {
        flex: 1 1 170px;
        min-width: 150px;
    }

    .sr-muted {
        margin: 2px 0 0;
        color: var(--muted);
        font-size: 13.5px;
    }

    .sr-key {
        display: inline-block;
        width: 10px;
        height: 10px;
        border-radius: 3px;
        margin-right: 6px;
        vertical-align: -1px;
    }

    .sr-key-wholesale { background: var(--sr-wholesale); }
    .sr-key-retail { background: var(--sr-retail); }

    /* ---------- KPI tiles ---------- */

    .sr-kpis {
        display: grid;
        grid-template-columns: 1.5fr repeat(4, minmax(0, 1fr));
        gap: 14px;
        margin: 18px 0;
    }

    .sr-kpi {
        min-width: 0;
        padding: 18px 18px 16px;
        background: var(--surface);
        border: 1px solid #e4ebe9;
        border-radius: var(--radius);
        box-shadow: var(--shadow);
    }

    .sr-kpi-label {
        display: block;
        font-size: 13px;
        font-weight: 650;
        color: var(--muted);
    }

    .sr-kpi strong {
        display: block;
        margin: 8px 0 8px;
        font-size: clamp(18px, 1.6vw, 24px);
        font-weight: 850;
        letter-spacing: -0.4px;
        font-variant-numeric: tabular-nums;
        white-space: nowrap;
        color: var(--text);
    }

    .sr-kpi-foot {
        display: flex;
        flex-wrap: wrap;
        gap: 4px 8px;
        align-items: center;
        font-size: 12.5px;
        color: var(--muted);
    }

    .sr-kpi-hero {
        background: var(--grad);
        border: none;
        box-shadow: 0 14px 30px rgba(15, 118, 110, 0.25);
    }

    .sr-kpi-hero .sr-kpi-label,
    .sr-kpi-hero .sr-kpi-foot {
        color: rgba(255, 255, 255, 0.88);
    }

    .sr-kpi-hero strong {
        color: #fff;
        font-size: clamp(22px, 2.2vw, 32px);
    }

    .sr-change {
        display: inline-flex;
        align-items: center;
        padding: 2px 8px;
        border-radius: 999px;
        font-weight: 750;
        font-size: 12px;
        white-space: nowrap;
    }

    .sr-change-up { background: #e7f6ee; color: #146c3b; }
    .sr-change-down { background: #fdecec; color: #a32424; }
    .sr-change-flat { background: #eef1f0; color: #56645c; }

    .sr-kpi-hero .sr-change {
        background: rgba(255, 255, 255, 0.95);
    }

    /* ---------- chart ---------- */

    .sr-chart-head {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 14px;
        flex-wrap: wrap;
        margin-bottom: 10px;
    }

    .sr-chart-head h2 {
        margin: 0;
    }

    .sr-legend {
        display: flex;
        gap: 16px;
        font-size: 13.5px;
        font-weight: 600;
        color: var(--text);
    }

    .sr-chart {
        position: relative;
        width: 100%;
        min-height: 230px;
    }

    .sr-chart svg {
        display: block;
    }

    .sr-grid { stroke: var(--sr-grid); stroke-width: 1; }
    .sr-axis { stroke: var(--sr-axis); stroke-width: 1; }

    .sr-tick {
        fill: var(--sr-ink-2);
        font-size: 11.5px;
        font-family: var(--font);
        font-variant-numeric: tabular-nums;
    }

    .sr-bar-wholesale { fill: var(--sr-wholesale); }
    .sr-bar-retail { fill: var(--sr-retail); }

    .sr-hit {
        fill: transparent;
        cursor: pointer;
    }

    .sr-hover-band {
        fill: rgba(15, 118, 110, 0.07);
    }

    .sr-tooltip {
        position: absolute;
        z-index: 5;
        min-width: 170px;
        padding: 10px 12px;
        border-radius: 10px;
        background: #102a27;
        color: #fff;
        font-size: 13px;
        line-height: 1.6;
        box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
        pointer-events: none;
    }

    .sr-tooltip strong {
        display: block;
        margin-bottom: 2px;
    }

    .sr-tooltip b {
        float: right;
        margin-left: 14px;
        font-variant-numeric: tabular-nums;
    }

    .sr-tip-total {
        margin-top: 4px;
        padding-top: 4px;
        border-top: 1px solid rgba(255, 255, 255, 0.2);
    }

    .sr-tip-sub {
        color: rgba(255, 255, 255, 0.7);
        font-size: 12px;
    }

    .sr-table-toggle {
        margin-top: 12px;
    }

    .sr-table-toggle summary {
        cursor: pointer;
        color: var(--green);
        font-weight: 650;
        font-size: 14px;
    }

    .sr-empty {
        padding: 28px;
        text-align: center;
        color: var(--muted);
    }

    /* ---------- top lists ---------- */

    .sr-two-col {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 18px;
        margin-top: 18px;
    }

    .sr-two-col .card h2 {
        margin-bottom: 0;
    }

    .sr-rank-list {
        list-style: none;
        margin: 14px 0 0;
        padding: 0;
    }

    .sr-rank-list li {
        padding: 9px 0;
        border-bottom: 1px solid #edf1ee;
    }

    .sr-rank-list li:last-child {
        border-bottom: none;
    }

    .sr-rank-row {
        display: flex;
        align-items: baseline;
        gap: 10px;
    }

    .sr-rank-no {
        width: 22px;
        flex: 0 0 22px;
        color: var(--muted);
        font-weight: 700;
        font-size: 13px;
    }

    .sr-rank-name {
        flex: 1 1 auto;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-weight: 650;
        color: var(--text);
        text-decoration: none;
    }

    a.sr-rank-name:hover {
        color: var(--green);
        text-decoration: underline;
    }

    .sr-rank-value {
        font-weight: 750;
        font-variant-numeric: tabular-nums;
        white-space: nowrap;
    }

    .sr-rank-bar {
        height: 6px;
        margin: 6px 0 4px 32px;
        border-radius: 3px;
        background: #eef3f1;
        overflow: hidden;
    }

    .sr-rank-bar span {
        display: block;
        height: 100%;
        border-radius: 3px;
        background: var(--sr-wholesale);
    }

    .sr-rank-sub {
        margin-left: 32px;
        font-size: 12px;
        color: var(--muted);
    }

    @media (max-width: 1100px) {
        .sr-kpis {
            grid-template-columns: repeat(2, minmax(0, 1fr));
        }

        .sr-kpi-hero {
            grid-column: 1 / -1;
        }
    }

    @media (max-width: 768px) {
        .sr-two-col {
            grid-template-columns: 1fr;
        }

        .sr-kpis {
            gap: 10px;
        }

        .sr-kpi {
            padding: 14px;
        }

        .sr-kpi strong {
            font-size: 19px;
        }

        .sr-kpi-hero strong {
            font-size: 26px;
        }
    }
}

/* =====================================================
   PRODUCTS - EDIT POPUP
===================================================== */

@media screen {

    .product-actions {
        white-space: nowrap;
    }

    .product-actions form,
    .product-actions .btn-product-edit {
        margin-right: 4px;
    }

    .btn-product-edit {
        background: var(--green-soft);
        border-color: var(--green-line);
        color: var(--green);
    }

    .product-edit-modal {
        align-items: flex-start;
        justify-content: center;
        overflow-y: auto;
    }

    .product-edit-card {
        width: 100%;
        max-width: 460px;
        margin: 60px auto;
        padding: 22px 24px;
        border-radius: 16px;
        border-top: 5px solid var(--green);
    }

    .product-edit-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 14px;
    }

    .product-edit-header h3 {
        margin: 0;
        color: var(--green-dark);
        font-size: 20px;
    }

    .product-edit-close {
        background: none;
        border: none;
        font-size: 26px;
        line-height: 1;
        color: #6b7280;
        cursor: pointer;
    }

    .product-edit-field {
        display: flex;
        flex-direction: column;
        gap: 5px;
        margin-bottom: 12px;
        min-width: 0;
    }

    .product-edit-field label {
        font-size: 13px;
        font-weight: 650;
        color: #3c4a42;
    }

    .product-edit-field input {
        width: 100%;
        box-sizing: border-box;
        padding: 10px 12px;
    }

    #editProductPrice {
        font-size: 18px;
        font-weight: 700;
    }

    .product-edit-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .product-edit-note {
        margin: 2px 0 14px;
        padding: 9px 12px;
        border-radius: 8px;
        background: var(--green-soft);
        color: #36524a;
        font-size: 13px;
    }

    .product-edit-actions {
        display: flex;
        justify-content: flex-end;
        gap: 10px;
    }

    @media (max-width: 768px) {
        .product-edit-card {
            margin: 16px auto;
            padding: 18px;
        }

        .product-edit-row {
            grid-template-columns: 1fr;
            gap: 0;
        }
    }

    /* ---------- Language switch (EN / Telugu) ---------- */

    .topbar-status {
        display: flex;
        align-items: center;
    }

    .lang-switch {
        display: inline-flex;
        align-items: center;
        padding: 3px;
        border-radius: 999px;
        background: #eef4f3;
        border: 1px solid var(--line, #dfe8e6);
        gap: 2px;
        flex-shrink: 0;
    }

    .lang-switch a {
        padding: 5px 11px;
        border-radius: 999px;
        font-size: 12.5px;
        font-weight: 700;
        line-height: 1.2;
        color: #4b635e;
        text-decoration: none;
        white-space: nowrap;
        transition: background 0.15s ease, color 0.15s ease;
    }

    .lang-switch a:hover {
        color: var(--green);
    }

    .lang-switch a.active {
        background: var(--green);
        color: #fff;
        box-shadow: 0 2px 6px rgba(15, 118, 110, 0.3);
    }

    .login-lang {
        display: flex;
        justify-content: flex-end;
        margin: -14px -10px 6px 0;
    }

    .optional-label {
        font-weight: 500;
        color: var(--muted, #6b7f7a);
        font-size: 0.9em;
    }

    .telugu-sub {
        display: block;
        margin-top: 2px;
        font-size: 12.5px;
        color: var(--muted, #6b7f7a);
    }

    input.telugu-name-input {
        margin-top: 6px;
        font-size: 13px;
    }

    @media (max-width: 768px) {
        .lang-switch a {
            padding: 5px 9px;
            font-size: 12px;
        }
    }

    @media (max-width: 420px) {
        .topbar-status .status-pill {
            display: none;
        }
    }

    /* Telugu letters need a little more line height, and no letter
       spacing (spacing breaks the joined Telugu letters apart) */
    html[lang="te"] body {
        line-height: 1.55;
    }

    html[lang="te"] body *:not(.lang-switch a) {
        letter-spacing: 0 !important;
    }

    html[lang="te"] .side-link span,
    html[lang="te"] button,
    html[lang="te"] .btn-primary {
        line-height: 1.45;
    }

    /* ---------- Products page search ---------- */

    .products-list-header {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        margin-bottom: 14px;
    }

    .products-list-header h2 {
        margin: 0;
    }

    .product-search {
        position: relative;
        display: flex;
        align-items: center;
        flex: 0 1 380px;
        min-width: 220px;
    }

    .product-search svg {
        position: absolute;
        left: 13px;
        color: var(--muted, #6b7f7a);
        pointer-events: none;
    }

    .product-search input {
        width: 100%;
        margin: 0;
        padding: 10px 38px 10px 40px;
        border-radius: 999px;
        font-size: 14px;
    }

    .product-search input::-webkit-search-cancel-button {
        display: none;
    }

    .product-search-clear {
        position: absolute;
        right: 6px;
        width: 28px;
        height: 28px;
        padding: 0;
        border: none;
        border-radius: 50%;
        background: #eef4f3;
        color: #4b635e;
        font-size: 18px;
        line-height: 1;
        cursor: pointer;
    }

    .product-search-clear:hover {
        background: var(--green-soft);
        color: var(--green);
    }

    .product-search-count {
        margin: -4px 0 10px;
        color: var(--muted, #6b7f7a);
        font-size: 13px;
    }

    .product-search-empty td {
        padding: 22px 12px !important;
        text-align: center;
        color: var(--muted, #6b7f7a);
    }

    tr.product-row[hidden],
    .product-search-empty[hidden],
    .product-search-clear[hidden],
    .product-search-count[hidden] {
        display: none !important;
    }

    @media (max-width: 768px) {
        .product-search {
            flex: 1 1 100%;
        }
    }

    /* ---------- Wholesale Shops list (full shop names) ---------- */

    .shops-table input {
        width: 100%;
        min-width: 0;
        margin: 0;
        font-size: 14px;
    }

    .shops-table .shop-cell-name {
        min-width: 220px;
    }

    .shops-table .shop-name-input {
        display: block;
        width: 100%;
        min-height: 42px;
        margin: 0;
        padding: 10px 12px;
        overflow: hidden;
        resize: none;
        font: inherit;
        font-size: 14px;
        font-weight: 600;
        line-height: 1.35;
        border: 1px solid var(--line, #d5dfdc);
        border-radius: 10px;
        background: #fff;
        color: inherit;
        word-break: break-word;
    }

    .shops-table .shop-name-input:focus {
        outline: none;
        border-color: var(--green);
        box-shadow: 0 0 0 3px var(--green-soft);
    }

    .shops-table .telugu-name-input {
        margin-top: 6px;
    }

    .shops-table .shop-cell-owner {
        min-width: 100px;
    }

    .shops-table .shop-cell-phone {
        min-width: 118px;
    }

    .shops-table .shop-cell-address {
        min-width: 130px;
    }

    .shops-table .shop-cell-order {
        width: 76px;
    }

    .shops-table .shop-cell-order input {
        width: 64px;
        text-align: center;
    }

    .shops-table .shop-cell-actions {
        min-width: 180px;
        white-space: normal;
    }

    .shops-table .shop-cell-actions button {
        margin: 2px 0;
    }

    .shop-id-badge {
        color: var(--muted, #6b7f7a);
        font-weight: 600;
        font-size: 13px;
    }

    /* Phones / Android app: each shop becomes a card with full-width
       fields, so long shop names are fully visible. */
    @media (max-width: 768px) {
        .table-wrapper:has(.shops-table) {
            overflow: visible;
            border: none;
            background: none;
        }

        .shops-table,
        .shops-table tbody {
            display: block;
            width: 100%;
            min-width: 0 !important;
        }

        .shops-table thead {
            display: none;
        }

        .shops-table tr.shop-row {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 10px 12px;
            margin: 0 0 14px;
            padding: 14px;
            border: 1px solid var(--line, #dfe8e6);
            border-radius: 14px;
            background: #fff;
            box-shadow: 0 2px 8px rgba(15, 47, 44, 0.06);
        }

        .shops-table tr.shop-row:nth-child(even) {
            background: #fff;
        }

        .shops-table tr.shop-row td {
            display: block;
            min-width: 0 !important;
            width: auto !important;
            padding: 0 !important;
            border: none !important;
            background: none !important;
            text-align: left;
        }

        .shops-table tr.shop-row td::before {
            content: attr(data-label);
            display: block;
            margin-bottom: 4px;
            color: var(--muted, #6b7f7a);
            font-size: 11.5px;
            font-weight: 700;
        }

        .shops-table .shop-cell-id,
        .shops-table .shop-cell-status {
            display: flex !important;
            align-items: center;
        }

        .shops-table .shop-cell-id::before,
        .shops-table .shop-cell-status::before,
        .shops-table .shop-cell-actions::before {
            display: none !important;
        }

        .shops-table .shop-cell-status {
            justify-content: flex-end;
        }

        /* ID and status on the top line of each card */
        .shops-table tr.shop-row td {
            order: 1;
        }

        .shops-table tr.shop-row td.shop-cell-id,
        .shops-table tr.shop-row td.shop-cell-status {
            order: 0;
        }

        .shops-table .shop-cell-name,
        .shops-table .shop-cell-address,
        .shops-table .shop-cell-actions {
            grid-column: 1 / -1;
        }

        .shops-table input {
            height: 44px;
            font-size: 15px;
        }

        .shops-table .shop-name-input {
            font-size: 16px;
            min-height: 44px;
        }

        .shops-table .shop-cell-order input {
            width: 100%;
            text-align: left;
        }

        .shops-table .shop-cell-actions {
            display: flex !important;
            flex-wrap: wrap;
            gap: 8px;
            padding-top: 4px !important;
            white-space: normal;
        }

        .shops-table .shop-cell-actions button {
            flex: 1 1 auto;
            min-height: 42px;
            margin: 0 !important;
        }

        .shops-table .shop-cell-actions .btn-toggle[title] {
            flex: 0 0 48px;
        }

        .customers-list-header {
            align-items: center;
            gap: 10px;
        }
    }

    /* ---------- Wholesale Billing: Repeat Last Bill ---------- */

    .repeat-bill-box {
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 12px;
        margin: 4px 0 20px;
        padding: 14px 16px;
        border: 1px dashed #8fd1c6;
        border-radius: 14px;
        background: linear-gradient(135deg, #f0fbf8, #ffffff);
    }

    .repeat-bill-box[hidden] {
        display: none !important;
    }

    .repeat-bill-text {
        display: flex;
        flex-direction: column;
        gap: 2px;
        min-width: 0;
    }

    .repeat-bill-text strong {
        color: var(--green);
        font-size: 14px;
    }

    .repeat-bill-text span {
        color: #2d4541;
        font-size: 14px;
        font-weight: 600;
    }

    .repeat-bill-text small {
        color: var(--muted, #6b7f7a);
        font-size: 12.5px;
    }

    .repeat-bill-text small[hidden] {
        display: none;
    }

    .btn-repeat-bill {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        padding: 11px 18px;
        border: none;
        border-radius: 999px;
        background: var(--grad, #0f766e);
        color: #fff;
        font-weight: 700;
        font-size: 14px;
        cursor: pointer;
        box-shadow: 0 4px 12px rgba(15, 118, 110, 0.28);
        white-space: nowrap;
    }

    .btn-repeat-bill:hover {
        filter: brightness(1.06);
    }

    @media (max-width: 768px) {
        .btn-repeat-bill {
            width: 100%;
            justify-content: center;
        }
    }

    /* ---------- Shop Rates: change rate for all shops ---------- */

    .bulk-rate-help {
        margin: -4px 0 14px;
        color: var(--muted, #6b7f7a);
        font-size: 13.5px;
    }

    .bulk-rate-form {
        display: grid;
        grid-template-columns: minmax(220px, 2fr) minmax(160px, 1fr) minmax(130px, 1fr) auto;
        gap: 12px;
        align-items: end;
    }

    .bulk-rate-form .form-group {
        margin: 0;
    }

    .bulk-rate-preview {
        margin-top: 18px;
        padding-top: 16px;
        border-top: 1px solid var(--line, #dfe8e6);
    }

    .bulk-rate-preview-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 10px;
    }

    .bulk-select-all {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        font-size: 13.5px;
        font-weight: 600;
        cursor: pointer;
    }

    .bulk-select-all input,
    .bulk-rate-table input[type="checkbox"] {
        width: 18px !important;
        height: 18px;
        margin: 0;
        accent-color: var(--green);
    }

    .bulk-rate-table td:first-child,
    .bulk-rate-table th:first-child {
        width: 40px;
    }

    .bulk-new-rate {
        color: var(--green);
    }

    .bulk-invalid td {
        color: #9aa9a5;
    }

    .bulk-invalid-note {
        color: #c2410c;
        font-size: 13px;
    }

    .bulk-rate-actions {
        display: flex;
        justify-content: flex-end;
        gap: 10px;
        margin-top: 14px;
    }

    @media (max-width: 768px) {
        .bulk-rate-form {
            grid-template-columns: 1fr 1fr;
        }

        .bulk-rate-form .form-group:first-child,
        .bulk-rate-form button {
            grid-column: 1 / -1;
        }

        .bulk-rate-actions {
            flex-direction: column-reverse;
        }

        .bulk-rate-actions .btn-primary,
        .bulk-rate-actions .btn-reset {
            width: 100%;
            text-align: center;
        }
    }

    /* ---------- Backups page ---------- */

    .backup-info-card {
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 16px;
    }

    .backup-info {
        display: flex;
        gap: 14px;
        align-items: flex-start;
        flex: 1 1 420px;
    }

    .backup-info-icon {
        display: flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 48px;
        height: 48px;
        border-radius: 14px;
        background: var(--green-soft);
        color: var(--green);
    }

    .backup-info strong {
        font-size: 16px;
    }

    .backup-info p {
        margin: 4px 0 0;
        color: #4b635e;
        font-size: 13.5px;
    }

    .backup-name {
        font-weight: 600;
        word-break: break-all;
    }

    .backup-chip {
        display: inline-block;
        margin-left: 6px;
        padding: 2px 8px;
        border-radius: 999px;
        background: #fff4e5;
        color: #b45309;
        font-size: 11.5px;
        font-weight: 700;
        vertical-align: 1px;
    }

    .backup-chip-auto {
        background: #eef4f3;
        color: #4b635e;
    }

    .backup-chip-new {
        background: var(--green-soft);
        color: var(--green);
    }

    .backup-note {
        margin: 12px 0 0;
        color: var(--muted, #6b7f7a);
        font-size: 13px;
    }

    /* Small tables that must fit a phone screen without side scrolling */
    @media (max-width: 768px) {
        table.bulk-rate-table,
        table.backup-table {
            min-width: 0 !important;
            width: 100%;
        }

        .bulk-rate-table th,
        .bulk-rate-table td,
        .backup-table th,
        .backup-table td {
            padding: 10px 6px !important;
            font-size: 13.5px;
        }

        .backup-table th:nth-child(3),
        .backup-table td:nth-child(3) {
            display: none;
        }

        .backup-name {
            display: block;
            font-size: 13px;
        }

        .backup-chip {
            margin: 4px 4px 0 0;
        }
    }

    /* ---------- Daily Shop Items ---------- */

    .dsi-date-form {
        display: flex;
        align-items: flex-end;
        flex-wrap: wrap;
        gap: 10px;
    }

    .dsi-date-field {
        margin: 0;
        flex: 0 1 220px;
    }

    .dsi-day-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        border-radius: 12px;
        border: 1px solid var(--line, #dfe8e6);
        background: #fff;
        color: var(--green);
        font-size: 26px;
        font-weight: 700;
        line-height: 1;
        text-decoration: none;
    }

    .dsi-day-btn:hover {
        background: var(--green-soft);
    }

    .dsi-today-btn,
    .dsi-print-btn {
        height: 44px;
        display: inline-flex;
        align-items: center;
    }

    .dsi-print-btn {
        margin-left: auto;
    }

    .dsi-summary {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 12px;
        margin-bottom: 18px;
    }

    .dsi-summary-card {
        padding: 14px 16px;
        border-radius: 14px;
        background: #fff;
        border: 1px solid var(--line, #dfe8e6);
    }

    .dsi-summary-card span {
        display: block;
        color: var(--muted, #6b7f7a);
        font-size: 12.5px;
        font-weight: 600;
    }

    .dsi-summary-card strong {
        display: block;
        margin-top: 4px;
        font-size: 22px;
        white-space: nowrap;
    }

    .dsi-summary-total {
        background: var(--grad, #0f766e);
        border: none;
        color: #fff;
    }

    .dsi-summary-total span {
        color: rgba(255, 255, 255, 0.85);
    }

    .dsi-products summary,
    .dsi-not-billed summary {
        display: flex;
        align-items: baseline;
        gap: 10px;
        cursor: pointer;
        font-weight: 700;
        font-size: 16px;
        list-style: none;
    }

    .dsi-products summary::-webkit-details-marker,
    .dsi-not-billed summary::-webkit-details-marker {
        display: none;
    }

    .dsi-products summary small,
    .dsi-not-billed summary small {
        color: var(--muted, #6b7f7a);
        font-weight: 500;
        font-size: 13px;
    }

    .dsi-products[open] summary {
        margin-bottom: 10px;
    }

    .dsi-table {
        width: 100%;
        min-width: 0 !important;
        border-collapse: collapse;
    }

    .dsi-table th,
    .dsi-table td {
        padding: 8px 10px;
        border-bottom: 1px solid #edf2f1;
        text-align: left;
        font-size: 14px;
    }

    .dsi-table th {
        color: var(--muted, #6b7f7a);
        font-size: 12px;
        font-weight: 700;
        background: #f6faf9;
    }

    .dsi-table .num {
        text-align: right;
        white-space: nowrap;
    }

    .dsi-unit {
        color: var(--muted, #6b7f7a);
        font-size: 12px;
    }

    .dsi-search {
        margin: 0 0 12px;
    }

    .dsi-search input {
        width: 100%;
        max-width: 360px;
        border-radius: 999px;
        padding: 10px 16px;
    }

    .dsi-shops {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
        gap: 14px;
        margin-bottom: 18px;
    }

    .dsi-shop {
        padding: 14px 16px 10px;
        border-radius: 16px;
        background: #fff;
        border: 1px solid var(--line, #dfe8e6);
        box-shadow: 0 2px 10px rgba(15, 47, 44, 0.05);
    }

    .dsi-shop[hidden],
    #dsiNoMatch[hidden] {
        display: none !important;
    }

    .dsi-shop-head {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 10px;
    }

    .dsi-shop-name {
        font-size: 16.5px;
        word-break: break-word;
    }

    .dsi-shop-total {
        flex-shrink: 0;
        padding: 4px 10px;
        border-radius: 999px;
        background: var(--green-soft);
        color: var(--green);
        font-weight: 800;
        white-space: nowrap;
    }

    .dsi-bills {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        margin: 8px 0 6px;
    }

    .dsi-bill-chip {
        padding: 2px 9px;
        border-radius: 999px;
        background: #eef4f3;
        color: #4b635e;
        font-size: 12px;
        font-weight: 600;
        text-decoration: none;
    }

    .dsi-bill-chip:hover {
        background: var(--green-soft);
        color: var(--green);
    }

    .dsi-shop-table th,
    .dsi-shop-table td {
        padding: 7px 6px;
    }

    .dsi-shop-table tbody tr:last-child td {
        border-bottom: none;
    }

    .dsi-empty-note {
        color: var(--muted, #6b7f7a);
        font-size: 13.5px;
    }

    .dsi-not-billed-list {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        margin-top: 10px;
    }

    .dsi-not-billed-list span {
        padding: 4px 10px;
        border-radius: 999px;
        background: #fff4e5;
        color: #9a4b07;
        font-size: 13px;
    }

    .dsi-empty {
        text-align: center;
    }

    .dsi-empty p {
        color: var(--muted, #6b7f7a);
    }

    @media (max-width: 768px) {
        .dsi-summary {
            grid-template-columns: 1fr 1fr;
        }

        .dsi-summary-total {
            grid-column: 1 / -1;
        }

        .dsi-shops {
            grid-template-columns: 1fr;
        }

        .dsi-date-field {
            flex: 1 1 140px;
        }

        .dsi-print-btn {
            margin-left: 0;
            flex: 1 1 100%;
            justify-content: center;
        }

        .dsi-table th,
        .dsi-table td {
            padding: 7px 5px;
            font-size: 13.5px;
        }
    }

    /* Daily Shop Items: Bills - Payments = Balance */

    .dsi-summary-total {
        display: flex;
        flex-direction: column;
        gap: 4px;
    }

    .dsi-money-row {
        display: flex;
        align-items: baseline;
        justify-content: space-between;
        gap: 10px;
    }

    .dsi-money-row span {
        display: inline !important;
        font-size: 13px !important;
    }

    .dsi-money-row strong {
        display: inline !important;
        margin: 0 !important;
        font-size: 17px !important;
    }

    .dsi-money-row.dsi-money-balance {
        margin-top: 4px;
        padding-top: 6px;
        border-top: 1px solid rgba(255, 255, 255, 0.35);
    }

    .dsi-money-row.dsi-money-balance span {
        color: #fff !important;
        font-weight: 800;
    }

    .dsi-money-row.dsi-money-balance strong {
        font-size: 22px !important;
    }

    .dsi-shop-head {
        align-items: center;
    }

    .dsi-shop-name {
        flex: 1 1 auto;
        min-width: 0;
    }

    .dsi-shop-print {
        display: inline-flex;
        align-items: center;
        gap: 5px;
        flex-shrink: 0;
        padding: 6px 10px;
        border: 1px solid var(--line, #dfe8e6);
        border-radius: 999px;
        background: #fff;
        color: #2d4541;
        font-size: 12.5px;
        font-weight: 700;
        cursor: pointer;
    }

    .dsi-shop-print:hover {
        background: var(--green-soft);
        color: var(--green);
        border-color: #9fd8cd;
    }

    .dsi-shop-money {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
        margin-top: 8px;
        padding-top: 8px;
        border-top: 1px dashed var(--line, #dfe8e6);
    }

    .dsi-shop-money div {
        display: flex;
        flex-direction: column;
        min-width: 0;
    }

    .dsi-shop-money span {
        color: var(--muted, #6b7f7a);
        font-size: 11.5px;
        font-weight: 700;
    }

    .dsi-shop-money strong {
        font-size: 14.5px;
        white-space: nowrap;
    }

    .dsi-shop-money .dsi-money-balance {
        text-align: right;
    }

    .dsi-shop-money .dsi-money-balance strong {
        color: var(--green);
        font-size: 16px;
    }

    @media (max-width: 768px) {
        .dsi-shop-print span {
            display: none;
        }

        .dsi-shop-print {
            padding: 7px;
        }
    }

    /* Daily Shop Items: print options popup */

    .dsi-print-modal {
        position: fixed;
        inset: 0;
        z-index: 2000;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 16px;
        background: rgba(12, 47, 44, 0.45);
    }

    .dsi-print-modal[hidden] {
        display: none !important;
    }

    .dsi-print-card {
        width: 100%;
        max-width: 380px;
        padding: 20px;
        border-radius: 18px;
        background: #fff;
        box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
    }

    .dsi-print-card h3 {
        margin: 0 0 4px;
        font-size: 19px;
    }

    .dsi-print-target {
        margin: 0 0 14px;
        color: var(--green);
        font-weight: 700;
        word-break: break-word;
    }

    .dsi-print-option {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 12px 14px;
        border: 1px solid var(--line, #dfe8e6);
        border-radius: 12px;
        background: #f6faf9;
        font-weight: 700;
        cursor: pointer;
    }

    .dsi-print-option input {
        width: 20px !important;
        height: 20px;
        margin: 0;
        accent-color: var(--green);
    }

    .dsi-print-hint {
        margin: 8px 2px 16px;
        color: var(--muted, #6b7f7a);
        font-size: 12.5px;
    }

    .dsi-print-actions {
        display: flex;
        justify-content: flex-end;
        gap: 10px;
    }

    .dsi-print-actions button {
        min-width: 96px;
    }

    .dsi-print-bills {
        display: flex;
        flex-direction: column;
        gap: 6px;
        margin: -6px 0 12px;
    }

    .dsi-print-bills[hidden] {
        display: none !important;
    }

    .dsi-print-bill-choice {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 8px 12px;
        border: 1px solid var(--line, #dfe8e6);
        border-radius: 10px;
        font-weight: 600;
        font-size: 14px;
        cursor: pointer;
    }

    .dsi-print-bill-choice input {
        width: 18px !important;
        height: 18px;
        margin: 0;
        accent-color: var(--green);
    }
}
