/* =========================================================
   Arun Offset Printers · Stock Console
   Theme: midnight ink + press gold, with a CMYK registration accent
   ========================================================= */
:root {
  --ink: #0b1626;
  --ink-2: #12233a;
  --ink-3: #1b3150;
  --gold: #c9a227;
  --gold-2: #e9c46a;
  --gold-soft: #fbf3dc;
  --bg: #f4f5f9;
  --card: #ffffff;
  --text: #0f172a;
  --text-2: #334155;
  --muted: #64748b;
  --line: #e5e8f0;
  --line-2: #eef0f5;
  --cyan: #00aeef;
  --magenta: #ec008c;
  --yellow: #ffd400;
  --ok: #15803d;
  --ok-bg: #e9f7ef;
  --warn: #b45309;
  --warn-bg: #fff4e0;
  --bad: #c62828;
  --bad-bg: #fdecec;
  --info: #1d4ed8;
  --info-bg: #e8efff;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px -12px rgba(15, 23, 42, 0.12);
  --shadow-lg: 0 24px 60px -20px rgba(11, 22, 38, 0.45);
  --serif: "Playfair Display", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --sidebar: 272px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--sans);
  font-size: 15px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.hidden { display: none !important; }

.cmyk { display: flex; height: 4px; }
.cmyk span { flex: 1; }
.cmyk span:nth-child(1) { background: var(--cyan); }
.cmyk span:nth-child(2) { background: var(--magenta); }
.cmyk span:nth-child(3) { background: var(--yellow); }
.cmyk span:nth-child(4) { background: var(--ink); }

/* ---------- Splash ---------- */
.splash { position: fixed; inset: 0; display: grid; place-items: center; background: var(--ink); z-index: 100; transition: opacity .4s; }
.splash { flex-direction: column; gap: 34px; display: flex; align-items: center; justify-content: center; }
@keyframes pulse { 50% { transform: scale(1.06); opacity: .85; } }

/* ---------- Auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.15fr 1fr; background: var(--bg); }
.auth-hero {
  position: relative; overflow: hidden; color: #fff; padding: 56px 64px;
  display: flex; flex-direction: column; justify-content: space-between;
  background:
    radial-gradient(1200px 500px at -10% -20%, rgba(233, 196, 106, .18), transparent 60%),
    radial-gradient(800px 600px at 120% 120%, rgba(0, 174, 239, .12), transparent 60%),
    linear-gradient(160deg, #0b1626 0%, #12233a 60%, #0e1c30 100%);
}
.auth-hero::before {
  content: ""; position: absolute; inset: 0; opacity: .25;
  background-image: radial-gradient(rgba(233, 196, 106, .55) 1px, transparent 1.2px);
  background-size: 18px 18px;
  mask-image: linear-gradient(120deg, transparent 30%, #000 100%);
}
.reg-mark { position: absolute; width: 64px; height: 64px; opacity: .35; }
.reg-mark::before, .reg-mark::after { content: ""; position: absolute; background: var(--gold-2); }
.reg-mark::before { left: 50%; top: 0; bottom: 0; width: 1px; }
.reg-mark::after { top: 50%; left: 0; right: 0; height: 1px; }
.reg-mark i { position: absolute; inset: 14px; border: 1px solid var(--gold-2); border-radius: 50%; }
.reg-mark.tl { top: 28px; right: 28px; }
.reg-mark.br { bottom: 28px; right: 120px; width: 44px; height: 44px; }
.reg-mark.br i { inset: 10px; }
.brand-lockup { position: relative; display: flex; align-items: center; gap: 18px; }
.brand-lockup img { width: 84px; height: 84px; border-radius: 18px; object-fit: cover; background: #000; box-shadow: 0 0 0 1px rgba(233, 196, 106, .45), 0 14px 34px rgba(0,0,0,.45); }
.brand-lockup .t1 { font-family: var(--serif); font-size: 26px; font-weight: 700; letter-spacing: .2px; }
.brand-lockup .t2 { font-size: 12px; letter-spacing: 3.5px; text-transform: uppercase; color: var(--gold-2); margin-top: 4px; }
.hero-copy { position: relative; max-width: 520px; }
.hero-copy .eyebrow { display: inline-flex; gap: 8px; align-items: center; font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: var(--gold-2); padding: 6px 12px; border: 1px solid rgba(233,196,106,.35); border-radius: 999px; }
.hero-copy h1 { font-family: var(--serif); font-size: clamp(34px, 4vw, 52px); line-height: 1.08; margin: 22px 0 16px; font-weight: 700; }
.hero-copy h1 em { font-style: italic; color: var(--gold-2); }
.hero-copy p { color: #b9c4d6; line-height: 1.7; margin: 0; font-size: 16px; }
.hero-feats { position: relative; display: flex; gap: 28px; flex-wrap: wrap; color: #cfd8e6; font-size: 13px; }
.hero-feats div { display: flex; align-items: center; gap: 10px; }
.hero-feats .dot { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: rgba(233,196,106,.12); color: var(--gold-2); }

.auth-side { display: grid; place-items: center; padding: 32px 20px; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card .m-brand { display: none; }
.auth-card h2 { font-family: var(--serif); font-size: 32px; margin: 0 0 6px; }
.auth-card .sub { color: var(--muted); margin: 0 0 28px; }
.role-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 22px; }
.role-opt { border: 1.5px solid var(--line); background: #fff; border-radius: 14px; padding: 14px; text-align: left; display: flex; gap: 12px; align-items: center; transition: .18s; }
.role-opt .ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--line-2); color: var(--text-2); transition: .18s; }
.role-opt b { display: block; font-size: 15px; }
.role-opt small { color: var(--muted); font-size: 12px; }
.role-opt.on { border-color: var(--ink); box-shadow: 0 0 0 4px rgba(11,22,38,.06); }
.role-opt.on .ic { background: var(--ink); color: var(--gold-2); }
.auth-foot { margin-top: 26px; font-size: 12.5px; color: var(--muted); text-align: center; line-height: 1.6; }
.demo-note { margin-top: 18px; padding: 12px 14px; border-radius: 12px; background: var(--gold-soft); color: #7a5b06; font-size: 12.5px; line-height: 1.55; border: 1px dashed #e6cf8c; }
.linkish { background: none; border: 0; padding: 0; color: var(--info); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Forms ---------- */
.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-bottom: 7px; letter-spacing: .2px; }
.input, .select, textarea.input {
  width: 100%; height: 46px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff;
  padding: 0 14px; outline: none; transition: border-color .15s, box-shadow .15s;
}
textarea.input { height: auto; min-height: 90px; padding: 12px 14px; resize: vertical; }
.input:focus, .select:focus { border-color: var(--ink-3); box-shadow: 0 0 0 4px rgba(27, 49, 80, .1); }
.input.err { border-color: var(--bad); }
.select { appearance: none; padding-right: 38px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2364748b' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 14px center; }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 46px; }
.pw-eye { position: absolute; right: 6px; top: 6px; width: 34px; height: 34px; border: 0; background: none; color: var(--muted); border-radius: 8px; display: grid; place-items: center; }
.form-err { color: var(--bad); font-size: 13px; margin: -4px 0 14px; min-height: 18px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 6px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; font-size: 14px; }
.switch input { position: absolute; opacity: 0; }
.switch .tr { width: 42px; height: 24px; border-radius: 999px; background: #cbd2de; position: relative; transition: .2s; flex: none; }
.switch .tr::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: .2s; }
.switch input:checked + .tr { background: var(--ok); }
.switch input:checked + .tr::after { transform: translateX(18px); }

.seg { display: inline-flex; background: var(--line-2); border-radius: 11px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; padding: 7px 14px; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.seg button.on { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(15,23,42,.12); }
.seg button.on.used { color: var(--bad); }
.seg button.on.added { color: var(--ok); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 18px; border-radius: 12px; border: 1.5px solid transparent; font-weight: 600; font-size: 14px; white-space: nowrap; transition: transform .08s, background .15s, box-shadow .15s, opacity .15s; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--ink); color: #fff; box-shadow: 0 6px 16px -8px rgba(11,22,38,.7); }
.btn-primary:hover { background: var(--ink-3); }
.btn-gold { background: linear-gradient(135deg, var(--gold-2), var(--gold)); color: #241a00; box-shadow: 0 8px 20px -10px rgba(201,162,39,.9); }
.btn-gold:hover { filter: brightness(1.04); }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--text-2); }
.btn-ghost:hover { border-color: #cfd5e1; background: #fafbfd; }
.btn-danger { background: var(--bad-bg); color: var(--bad); }
.btn-ok { background: var(--ok); color: #fff; }
.btn-lg { height: 50px; font-size: 15px; border-radius: 14px; }
.btn-block { width: 100%; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.icon-btn { width: 36px; height: 36px; border-radius: 10px; border: 1.5px solid var(--line); background: #fff; display: inline-grid; place-items: center; color: var(--text-2); }
.icon-btn:hover { background: var(--line-2); }
.icon-btn.danger:hover { color: var(--bad); background: var(--bad-bg); border-color: #f5c6c6; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- App shell ---------- */
.app { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; background: linear-gradient(180deg, #0b1626, #0f1f35); color: #c7d1e0; display: flex; flex-direction: column; }
.sb-brand { display: flex; gap: 12px; align-items: center; padding: 22px 22px 20px; border-bottom: 1px solid rgba(255,255,255,.06); }
.sb-brand img { width: 50px; height: 50px; border-radius: 12px; background: #000; object-fit: cover; }
.sb-brand .logo-anim { box-shadow: 0 0 0 1px rgba(233,196,106,.4); }
.sb-brand .t1 { font-family: var(--serif); color: #fff; font-size: 17px; font-weight: 700; line-height: 1.15; }
.sb-brand .t2 { font-size: 10.5px; letter-spacing: 2.6px; text-transform: uppercase; color: var(--gold-2); margin-top: 3px; }
.sb-nav { padding: 18px 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; overflow-y: auto; }
.sb-label { font-size: 10.5px; letter-spacing: 2px; text-transform: uppercase; color: #6f7f98; padding: 10px 12px 6px; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; text-decoration: none; color: #c7d1e0; font-weight: 500; font-size: 14.5px; position: relative; transition: background .15s, color .15s; }
.nav-item:hover { background: rgba(255,255,255,.05); color: #fff; }
.nav-item.on { background: linear-gradient(90deg, rgba(233,196,106,.16), rgba(233,196,106,.04)); color: #fff; }
.nav-item.on::before { content: ""; position: absolute; left: -14px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--gold-2); }
.nav-item.on svg { color: var(--gold-2); }
.nav-badge { margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--magenta); color: #fff; font-size: 11.5px; font-weight: 700; display: grid; place-items: center; }
.sb-user { margin: 14px; padding: 12px; border-radius: 14px; background: rgba(255,255,255,.05); display: flex; align-items: center; gap: 12px; }
.sb-user .who { flex: 1; min-width: 0; }
.sb-user b { color: #fff; font-size: 14px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-user small { color: #8a9ab3; font-size: 12px; }
.sb-user .icon-btn { background: transparent; border-color: rgba(255,255,255,.1); color: #c7d1e0; }
.sb-user .icon-btn:hover { background: rgba(255,255,255,.08); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 16px; padding: 26px 36px 8px; }
.topbar h1 { font-family: var(--serif); font-size: 30px; margin: 0; font-weight: 700; letter-spacing: .1px; }
.topbar .crumb { color: var(--muted); font-size: 13.5px; margin-top: 4px; }
.topbar .actions { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; }
.content { padding: 18px 36px 48px; }
.demo-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; color: #7a5b06; background: var(--gold-soft); border: 1px solid #ecd9a0; padding: 4px 10px; border-radius: 999px; }

.mtop, .bnav { display: none; }

/* ---------- Cards & grid ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line-2); }
.card-h h3 { margin: 0; font-size: 16px; font-weight: 700; }
.card-h .sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.card-h .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.card-b { padding: 20px 22px; }
.grid { display: grid; gap: 20px; }
.g-kpi { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.g-2 { grid-template-columns: 1.6fr 1fr; }
.g-2e { grid-template-columns: 1fr 1fr; }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mt { margin-top: 20px; }

.kpi { padding: 18px 20px; position: relative; overflow: hidden; }
.kpi .lbl { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; font-weight: 600; letter-spacing: .2px; }
.kpi .lbl .ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; }
.kpi .val { font-size: 30px; font-weight: 800; margin-top: 12px; letter-spacing: -.5px; }
.kpi .val small { font-size: 13px; color: var(--muted); font-weight: 600; margin-left: 4px; letter-spacing: 0; }
.kpi .foot { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.kpi.hero { background: linear-gradient(140deg, #0b1626, #1b3150); color: #fff; border-color: transparent; }
.kpi.hero .lbl, .kpi.hero .foot, .kpi.hero .val small { color: #b6c3d8; }
.kpi.hero::after { content: ""; position: absolute; right: -30px; top: -30px; width: 120px; height: 120px; border-radius: 50%; border: 18px solid rgba(233,196,106,.12); }
.ic-c { background: #e3f6fd; color: #0284c7; }
.ic-m { background: #fde7f3; color: #be185d; }
.ic-y { background: #fff6cc; color: #a16207; }
.ic-k { background: #e9edf3; color: var(--ink); }
.ic-g { background: rgba(233,196,106,.18); color: var(--gold-2); }

.chart-box { position: relative; height: 280px; }

/* ---------- Badges, avatars ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge svg.i { width: 13px; height: 13px; }
.b-ok { background: var(--ok-bg); color: var(--ok); }
.b-warn { background: var(--warn-bg); color: var(--warn); }
.b-bad { background: var(--bad-bg); color: var(--bad); }
.b-info { background: var(--info-bg); color: var(--info); }
.b-mute { background: var(--line-2); color: var(--muted); }
.b-gold { background: var(--gold-soft); color: #7a5b06; }

.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 14px; flex: none; position: relative; }
.avatar.male { background: linear-gradient(135deg, #1e5aa8, #0b8fd1); }
.avatar.female { background: linear-gradient(135deg, #c2185b, #e85d9a); }
.avatar.admin { background: linear-gradient(135deg, var(--gold-2), var(--gold)); color: #241a00; }
.avatar.lg { width: 64px; height: 64px; font-size: 22px; }
.avatar.sm { width: 32px; height: 32px; font-size: 12px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-size: 11.5px; letter-spacing: .8px; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: 12px 22px; background: #fafbfd; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 14px 22px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t tbody tr:hover td { background: #fbfcfe; }
table.t .num { text-align: right; font-variant-numeric: tabular-nums; }
.cell-main { display: flex; align-items: center; gap: 12px; }
.cell-main b { display: block; font-weight: 600; }
.cell-main small { color: var(--muted); font-size: 12.5px; }
.prod-ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(135deg, #eef2f8, #e3e8f1); color: var(--ink-3); flex: none; }
.stock-bar { width: 140px; height: 7px; border-radius: 999px; background: var(--line-2); overflow: hidden; margin-top: 6px; }
.stock-bar > i { display: block; height: 100%; border-radius: 999px; background: var(--ok); }
.stock-bar.low > i { background: var(--bad); }
.stock-bar.near > i { background: #d97706; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.qty { font-weight: 700; font-variant-numeric: tabular-nums; }
.qty.used { color: var(--bad); }
.qty.added { color: var(--ok); }

.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty .ic { width: 56px; height: 56px; border-radius: 16px; background: var(--line-2); display: grid; place-items: center; margin: 0 auto 14px; color: var(--muted); }
.empty .ic svg.i { width: 26px; height: 26px; }
.empty b { display: block; color: var(--text); font-size: 15px; margin-bottom: 4px; }

/* lists */
.list { display: flex; flex-direction: column; }
.li { display: flex; align-items: center; gap: 12px; padding: 13px 22px; border-bottom: 1px solid var(--line-2); }
.li:last-child { border-bottom: 0; }
.li .grow { flex: 1; min-width: 0; }
.li .grow b { font-weight: 600; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li .grow small { color: var(--muted); font-size: 12.5px; }

/* filters */
.filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; padding: 18px 22px; border-bottom: 1px solid var(--line-2); }
.filters .field { margin: 0; min-width: 150px; flex: 1; }
.filters .field .input, .filters .field .select { height: 42px; }
.tabs { display: flex; gap: 4px; padding: 0 22px; border-bottom: 1px solid var(--line-2); overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 14px 6px; margin-right: 18px; font-weight: 600; color: var(--muted); border-bottom: 2.5px solid transparent; white-space: nowrap; }
.tabs button.on { color: var(--text); border-bottom-color: var(--gold); }

/* staff cards */
.staff-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.staff-card { padding: 22px; text-align: center; position: relative; transition: transform .15s, box-shadow .15s; }
.staff-card:hover { transform: translateY(-2px); box-shadow: 0 18px 40px -20px rgba(15,23,42,.3); }
.staff-card .avatar { margin: 0 auto 12px; }
.staff-card h4 { margin: 0; font-size: 16.5px; }
.staff-card .meta { color: var(--muted); font-size: 12.5px; margin-top: 3px; text-transform: capitalize; }
.staff-card .stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 16px 0; }
.staff-card .stats div { background: #f7f8fb; border-radius: 12px; padding: 10px; }
.staff-card .stats b { display: block; font-size: 18px; }
.staff-card .stats small { color: var(--muted); font-size: 11.5px; }
.staff-card .acts { display: flex; gap: 8px; justify-content: center; }
.staff-card .menu { position: absolute; top: 12px; right: 12px; display: flex; gap: 6px; }

/* profile picker */
.picker { min-height: 100vh; display: grid; place-items: center; padding: 30px 18px; background:
  radial-gradient(900px 400px at 50% -10%, rgba(233,196,106,.18), transparent 60%), var(--bg); }
.picker-in { width: 100%; max-width: 760px; text-align: center; }
.picker-in img.logo { width: 76px; height: 76px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px rgba(201,162,39,.4); }
.picker-in h2 { font-family: var(--serif); font-size: 32px; margin: 18px 0 6px; }
.picker-in p { color: var(--muted); margin: 0 0 28px; }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.pick { background: #fff; border: 1.5px solid var(--line); border-radius: 18px; padding: 22px 12px; display: flex; flex-direction: column; align-items: center; gap: 10px; transition: .15s; }
.pick:hover { border-color: var(--gold); transform: translateY(-2px); box-shadow: var(--shadow); }
.pick b { font-size: 15px; }

/* staff update form */
.entry-rows { display: flex; flex-direction: column; gap: 12px; }
.entry-row { display: grid; grid-template-columns: 34px minmax(0, 2.2fr) minmax(0, 1fr) auto 40px; gap: 12px; align-items: center; padding: 14px; border: 1.5px solid var(--line); border-radius: 14px; background: #fcfcfe; transition: border-color .15s; }
.entry-row:focus-within { border-color: #c4ccda; background: #fff; }
.entry-row .n { width: 30px; height: 30px; border-radius: 9px; background: var(--ink); color: var(--gold-2); display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.entry-row .avail { font-size: 12px; color: var(--muted); margin-top: 5px; min-height: 16px; }
.entry-row .avail.low { color: var(--bad); font-weight: 600; }
.entry-row .field { margin: 0; }
.add-row { border: 1.5px dashed #cdd4e1; background: transparent; border-radius: 14px; padding: 14px; color: var(--text-2); font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 8px; }
.add-row:hover:not(:disabled) { border-color: var(--gold); color: #7a5b06; background: var(--gold-soft); }
.add-row:disabled { opacity: .5; cursor: not-allowed; }
.submit-bar { display: flex; align-items: center; gap: 14px; margin-top: 18px; flex-wrap: wrap; }
.submit-bar .sum { color: var(--muted); font-size: 13.5px; }

.welcome { padding: 24px 26px; display: flex; align-items: center; gap: 18px; background: linear-gradient(130deg, #0b1626, #1b3150); color: #fff; border: 0; position: relative; overflow: hidden; }
.welcome::after { content: ""; position: absolute; right: -40px; bottom: -60px; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle, rgba(233,196,106,.25), transparent 65%); }
.welcome h2 { font-family: var(--serif); margin: 0; font-size: 24px; }
.welcome p { margin: 4px 0 0; color: #b6c3d8; font-size: 14px; }
.welcome .stats { margin-left: auto; display: flex; gap: 26px; position: relative; z-index: 1; }
.welcome .stats b { display: block; font-size: 22px; }
.welcome .stats small { color: #b6c3d8; font-size: 12px; }

/* history entries */
.day-nav { display: flex; align-items: center; gap: 8px; }
.day-nav .input { width: 170px; height: 40px; }
.entry-card { display: flex; gap: 14px; align-items: center; padding: 16px 22px; border-bottom: 1px solid var(--line-2); }
.entry-card:last-child { border-bottom: 0; }
.entry-card .grow { flex: 1; min-width: 0; }
.entry-card .grow b { display: block; font-weight: 600; }
.entry-card .grow small { color: var(--muted); font-size: 12.5px; }
.entry-card .prev { font-size: 12px; color: var(--muted); text-decoration: line-through; }
.entry-card .side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }

/* approvals */
.req { padding: 18px 22px; border-bottom: 1px solid var(--line-2); display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center; }
.req:last-child { border-bottom: 0; }
.req .reason { margin-top: 8px; background: #f7f8fb; border-left: 3px solid var(--gold); padding: 8px 12px; border-radius: 0 8px 8px 0; font-size: 13.5px; color: var(--text-2); }
.req .acts { display: flex; gap: 8px; }

/* settings */
.set-row { display: flex; align-items: center; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line-2); }
.set-row:last-child { border-bottom: 0; }
.set-row .grow { flex: 1; }
.set-row b { display: block; }
.set-row small { color: var(--muted); }
.steps { margin: 0; padding-left: 20px; color: var(--text-2); line-height: 1.8; font-size: 14px; }
.chat-opt { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 12px; margin-top: 8px; }
.tg-status { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 14px; background: #f7f8fb; margin-bottom: 18px; }
.tg-status .ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: #229ed9; color: #fff; }

/* ---------- Modal & toast ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(11, 22, 38, .55); backdrop-filter: blur(4px); display: grid; place-items: center; z-index: 50; padding: 18px; animation: fade .18s; }
.modal { width: 100%; max-width: 480px; background: #fff; border-radius: 20px; box-shadow: var(--shadow-lg); animation: rise .22s cubic-bezier(.2,.8,.2,1); max-height: calc(100vh - 36px); display: flex; flex-direction: column; }
.modal.wide { max-width: 640px; }
.modal-h { display: flex; align-items: flex-start; gap: 14px; padding: 22px 24px 8px; }
.modal-h h3 { margin: 0; font-family: var(--serif); font-size: 22px; }
.modal-h p { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; }
.modal-h .icon-btn { margin-left: auto; }
.modal-b { padding: 16px 24px; overflow-y: auto; }
.modal-f { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 24px 22px; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.98); } }

.toasts { position: fixed; top: 20px; right: 20px; z-index: 60; display: flex; flex-direction: column; gap: 10px; }
.toast { display: flex; align-items: center; gap: 10px; min-width: 260px; max-width: 380px; padding: 13px 16px; border-radius: 14px; background: var(--ink); color: #fff; box-shadow: var(--shadow-lg); font-size: 14px; animation: rise .25s; }
.toast.ok svg { color: #4ade80; }
.toast.bad svg { color: #f87171; }
.toast.warn svg { color: var(--gold-2); }

.gender-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.gender-pick label { border: 1.5px solid var(--line); border-radius: 12px; padding: 12px; display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; }
.gender-pick input { position: absolute; opacity: 0; pointer-events: none; }

/* ---------- Brand hero logo ---------- */
.hero-logo { position: relative; width: 168px; height: 168px; border-radius: 30px; overflow: hidden; box-shadow: 0 0 0 1px rgba(233,196,106,.35), 0 30px 70px -20px rgba(0,0,0,.7); margin-bottom: 26px; }
.hero-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.admin-entry { background: linear-gradient(135deg, var(--gold-2), var(--gold)); color: #241a00; }

/* ---------- Notifications ---------- */
.bell { position: relative; }
.bell .dotc { position: absolute; top: -6px; right: -6px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px; background: var(--magenta); color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; border: 2px solid #fff; }
.mtop .bell .dotc { border-color: var(--ink); }
.np-bg { position: fixed; inset: 0; z-index: 44; }
.np { position: fixed; top: 78px; right: 30px; width: 410px; max-height: min(640px, calc(100vh - 100px)); background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lg); z-index: 45; display: flex; flex-direction: column; animation: rise .2s; overflow: hidden; }
.np-h { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line-2); }
.np-h h3 { margin: 0; font-size: 16px; }
.np-h .right { margin-left: auto; display: flex; gap: 6px; }
.np-b { overflow-y: auto; }
.np-sec { font-size: 10.5px; letter-spacing: 1.6px; text-transform: uppercase; color: var(--muted); padding: 14px 18px 6px; font-weight: 700; }
.np-item { display: flex; gap: 12px; width: 100%; text-align: left; padding: 13px 18px; border: 0; border-bottom: 1px solid var(--line-2); background: #fff; }
.np-item:hover { background: #fafbfd; }
.np-item.unread { background: #fdf8ea; }
.np-item.unread b::after { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--magenta); margin-left: 7px; vertical-align: 2px; }
.np-item .ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.np-item b { display: block; font-size: 14px; font-weight: 600; }
.np-item p { margin: 2px 0 3px; font-size: 13px; color: var(--text-2); line-height: 1.45; }
.np-item small { color: var(--muted); font-size: 11.5px; }
.np-item.rem { background: var(--warn-bg); }
.ic-ok { background: var(--ok-bg); color: var(--ok); }
.ic-bad { background: var(--bad-bg); color: var(--bad); }
.ic-warn { background: var(--warn-bg); color: var(--warn); }
.ic-info { background: var(--info-bg); color: var(--info); }

.reminder { display: flex; gap: 14px; align-items: center; padding: 14px 18px; border-radius: 14px; background: var(--warn-bg); border: 1px solid #f1d6a4; color: #7c3d00; margin-bottom: 20px; }
.reminder .ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: #fff; color: var(--warn); flex: none; }
.reminder .grow { flex: 1; min-width: 0; }
.reminder b { display: block; }
.reminder small { color: #8a5a1a; }

.offline { position: fixed; top: 0; left: 0; right: 0; z-index: 80; background: var(--bad); color: #fff; text-align: center; font-size: 13px; font-weight: 600; padding: 7px 12px; display: flex; gap: 8px; justify-content: center; align-items: center; }

/* who is submitting */
.who-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 10px; }
.who-grid label { border: 1.5px solid var(--line); border-radius: 14px; padding: 14px 10px; display: flex; flex-direction: column; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; font-size: 14px; text-align: center; transition: .15s; }
.who-grid label:hover { border-color: #cfd5e1; }
.who-grid input { position: absolute; opacity: 0; pointer-events: none; }
.who-grid label.on { border-color: var(--ink); background: #f7f8fb; box-shadow: 0 0 0 4px rgba(11,22,38,.07); }
.confirm-list { margin-top: 16px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.confirm-list div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.confirm-list div:last-child { border-bottom: 0; background: #fafbfd; font-weight: 700; }
.gender-pick label.on { border-color: var(--ink); background: #f7f8fb; box-shadow: 0 0 0 4px rgba(11,22,38,.05); }
.entry-row.staff { grid-template-columns: 34px minmax(0, 2.2fr) minmax(0, 1fr) 40px; }

/* ---------- Dashboard tabs ---------- */
.dash-tabs { margin-bottom: 20px; }
.dash-tabs button { padding: 9px 16px; font-size: 13.5px; }
.dash-tabs svg.i { width: 16px; height: 16px; }

/* ---------- Devices ---------- */
.device { display: flex; gap: 14px; align-items: center; padding: 16px 22px; border-bottom: 1px solid var(--line-2); }
.device:last-child { border-bottom: 0; }
.device .grow { flex: 1; min-width: 0; }
.device .grow b { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 600; }
.device .grow small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.device .side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.dev-ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--line-2); color: var(--muted); flex: none; position: relative; }
.dev-ic svg.i { width: 22px; height: 22px; }
.dev-ic.on { background: #e8f0fb; color: var(--ink-3); }
.dev-ic.on::after { content: ""; position: absolute; right: -2px; bottom: -2px; width: 12px; height: 12px; border-radius: 50%; background: #22c55e; border: 2px solid #fff; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: #22c55e; display: inline-block; animation: pulse 1.6s infinite; }

/* ---------- Animated logo ---------- */
.logo-anim { position: relative; display: inline-block; overflow: hidden; border-radius: 14px; flex: none; isolation: isolate; }
.logo-anim img { display: block; position: relative; z-index: 1; }
.logo-anim::after { content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none; border-radius: inherit;
  background: linear-gradient(115deg, transparent 40%, rgba(255,255,255,.5) 50%, rgba(255,255,255,.06) 56%, transparent 62%) no-repeat;
  background-size: 300% 100%; background-position: 150% 0; animation: shine 4.5s cubic-bezier(.4,0,.2,1) infinite 1.2s; }
.logo-anim.sm { border-radius: 12px; }
.logo-anim.sm::after { animation-duration: 7s; animation-delay: 2s; }
.sb-brand .logo-anim img, .mtop .logo-anim img, .m-brand .logo-anim img { box-shadow: none; }
@keyframes shine { 0% { background-position: 150% 0; } 30%, 100% { background-position: -50% 0; } }

.splash-logo { width: 150px; height: 150px; border-radius: 30px; overflow: visible; animation: logoIn .9s cubic-bezier(.2,.9,.25,1.15) both; }
.splash-logo img { width: 150px; height: 150px; border-radius: 30px; box-shadow: 0 24px 60px rgba(0,0,0,.55); }
.splash-logo::after { border-radius: 30px; }
.logo-anim .ring { position: absolute; inset: -5px; border-radius: inherit; z-index: 0; padding: 3px;
  background: conic-gradient(from 0deg, #00aeef, #ec008c, #ffd400, #00aeef);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  animation: spin 3.2s linear infinite; opacity: .9; }
.splash-logo .ring { inset: -8px; border-radius: 36px; }
@keyframes logoIn { 0% { opacity: 0; transform: scale(.55) rotate(-8deg); filter: blur(10px); } 100% { opacity: 1; transform: none; filter: none; } }
.cmyk-loader { display: flex; gap: 10px; }
.cmyk-loader i { width: 11px; height: 11px; border-radius: 50%; animation: dotBounce 1.1s ease-in-out infinite; }
.cmyk-loader i:nth-child(1) { background: #00aeef; }
.cmyk-loader i:nth-child(2) { background: #ec008c; animation-delay: .12s; }
.cmyk-loader i:nth-child(3) { background: #ffd400; animation-delay: .24s; }
.cmyk-loader i:nth-child(4) { background: #f5f5f5; animation-delay: .36s; }
@keyframes dotBounce { 0%, 80%, 100% { transform: translateY(0); opacity: .45; } 40% { transform: translateY(-12px); opacity: 1; } }

.hero-logo { overflow: visible; animation: logoIn .9s cubic-bezier(.2,.9,.25,1.15) both, float 6s ease-in-out infinite 1s; }
.hero-logo img { border-radius: 30px; }
.hero-logo::after { border-radius: 30px; }
.hero-logo .ring { inset: -6px; border-radius: 34px; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

/* ---------- Page & card motion (only on navigation) ---------- */
.content.enter > * { animation: fadeUp .45s cubic-bezier(.2,.8,.2,1) both; }
.content.enter > *:nth-child(2) { animation-delay: .05s; }
.content.enter > *:nth-child(3) { animation-delay: .1s; }
.content.enter > *:nth-child(4) { animation-delay: .15s; }
.content.enter > *:nth-child(n+5) { animation-delay: .2s; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } }
.auth-card { animation: fadeUp .6s cubic-bezier(.2,.8,.2,1) both .1s; }
.hero-copy h1, .hero-copy p, .hero-copy .eyebrow { animation: fadeUp .7s cubic-bezier(.2,.8,.2,1) both .35s; }
.card.kpi { transition: transform .18s, box-shadow .18s; }
.card.kpi:hover { transform: translateY(-2px); box-shadow: 0 18px 40px -22px rgba(15,23,42,.35); }
.btn-gold { background-size: 200% 100%; background-image: linear-gradient(110deg, var(--gold-2), var(--gold) 45%, var(--gold-2) 90%); transition: background-position .5s, transform .08s; }
.btn-gold:hover { background-position: 100% 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1280px) {
  .g-kpi { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .g-kpi .kpi.hero { grid-column: span 3; }
}
@media (max-width: 1100px) {
  .g-2, .g-2e, .g-3 { grid-template-columns: 1fr; }
}
@media (max-width: 1023px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .mtop { display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 20; padding: 12px 16px; background: rgba(11,22,38,.97); backdrop-filter: blur(8px); color: #fff; }
  .mtop img { width: 40px; height: 40px; border-radius: 10px; background: #000; object-fit: cover; }
  .mtop .logo-anim { border-radius: 10px; box-shadow: 0 0 0 1px rgba(233,196,106,.4); }
  .mtop .t1 { font-family: var(--serif); font-weight: 700; font-size: 16px; line-height: 1.1; }
  .mtop .t2 { font-size: 10px; letter-spacing: 2.2px; text-transform: uppercase; color: var(--gold-2); }
  .mtop .right { margin-left: auto; display: flex; gap: 8px; }
  .mtop .icon-btn { background: transparent; border-color: rgba(255,255,255,.14); color: #e2e8f0; }
  .bnav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: #fff; border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); box-shadow: 0 -8px 24px -16px rgba(15,23,42,.25); }
  .bnav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 2px; text-decoration: none; color: var(--muted); font-size: 11px; font-weight: 600; border-radius: 12px; position: relative; }
  .bnav a.on { color: var(--ink); }
  .bnav a.on svg { color: var(--gold); }
  .bnav a .nav-badge { position: absolute; top: 2px; right: calc(50% - 22px); min-width: 18px; height: 18px; font-size: 10px; padding: 0 5px; }
  .main { padding-bottom: 84px; }
  .topbar { padding: 20px 18px 4px; flex-wrap: wrap; }
  .topbar h1 { font-size: 25px; }
  .topbar .actions { width: 100%; margin-left: 0; }
  .content { padding: 14px 16px 30px; }
  .toasts { left: 16px; right: 16px; top: auto; bottom: 92px; }
  .np { top: 68px; left: 10px; right: 10px; width: auto; max-height: calc(100vh - 160px); }
  .topbar .tb-bell { display: none; }
  .toast { max-width: none; }
}
@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
  .auth-card .m-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 30px; padding: 16px; border-radius: 18px; background: linear-gradient(135deg, #0b1626, #1b3150); color: #fff; }
  .auth-card .m-brand img { width: 64px; height: 64px; border-radius: 14px; background: #000; object-fit: cover; }
  .auth-card .m-brand .t1 { font-family: var(--serif); font-size: 19px; font-weight: 700; }
  .auth-card .m-brand .t2 { font-size: 10.5px; letter-spacing: 2.4px; color: var(--gold-2); text-transform: uppercase; margin-top: 3px; }
}
@media (max-width: 720px) {
  .g-kpi { grid-template-columns: 1fr 1fr; gap: 12px; }
  .g-kpi .kpi.hero { grid-column: span 2; }
  .kpi { padding: 14px 16px; }
  .kpi .val { font-size: 24px; }
  .grid { gap: 14px; }
  .card-h, .card-b { padding-left: 16px; padding-right: 16px; }
  .li, .entry-card, .req, .filters { padding-left: 16px; padding-right: 16px; }
  .chart-box { height: 230px; }
  .row2 { grid-template-columns: 1fr; }
  .entry-row { grid-template-columns: 30px 1fr 40px; grid-template-areas: "n p x" "n q t"; }
  .entry-row .n { grid-area: n; align-self: start; }
  .entry-row .c-p { grid-area: p; }
  .entry-row .c-q { grid-area: q; }
  .entry-row .c-t { grid-area: t; justify-self: end; }
  .entry-row .c-x { grid-area: x; align-self: start; }
  .entry-row.staff { grid-template-columns: 30px 1fr 40px; grid-template-areas: "n p x" "n q q"; }
  .welcome { flex-wrap: wrap; padding: 20px; }
  .welcome .stats { margin-left: 0; width: 100%; justify-content: space-between; }
  .req { grid-template-columns: auto 1fr; }
  .req .acts { grid-column: 1 / -1; }
  .req .acts .btn { flex: 1; }
  .device { flex-wrap: wrap; padding: 14px 16px; }
  .device .side { width: 100%; flex-direction: row; justify-content: space-between; align-items: center; }
  .dash-tabs { display: flex; }
  .dash-tabs button { flex: 1; justify-content: center; }
  .submit-bar .btn { width: 100%; }
  .day-nav { width: 100%; }
  .day-nav .input { flex: 1; width: auto; }

  /* tables become cards */
  table.t.stack thead { display: none; }
  table.t.stack, table.t.stack tbody, table.t.stack tr, table.t.stack td { display: block; width: 100%; }
  table.t.stack tr { padding: 12px 16px; border-bottom: 1px solid var(--line-2); }
  table.t.stack td { border: 0; padding: 5px 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; text-align: right; }
  table.t.stack td::before { content: attr(data-l); font-size: 11.5px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); font-weight: 600; text-align: left; }
  table.t.stack td.lead { padding-bottom: 8px; }
  table.t.stack td.lead::before { display: none; }
  table.t.stack td.lead > * { text-align: left; }
  table.t.stack .row-actions { justify-content: flex-end; }
  .stock-bar { width: 110px; }
}
@media (min-width: 721px) {
  .only-m { display: none !important; }
}
