/* ============================================================
   BUYER PORTAL — buyer.css
   ============================================================ */

:root {
    --buyer-green-950: #0b2417;
    --buyer-green-900: #102f1f;
    --buyer-green-800: #17442c;
    --buyer-green-700: #1f5f3c;
    --buyer-gold-500:  #d6a447;
    --buyer-mist-100:  #f4f7f2;
    --buyer-mist-50:   #f9fbf8;
    --buyer-ink-900:   #10201a;
    --buyer-ink-700:   #3a4e42;
    --buyer-ink-500:   #6b7a71;
    --buyer-white:     #ffffff;
    --buyer-border:    rgba(16, 47, 31, 0.12);
    --buyer-shadow:    0 20px 48px rgba(11, 36, 23, 0.08);
    --buyer-shadow-sm: 0 2px 14px rgba(11, 36, 23, 0.06);
    --buyer-ease:      220ms ease;
    --buyer-sidebar-w: 272px;
}

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

body {
    margin: 0;
    font-family: "Roboto", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    color: var(--buyer-ink-900);
    background: linear-gradient(160deg, #f9fbf8 0%, #eef5ec 50%, #f7f3ec 100%) fixed;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

img { display: block; max-width: 100%; }

button, input, textarea, select { font: inherit; }

/* ── Focus ──────────────────────────────────────────────── */
:focus-visible {
    outline: 2.5px solid var(--buyer-green-700);
    outline-offset: 2px;
    border-radius: 6px;
}

/* ============================================================
   AUTHENTICATED SHELL
   ============================================================ */

.buyer-shell {
    display: grid;
    grid-template-columns: var(--buyer-sidebar-w) minmax(0, 1fr);
    min-height: 100vh;
}

/* ── Sidebar backdrop (mobile only) ─────────────────────── */
.buyer-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 150;
    background: rgba(11, 36, 23, 0.6);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--buyer-ease);
}

.buyer-sidebar-backdrop.is-visible {
    opacity: 1;
    pointer-events: auto;
}

/* ── Sidebar ─────────────────────────────────────────────── */
.buyer-sidebar {
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: 28px;
    padding: 22px 16px;
    background: linear-gradient(175deg, var(--buyer-green-950) 0%, var(--buyer-green-900) 100%);
    color: rgba(255, 255, 255, 0.85);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.15) transparent;
    transition: transform var(--buyer-ease), box-shadow var(--buyer-ease);
    z-index: 200;
}

/* ── Sidebar top row (brand + close) ─────────────────────── */
.buyer-sidebar__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.buyer-brand {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    text-decoration: none;
    padding: 6px 8px;
    border-radius: 14px;
    transition: background var(--buyer-ease);
    flex: 1;
    min-width: 0;
}

.buyer-brand:hover {
    background: rgba(255, 255, 255, 0.06);
}

.buyer-brand img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 10px;
    background: rgba(255,255,255,0.06);
}

.buyer-brand strong {
    display: block;
    font-size: 14px;
    font-family: "Roboto Slab", Cambria, Georgia, serif;
    color: #fff;
    line-height: 1.3;
    white-space: normal;
}

.buyer-brand small {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.buyer-sidebar-close {
    display: none;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 10px;
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.75);
    cursor: pointer;
    transition: background var(--buyer-ease), color var(--buyer-ease);
}

.buyer-sidebar-close:hover {
    background: rgba(255,255,255,0.15);
    color: #fff;
}

/* ── Sidebar nav ─────────────────────────────────────────── */
.buyer-nav {
    display: grid;
    gap: 3px;
    align-content: start;
}

.buyer-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    font-weight: 500;
    transition: background var(--buyer-ease), color var(--buyer-ease);
    line-height: 1.3;
}

.buyer-nav a svg {
    flex-shrink: 0;
    opacity: 0.75;
    transition: opacity var(--buyer-ease);
}

.buyer-nav a:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.buyer-nav a:hover svg { opacity: 1; }

.buyer-nav a.is-active {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-weight: 700;
}

.buyer-nav a.is-active svg { opacity: 1; }

/* ── Sidebar footer ──────────────────────────────────────── */
.buyer-sidebar__footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 16px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.45);
    line-height: 1.7;
}

.buyer-sidebar__footer p { margin: 0 0 4px; }

.buyer-sidebar__footer a {
    color: #f0d290;
    text-decoration: none;
    font-weight: 600;
    font-size: 12px;
    transition: color var(--buyer-ease);
}

.buyer-sidebar__footer a:hover { color: var(--buyer-gold-500); }

/* ── Main column ─────────────────────────────────────────── */
.buyer-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 100vh;
}

/* ── Topbar ──────────────────────────────────────────────── */
.buyer-topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 24px;
    background: rgba(249, 251, 248, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--buyer-border);
}

.buyer-menu-btn {
    display: none;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    background: var(--buyer-mist-100);
    border: 1px solid var(--buyer-border);
    border-radius: 12px;
    cursor: pointer;
    color: var(--buyer-green-900);
    transition: background var(--buyer-ease), border-color var(--buyer-ease);
}

.buyer-menu-btn:hover {
    background: rgba(31, 95, 60, 0.08);
    border-color: rgba(31, 95, 60, 0.2);
}

.buyer-topbar__title { flex: 1; min-width: 0; }

.buyer-kicker {
    margin: 0 0 3px;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    font-size: 10px;
    color: var(--buyer-green-700);
    font-weight: 700;
}

.buyer-topbar h1 {
    margin: 0;
    font-size: 19px;
    font-family: "Roboto Slab", Cambria, Georgia, serif;
    color: var(--buyer-green-900);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.buyer-user { flex-shrink: 0; text-align: right; }

.buyer-user strong {
    display: block;
    font-size: 14px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.buyer-user span {
    display: block;
    margin: 2px 0 8px;
    color: var(--buyer-ink-500);
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

/* ── Content ─────────────────────────────────────────────── */
.buyer-content {
    flex: 1;
    padding: 24px 24px 48px;
}

/* ============================================================
   LOGIN SHELL
   ============================================================ */

.buyer-login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px 16px;
}

.buyer-login-grid {
    display: grid;
    width: min(1040px, 100%);
    grid-template-columns: minmax(0, 440px) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

/* ── Cards ───────────────────────────────────────────────── */
.buyer-login-card,
.buyer-login-side,
.buyer-card,
.buyer-notice,
.buyer-stat {
    background: rgba(255, 255, 255, 0.97);
    border: 1px solid var(--buyer-border);
    border-radius: 20px;
    box-shadow: var(--buyer-shadow);
}

.buyer-login-card,
.buyer-login-side,
.buyer-card,
.buyer-notice {
    padding: 28px;
}

.buyer-login-card__brand {
    display: grid;
    justify-items: center;
    gap: 12px;
    margin-bottom: 24px;
    text-align: center;
}

.buyer-login-card__brand img {
    width: 76px;
    height: 76px;
    object-fit: contain;
}

.buyer-login-card__brand h1 {
    margin: 0;
    font-family: "Roboto Slab", Cambria, Georgia, serif;
    color: var(--buyer-green-900);
    font-size: 22px;
}

.buyer-login-card__brand p {
    margin: 0;
    color: var(--buyer-ink-500);
    font-size: 13.5px;
    line-height: 1.7;
    max-width: 340px;
}

/* ── Login side panels ───────────────────────────────────── */
.buyer-panel + .buyer-panel { margin-top: 16px; }

.buyer-panel--muted {
    background: var(--buyer-mist-100);
    border-radius: 16px;
    padding: 20px;
}

.buyer-panel h2 {
    margin: 0 0 10px;
    font-family: "Roboto Slab", Cambria, Georgia, serif;
    color: var(--buyer-green-900);
    font-size: 17px;
}

.buyer-panel p, .buyer-panel ul {
    margin: 0;
    color: var(--buyer-ink-700);
    font-size: 14px;
    line-height: 1.75;
}

.buyer-panel ul { padding-left: 20px; }
.buyer-panel ul li + li { margin-top: 7px; }

/* ============================================================
   GRIDS
   ============================================================ */
.buyer-grid { display: grid; gap: 20px; }

.buyer-grid--stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.buyer-grid--two { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.buyer-space-bottom { margin-bottom: 20px; }
.buyer-space-top    { margin-top:    20px; }

/* ============================================================
   STAT CARDS
   ============================================================ */
.buyer-stat {
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: box-shadow var(--buyer-ease), transform var(--buyer-ease);
}

.buyer-stat:hover {
    box-shadow: 0 10px 32px rgba(11, 36, 23, 0.12);
    transform: translateY(-2px);
}

.buyer-stat strong {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--buyer-green-700);
    font-weight: 700;
}

.buyer-stat span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 28px;
    font-weight: 800;
    font-family: "Roboto Slab", Cambria, Georgia, serif;
    color: var(--buyer-ink-900);
    line-height: 1;
}

/* Reset tag styling when it appears inside a stat card */
.buyer-stat .buyer-tag {
    font-size: 12px;
    font-family: "Roboto", "Segoe UI", sans-serif;
    font-weight: 800;
    line-height: normal;
}

/* ============================================================
   CARDS
   ============================================================ */
.buyer-card h2 {
    margin: 0 0 6px;
    font-family: "Roboto Slab", Cambria, Georgia, serif;
    color: var(--buyer-green-900);
    font-size: 17px;
}

.buyer-card h3 {
    font-family: "Roboto Slab", Cambria, Georgia, serif;
    color: var(--buyer-green-900);
    font-size: 14.5px;
    margin: 0 0 12px;
}

.buyer-topbar h1, .buyer-card h2 { /* already handled above */ }

.buyer-muted {
    color: var(--buyer-ink-500);
    line-height: 1.7;
    margin: 0 0 14px;
    font-size: 13.5px;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.buyer-button,
.buyer-link-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-radius: 999px;
    padding: 11px 20px;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    border: 0;
    cursor: pointer;
    white-space: nowrap;
    transition: background var(--buyer-ease), box-shadow var(--buyer-ease),
                transform var(--buyer-ease), border-color var(--buyer-ease);
}

.buyer-button:active,
.buyer-link-button:active { transform: scale(0.97); }

.buyer-button--primary {
    color: var(--buyer-white);
    background: linear-gradient(135deg, var(--buyer-green-700), var(--buyer-green-900));
    box-shadow: 0 4px 18px rgba(31, 95, 60, 0.3);
}

.buyer-button--primary:hover {
    background: linear-gradient(135deg, var(--buyer-green-800), var(--buyer-green-950));
    box-shadow: 0 6px 22px rgba(31, 95, 60, 0.38);
}

.buyer-link-button,
.buyer-button--secondary {
    background: transparent;
    color: var(--buyer-green-900);
    border: 1.5px solid var(--buyer-border);
    font-size: 13px;
}

.buyer-link-button:hover,
.buyer-button--secondary:hover {
    background: var(--buyer-mist-100);
    border-color: rgba(31, 95, 60, 0.2);
}

/* ============================================================
   FORMS
   ============================================================ */
.buyer-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

/* Buttons inside a form grid always span full width */
.buyer-form-grid > .buyer-button { grid-column: 1 / -1; }

.buyer-form-group { display: grid; gap: 7px; }

.buyer-form-group--full { grid-column: 1 / -1; }

.buyer-form-group label {
    font-weight: 600;
    font-size: 13px;
    color: var(--buyer-ink-700);
    line-height: 1.3;
}

.buyer-form-group small {
    color: var(--buyer-ink-500);
    font-size: 12px;
    line-height: 1.5;
}

/* Text/select/textarea inputs */
.buyer-form-group input:not([type="checkbox"]):not([type="file"]),
.buyer-form-group select,
.buyer-form-group textarea {
    width: 100%;
    min-height: 48px;
    padding: 11px 14px;
    border-radius: 12px;
    border: 1.5px solid rgba(16, 47, 31, 0.15);
    background: var(--buyer-white);
    color: var(--buyer-ink-900);
    transition: border-color var(--buyer-ease), box-shadow var(--buyer-ease);
    appearance: auto;
}

.buyer-form-group input:not([type="checkbox"]):not([type="file"]):focus,
.buyer-form-group select:focus,
.buyer-form-group textarea:focus {
    outline: none;
    border-color: var(--buyer-green-700);
    box-shadow: 0 0 0 3px rgba(31, 95, 60, 0.1);
}

.buyer-form-group input:not([type="checkbox"]):not([type="file"])::placeholder,
.buyer-form-group textarea::placeholder {
    color: var(--buyer-ink-500);
    opacity: 0.7;
}

/* File input */
.buyer-form-group input[type="file"] {
    padding: 11px 14px;
    border-radius: 12px;
    border: 1.5px dashed rgba(16, 47, 31, 0.2);
    background: var(--buyer-mist-100);
    cursor: pointer;
    font-size: 13px;
    color: var(--buyer-ink-700);
    transition: border-color var(--buyer-ease), background var(--buyer-ease);
}

.buyer-form-group input[type="file"]:hover {
    border-color: var(--buyer-green-700);
    background: rgba(31, 95, 60, 0.04);
}

/* Textarea */
.buyer-form-group textarea {
    min-height: 108px;
    resize: vertical;
}

/* Checkbox */
.buyer-form-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--buyer-green-700);
    cursor: pointer;
    flex-shrink: 0;
    margin-top: 2px;
}

/* Password wrapper for show/hide toggle */
.buyer-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.buyer-input-wrap input {
    width: 100%;
    min-height: 48px;
    padding: 11px 44px 11px 14px;
    border-radius: 12px;
    border: 1.5px solid rgba(16, 47, 31, 0.15);
    background: var(--buyer-white);
    color: var(--buyer-ink-900);
    transition: border-color var(--buyer-ease), box-shadow var(--buyer-ease);
}

.buyer-input-wrap input:focus {
    outline: none;
    border-color: var(--buyer-green-700);
    box-shadow: 0 0 0 3px rgba(31, 95, 60, 0.1);
}

.buyer-pw-toggle {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--buyer-ink-500);
    padding: 4px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    transition: color var(--buyer-ease);
}

.buyer-pw-toggle:hover { color: var(--buyer-green-700); }

/* ============================================================
   SECTION HEADING & ACTION ROWS
   ============================================================ */
.buyer-section-heading {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}

.buyer-section-heading h2 { margin: 0 0 4px !important; }
.buyer-section-heading .buyer-muted { margin-bottom: 0; }

.buyer-actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

/* ============================================================
   STATUS TAGS / BADGES
   ============================================================ */
.buyer-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(16, 47, 31, 0.08);
    color: var(--buyer-green-900);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    white-space: nowrap;
    vertical-align: middle;
}

.buyer-tag--success {
    background: rgba(31, 95, 60, 0.1);
    color: #14532d;
}

.buyer-tag--warning {
    background: rgba(214, 164, 71, 0.16);
    color: #7a510a;
}

.buyer-tag--danger {
    background: rgba(177, 58, 41, 0.1);
    color: #8a3124;
}

/* ============================================================
   HIGHLIGHT BOXES
   ============================================================ */
.buyer-highlight {
    padding: 15px 18px;
    border-radius: 14px;
    border-left: 4px solid transparent;
    margin-bottom: 16px;
}

.buyer-highlight strong {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
}

.buyer-highlight p {
    margin: 0;
    font-size: 14px;
    line-height: 1.65;
}

.buyer-highlight--success {
    background: rgba(31, 95, 60, 0.07);
    border-left-color: var(--buyer-green-700);
    color: var(--buyer-green-800);
}

.buyer-highlight--warning {
    background: rgba(214, 164, 71, 0.1);
    border-left-color: var(--buyer-gold-500);
    color: #6b4a06;
}

.buyer-highlight--danger {
    background: rgba(177, 58, 41, 0.07);
    border-left-color: #c0392b;
    color: #6e1c10;
}

/* ============================================================
   NOTICES (flash messages)
   ============================================================ */
.buyer-notice {
    border-left: 4px solid transparent;
    border-radius: 16px;
    padding: 18px 22px;
    margin-bottom: 20px;
    box-shadow: none;
}

.buyer-notice strong {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
}

.buyer-notice p {
    margin: 0;
    line-height: 1.65;
    font-size: 14px;
}

.buyer-notice--success {
    background: rgba(240, 253, 244, 0.99);
    border-left-color: #16a34a;
    color: #14532d;
}

.buyer-notice--warning {
    background: rgba(255, 251, 235, 0.99);
    border-left-color: var(--buyer-gold-500);
    color: #6b4a06;
}

.buyer-notice--error {
    background: rgba(255, 241, 242, 0.99);
    border-left-color: #e11d48;
    color: #881337;
}

/* ============================================================
   TABLES
   ============================================================ */
.buyer-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -28px;
    padding: 0 28px;
}

.buyer-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 560px;
}

.buyer-table th {
    padding: 10px 14px;
    border-bottom: 2px solid rgba(16, 47, 31, 0.1);
    text-align: left;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--buyer-ink-500);
    font-weight: 700;
    white-space: nowrap;
}

.buyer-table td {
    padding: 13px 14px;
    border-bottom: 1px solid rgba(16, 47, 31, 0.07);
    text-align: left;
    vertical-align: top;
    color: var(--buyer-ink-700);
    font-size: 14px;
}

.buyer-table tbody tr {
    transition: background var(--buyer-ease);
}

.buyer-table tbody tr:hover {
    background: rgba(31, 95, 60, 0.025);
}

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

.buyer-table--compact th,
.buyer-table--compact td {
    padding: 9px 12px;
    font-size: 13px;
}

.buyer-table--compact { min-width: 0; }

.buyer-table-meta {
    color: var(--buyer-ink-500);
    font-size: 12px;
    display: block;
    margin-top: 2px;
}

.buyer-link-inline {
    color: var(--buyer-green-700);
    font-weight: 700;
    font-size: 13px;
    text-decoration: none;
    white-space: nowrap;
    transition: color var(--buyer-ease);
}

.buyer-link-inline:hover {
    color: var(--buyer-green-900);
    text-decoration: underline;
}

/* ============================================================
   BANK CARD
   ============================================================ */
.buyer-bank-card {
    display: grid;
    gap: 4px;
    padding: 18px 20px;
    border-radius: 14px;
    background: var(--buyer-mist-100);
    border: 1px solid var(--buyer-border);
    margin-top: 14px;
    font-size: 15px;
    font-weight: 700;
}

.buyer-bank-card strong {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--buyer-green-700);
    font-weight: 700;
    margin-bottom: 4px;
}

/* ============================================================
   ORDER DETAIL
   ============================================================ */
.buyer-detail-dl {
    display: grid;
    gap: 10px;
    font-size: 14px;
}

.buyer-detail-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.buyer-detail-row dt {
    min-width: 130px;
    font-weight: 600;
    color: var(--buyer-ink-700);
    flex-shrink: 0;
}

.buyer-detail-row dd {
    margin: 0;
    color: var(--buyer-ink-900);
    flex: 1;
}

.buyer-letter-row {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    font-size: 14px;
    padding: 10px 0;
    border-bottom: 1px solid var(--buyer-border);
}

.buyer-letter-row:last-child { border-bottom: none; }

/* ============================================================
   RESPONSIVE — Tablet (≤ 1000px)
   ============================================================ */
@media (max-width: 1000px) {
    .buyer-login-grid {
        grid-template-columns: minmax(0, 400px) minmax(0, 1fr);
    }
}

/* ============================================================
   RESPONSIVE — Mobile (≤ 860px) — sidebar becomes a drawer
   ============================================================ */
@media (max-width: 860px) {
    .buyer-shell {
        grid-template-columns: 1fr;
    }

    .buyer-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: min(var(--buyer-sidebar-w), 88vw);
        height: 100%;
        height: 100dvh;
        transform: translateX(-110%);
        box-shadow: none;
    }

    .buyer-sidebar.is-open {
        transform: translateX(0);
        box-shadow: 8px 0 48px rgba(11, 36, 23, 0.28);
    }

    .buyer-sidebar-backdrop { display: block; }

    .buyer-sidebar-close { display: flex; }

    .buyer-menu-btn { display: flex; }

    .buyer-topbar {
        padding: 12px 16px;
    }

    .buyer-content {
        padding: 18px 16px 40px;
    }

    .buyer-login-grid {
        grid-template-columns: 1fr;
        max-width: 480px;
        margin: 0 auto;
    }

    .buyer-grid--two {
        grid-template-columns: 1fr;
    }

    .buyer-grid--stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .buyer-section-heading {
        flex-direction: column;
        align-items: flex-start;
    }

    .buyer-user strong,
    .buyer-user span {
        display: none;
    }

    .buyer-user {
        text-align: left;
    }

    .buyer-table-wrap {
        margin: 0 -16px;
        padding: 0 16px;
    }
}

/* ============================================================
   RESPONSIVE — Small (≤ 600px)
   ============================================================ */
@media (max-width: 600px) {
    .buyer-topbar h1 { font-size: 16px; }

    .buyer-login-card,
    .buyer-login-side,
    .buyer-card,
    .buyer-notice {
        padding: 20px;
        border-radius: 16px;
    }

    .buyer-stat span { font-size: 24px; }

    .buyer-button { padding: 11px 18px; font-size: 13.5px; }

    .buyer-form-grid {
        grid-template-columns: 1fr;
    }

    /* Mobile-card table for the compact doc table */
    .buyer-table--compact {
        min-width: 0;
        display: block;
    }

    .buyer-table--compact thead { display: none; }

    .buyer-table--compact tbody { display: block; }

    .buyer-table--compact tr {
        display: block;
        padding: 12px 0;
        border-bottom: 1px solid rgba(16, 47, 31, 0.08);
    }

    .buyer-table--compact tr:last-child { border-bottom: none; }

    .buyer-table--compact td {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 8px;
        padding: 4px 0;
        border-bottom: none;
        font-size: 13px;
    }

    .buyer-table--compact td::before {
        content: attr(data-label);
        font-weight: 700;
        color: var(--buyer-ink-500);
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: 0.07em;
        flex-shrink: 0;
        min-width: 90px;
        padding-top: 1px;
    }

    /* ── Mobile card layout for main orders table ──── */
    .buyer-table--orders {
        min-width: 0;
        display: block;
    }

    .buyer-table--orders thead { display: none; }

    .buyer-table--orders tbody { display: grid; gap: 12px; }

    .buyer-table--orders tr {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 4px 12px;
        padding: 16px;
        border: 1px solid var(--buyer-border);
        border-radius: 14px;
        background: var(--buyer-mist-50);
    }

    .buyer-table--orders td {
        padding: 3px 0;
        border: none;
        font-size: 13px;
    }

    .buyer-table--orders td::before {
        content: attr(data-label);
        display: block;
        font-weight: 700;
        color: var(--buyer-ink-500);
        font-size: 10px;
        text-transform: uppercase;
        letter-spacing: 0.07em;
        margin-bottom: 2px;
    }

    /* Reference spans full width */
    .buyer-table--orders td:first-child {
        grid-column: 1 / -1;
    }

    /* Actions span full width */
    .buyer-table--orders td:last-child {
        grid-column: 1 / -1;
        padding-top: 8px;
        border-top: 1px solid var(--buyer-border);
        margin-top: 4px;
    }

    /* Letter cards stack */
    .buyer-letters-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   AUTHORIZATION LETTER CARDS
   ============================================================ */
.buyer-letters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.buyer-letter-card {
    border: 1px solid var(--buyer-border);
    border-radius: 16px;
    background: var(--buyer-white);
    overflow: hidden;
    transition: box-shadow var(--buyer-ease), transform var(--buyer-ease);
}

.buyer-letter-card:hover {
    box-shadow: 0 8px 28px rgba(11, 36, 23, 0.1);
    transform: translateY(-2px);
}

.buyer-letter-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 14px 18px;
    background: linear-gradient(135deg, rgba(31, 95, 60, 0.06), rgba(214, 164, 71, 0.06));
    border-bottom: 1px solid var(--buyer-border);
}

.buyer-letter-card__ref {
    font-size: 12px;
    font-weight: 700;
    color: var(--buyer-ink-500);
}

.buyer-letter-card__body {
    padding: 16px 18px;
    display: grid;
    gap: 10px;
}

.buyer-letter-card__field {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    font-size: 13px;
}

.buyer-letter-card__label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--buyer-ink-500);
    flex-shrink: 0;
}

.buyer-letter-card__code {
    font-size: 15px;
    color: var(--buyer-green-900);
    font-family: "Roboto Slab", Cambria, Georgia, serif;
    letter-spacing: 0.04em;
}

.buyer-letter-card__dl {
    display: flex;
    justify-content: center;
    margin: 0 18px 16px;
    padding: 10px 18px;
}

/* ============================================================
   COST SUMMARY BOX (order detail)
   ============================================================ */
.buyer-cost-box {
    padding: 16px 18px;
    border-radius: 14px;
    background: rgba(31, 95, 60, 0.05);
    border: 1px solid rgba(31, 95, 60, 0.12);
    margin-bottom: 4px;
}

.buyer-detail-row--total {
    padding-top: 8px;
    border-top: 2px solid rgba(31, 95, 60, 0.15);
    margin-top: 4px;
}

.buyer-detail-row--total dt,
.buyer-detail-row--total dd {
    font-size: 15px;
    color: var(--buyer-green-900);
}

/* ============================================================
   CHECKBOX ROW
   ============================================================ */
.buyer-checkbox-row {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.buyer-checkbox-row label {
    font-weight: 400;
    font-size: 13.5px;
    line-height: 1.6;
    cursor: pointer;
}

/* ============================================================
   BANK CARD polish
   ============================================================ */
.buyer-bank-card__number {
    font-size: 18px;
    font-family: "Roboto Slab", Cambria, Georgia, serif;
    letter-spacing: 0.03em;
}

/* ============================================================
   RESPONSIVE — Tablet (≤ 1000px) — 4-stat → 2-col
   ============================================================ */
@media (max-width: 1000px) {
    .buyer-grid--stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ============================================================
   RESPONSIVE — Mobile (≤ 860px) — stats stacked
   ============================================================ */
@media (max-width: 860px) {
    .buyer-grid--stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ============================================================
   RESPONSIVE — Small (≤ 600px) — letter cards + stats
   ============================================================ */
@media (max-width: 600px) {
    .buyer-grid--stats {
        grid-template-columns: 1fr 1fr;
    }

    .buyer-stat {
        padding: 16px;
    }

    .buyer-letter-card__field {
        flex-direction: column;
        gap: 2px;
    }

    .buyer-letter-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
}

body.buyer-nav-open {
    overflow: hidden;
}

.buyer-sidebar__summary {
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.05);
}

.buyer-sidebar__summary .buyer-tag {
    margin-bottom: 10px;
}

.buyer-sidebar__summary p {
    margin: 0;
    color: rgba(255, 255, 255, 0.72);
    font-size: 13px;
    line-height: 1.6;
}

.buyer-note-muted {
    font-weight: 400;
    color: var(--buyer-ink-500);
}

.buyer-required {
    color: #b42318;
}

.buyer-empty-state {
    padding: 18px;
    border: 1px dashed rgba(16, 47, 31, 0.18);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(244, 247, 242, 0.9), rgba(255, 255, 255, 0.95));
}

.buyer-empty-state strong {
    display: block;
    margin-bottom: 6px;
    color: var(--buyer-green-900);
}

.buyer-empty-state p {
    margin: 0;
    color: var(--buyer-ink-700);
    line-height: 1.65;
}

.buyer-button--compact {
    padding: 8px 16px;
    font-size: 13px;
}

.buyer-space-top-sm {
    margin-top: 14px;
}

.buyer-order-detail-grid {
    margin-top: 10px;
}

.buyer-topbar .buyer-tag {
    justify-self: end;
}

@media (max-width: 860px) {
    .buyer-sidebar__summary {
        margin-top: 4px;
    }

    .buyer-user {
        min-width: 0;
        text-align: left;
    }

    .buyer-user .buyer-link-button {
        width: 100%;
        margin-top: 8px;
    }
}

@media (max-width: 600px) {
    .buyer-topbar {
        align-items: flex-start;
    }

    .buyer-user {
        width: 100%;
    }

    .buyer-user strong,
    .buyer-user span {
        max-width: none;
    }
}

.buyer-dashboard-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.9fr);
    gap: 20px;
    padding: 28px;
    border-radius: 24px;
    border: 1px solid var(--buyer-border);
    background: linear-gradient(140deg, rgba(255, 255, 255, 0.98), rgba(244, 247, 242, 0.96));
    box-shadow: var(--buyer-shadow);
}

.buyer-dashboard-hero__content h2 {
    margin: 0 0 12px;
    font-family: "Roboto Slab", Cambria, Georgia, serif;
    font-size: clamp(1.8rem, 2.6vw, 2.4rem);
    line-height: 1.2;
    color: var(--buyer-green-900);
}

.buyer-dashboard-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 18px;
}

.buyer-dashboard-hero__panel {
    padding: 20px;
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(16, 47, 31, 0.04), rgba(214, 164, 71, 0.08));
    border: 1px solid rgba(16, 47, 31, 0.1);
}

.buyer-dashboard-hero__panel strong {
    display: block;
    margin: 14px 0 8px;
    color: var(--buyer-green-900);
    font-size: 18px;
}

.buyer-dashboard-hero__panel p {
    margin: 0;
    color: var(--buyer-ink-700);
    line-height: 1.65;
}

.buyer-hero-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
}

.buyer-hero-metrics div {
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(16, 47, 31, 0.08);
}

.buyer-hero-metrics dt {
    margin: 0 0 6px;
    color: var(--buyer-ink-500);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.buyer-hero-metrics dd {
    margin: 0;
    color: var(--buyer-green-900);
    font-size: 22px;
    font-weight: 800;
}

@media (max-width: 1000px) {
    .buyer-dashboard-hero {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .buyer-dashboard-hero {
        padding: 22px 18px;
        border-radius: 20px;
    }

    .buyer-dashboard-actions {
        flex-direction: column;
    }

    .buyer-dashboard-actions .buyer-button {
        width: 100%;
    }

    .buyer-hero-metrics {
        grid-template-columns: 1fr;
    }
}

.buyer-grid--three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.buyer-flow-grid {
    align-items: stretch;
}

.buyer-flow-card {
    padding: 22px;
    display: grid;
    gap: 8px;
}

.buyer-flow-card strong {
    color: var(--buyer-green-900);
    font-family: "Roboto Slab", Cambria, Georgia, serif;
    font-size: 17px;
}

.buyer-flow-card p {
    margin: 0;
    color: var(--buyer-ink-700);
    line-height: 1.7;
    font-size: 14px;
}

.buyer-proof-tag {
    margin-left: 4px;
    padding: 2px 6px;
    font-size: 10px;
}

.buyer-zero-margin {
    margin: 0;
}

.buyer-order-panel {
    min-width: 0;
}

.buyer-detail-stack {
    display: grid;
    gap: 12px;
    margin-top: 14px;
}

@media (max-width: 1000px) {
    .buyer-grid--three {
        grid-template-columns: 1fr;
    }
}

.buyer-section-heading--stack-mobile {
    align-items: center;
}

.buyer-notification-hub {
    position: relative;
    overflow: hidden;
}

.buyer-notification-hub::before {
    content: "";
    position: absolute;
    inset: 0 auto auto 0;
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, rgba(214, 164, 71, 0.14), transparent 70%);
    pointer-events: none;
}

.buyer-notification-actions {
    justify-content: flex-end;
}

.buyer-notification-count {
    min-width: 92px;
    justify-content: center;
}

.buyer-notification-permission {
    margin-bottom: 18px;
}

.buyer-notification-list {
    display: grid;
    gap: 14px;
}

.buyer-notification-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    padding: 18px;
    border: 1px solid var(--buyer-border);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.92);
    transition: border-color var(--buyer-ease), box-shadow var(--buyer-ease), transform var(--buyer-ease);
}

.buyer-notification-item.is-unread {
    border-color: rgba(214, 164, 71, 0.35);
    box-shadow: 0 12px 28px rgba(11, 36, 23, 0.08);
}

.buyer-notification-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 30px rgba(11, 36, 23, 0.1);
}

.buyer-notification-item__body {
    min-width: 0;
}

.buyer-notification-item__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.buyer-notification-item__meta strong {
    color: var(--buyer-green-900);
    font-family: "Roboto Slab", Cambria, Georgia, serif;
    font-size: 16px;
}

.buyer-notification-item__meta span {
    color: var(--buyer-ink-500);
    font-size: 12px;
}

.buyer-notification-item__body p {
    margin: 0;
    color: var(--buyer-ink-700);
    line-height: 1.7;
    font-size: 14px;
}

.buyer-notification-item__actions {
    justify-content: flex-end;
}

@media (max-width: 860px) {
    .buyer-section-heading--stack-mobile {
        align-items: stretch;
    }

    .buyer-notification-actions {
        justify-content: flex-start;
    }

    .buyer-notification-item {
        grid-template-columns: 1fr;
    }

    .buyer-notification-item__actions {
        justify-content: flex-start;
    }
}

@media (max-width: 600px) {
    .buyer-notification-actions {
        width: 100%;
    }

    .buyer-notification-actions .buyer-button,
    .buyer-notification-actions .buyer-tag {
        width: 100%;
    }

    .buyer-notification-item {
        padding: 16px;
        border-radius: 16px;
    }

    .buyer-notification-item__meta {
        flex-direction: column;
        align-items: flex-start;
    }
}
/* Final responsive polish */
.buyer-body {
    min-height: 100vh;
}

.buyer-main,
.buyer-content,
.buyer-card,
.buyer-stat,
.buyer-dashboard-hero,
.buyer-dashboard-hero__content,
.buyer-dashboard-hero__panel,
.buyer-notification-item,
.buyer-topbar__title,
.buyer-topbar__right,
.buyer-user,
.buyer-user__actions {
    min-width: 0;
}

.buyer-content [id] {
    scroll-margin-top: 96px;
}

.buyer-topbar {
    justify-content: space-between;
}

.buyer-topbar__right {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.buyer-user {
    display: grid;
    gap: 4px;
    justify-items: end;
    min-width: 0;
}

.buyer-user__status {
    justify-self: end;
}

.buyer-user__name,
.buyer-user__email {
    display: block;
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.buyer-user__actions {
    display: flex;
    align-items: center;
}

.buyer-card,
.buyer-stat,
.buyer-login-card,
.buyer-login-side,
.buyer-letter-card,
.buyer-notification-item {
    overflow: hidden;
}

.buyer-dashboard-actions,
.buyer-notification-actions,
.buyer-actions-row {
    min-width: 0;
}

.buyer-dashboard-actions .buyer-button,
.buyer-notification-actions .buyer-button,
.buyer-actions-row .buyer-button,
.buyer-actions-row .buyer-link-button {
    max-width: 100%;
}

.buyer-bank-card span,
.buyer-detail-row dd,
.buyer-notification-item__body p,
.buyer-letter-card__code {
    overflow-wrap: anywhere;
}

.buyer-letter-card__dl {
    width: calc(100% - 36px);
}

.buyer-order-detail-grid {
    margin-top: 4px;
}

@media (max-width: 860px) {
    .buyer-topbar {
        flex-wrap: wrap;
        align-items: flex-start;
    }

    .buyer-topbar__title {
        flex: 1 1 0;
    }

    .buyer-topbar__right {
        width: 100%;
        justify-content: space-between;
        align-items: flex-start;
    }

    .buyer-user {
        justify-items: start;
    }

    .buyer-user__status,
    .buyer-user__name {
        display: block;
        justify-self: start;
    }

    .buyer-user__email {
        display: none;
    }

    .buyer-user__actions .buyer-link-button {
        width: auto;
        margin-top: 0;
    }

    .buyer-dashboard-hero {
        gap: 16px;
    }

    .buyer-notification-actions {
        width: 100%;
        justify-content: flex-start;
    }
}

@media (max-width: 600px) {
    .buyer-topbar__right {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .buyer-user,
    .buyer-user__actions {
        width: 100%;
    }

    .buyer-user__status {
        justify-self: start;
    }

    .buyer-user__name,
    .buyer-user__email {
        max-width: none;
    }

    .buyer-user__actions .buyer-link-button {
        width: 100%;
    }

    .buyer-dashboard-hero__content h2 {
        font-size: 1.65rem;
    }

    .buyer-notification-actions .buyer-button,
    .buyer-notification-actions .buyer-tag,
    .buyer-dashboard-actions .buyer-button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .buyer-content {
        padding: 16px 14px 32px;
    }

    .buyer-grid--stats {
        grid-template-columns: 1fr;
    }

    .buyer-topbar h1 {
        font-size: 15px;
    }

    .buyer-dashboard-hero {
        padding: 20px 16px;
    }

    .buyer-letter-card__dl {
        width: calc(100% - 28px);
        margin: 0 14px 14px;
    }
}
