/* ============================================================
   HC Farms — Admin dashboard
   ============================================================ */

.admin { display: grid; grid-template-columns: 264px 1fr; min-height: 100vh; }

/* mobile overlay — hidden by default so it never consumes a desktop grid column */
.side-backdrop { display: none; }

/* ---------- SIDEBAR ---------- */
.side {
  background: var(--green-900); color: var(--on-green);
  padding: 22px 16px; display: flex; flex-direction: column; gap: 6px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.side .brand { padding: 8px 10px 18px; }
.side .brand .name { color: var(--on-green); font-size: 21px; font-family: var(--serif); font-weight: 700; line-height: 1; }
.side .brand .name small { display: block; font-family: var(--mono); font-size: 9.5px; letter-spacing: .22em; color: var(--gold); margin-top: 4px; }
.side .brand .mark { width: 34px; height: 34px; flex: 0 0 auto; }
.side .nav-group { font-family: var(--mono); font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase; color: color-mix(in oklab,var(--on-green) 45%, transparent); padding: 16px 12px 8px; }
.side a {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px; border-radius: 11px;
  color: color-mix(in oklab,var(--on-green) 78%, transparent);
  font-weight: 600; font-size: 14.5px; transition: background .2s, color .2s;
}
.side a svg { width: 19px; height: 19px; flex: 0 0 auto; opacity: .85; }
.side a:hover { background: color-mix(in oklab,var(--on-green) 8%, transparent); color: var(--on-green); }
.side a.active { background: var(--green); color: var(--on-green); box-shadow: var(--sh-sm); }
.side a.active svg { opacity: 1; color: var(--gold-bright); }
.side .spacer { flex: 1; }
.side .me { display: flex; align-items: center; gap: 11px; padding: 12px; border-radius: 12px; background: color-mix(in oklab,var(--on-green) 7%, transparent); margin-top: 8px; }
.side .me .av { width: 38px; height: 38px; border-radius: 50%; background: var(--gold); color: #1B1A13; display: grid; place-items: center; font-weight: 800; }
.side .me b { font-size: 14px; display: block; } .side .me span { font-size: 12px; color: color-mix(in oklab,var(--on-green) 55%, transparent); }

/* ---------- MAIN ---------- */
.main { padding: 26px clamp(20px, 3vw, 40px) 60px; background: var(--bg); min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 26px; flex-wrap: wrap; }
.topbar h1 { font-family: var(--serif); font-size: 34px; font-weight: 600; }
.topbar .sub { color: var(--ink-faint); font-size: 14px; font-family: var(--mono); }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.search { display: flex; align-items: center; gap: 9px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 9px 16px; color: var(--ink-faint); font-size: 14px; min-width: 220px; }
.search input { border: none; background: none; outline: none; width: 100%; color: var(--ink); }

/* ---------- STAT CARDS ---------- */
.stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; margin-bottom: 24px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 20px; transition: transform .3s var(--ease), box-shadow .3s var(--ease); position: relative; overflow: hidden; }
.stat:hover { transform: translateY(-4px); box-shadow: var(--sh-lg); }
.stat .ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--gold-soft); color: var(--green); margin-bottom: 14px; }
.stat .lbl { font-size: 12.5px; color: var(--ink-faint); font-weight: 600; letter-spacing: .02em; }
.stat .val { font-family: var(--mono); font-size: 28px; font-weight: 600; line-height: 1.1; margin-top: 3px; }
.stat .delta { font-size: 12px; font-weight: 700; margin-top: 6px; display: inline-flex; align-items: center; gap: 4px; }
.stat .delta.up { color: #2e8b57; } .stat .delta.down { color: #c0392b; }
.stat.accent { background: linear-gradient(160deg, var(--green-600), var(--green-800)); color: var(--on-green); border-color: var(--green-500); }
.stat.accent .lbl { color: color-mix(in oklab,var(--on-green) 70%, transparent); }
.stat.accent .ic { background: color-mix(in oklab,var(--on-green) 14%, transparent); color: var(--gold-bright); }
.stat.gold { background: linear-gradient(160deg, var(--gold), var(--gold-bright)); color: #1B1A13; border: none; }
.stat.gold .lbl { color: #5a4416; } .stat.gold .ic { background: rgba(255,255,255,.3); color: #5a4416; }

@media (max-width: 1200px){ .stats { grid-template-columns: repeat(3,1fr);} }
@media (max-width: 640px){ .stats { grid-template-columns: repeat(2,1fr);} }

/* ---------- PANELS ---------- */
.grid-2 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 18px; margin-bottom: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 18px; margin-bottom: 18px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 22px; }
.panel-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; gap: 12px; }
.panel-h h3 { font-family: var(--serif); font-size: 22px; font-weight: 600; }
.panel-h .hint { font-size: 12px; color: var(--ink-faint); font-family: var(--mono); }
@media (max-width: 980px){ .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* ---------- CHARTS ---------- */
.chart { width: 100%; }
.bars { display: flex; align-items: flex-end; gap: 10px; height: 200px; padding-top: 10px; }
.bars .bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.bars .bar { width: 100%; max-width: 34px; border-radius: 7px 7px 3px 3px; background: linear-gradient(180deg, var(--green-500), var(--green)); transition: height 1s var(--ease); position: relative; }
.bars .bar.g { background: linear-gradient(180deg, var(--gold-bright), var(--gold)); }
.bars .bar:hover::after { content: attr(data-v); position: absolute; top: -26px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); font-family: var(--mono); font-size: 11px; padding: 3px 7px; border-radius: 6px; white-space: nowrap; }
.bars .x { font-size: 11px; color: var(--ink-faint); font-family: var(--mono); }

.legend { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 14px; }
.legend span { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ink-soft); }
.legend i { width: 11px; height: 11px; border-radius: 3px; }

/* donut */
.donut-wrap { display: flex; align-items: center; gap: 24px; }
.donut { width: 150px; height: 150px; flex: 0 0 auto; }

/* line/area chart svg */
.area-chart { width: 100%; height: 220px; }
.area-chart .grid-l { stroke: var(--line); stroke-width: 1; }
.area-chart .axis { font-family: var(--mono); font-size: 10px; fill: var(--ink-faint); }

/* ---------- TABLE ---------- */
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-faint); font-weight: 700; padding: 0 14px 12px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr { transition: background .15s; }
.tbl tbody tr:hover { background: var(--bg-2); }
.tbl .mono { font-family: var(--mono); }
.tbl .num { text-align: right; font-family: var(--mono); }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.pending { background: #fdf0d5; color: #b8860b; }
.badge.confirmed { background: #dceeff; color: #1f6fb2; }
.badge.delivered { background: #d8f0e0; color: #2e8b57; }
.badge.cancelled { background: #f7dada; color: #c0392b; }

/* ---------- FORMS (admin) ---------- */
.aform { display: grid; grid-template-columns: repeat(2,1fr); gap: 18px; }
.aform .field.full { grid-column: 1 / -1; }
.aform label { display: block; font-size: 12.5px; font-weight: 700; margin-bottom: 7px; color: var(--ink-soft); }
.aform input, .aform select, .aform textarea { width: 100%; padding: 12px 14px; border-radius: var(--r-sm); border: 1.5px solid var(--line); background: var(--surface-2); font-weight: 500; }
.aform input:focus, .aform select:focus, .aform textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 4px color-mix(in oklab,var(--green) 14%, transparent); }
@media (max-width: 680px){ .aform { grid-template-columns: 1fr; } }

.seg-pills { display: inline-flex; background: var(--bg-2); border: 1px solid var(--line); border-radius: 999px; padding: 4px; gap: 2px; }
.seg-pills button { padding: 8px 16px; border-radius: 999px; font-size: 13px; font-weight: 700; color: var(--ink-faint); transition: all .2s; }
.seg-pills button.on { background: var(--surface); color: var(--green); box-shadow: var(--sh-sm); }

/* ---------- LOGIN ---------- */
.login-page { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art { background: var(--green-900); color: var(--on-green); position: relative; overflow: hidden; padding: 60px; display: flex; flex-direction: column; justify-content: space-between; }
.login-art .circuit { color: var(--green-500); opacity: .3; }
.login-art .big-egg { position: absolute; right: -80px; bottom: -60px; width: 360px; aspect-ratio: 3/4; border-radius: var(--r-egg); background: radial-gradient(circle at 40% 35%, color-mix(in oklab,var(--gold-bright) 40%,transparent), transparent 60%); }
.login-art h2 { font-family: var(--serif); font-size: 46px; font-weight: 600; line-height: 1.05; position: relative; z-index: 2; max-width: 16ch; }
.login-art .meta { position: relative; z-index: 2; }
.login-card { display: grid; place-items: center; padding: 40px; background: var(--bg); }
.login-box { width: min(380px, 100%); }
.login-box h1 { font-family: var(--serif); font-size: 32px; font-weight: 600; margin-bottom: 6px; }
.login-box .lead { color: var(--ink-faint); margin-bottom: 28px; font-size: 15px; }
.login-box .field { margin-bottom: 16px; }
.login-box label { display: block; font-size: 12.5px; font-weight: 700; margin-bottom: 7px; color: var(--ink-soft); }
.login-box input { width: 100%; padding: 13px 15px; border-radius: var(--r-sm); border: 1.5px solid var(--line); background: var(--surface); }
.login-box input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 4px color-mix(in oklab,var(--green) 14%,transparent); }
.login-row { display: flex; align-items: center; justify-content: space-between; font-size: 13px; margin: 6px 0 22px; color: var(--ink-soft); }
.login-demo { margin-top: 18px; padding: 12px 14px; border-radius: var(--r-sm); background: var(--gold-soft); color: var(--brown); font-size: 12.5px; font-family: var(--mono); }
@media (max-width: 820px){ .login-page { grid-template-columns: 1fr; } .login-art { display: none; } }

/* ---------- mobile sidebar ---------- */
.side-toggle { display: none; }
@media (max-width: 900px){
  .admin { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 100; width: 264px; left: 0; top: 0; transform: translateX(-100%); transition: transform .3s var(--ease); }
  .side.open { transform: none; box-shadow: var(--sh-lg); }
  .side-toggle { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
  .side-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 99; }
  .side-backdrop.show { display: block; }
}

/* progress mini */
.mini-bar { height: 8px; border-radius: 999px; background: var(--bg-2); overflow: hidden; }
.mini-bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--green-500), var(--green)); }

.kpi-row { display: flex; gap: 22px; flex-wrap: wrap; }
.kpi { flex: 1; min-width: 120px; }
.kpi .k { font-family: var(--mono); font-size: 24px; font-weight: 600; }
.kpi .kl { font-size: 12.5px; color: var(--ink-faint); }

.pill-list { display: flex; flex-direction: column; gap: 12px; }
.pill-list .pl { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r-sm); background: var(--bg-2); }
.pill-list .pl .av { width: 36px; height: 36px; border-radius: 50%; background: var(--green); color: var(--on-green); display: grid; place-items: center; font-weight: 700; font-size: 14px; flex: 0 0 auto; }
