/* ============================================================
   HIDDEN EMPIRE OPS — premium black / gold, mobile-first
   Five-star hotel grade UI. Same markup, elevated finish.
   ============================================================ */
:root {
  /* -- surfaces (warm onyx, not flat black) -- */
  --bg: #08080a;
  --panel: #131114;
  --panel2: #1c181a;
  --panel3: #241f1e;
  --line: #2e2723;
  --line-soft: rgba(193,147,76,.14);
  --hairline: rgba(214,183,133,.16);

  /* -- gold family -- */
  --gold-deep: #A4651E;
  --gold-dark: #AD722B;
  --gold-rich: #B47E36;
  --gold-bright: #C1934C;
  --gold-warm: #D1AC63;
  --gold-sand: #D6B785;
  --gold-soft: #DFC27C;
  --champagne: #F2E39D;
  --cream: #FAF2BE;
  --white: #f8f5ef;
  --grey: #a49d90;
  --grey-dim: #746c60;

  /* -- status -- */
  --ok: #3ddc84;
  --warn: #e6c35c;
  --bad: #e05252;

  /* -- signature gradients -- */
  --grad: linear-gradient(135deg, var(--champagne) 0%, var(--gold-warm) 28%, var(--gold-rich) 62%, var(--gold-deep) 100%);
  --grad-deep: linear-gradient(160deg, #2a2013 0%, #1a140d 60%, #100c08 100%);
  --grad-hero: linear-gradient(135deg, var(--cream) 0%, var(--champagne) 18%, var(--gold-soft) 40%, var(--gold-rich) 70%, var(--gold-deep) 100%);
  --shine: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.55) 47%, rgba(255,255,255,.05) 54%, transparent 65%);

  /* -- elevation -- */
  --shadow-sm: 0 2px 8px rgba(0,0,0,.35);
  --shadow-md: 0 10px 30px rgba(0,0,0,.45), 0 2px 8px rgba(0,0,0,.35);
  --shadow-lg: 0 18px 50px rgba(0,0,0,.55), 0 4px 14px rgba(0,0,0,.4);
  --shadow-gold: 0 10px 28px rgba(164,101,30,.38), 0 2px 8px rgba(0,0,0,.35);
  --inset-hi: inset 0 1px 0 rgba(255,255,255,.05);

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 26px;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }
::selection { background: var(--gold-deep); color: var(--cream); }

/* refined scrollbar */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: linear-gradient(var(--gold-deep), var(--gold-dark)); border-radius: 999px; border: 2px solid var(--bg); }
* { scrollbar-width: thin; scrollbar-color: var(--gold-deep) var(--bg); }

body {
  background:
    radial-gradient(1100px 420px at 50% -160px, rgba(209,172,99,.16), transparent 62%),
    radial-gradient(760px 500px at 100% 100%, rgba(164,101,30,.10), transparent 60%),
    radial-gradient(600px 420px at -10% 40%, rgba(180,126,54,.07), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  color: var(--white);
  font-family: 'Montserrat', -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

/* ---------- top bar ---------- */
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 20px; background: linear-gradient(rgba(8,8,10,.97), rgba(8,8,10,.9));
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line); position: relative; box-shadow: var(--shadow-sm);
}
.topbar::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  background: var(--grad); box-shadow: 0 0 12px rgba(193,147,76,.55);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo { height: 36px; width: auto; display: block; filter: drop-shadow(0 2px 8px rgba(193,147,76,.35)); }
.brand-txt {
  font-family: 'Playfair Display', serif; font-weight: 800; letter-spacing: 2.5px; font-size: 16.5px; line-height: 1.15;
  background: var(--grad-hero); background-size: 220% auto;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shimmer 7s ease-in-out infinite;
}
.brand-sub { display: block; color: var(--grey); font-size: 9.5px; letter-spacing: 5.5px; font-weight: 600; font-family: 'Montserrat', sans-serif; -webkit-text-fill-color: var(--grey); }
@keyframes shimmer { 0%,100% { background-position: 0% center; } 50% { background-position: 100% center; } }
.userchip {
  font-size: 12px; color: var(--white); background: var(--panel2);
  border: 1px solid var(--hairline); border-radius: 999px; padding: 7px 14px;
  box-shadow: var(--inset-hi);
}

/* ---------- nav ---------- */
.nav {
  display: flex; gap: 8px; overflow-x: auto; padding: 12px 16px;
  background: rgba(8,8,10,.94); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  position: sticky; top: 0; z-index: 20; scrollbar-width: none;
  border-bottom: 1px solid var(--line);
}
.nav::-webkit-scrollbar { display: none; }
.nav a {
  color: var(--grey); text-decoration: none; padding: 10px 17px;
  border-radius: 999px; white-space: nowrap; font-size: 13.5px; font-weight: 700; letter-spacing: .2px;
  border: 1px solid var(--line); background: var(--panel);
  transition: all .18s ease; box-shadow: var(--inset-hi);
}
.nav a.active {
  background: var(--grad); color: #1a1206; border-color: transparent;
  box-shadow: var(--shadow-gold), inset 0 1px 0 rgba(255,255,255,.4);
}
.nav a:active { transform: scale(.96); }
@media (hover: hover) {
  .nav a:not(.active):hover { border-color: var(--hairline); color: var(--gold-soft); background: var(--panel3); }
}

/* ---------- layout ---------- */
.wrap { padding: 20px 16px 116px; max-width: 900px; margin: 0 auto; animation: rise .45s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.pagetitle {
  font-family: 'Playfair Display', serif;
  font-size: 23px; font-weight: 800; letter-spacing: .3px; margin-bottom: 18px;
  display: flex; align-items: center; gap: 12px; color: var(--white);
}
.pagetitle::before { content: ""; width: 5px; height: 26px; border-radius: 3px; background: var(--grad); display: inline-block; box-shadow: 0 0 10px rgba(193,147,76,.5); }

.flash {
  background: linear-gradient(135deg, rgba(193,147,76,.20), rgba(164,101,30,.14));
  border: 1px solid rgba(193,147,76,.4); color: #fff;
  padding: 14px 17px; border-radius: var(--radius-md); margin-bottom: 18px; font-size: 14px; font-weight: 600;
  box-shadow: var(--inset-hi), var(--shadow-sm);
  border-left: 3px solid var(--gold-bright);
}
.card {
  background: linear-gradient(165deg, var(--panel) 0%, var(--panel2) 100%);
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 20px; margin-bottom: 18px; box-shadow: var(--shadow-md), var(--inset-hi);
  position: relative; transition: border-color .2s ease, box-shadow .2s ease;
}
.card h2 {
  font-size: 11.5px; color: var(--gold-sand); text-transform: uppercase;
  letter-spacing: 2.4px; margin-bottom: 14px; font-weight: 700;
  display: flex; align-items: center; gap: 8px;
}
.card h2::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--hairline), transparent); }

/* ---------- forms ---------- */
label { display: block; font-size: 12.5px; color: var(--grey); margin: 14px 0 6px; font-weight: 600; letter-spacing: .4px; }
input, select, textarea {
  width: 100%; padding: 14px 15px; border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--panel3); color: var(--white); font-size: 16.5px;
  font-family: inherit; box-shadow: inset 0 1px 4px rgba(0,0,0,.3);
  transition: border-color .18s, box-shadow .18s, background .18s;
}
input::placeholder, textarea::placeholder { color: var(--grey-dim); }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--gold-bright); background: var(--panel2);
  box-shadow: 0 0 0 3px rgba(193,147,76,.22), inset 0 1px 4px rgba(0,0,0,.25);
}
input[type=number] { -moz-appearance: textfield; }
input[type=checkbox] { accent-color: var(--gold-rich); width: auto; }

.btn {
  display: inline-block; width: 100%; text-align: center; background: var(--grad);
  color: #1a1206; border: 0; border-radius: var(--radius-sm); padding: 16px; font-size: 16.5px;
  font-weight: 800; letter-spacing: .4px; cursor: pointer; text-decoration: none;
  margin-top: 14px; box-shadow: var(--shadow-gold), inset 0 1px 0 rgba(255,255,255,.5);
  transition: transform .12s ease, box-shadow .18s ease, filter .18s ease;
  position: relative; overflow: hidden; isolation: isolate;
}
.btn::before {
  content: ""; position: absolute; inset: 0; background: var(--shine);
  transform: translateX(-120%); transition: transform .6s ease; z-index: 1;
}
@media (hover: hover) { .btn:hover::before { transform: translateX(120%); } .btn:hover { filter: brightness(1.04); } }
.btn:active { transform: scale(.98); box-shadow: 0 4px 14px rgba(164,101,30,.32); }
.btn.secondary {
  background: var(--panel3); border: 1px solid var(--hairline); box-shadow: var(--inset-hi); color: var(--gold-soft);
}
.btn.secondary::before { display: none; }
@media (hover: hover) { .btn.secondary:hover { border-color: var(--gold-bright); color: var(--white); } }
.btn.small { width: auto; padding: 10px 18px; font-size: 13.5px; margin: 4px 4px 0 0; border-radius: 999px; }

/* ---------- tables ---------- */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  text-align: left; color: var(--gold-sand); font-size: 10.5px; text-transform: uppercase;
  letter-spacing: 1.4px; padding: 11px 8px; border-bottom: 1px solid var(--hairline); font-weight: 700;
}
td { padding: 12px 8px; border-bottom: 1px solid rgba(46,39,35,.7); font-variant-numeric: tabular-nums; }
tr { transition: background .15s ease; }
@media (hover: hover) { tbody tr:hover { background: rgba(193,147,76,.05); } }
td.r, th.r { text-align: right; }

/* ---------- KPI cards ---------- */
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; margin-bottom: 18px; }
.kpi {
  background: linear-gradient(165deg, var(--panel) 0%, var(--panel2) 100%);
  border: 1px solid var(--line); border-radius: var(--radius-md); padding: 17px;
  box-shadow: var(--shadow-sm), var(--inset-hi); position: relative; overflow: hidden;
}
.kpi::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: linear-gradient(90deg, transparent, var(--hairline), transparent); }
.kpi .v { font-family: 'Playfair Display', serif; font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: .3px; }
.kpi .l { font-size: 10px; color: var(--grey); text-transform: uppercase; letter-spacing: 1.6px; margin-top: 5px; font-weight: 700; }
.kpi.red { background: var(--grad-hero); border-color: transparent; box-shadow: var(--shadow-gold); }
.kpi.red::before { background: linear-gradient(90deg, transparent, rgba(255,255,255,.6), transparent); }
.kpi.red .v, .kpi.red .l { color: #1a1206; }
.kpi.green .v { color: var(--ok); }

/* ---------- count screen ---------- */
.searchbox { position: sticky; top: 62px; z-index: 15; padding: 8px 0; background: linear-gradient(var(--bg) 78%, transparent); }
.searchbox input { border-radius: 999px; padding: 14px 22px; }
.progress { font-size: 13.5px; color: var(--grey); margin-bottom: 7px; font-weight: 600; }
.progress b { color: var(--gold-soft); }
.pbar { height: 6px; border-radius: 999px; background: var(--panel3); margin-bottom: 16px; overflow: hidden; box-shadow: inset 0 1px 3px rgba(0,0,0,.4); }
.pbar .fill { height: 100%; border-radius: 999px; background: var(--grad); transition: width .3s ease; box-shadow: 0 0 8px rgba(193,147,76,.5); }

.cat-head {
  color: var(--gold-bright); font-weight: 800; font-size: 11.5px; letter-spacing: 2.2px;
  padding: 18px 4px 9px; text-transform: uppercase; display: flex; align-items: center; gap: 10px;
}
.cat-head::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--hairline), transparent); }
.line {
  display: flex; align-items: center; gap: 9px; padding: 12px 13px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius-md); margin-bottom: 8px; transition: border-color .2s, background .2s, box-shadow .2s;
  flex-wrap: wrap; box-shadow: var(--inset-hi);
}
.line .pname { flex: 1 1 100%; min-width: 0; }
.line .pname .nm { font-size: 14.5px; font-weight: 700; }
.line .pname .meta { font-size: 11.5px; color: var(--grey); margin-top: 2px; }
.line .qtygrp { display: flex; gap: 6px; flex: 1; }
.line input.qty {
  width: 100%; text-align: center; padding: 12px 4px; font-size: 15px; font-weight: 700;
  border-radius: var(--radius-sm); font-variant-numeric: tabular-nums;
}
.line.done { border-color: rgba(61,220,132,.35); background: rgba(61,220,132,.05); box-shadow: 0 0 0 1px rgba(61,220,132,.08) inset; }
.line.done input.qty.counted { border-color: rgba(61,220,132,.6); color: var(--ok); }
.savedot { width: 8px; height: 8px; border-radius: 50%; background: transparent; flex: 0 0 8px; transition: background .2s, box-shadow .2s; }
.savedot.saving { background: var(--warn); box-shadow: 0 0 6px rgba(230,195,92,.7); }
.savedot.saved { background: var(--ok); box-shadow: 0 0 6px rgba(61,220,132,.7); }
.savedot.error { background: var(--bad); box-shadow: 0 0 6px rgba(224,82,82,.7); }

/* ---------- submit bar ---------- */
.submitbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; align-items: center; gap: 14px;
  padding: 13px 16px calc(13px + env(safe-area-inset-bottom));
  background: linear-gradient(rgba(8,8,10,.7), rgba(8,8,10,.96));
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-top: 1px solid var(--line); box-shadow: 0 -8px 24px rgba(0,0,0,.35);
}
.submitbar::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--hairline), transparent); }
.submitbar .sb-info { font-size: 13px; color: var(--grey); font-weight: 700; white-space: nowrap; }
.submitbar .sb-info b { color: var(--white); font-size: 16px; }
.submitbar form { flex: 1; }
.submitbar .btn { margin-top: 0; padding: 14px; }

.okbanner {
  background: linear-gradient(135deg, rgba(61,220,132,.16), rgba(61,220,132,.05));
  border: 1px solid rgba(61,220,132,.4); color: var(--ok);
  padding: 14px 17px; border-radius: var(--radius-md); margin-bottom: 16px; font-size: 14px; font-weight: 700;
  border-left: 3px solid var(--ok); box-shadow: var(--inset-hi);
}

/* ---------- badges ---------- */
.badge {
  display: inline-block; font-size: 10.5px; font-weight: 800; letter-spacing: 1.1px;
  padding: 5px 12px; border-radius: 999px; background: var(--panel3);
  color: var(--grey); border: 1px solid var(--line); text-transform: uppercase;
}
.badge.red { background: var(--grad); color: #1a1206; border-color: transparent; box-shadow: 0 3px 10px rgba(164,101,30,.35); }
.badge.green { background: rgba(61,220,132,.15); color: var(--ok); border-color: rgba(61,220,132,.4); }

/* ---------- login ---------- */
body:has(.login-box) {
  display: flex; align-items: center; min-height: 100vh;
}
.login-box { max-width: 380px; margin: 0 auto; padding: 0 18px; text-align: center; width: 100%; animation: rise .5s ease both; }
.login-logo { text-align: center; margin-bottom: 26px; position: relative; }
.login-logo::before {
  content: ""; position: absolute; left: 50%; top: -30px; width: 220px; height: 220px;
  background: radial-gradient(circle, rgba(209,172,99,.20), transparent 70%);
  transform: translateX(-50%); pointer-events: none;
}
.login-logo img { width: 112px; height: auto; margin-bottom: 12px; position: relative; filter: drop-shadow(0 6px 18px rgba(193,147,76,.4)); }
.login-logo small { display: block; font-size: 11px; letter-spacing: 7.5px; color: var(--grey); font-weight: 600; position: relative; }
.login-box .card { padding: 26px 22px; border-radius: var(--radius-xl); }

.foot { text-align: center; color: #4d463b; font-size: 11px; padding: 26px; letter-spacing: 1.2px; }
.muted { color: var(--grey); font-size: 13.5px; }
.right { text-align: right; }
.mt { margin-top: 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (min-width: 700px) {
  .kpis { grid-template-columns: repeat(4, 1fr); }
  .line .pname { flex: 1 1 auto; } .line .qtygrp { flex: 0 0 260px; }
  .card:hover { border-color: var(--hairline); }
}
