/* =============================================================
   KASDAP ONE — ADMIN + DASHBOARD
============================================================= */

/* KPI stat cards */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 22px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r18); padding: 18px; position: relative; overflow: hidden; transition: all .2s; }
.kpi:hover { border-color: var(--line-2); transform: translateY(-2px); }
.kpi::after { content: ''; position: absolute; top: -30px; right: -30px; width: 96px; height: 96px; border-radius: 50%; opacity: .08; }
.kpi.c1::after { background: var(--emerald); } .kpi.c2::after { background: var(--indigo); } .kpi.c3::after { background: var(--amber); } .kpi.c4::after { background: var(--sky); } .kpi.c5::after { background: var(--rose); } .kpi.c6::after { background: var(--coral); }
.kpi .ki { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.kpi.c1 .ki { background: var(--emerald-soft); color: var(--emerald); } .kpi.c2 .ki { background: var(--indigo-soft); color: var(--indigo); }
.kpi.c3 .ki { background: var(--amber-soft); color: var(--amber); } .kpi.c4 .ki { background: var(--sky-soft); color: var(--sky); }
.kpi.c5 .ki { background: var(--rose-soft); color: var(--rose); } .kpi.c6 .ki { background: rgba(255,122,69,.13); color: var(--coral); }
.kpi .kv { font-family: var(--ff-mono); font-size: 1.55rem; font-weight: 700; line-height: 1; letter-spacing: -.02em; }
.kpi .kl { font-size: .72rem; color: var(--text-2); margin-top: 6px; }
.kpi .kc { font-family: var(--ff-mono); font-size: .66rem; margin-top: 7px; display: inline-flex; align-items: center; gap: 4px; }
.kpi .kc.up { color: var(--emerald); } .kpi .kc.dn { color: var(--rose); }

.dash-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; }
@media (max-width: 900px) { .dash-grid { grid-template-columns: 1fr; } }

/* bar chart */
.bars { display: flex; align-items: flex-end; gap: 8px; height: 160px; padding-top: 10px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.bar { width: 100%; border-radius: 6px 6px 0 0; position: relative; transition: height .6s cubic-bezier(.4,1.3,.5,1); min-height: 4px; cursor: pointer; }
.bar .b-d2c { background: linear-gradient(180deg, var(--emerald), rgba(0,184,107,.25)); border-radius: 6px 6px 0 0; }
.bar .b-b2b { background: linear-gradient(180deg, var(--indigo), rgba(94,91,255,.3)); }
.bar-stack { width: 100%; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; }
.bar-lbl { font-family: var(--ff-mono); font-size: .58rem; color: var(--text-3); }
.legend { display: flex; gap: 16px; margin-top: 6px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; font-size: .72rem; color: var(--text-2); }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* split donut-ish */
.split-bar { height: 12px; border-radius: 99px; overflow: hidden; display: flex; margin: 14px 0 10px; }
.split-bar i { display: block; height: 100%; }

/* rank list */
.rank { display: flex; flex-direction: column; gap: 11px; }
.rank-row { display: flex; align-items: center; gap: 11px; }
.rank-n { font-family: var(--ff-mono); font-size: .68rem; color: var(--text-3); width: 16px; }
.rank-nm { font-size: .78rem; flex-shrink: 0; width: 120px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-bar { flex: 1; height: 6px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.rank-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.rank-v { font-family: var(--ff-mono); font-size: .66rem; color: var(--text-2); }

/* data table */
.dtable-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r18); overflow: hidden; }
.dtable-tools { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.dtable-search { flex: 1; min-width: 180px; display: flex; align-items: center; gap: 8px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r10); padding: 0 12px; }
.dtable-search input { flex: 1; background: none; border: none; outline: none; padding: 9px 0; font-size: .82rem; }
.dtable-search svg { color: var(--text-3); }
.dtable { width: 100%; border-collapse: collapse; }
.dtable th { text-align: left; font-family: var(--ff-mono); font-size: .58rem; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); padding: 11px 14px; background: var(--surface-2); position: sticky; top: 0; }
.dtable td { padding: 11px 14px; font-size: .8rem; border-top: 1px solid var(--line); vertical-align: middle; }
.dtable tr:hover td { background: var(--surface-2); }
.dtable .tnm { font-weight: 700; } .dtable .tsalt { font-size: .68rem; color: var(--text-3); font-style: italic; }
.dtable .tsku { font-family: var(--ff-mono); font-size: .72rem; color: var(--text-2); }
.editp { font-family: var(--ff-mono); font-size: .8rem; font-weight: 600; cursor: pointer; padding: 3px 8px; border-radius: 6px; transition: background .15s; display: inline-flex; align-items: center; gap: 5px; }
.editp:hover { background: var(--accent-soft); color: var(--accent); }
.ov-flag { font-family: var(--ff-mono); font-size: .54rem; padding: 1px 5px; border-radius: 4px; background: var(--amber-soft); color: var(--amber); margin-left: 6px; }
.dtable-foot { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-top: 1px solid var(--line); font-size: .76rem; color: var(--text-3); }
.pager { display: flex; gap: 6px; }
.pager button { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); font-size: .76rem; font-family: var(--ff-mono); color: var(--text-2); }
.pager button.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.pager button:disabled { opacity: .3; }

/* admin tabs */
.atabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 22px; overflow-x: auto; }
.atabs button { padding: 11px 16px; font-size: .84rem; font-weight: 600; color: var(--text-2); border-bottom: 2px solid transparent; white-space: nowrap; display: inline-flex; align-items: center; gap: 7px; }
.atabs button.on { color: var(--accent); border-bottom-color: var(--accent); }

/* upload zone */
.upzone { border: 2px dashed var(--line-2); border-radius: var(--r18); padding: 40px 24px; text-align: center; cursor: pointer; transition: all .2s; }
.upzone:hover { border-color: var(--accent); background: var(--accent-soft); }
.upzone .ui { width: 56px; height: 56px; border-radius: 16px; background: var(--surface-2); display: flex; align-items: center; justify-content: center; margin: 0 auto 14px; color: var(--accent); }
.imp-row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r10); margin-bottom: 7px; }
.imp-row .id { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.prog { height: 7px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.prog i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 99px; transition: width .3s; }

/* settings rows */
.setrow { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.setrow:last-child { border-bottom: none; }
.setrow .sk { font-weight: 600; font-size: .86rem; } .setrow .sd { font-size: .74rem; color: var(--text-3); margin-top: 2px; }
.setrow input { width: 100px; text-align: right; }

/* appearance / colour control */
.app-swatch { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r14); padding: 16px; }
.aps-head { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; }
.aps-dot { width: 18px; height: 18px; border-radius: 6px; box-shadow: var(--shadow-1); }
.aps-row { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.aps-k { font-size: .76rem; color: var(--text-2); flex: 1; }
.aps-color { width: 40px; height: 32px; padding: 0; border: 1px solid var(--line-2); border-radius: 8px; background: none; cursor: pointer; }
.aps-color::-webkit-color-swatch-wrapper { padding: 3px; }
.aps-color::-webkit-color-swatch { border: none; border-radius: 5px; }
.preset-chip { display: inline-flex; align-items: center; gap: 4px; padding: 7px 13px 7px 10px; border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--surface); font-size: .76rem; font-weight: 600; color: var(--text-2); transition: all .15s; }
.preset-chip:hover { border-color: var(--accent); color: var(--text); }
.preset-dot { width: 15px; height: 15px; border-radius: 50%; border: 2px solid var(--surface); }
@media (max-width: 600px) { .app-swatch { padding: 13px; } }

@media (max-width: 720px) {
  .dtable th:nth-child(2), .dtable td:nth-child(2) { display: none; }
  .dtable th:nth-child(5), .dtable td:nth-child(5) { display: none; }
}

/* ============================================================
   ADMIN CONSOLE SHELL (separate app)
============================================================ */
.adm { display: grid; grid-template-columns: 244px 1fr; min-height: 100vh; }
.adm-scrim { display: none; }
.adm-side { background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.adm-brand { display: flex; align-items: center; gap: 11px; padding: 20px 18px; border-bottom: 1px solid var(--line); }
.adm-brand .brand-mark { width: 38px; height: 38px; }
.adm-brand .bt { line-height: 1; }
.adm-brand .bn { font-family: var(--ff-display); font-size: 1.04rem; font-weight: 800; letter-spacing: -.03em; white-space: nowrap; }
.adm-brand .bn b { color: var(--accent); }
.adm-brand .bs { font-family: var(--ff-mono); font-size: .54rem; letter-spacing: .2em; text-transform: uppercase; color: var(--text-3); margin-top: 3px; }
.adm-nav { flex: 1; padding: 14px 12px; display: flex; flex-direction: column; gap: 3px; overflow-y: auto; }
.adm-navi { display: flex; align-items: center; gap: 11px; padding: 11px 13px; border-radius: var(--r10); font-size: .86rem; font-weight: 600; color: var(--text-2); transition: all .15s; cursor: pointer; }
.adm-navi:hover { background: var(--surface-2); color: var(--text); }
.adm-navi.on { background: var(--accent-soft); color: var(--accent); }
.adm-navi svg { width: 18px; height: 18px; flex-shrink: 0; }
.adm-navi .nbadge { margin-left: auto; font-family: var(--ff-mono); font-size: .62rem; background: var(--surface-3); color: var(--text-2); padding: 1px 7px; border-radius: 99px; }
.adm-navi.on .nbadge { background: rgba(var(--accent-rgb),.18); color: var(--accent); }
.adm-side-foot { padding: 14px 12px; border-top: 1px solid var(--line); }
.adm-user { display: flex; align-items: center; gap: 10px; padding: 8px 6px; }
.adm-user .av { width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--on-accent); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: .8rem; flex-shrink: 0; }
.adm-user .un { font-size: .8rem; font-weight: 700; line-height: 1.2; }
.adm-user .ue { font-size: .66rem; color: var(--text-3); }

.adm-main { display: flex; flex-direction: column; min-width: 0; }
.adm-topbar { display: flex; align-items: center; gap: 12px; padding: 0 24px; height: 60px; border-bottom: 1px solid var(--line); background: var(--glass); backdrop-filter: blur(20px); position: sticky; top: 0; z-index: 50; }
.adm-topbar .secure-chip { display: inline-flex; align-items: center; gap: 7px; font-size: .72rem; color: var(--emerald); font-weight: 600; }
.adm-content { padding: 26px 24px 60px; max-width: 1320px; width: 100%; }
.adm-head { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.adm-head h1 { font-size: 1.7rem; letter-spacing: -.03em; }
.adm-head .muted { margin-top: 4px; font-size: .84rem; }

.tabcnt { font-family: var(--ff-mono); font-size: .6rem; background: var(--surface-3); color: var(--text-2); padding: 1px 7px; border-radius: 99px; margin-left: 7px; }
.atabs button.on .tabcnt { background: rgba(var(--accent-rgb),.18); color: var(--accent); }

.stock-in { width: 56px; text-align: center; background: var(--surface-2); border: 1px solid var(--line); border-radius: 7px; padding: 5px 4px; font-family: var(--ff-mono); font-size: .76rem; font-weight: 600; color: var(--text); outline: none; }
.stock-in:focus { border-color: var(--accent); }

/* import modes */
.imp-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 4px; }
.imp-mode { display: flex; align-items: flex-start; gap: 11px; padding: 15px; border-radius: var(--r14); border: 1.5px solid var(--line); background: var(--surface); text-align: left; transition: all .15s; }
.imp-mode:hover { border-color: var(--line-2); }
.imp-mode.on { border-color: var(--accent); background: var(--accent-soft); }
.imp-mode svg { flex-shrink: 0; margin-top: 1px; color: var(--text-2); }
.imp-mode.on svg { color: var(--accent); }
.imp-mode .im-t { font-weight: 700; font-size: .88rem; }
.imp-mode .im-d { font-size: .72rem; color: var(--text-3); margin-top: 2px; line-height: 1.4; }
.warn-banner { display: flex; gap: 10px; align-items: flex-start; padding: 13px 15px; border-radius: var(--r12); background: var(--amber-soft); border: 1px solid rgba(245,166,35,.3); color: var(--text); font-size: .8rem; line-height: 1.5; margin-top: 14px; }
.warn-banner svg { color: var(--amber); flex-shrink: 0; margin-top: 1px; }

/* ---- OTP login screen ---- */
.otp-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; position: relative; }
.otp-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r24); box-shadow: var(--shadow-3); padding: 36px 32px; }
.otp-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.otp-logo .brand-mark { width: 44px; height: 44px; }
.otp-logo .bn { font-family: var(--ff-display); font-size: 1.25rem; font-weight: 800; letter-spacing: -.03em; white-space: nowrap; }
.otp-logo .bn b { color: var(--accent); }
.otp-logo .bs { font-family: var(--ff-mono); font-size: .56rem; letter-spacing: .18em; text-transform: uppercase; color: var(--text-3); margin-top: 3px; }
.otp-card h2 { font-size: 1.5rem; }
.otp-card .sub { color: var(--text-2); font-size: .86rem; margin: 6px 0 24px; line-height: 1.5; }
.otp-inputs { display: flex; gap: 9px; justify-content: space-between; margin: 6px 0 8px; }
.otp-digit { width: 100%; aspect-ratio: 1; text-align: center; font-family: var(--ff-mono); font-size: 1.4rem; font-weight: 700; background: var(--surface-2); border: 1.5px solid var(--line-2); border-radius: var(--r12); color: var(--text); outline: none; transition: all .15s; }
.otp-digit:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(var(--accent-rgb),.14); }
.otp-demo { margin-top: 18px; padding: 13px 15px; border-radius: var(--r12); background: var(--sky-soft); border: 1px solid rgba(79,155,247,.3); font-size: .76rem; line-height: 1.55; color: var(--text); }
.otp-demo b { font-family: var(--ff-mono); font-size: 1.05rem; letter-spacing: .12em; color: var(--sky); }
.otp-resend { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; font-size: .76rem; color: var(--text-3); }
.otp-resend button { color: var(--accent); font-weight: 600; }
.otp-back { position: absolute; top: 22px; left: 22px; display: inline-flex; align-items: center; gap: 7px; font-size: .8rem; font-weight: 600; color: var(--text-2); }
.otp-back:hover { color: var(--accent); }

/* mobile admin */
.adm-burger { display: none; }
@media (max-width: 900px) {
  .adm { grid-template-columns: 1fr; }
  .adm-side { position: fixed; left: 0; top: 0; bottom: 0; width: 248px; z-index: 200; transform: translateX(-100%); transition: transform .3s cubic-bezier(.32,.72,0,1); }
  .adm.open .adm-side { transform: none; box-shadow: var(--shadow-3); }
  .adm-burger { display: inline-flex; }
  .adm-scrim { display: none; }
  .adm.open .adm-scrim { display: block; position: fixed; inset: 0; background: rgba(4,7,14,.6); z-index: 150; }
}
@media (max-width: 600px) {
  .adm-content { padding: 18px 14px 50px; }
  .adm-head h1 { font-size: 1.4rem; }
  .imp-modes { grid-template-columns: 1fr; }
  .otp-card { padding: 28px 20px; }
}
