/* ═══════════════════════════════════════════════════════════
   NectarFlow — Global Stylesheet v3
   Color palette:
     --gold        #D4A017    (primary accent)
     --gold-light  #F0C040    (highlight)
     --brown       #3B1F0A    (primary dark)
     --brown-mid   #6B3A1F    (medium dark)
     --brown-light #A0622A    (light brown)
     --cream       #FDF8F0    (background light)
     --white       #FFFFFF
═══════════════════════════════════════════════════════════ */

/* ─── Reset & Base ─────────────────────────────────────── */

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

:root {
    --gold:          #D4A017;
    --gold-light:    #F0C040;
    --gold-pale:     #FDF3DC;
    --brown:         #3B1F0A;
    --brown-mid:     #6B3A1F;
    --brown-light:   #A0622A;
    --cream:         #FDF8F0;
    --cream-dark:    #F5ECD9;
    --white:         #FFFFFF;
    --text-dark:     #2C1503;
    --text-mid:      #6B4226;
    --text-light:    #A07850;
    --text-muted:    #BFA080;
    --border:        #E8D5B0;
    --border-light:  #F0E4C8;
    --red:           #C0392B;
    --red-bg:        #FDE8E8;
    --red-border:    #F5C6C6;
    --green:         #27AE60;
    --green-bg:      #E8F8EE;
    --green-border:  #B7EAC8;
    --amber:         #E67E22;
    --amber-bg:      #FEF3E2;
    --blue:          #2980B9;
    --blue-bg:       #EBF5FB;

    --sidebar-w:     260px;
    --topbar-h:      64px;
    --radius:        10px;
    --radius-lg:     16px;
    --shadow:        0 2px 12px rgba(59,31,10,0.08);
    --shadow-md:     0 4px 20px rgba(59,31,10,0.12);
    --shadow-lg:     0 8px 40px rgba(59,31,10,0.16);
    --transition:    0.2s ease;
}

html {
    font-size: 15px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--cream);
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ─── Custom Scrollbars ─────────────────────────────────── */

::-webkit-scrollbar {
    width: 7px;
    height: 7px;
}

::-webkit-scrollbar-track {
    background: var(--cream-dark);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--brown-light);
    border-radius: 10px;
    border: 1.5px solid var(--cream-dark);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--brown-mid);
}

* {
    scrollbar-width: thin;
    scrollbar-color: var(--brown-light) var(--cream-dark);
}

/* ─── Loading Overlay ───────────────────────────────────── */

#loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(59, 31, 10, 0.9);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    transition: opacity 0.3s ease;
}

#loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(240, 192, 64, 0.25);
    border-top-color: var(--gold-light);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-text {
    color: var(--gold-light);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.05em;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ─── Toast Notifications ───────────────────────────────── */

#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 8888;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 360px;
    width: calc(100vw - 48px);
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--radius);
    background: var(--white);
    box-shadow: var(--shadow-md);
    border-left: 4px solid var(--brown);
    animation: slideInToast 0.3s ease;
    font-size: 13px;
    color: var(--text-dark);
}

.toast.toast-success { border-left-color: var(--green); }
.toast.toast-error   { border-left-color: var(--red);   }
.toast.toast-warning { border-left-color: var(--amber); }
.toast.toast-info    { border-left-color: var(--blue);  }

.toast-icon {
    font-size: 16px;
    flex-shrink: 0;
    margin-top: 1px;
}

.toast-success .toast-icon { color: var(--green); }
.toast-error   .toast-icon { color: var(--red);   }
.toast-warning .toast-icon { color: var(--amber); }
.toast-info    .toast-icon { color: var(--blue);  }

.toast-msg  { flex: 1; line-height: 1.5; }
.toast-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 18px;
    padding: 0;
    line-height: 1;
    flex-shrink: 0;
}
.toast-close:hover { color: var(--text-dark); }

.toast-fade {
    opacity: 0;
    transform: translateX(20px);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

@keyframes slideInToast {
    from { opacity: 0; transform: translateX(30px); }
    to   { opacity: 1; transform: translateX(0);    }
}

/* ─── Layout ─────────────────────────────────────────────── */

.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ─── Sidebar ────────────────────────────────────────────── */

.sidebar {
    width: var(--sidebar-w);
    background: var(--brown);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 200;
    transition: transform var(--transition);
    overflow-y: auto;
    overflow-x: hidden;
}

.sb-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
}

.sb-icon {
    width: 38px;
    height: 38px;
    background: rgba(212,160,23,0.2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--gold-light);
    flex-shrink: 0;
}

.sb-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--gold-light);
    letter-spacing: 0.02em;
}

.sb-sub {
    font-size: 11px;
    color: rgba(255,255,255,0.45);
    margin-top: 1px;
}

.sb-nav {
    flex: 1;
    padding: 12px 0;
    overflow-y: auto;
}

.sb-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255,255,255,0.3);
    padding: 14px 20px 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 20px;
    color: rgba(255,255,255,0.65);
    cursor: pointer;
    border-radius: 0;
    transition: background var(--transition), color var(--transition);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    user-select: none;
}

.nav-item:hover {
    background: rgba(255,255,255,0.07);
    color: rgba(255,255,255,0.9);
}

.nav-item.active {
    background: rgba(212,160,23,0.18);
    color: var(--gold-light);
    border-right: 3px solid var(--gold);
}

.nav-item i { font-size: 16px; flex-shrink: 0; }

.sb-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
}

.sb-user {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.sb-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(212,160,23,0.2);
    border: 1.5px solid rgba(212,160,23,0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--gold-light);
    flex-shrink: 0;
    overflow: hidden;
}

.sb-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.sb-uname { font-size: 13px; font-weight: 600; color: var(--white); }
.sb-urole  { font-size: 11px; color: rgba(255,255,255,0.45); }

.btn-logout {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 14px;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: rgba(255,255,255,0.65);
    font-size: 13px;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-logout:hover {
    background: rgba(192,57,43,0.2);
    border-color: rgba(192,57,43,0.3);
    color: #F1948A;
}

/* ─── Main Content ───────────────────────────────────────── */

.main-content {
    margin-left: var(--sidebar-w);
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.page-body {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

/* ─── Topbar ─────────────────────────────────────────────── */

.topbar {
    height: var(--topbar-h);
    background: var(--white);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 4px rgba(59,31,10,0.06);
    flex-shrink: 0;
}

.tb-left h2 {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-dark);
}

.tb-left p {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 1px;
}

.tb-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.hamburger {
    display: none;
    background: none;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 7px 10px;
    cursor: pointer;
    color: var(--text-mid);
    font-size: 16px;
    transition: all var(--transition);
}

.hamburger:hover { background: var(--cream); }

/* ─── Alert Banner (inline) ─────────────────────────────── */

.alert-banner {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 13px;
    margin-bottom: 18px;
    border: 1px solid transparent;
}

.alert-banner.show { display: flex; }
.alert-banner.alert-success { background: var(--green-bg);  border-color: var(--green-border); color: #1E6B3E; }
.alert-banner.alert-error   { background: var(--red-bg);    border-color: var(--red-border);   color: #922B21; }
.alert-banner.alert-warning { background: var(--amber-bg);  border-color: #F5CBA7;             color: #784212; }

/* ─── Cards ──────────────────────────────────────────────── */

.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    overflow: hidden;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
}

.card-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-dark);
}

.card-body {
    padding: 20px;
}

/* ─── Stats Grid ─────────────────────────────────────────── */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow);
    padding: 20px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    transition: transform var(--transition), box-shadow var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.ic-gold   { background: rgba(212,160,23,0.12); color: var(--gold);        }
.ic-brown  { background: rgba(59,31,10,0.10);   color: var(--brown-mid);   }
.ic-green  { background: rgba(39,174,96,0.12);  color: var(--green);       }
.ic-red    { background: rgba(192,57,43,0.10);  color: var(--red);         }
.ic-blue   { background: rgba(41,128,185,0.10); color: var(--blue);        }
.ic-amber  { background: rgba(230,126,34,0.12); color: var(--amber);       }

.stat-info { flex: 1; min-width: 0; }
.stat-label { font-size: 12px; color: var(--text-light); font-weight: 500; }
.stat-value { font-size: 24px; font-weight: 700; color: var(--text-dark); line-height: 1.2; margin: 2px 0; }
.stat-hint  { font-size: 11px; color: var(--text-muted); }

/* ─── Two-column grid ────────────────────────────────────── */

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.grid-equal {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

/* ─── Search Bar (per-table) ─────────────────────────────── */

.table-search {
    position: relative;
    margin-bottom: 14px;
}

.table-search input {
    width: 100%;
    padding: 9px 36px 9px 14px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    color: var(--text-dark);
    background: var(--cream);
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
    font-family: inherit;
}

.table-search input:focus {
    border-color: var(--gold);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(212,160,23,0.12);
}

.table-search i {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 15px;
    pointer-events: none;
}

/* ─── Tables ─────────────────────────────────────────────── */

.table-wrap {
    overflow-x: auto;
    overflow-y: auto;
    max-height: 460px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    min-width: 500px;
}

thead {
    position: sticky;
    top: 0;
    z-index: 2;
}

thead th {
    background: var(--cream-dark);
    color: var(--text-mid);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

tbody tr {
    border-bottom: 1px solid var(--border-light);
    transition: background var(--transition);
}

tbody tr:last-child { border-bottom: none; }

tbody tr:hover { background: var(--cream); }

td {
    padding: 11px 14px;
    color: var(--text-dark);
    vertical-align: middle;
}

tr.empty-row td {
    text-align: center;
    color: var(--text-muted);
    padding: 28px;
    font-size: 13px;
    font-style: italic;
}

tr.hidden-row { display: none; }

/* ─── Badges ─────────────────────────────────────────────── */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.badge-active    { background: var(--green-bg);  color: #1E6B3E; border: 1px solid var(--green-border); }
.badge-inactive  { background: #F3F4F6;          color: #6B7280; border: 1px solid #E5E7EB; }
.badge-suspended { background: var(--red-bg);    color: #922B21; border: 1px solid var(--red-border); }
.badge-pending   { background: var(--amber-bg);  color: #784212; border: 1px solid #F5CBA7; }
.badge-paid      { background: var(--green-bg);  color: #1E6B3E; border: 1px solid var(--green-border); }
.badge-confirmed { background: var(--blue-bg);   color: #1A5276; border: 1px solid #AED6F1; }
.badge-shipped   { background: #EBF5FB;          color: #1A5276; border: 1px solid #AED6F1; }
.badge-delivered { background: var(--green-bg);  color: #1E6B3E; border: 1px solid var(--green-border); }
.badge-cancelled { background: var(--red-bg);    color: #922B21; border: 1px solid var(--red-border); }
.badge-refunded  { background: #F3F4F6;          color: #6B7280; border: 1px solid #E5E7EB; }
.badge-probation { background: var(--amber-bg);  color: #784212; border: 1px solid #F5CBA7; }
.badge-received  { background: var(--green-bg);  color: #1E6B3E; border: 1px solid var(--green-border); }
.badge-low       { background: var(--red-bg);    color: #922B21; border: 1px solid var(--red-border); }
.badge-ok        { background: var(--green-bg);  color: #1E6B3E; border: 1px solid var(--green-border); }

/* ─── Buttons ────────────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: 1.5px solid transparent;
    transition: all var(--transition);
    text-decoration: none;
    font-family: inherit;
    white-space: nowrap;
}

.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-primary {
    background: var(--brown);
    color: var(--gold-light);
    border-color: var(--brown);
}
.btn-primary:hover:not(:disabled) { background: var(--brown-mid); }

.btn-secondary {
    background: var(--cream);
    color: var(--text-mid);
    border-color: var(--border);
}
.btn-secondary:hover:not(:disabled) { background: var(--cream-dark); border-color: var(--brown-light); }

.btn-danger {
    background: var(--red-bg);
    color: var(--red);
    border-color: var(--red-border);
}
.btn-danger:hover:not(:disabled) { background: var(--red); color: var(--white); }

.btn-success {
    background: var(--green-bg);
    color: var(--green);
    border-color: var(--green-border);
}
.btn-success:hover:not(:disabled) { background: var(--green); color: var(--white); }

.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 6px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }

.btn-icon {
    padding: 6px 8px;
    border-radius: 6px;
}

/* ─── Forms ──────────────────────────────────────────────── */

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

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

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

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

label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-mid);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    background: var(--white);
    font-family: inherit;
    font-size: 13px;
    color: var(--text-dark);
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}

input:focus, select:focus, textarea:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(212,160,23,0.12);
}

input::placeholder { color: var(--text-muted); }
textarea { min-height: 80px; resize: vertical; }

.input-wrap { position: relative; }
.input-wrap .toggle-pw {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 16px;
    padding: 2px;
    display: flex;
    align-items: center;
}
.input-wrap .toggle-pw:hover { color: var(--text-mid); }
.input-wrap input { padding-right: 38px; }

.input-hint { font-size: 11px; color: var(--text-muted); }

/* ─── Password Strength ──────────────────────────────────── */

.pw-strength {
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pw-bars {
    display: flex;
    gap: 4px;
    height: 5px;
}

.pw-bar {
    flex: 1;
    border-radius: 3px;
    background: var(--border);
    transition: background 0.3s ease;
}

.pw-bar.active-1 { background: var(--red);   }
.pw-bar.active-2 { background: var(--amber); }
.pw-bar.active-3 { background: var(--amber); }
.pw-bar.active-4 { background: var(--green); }
.pw-bar.active-5 { background: var(--green); }

.pw-text { font-size: 11px; color: var(--text-muted); }

/* ─── Modals ─────────────────────────────────────────────── */

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 500;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
    backdrop-filter: blur(2px);
}

.modal-overlay.show { display: flex; }

.modal {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 580px;
    animation: popIn 0.25s ease;
    overflow: hidden;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid var(--border-light);
}

.modal-title { font-size: 15px; font-weight: 700; color: var(--text-dark); }

.modal-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 20px;
    display: flex;
    align-items: center;
    padding: 2px;
    border-radius: 4px;
}
.modal-close:hover { background: var(--cream); color: var(--text-dark); }

.modal-body   { padding: 22px; }
.modal-footer {
    padding: 16px 22px;
    border-top: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

@keyframes popIn {
    from { opacity: 0; transform: scale(0.94); }
    to   { opacity: 1; transform: scale(1); }
}

/* ─── Profile Page ───────────────────────────────────────── */

.profile-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow);
    overflow: hidden;
    max-width: 640px;
    margin-bottom: 20px;
}

.profile-header {
    background: linear-gradient(135deg, var(--brown) 0%, var(--brown-mid) 100%);
    padding: 32px 24px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid rgba(240,192,64,0.5);
    overflow: hidden;
    flex-shrink: 0;
    background: rgba(212,160,23,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 700;
    color: var(--gold-light);
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-name {
    font-size: 20px;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 3px;
}

.profile-email {
    font-size: 13px;
    color: rgba(255,255,255,0.65);
    margin-bottom: 4px;
}

.profile-role-badge {
    display: inline-block;
    padding: 3px 10px;
    background: rgba(212,160,23,0.2);
    border: 1px solid rgba(212,160,23,0.35);
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    color: var(--gold-light);
    letter-spacing: 0.03em;
}

.profile-section {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
}

.profile-section:last-child { border-bottom: none; }

.profile-section-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 14px;
}

/* ─── Alert Row (low stock) ──────────────────────────────── */

.alert-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 7px;
    margin-bottom: 6px;
    background: var(--red-bg);
    border: 1px solid var(--red-border);
    font-size: 12px;
    color: #922B21;
}

.alert-row i { color: var(--red); }
.alert-row .alert-val { margin-left: auto; font-weight: 600; }

/* ─── Shop / Product Grid ────────────────────────────────── */

.shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    padding: 4px 0;
}

.product-card {
    background: var(--white);
    border: 1.5px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 18px;
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.product-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--gold);
}

.product-card-icon {
    font-size: 28px;
    color: var(--gold);
    margin-bottom: 2px;
}

.product-card-name  { font-size: 13px; font-weight: 700; color: var(--text-dark); }
.product-card-cat   { font-size: 11px; color: var(--text-muted); }
.product-card-price { font-size: 16px; font-weight: 700; color: var(--brown); margin-top: 2px; }
.product-card-stock { font-size: 11px; color: var(--text-light); }

/* ─── Sidebar Overlay (mobile) ───────────────────────────── */

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 199;
}

/* ─── Auth Pages (login, register, etc.) ─────────────────── */

.auth-page {
    min-height: 100vh;
    background: var(--brown);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.auth-page::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 20% 80%, rgba(212,160,23,.16), transparent 55%),
        radial-gradient(ellipse 60% 40% at 80% 20%, rgba(160,98,42,.13), transparent 50%);
    pointer-events: none;
}

.honeycomb-bg {
    position: absolute;
    inset: 0;
    opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='100'%3E%3Cpath d='M28 66L0 50V18L28 2l28 16v32L28 66zM28 98L0 82V50l28-16 28 16v32L28 98z' fill='none' stroke='%23D4A017' stroke-width='1'/%3E%3C/svg%3E");
    pointer-events: none;
}

.auth-card {
    position: relative;
    z-index: 1;
    background: var(--cream);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 440px;
    overflow: hidden;
    animation: slideUp 0.5s ease both;
}

.auth-card-wide { max-width: 820px; display: flex; }

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

.auth-brand-panel {
    flex: 1;
    background: linear-gradient(160deg, var(--gold) 0%, var(--brown-light) 55%, var(--brown-mid) 100%);
    padding: 40px 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.auth-brand-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='100'%3E%3Cpath d='M28 66L0 50V18L28 2l28 16v32L28 66zM28 98L0 82V50l28-16 28 16v32L28 98z' fill='none' stroke='%23ffffff' stroke-width='.5'/%3E%3C/svg%3E");
    opacity: 0.1;
}

.brand-logo-hex {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    border: 2px solid rgba(255,255,255,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    color: var(--white);
    margin-bottom: 16px;
    position: relative;
}

.brand-name {
    font-size: 26px;
    font-weight: 800;
    color: var(--white);
    text-align: center;
    margin-bottom: 4px;
    position: relative;
}

.brand-tagline {
    font-size: 12px;
    color: rgba(255,255,255,0.7);
    text-align: center;
    letter-spacing: 0.05em;
    position: relative;
}

.brand-divider {
    width: 32px;
    height: 2px;
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
    margin: 14px auto;
    position: relative;
}

.brand-desc {
    font-size: 12px;
    color: rgba(255,255,255,0.5);
    text-align: center;
    line-height: 1.6;
    max-width: 180px;
    position: relative;
}

.auth-form-panel { flex: 1; padding: 36px 32px; }
.auth-form-panel-solo { padding: 36px 32px; }

.auth-heading { font-size: 22px; font-weight: 800; color: var(--text-dark); margin-bottom: 4px; }
.auth-subheading { font-size: 13px; color: var(--text-muted); margin-bottom: 24px; }

.auth-footer {
    margin-top: 20px;
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
}

.auth-footer a { color: var(--brown-mid); font-weight: 600; text-decoration: none; }
.auth-footer a:hover { text-decoration: underline; }

/* ─── Status Card (verify / activate) ───────────────────── */

.status-card {
    background: var(--cream);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 40px 36px;
    max-width: 440px;
    width: 100%;
    text-align: center;
    position: relative;
    z-index: 1;
    animation: slideUp 0.5s ease both;
}

.status-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 28px;
}

.status-icon.loading-icon { background: var(--gold-pale);   color: var(--gold); }
.status-icon.success-icon { background: var(--green-bg);    color: var(--green); }
.status-icon.error-icon   { background: var(--red-bg);      color: var(--red); }

.status-title { font-size: 20px; font-weight: 700; color: var(--text-dark); margin-bottom: 8px; }
.status-msg   { font-size: 14px; color: var(--text-mid); line-height: 1.6; margin-bottom: 24px; }

/* ─── Spinner (inline) ───────────────────────────────────── */

.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(240,192,64,0.3);
    border-top-color: var(--gold-light);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

/* ─── Dashboard Background Overlays ─────────────────────── */

.admin-bg-page .main-content {
    background-image: linear-gradient(rgba(253,248,240,0.94), rgba(253,248,240,0.94)),
                      url('../images/backgroundadmin.jpg');
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
}

.customer-bg-page .main-content {
    background-image: linear-gradient(rgba(253,248,240,0.92), rgba(253,248,240,0.92)),
                      url('../images/customer_dashboard.jpg');
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
}

/* ─── Sidebar overlay for mobile ────────────────────────── */

@media (max-width: 900px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay.show {
        display: block;
    }

    .main-content {
        margin-left: 0;
    }

    .hamburger {
        display: flex;
    }

    .grid-2 {
        grid-template-columns: 1fr;
    }

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

    .auth-brand-panel {
        display: none;
    }

    .auth-card-wide {
        max-width: 440px;
    }

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

@media (max-width: 520px) {
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .page-body {
        padding: 16px;
    }

    .topbar {
        padding: 0 16px;
    }

    .stat-value { font-size: 20px; }

    #toast-container {
        bottom: 16px;
        right: 16px;
        left: 16px;
        max-width: none;
        width: auto;
    }
}

/* ─── Pulse animation for loading bee ────────────────────── */
@keyframes pulse {
    0%   { transform: scale(1);    opacity: 1;    }
    50%  { transform: scale(1.08); opacity: 0.85; }
    100% { transform: scale(1);    opacity: 1;    }
}
