/* ==========================================================================
   Cannan Liquor Store — Admin Dashboard
   Theme: Navy & Gold (matches the approved dashboard concept)
   ========================================================================== */

:root {
    --navy: #0b1420;
    --navy-2: #111d2b;
    --gold: #dca51b;
    --gold-light: #f3c44c;
    --text: #182033;
    --muted: #7d8495;
    --line: #e9ebf0;
    --surface: #ffffff;
    --background: #f7f8fb;
    --green: #14a77a;
    --purple: #6844c6;
    --blue: #326bd1;
    --red: #e15353;
    --shadow: 0 10px 30px rgba(20, 30, 50, .055);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background: var(--background);
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

/* ---------- App shell ---------- */
.app { min-height: 100vh; display: flex; }
.sidebar {
    width: 276px; flex: 0 0 276px; min-height: 100vh; color: #fff;
    background: linear-gradient(180deg, #0b1420 0%, #101b29 100%);
    display: flex; flex-direction: column; padding: 28px 15px 18px;
    transition: transform .25s ease; z-index: 20;
    position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 13px; padding: 0 22px 28px; }
.brand-mark { color: var(--gold); font-size: 42px; line-height: 1; filter: drop-shadow(0 4px 8px rgba(220,165,27,.18)); }
.brand-name { font-family: Georgia, serif; font-size: 25px; letter-spacing: 2px; line-height: 1.05; }
.brand-name small { display: block; font-family: inherit; font-size: 14px; letter-spacing: 5px; margin-top: 7px; }
.nav { display: grid; gap: 6px; }
.nav a {
    display: flex; align-items: center; gap: 14px; padding: 13px 15px;
    color: #dce2eb; border-radius: 9px; font-size: 15px;
    transition: background .2s, color .2s, transform .2s;
}
.nav a:hover { background: rgba(255,255,255,.07); color: #fff; transform: translateX(2px); }
.nav a.active { background: linear-gradient(90deg, #e5ad24, #c58b0e); color: #fff; box-shadow: 0 7px 18px rgba(220,165,27,.18); }
.nav-icon { width: 22px; text-align: center; font-size: 18px; }
.nav-arrow { margin-left: auto; opacity: .75; }
.premium {
    margin: 23px 1px 0; border-radius: 15px; padding: 22px 20px; min-height: 150px;
    overflow: hidden; position: relative;
    background: radial-gradient(circle at 100% 100%, rgba(220,165,27,.18), transparent 45%), #202a34;
}
.premium h3 { margin: 0 0 12px; font-size: 14px; }
.premium p { margin: 0; color: #c9d0d9; font-size: 12px; line-height: 1.6; max-width: 165px; }
.bottles { position: absolute; right: -5px; bottom: -15px; font-size: 60px; transform: rotate(-8deg); opacity: .9; }
.profile { margin-top: auto; padding: 22px 10px 0; border-top: 1px solid rgba(255,255,255,.12); display: flex; align-items: center; gap: 12px; }
.avatar { width: 45px; height: 45px; border-radius: 50%; background: linear-gradient(135deg,#d9dde3,#7b8492); display: grid; place-items: center; color: #17202c; font-size: 22px; border: 2px solid rgba(255,255,255,.4); font-weight: 700;}
.profile strong { display: block; font-size: 13px; }
.profile small { color: var(--gold-light); font-size: 11px; font-weight: 700; display: block; margin-top: 5px; }
.profile a.logout { margin-left: auto; color: #dce2eb; font-size: 18px; }
.profile a.logout:hover { color: var(--red); }

.main { min-width: 0; flex: 1; }
.topbar { min-height: 100px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 32px; flex-wrap: wrap; }
.welcome { display: flex; align-items: center; gap: 20px; }
.menu-btn { border: 0; background: transparent; font-size: 28px; color: var(--text); display: none; }
.welcome small { color: #20283a; font-size: 13px; }
.welcome h1 { margin: 4px 0 0; font-size: 20px; }
.role { color: #c68d0f; font-size: 12px; font-weight: 800; margin-top: 6px; letter-spacing: .4px;}
.top-actions { display: flex; align-items: center; gap: 18px; }
.top-avatar { width: 40px; height: 40px; border-radius: 50%; background: #d8dce2; display: grid; place-items: center; font-size: 20px; }
.content { padding: 24px 17px 20px; max-width: 1500px; margin: auto; }

/* ---------- Toolbar / page heads ---------- */
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 15px; margin-bottom: 20px; flex-wrap: wrap; }
.toolbar h2 { margin: 0; font-size: 19px; }
.toolbar p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.date-select, select, .input {
    border: 1px solid #dfe3eb; background: #fff; border-radius: 9px; padding: 11px 14px; color: var(--text);
}

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 9px; padding: 11px 18px; font-weight: 700; font-size: 13px; transition: transform .15s, box-shadow .2s, opacity .2s; }
.btn:active { transform: scale(.97); }
.btn-gold { background: linear-gradient(135deg,#e9b52b,#bc8306); color: #fff; box-shadow: 0 8px 20px rgba(220,165,27,.28); }
.btn-gold:hover { box-shadow: 0 10px 26px rgba(220,165,27,.4); }
.btn-navy { background: var(--navy); color: #fff; }
.btn-navy:hover { background: var(--navy-2); }
.btn-outline { background: #fff; color: var(--text); border: 1px solid #dfe3eb; }
.btn-outline:hover { border-color: var(--gold); color: #96690b; }
.btn-danger { background: linear-gradient(135deg,#f16565,#d63a3a); color: #fff; }
.btn-danger:hover { box-shadow: 0 8px 18px rgba(214,58,58,.3); }
.btn-sm { padding: 7px 12px; font-size: 12px; border-radius: 7px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ---------- Cards / stats ---------- */
.card { background: var(--surface); border: 1px solid #edf0f4; border-radius: 12px; box-shadow: var(--shadow); }
.stats { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 20px; }
.stat { padding: 20px 18px; min-width: 0; }
.stat-top { display: flex; align-items: center; gap: 13px; }
.stat-icon { width: 51px; height: 51px; border-radius: 50%; display: grid; place-items: center; font-size: 24px; color: #fff; flex: 0 0 auto; }
.gold { background: linear-gradient(135deg,#e9b52b,#bc8306); }
.purple { background: linear-gradient(135deg,#7550d9,#4f2da5); }
.green { background: linear-gradient(135deg,#23b58c,#078365); }
.yellow { background: linear-gradient(135deg,#f0bc36,#d69a0c); }
.blue { background: linear-gradient(135deg,#4d8cf0,#2c5fc4); }
.red { background: linear-gradient(135deg,#f16565,#d63a3a); }
.stat-label { color: #303747; font-size: 13px; }
.stat-value { margin-top: 6px; font-size: 21px; font-weight: 800; white-space: nowrap; }
.stat-change { color: var(--green); font-size: 11px; margin-top: 18px; }
.stat-change span { color: var(--muted); }

.grid-two { display: grid; grid-template-columns: 1.3fr 1fr; gap: 20px; margin-top: 20px; }
.panel { padding: 20px; min-width: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap;}
.panel-head h3 { margin: 0; font-size: 15px; }
.panel-head button, .panel-head select, .panel-head a.btn { border: 1px solid #e4e7ee; background: #fff; border-radius: 7px; padding: 8px 10px; font-size: 12px; color: var(--text); }

.chart-wrap { width: 100%; overflow: hidden; }
.chart { width: 100%; height: 250px; display: block; }
.chart text { font-size: 11px; fill: #7d8495; }
.chart .grid-line { stroke: #edf0f4; stroke-width: 1; }
.chart .area { fill: url(#areaGradient); }
.chart .line { fill: none; stroke: #d89d15; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.chart .point { fill: #fff; stroke: #d89d15; stroke-width: 2; }

.product-row { display: grid; grid-template-columns: 24px 1fr auto auto; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid #eef0f4; font-size: 12px; }
.product-row:last-child { border-bottom: 0; }
.product-emoji { font-size: 26px; }
.product-thumb { width: 30px; height: 30px; border-radius: 7px; object-fit: cover; background: #f1f2f5; }
.product-name { min-width: 0; font-weight: 600; }
.product-sold { color: #7d8495; white-space: nowrap; }
.product-amount { font-weight: 800; white-space: nowrap; }

.bottom-grid { display: grid; grid-template-columns: 1fr 1.25fr 1fr; gap: 20px; margin-top: 20px; }
.donut-area { display: flex; align-items: center; gap: 18px; }
.donut { width: 150px; height: 150px; flex: 0 0 auto; border-radius: 50%; display: grid; place-items: center; position: relative; }
.donut:after { content: ''; width: 95px; height: 95px; border-radius: 50%; background: #fff; position: absolute; }
.donut-center { position: relative; z-index: 1; text-align: center; }
.donut-center strong { display: block; font-size: 19px; }
.donut-center small { color: var(--muted); font-size: 11px; }
.legend { display: grid; gap: 16px; font-size: 12px; width: 100%; }
.legend-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.legend-label { display: flex; align-items: center; gap: 8px; }
.dot { width: 9px; height: 9px; border-radius: 50%; display:inline-block;}

.stock-row { display: flex; align-items: center; gap: 11px; padding: 12px 0; border-bottom: 1px solid #eef0f4; font-size: 12px; }
.stock-row:last-child { border-bottom: 0; }
.stock-icon { font-size: 25px; }
.stock-name { flex: 1; min-width: 0; font-weight: 600; }
.stock-qty { color: #f04444; white-space: nowrap; }

footer.site-footer { text-align: center; padding: 25px 0 0; color: #7d8495; font-size: 12px; display: flex; justify-content: space-between; gap: 20px; }
.overlay { display: none; }
.overlay.show { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 10; }
.toast { position: fixed; right: 22px; bottom: 22px; background: #172333; color: #fff; padding: 14px 18px; border-radius: 9px; box-shadow: 0 12px 30px rgba(0,0,0,.2); transform: translateY(30px); opacity: 0; pointer-events: none; transition: .25s; z-index: 50; font-size: 13px; }
.toast.show { transform: translateY(0); opacity: 1; }

/* ---------- Tables (generic, used on products/orders/users) ---------- */
.table-wrap { overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data-table thead th { text-align: left; padding: 12px 10px; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); border-bottom: 1px solid var(--line); }
table.data-table tbody td { padding: 13px 10px; border-bottom: 1px solid #eef0f4; vertical-align: middle; }
table.data-table tbody tr { transition: background .15s ease; }
table.data-table tbody tr:hover { background: #fbfbfd; }
table.data-table tbody tr:last-child td { border-bottom: none; }
.cell-main { display: flex; align-items: center; gap: 10px; }
.cell-main strong { display: block; font-size: 13px; }
.cell-main small { color: var(--muted); font-size: 11px; }
.row-actions { display: flex; gap: 6px; }
.icon-btn { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; background: #fff; border: 1px solid var(--line); color: var(--muted); font-size: 13px; transition: all .15s ease; }
.icon-btn:hover { color: #96690b; border-color: var(--gold); }
.icon-btn.danger:hover { color: var(--red); border-color: #f2b7b7; }

/* ---------- Status badges ---------- */
.status { display: inline-flex; align-items:center; gap:6px; border-radius: 6px; padding: 6px 10px; font-size: 11px; font-weight: 700; white-space: nowrap;}
.status::before { content:""; width:6px; height:6px; border-radius:50%; }
.delivered, .done   { background: #e7f7ef; color: #15966c; } .delivered::before, .done::before { background:#15966c; }
.processing         { background: #f0eaff; color: #6844c6; } .processing::before { background:#6844c6; }
.shipped            { background: #e8f0ff; color: #326bd1; } .shipped::before { background:#326bd1; }
.pending            { background: #fff4d9; color: #c58a0b; } .pending::before { background:#c58a0b; }
.canceled           { background: #fdeaea; color: #d63a3a; } .canceled::before { background:#d63a3a; }
.active-badge       { background: #e7f7ef; color: #15966c; } .active-badge::before { background:#15966c; }
.inactive-badge     { background: #f1f2f5; color: #7d8495; } .inactive-badge::before { background:#7d8495; }
.paid-badge         { background: #e7f7ef; color: #15966c; } .paid-badge::before { background:#15966c; }
.unpaid-badge       { background: #fdeaea; color: #d63a3a; } .unpaid-badge::before { background:#d63a3a; }

select.status-select { padding: 7px 9px; font-size: 12px; border-radius: 7px; border: 1px solid var(--line); background:#fff; }

/* ---------- Flash messages ---------- */
.flash { padding: 13px 16px; border-radius: 9px; margin-bottom: 18px; font-size: 13.5px; display:flex; align-items:center; gap:10px; border: 1px solid transparent; }
.flash-success { background:#e7f7ef; color:#0d7a56; border-color:#c9ecd9; }
.flash-error   { background:#fdeaea; color:#b02a2a; border-color:#f6c7c7; }
.flash-info    { background:#fff4d9; color:#96690b; border-color:#f3e0ad; }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px 20px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 720px) { .form-grid { grid-template-columns: 1fr; } }
.field { margin-bottom: 4px; }
.field label { display:block; font-size: 12.5px; color: #303747; font-weight: 600; margin-bottom: 7px; }
.field input, .field select, .field textarea {
    width: 100%; border: 1px solid #dfe3eb; background: #fbfbfd; border-radius: 9px;
    padding: 11px 13px; font-size: 13.5px; color: var(--text); transition: border-color .2s, box-shadow .2s, background .2s;
}
.field input:focus, .field select:focus, .field textarea:focus { outline:none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(220,165,27,.15); background:#fff; }
.field small.hint { color: var(--muted); font-size: 11.5px; }
.field-error { color: var(--red); font-size: 11.5px; margin-top: 5px; }

.upload-box { border: 1.5px dashed #e0c988; border-radius: 12px; padding: 20px; text-align:center; color: var(--muted); font-size: 12.5px; background: #fffaf0; cursor:pointer; }
.upload-preview { max-width: 130px; border-radius: 10px; margin: 0 auto 10px; display:block; }

/* ---------- Empty state ---------- */
.empty-state { text-align:center; padding: 50px 20px; color: var(--muted); }
.empty-state .ic { font-size: 38px; margin-bottom: 10px; opacity: .55; }

/* ---------- Login / Auth page ---------- */
.auth-wrap { min-height: 100vh; display:flex; align-items:center; justify-content:center; padding: 24px; background: linear-gradient(160deg, #0b1420, #142238 55%, #0b1420); position: relative; overflow: hidden;}
.auth-wrap::before {
    content:""; position:absolute; width:620px; height:620px; border-radius:50%;
    background: radial-gradient(circle, rgba(220,165,27,.18), transparent 65%);
    top: -180px; right: -180px;
}
.auth-wrap::after {
    content:""; position:absolute; width:520px; height:520px; border-radius:50%;
    background: radial-gradient(circle, rgba(104,68,198,.15), transparent 65%);
    bottom: -160px; left: -160px;
}
.auth-card { position:relative; z-index:1; width:100%; max-width:400px; background:#fff; border-radius:18px; padding: 42px 36px; box-shadow: 0 30px 60px rgba(0,0,0,.35); }
.auth-logo { display:flex; flex-direction:column; align-items:center; gap:4px; margin-bottom: 28px; }
.auth-logo .brand-mark { font-size: 46px; }
.auth-logo h1 { font-family: Georgia, serif; letter-spacing: 3px; font-size: 22px; margin: 4px 0 2px; }
.auth-logo p { color: var(--muted); font-size: 11.5px; letter-spacing: 1.6px; text-transform: uppercase; margin:0; }
.auth-foot { text-align:center; margin-top: 20px; color: var(--muted); font-size: 12px; }
.auth-card .btn-block { width: 100%; justify-content: center; }
.shake { animation: shake .45s; }
@keyframes shake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-4px); }
  40%, 60% { transform: translateX(4px); }
}

/* ---------- Modal ---------- */
.modal-backdrop { position: fixed; inset:0; background: rgba(11,20,32,.55); display:none; align-items:center; justify-content:center; z-index:100; }
.modal-backdrop.open { display:flex; }
.modal-box { width:100%; max-width: 420px; background:#fff; border-radius:16px; padding: 26px; box-shadow: 0 30px 60px rgba(0,0,0,.25); }

/* ---------- Fade in ---------- */
@keyframes fadeUp { from { opacity:0; transform: translateY(12px); } to { opacity:1; transform:none; } }
.fade-up { animation: fadeUp .45s ease both; }
.stagger > * { animation: fadeUp .45s ease both; }
.stagger > *:nth-child(1){animation-delay:.02s;} .stagger > *:nth-child(2){animation-delay:.07s;}
.stagger > *:nth-child(3){animation-delay:.12s;} .stagger > *:nth-child(4){animation-delay:.17s;}
.stagger > *:nth-child(5){animation-delay:.22s;} .stagger > *:nth-child(6){animation-delay:.27s;}

/* ---------- Pagination ---------- */
.pagination { display:flex; gap:6px; justify-content:flex-end; margin-top: 16px; flex-wrap:wrap; }
.pagination a, .pagination span { padding: 7px 12px; border-radius: 7px; font-size:12.5px; border:1px solid var(--line); color: var(--text); }
.pagination a:hover { border-color: var(--gold); color:#96690b; }
.pagination .current { background: var(--navy); color:#fff; border-color: var(--navy); }

/* ---------- Responsive ---------- */
@media (max-width: 1250px) {
    .sidebar { width: 245px; flex-basis: 245px; }
    .stats { grid-template-columns: repeat(3, minmax(0,1fr)); }
    .grid-two, .bottom-grid { grid-template-columns: 1fr; }
}
@media (max-width: 800px) {
    .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); width: 276px; height:100vh; }
    .sidebar.open { transform: translateX(0); }
    .menu-btn { display: inline-block; }
    .topbar { padding: 18px 20px; }
    .top-actions .search { display:none; }
    .content { padding: 18px; }
    .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
    .topbar { align-items: flex-start; }
    .toolbar { align-items: flex-start; flex-direction: column; }
    .stats { grid-template-columns: 1fr 1fr; gap: 12px; }
    .stat { padding: 15px; }
    .stat-icon { width: 40px; height: 40px; font-size: 20px; }
    .stat-value { font-size: 18px; }
    footer.site-footer { flex-direction: column; align-items: center; }
}
