/* ============================================================
   Talla admin modern layer: loads after styles.css.
   Same Talla colors; sidebar shell, soft cards, KPI bento, order board.
   ============================================================ */
:root {
  --shadow: 0 1px 2px rgba(28,25,23,.05), 0 10px 26px -14px rgba(28,25,23,.22);
  --shadow-lg: 0 18px 40px -18px rgba(28,25,23,.35);
  --grad: linear-gradient(135deg, #C2410C, #EA580C);
  --radius: 20px;
  --col: #F1EBE2;
}
:root[data-theme="dark"] { --shadow: 0 1px 2px rgba(0,0,0,.4), 0 12px 30px -14px rgba(0,0,0,.8); --col: #171411; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --shadow: 0 1px 2px rgba(0,0,0,.4), 0 12px 30px -14px rgba(0,0,0,.8); --col: #171411; } }

body { font-family: 'Cairo', system-ui, sans-serif; }
h1, h2, h3 { font-weight: 900; }

/* shell */
.shell { display: flex; min-height: 100vh; }
.side { width: 240px; flex-shrink: 0; background: var(--surface); border-inline-end: 0; box-shadow: 1px 0 0 var(--line); position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 18px 14px 14px; gap: 6px; overflow-y: auto; scrollbar-width: none; }
.side::-webkit-scrollbar { display: none; }
.side-brand { padding: 0 8px 10px; }
.side-brand .logo { width: 40px; height: 40px; border-radius: 13px; box-shadow: 0 8px 18px -10px #C2410C; }
.side-brand b { display: block; font-size: 18px; font-weight: 900; line-height: 1.2; }
.side-nav { flex-direction: column; padding: 0; margin: 0; gap: 2px; overflow: visible; max-width: none; }
.side-g { font-size: 11.5px; font-weight: 800; color: var(--muted); padding: 12px 10px 4px; }
.side-nav button { width: 100%; border: 0; border-radius: 12px; padding: 8px 10px; font-size: 14px; font-weight: 700; color: var(--muted); gap: 10px; text-align: start; }
.side-nav button:hover { background: var(--soft); color: var(--ink); }
.side-nav button.on { background: var(--ink); color: var(--bg); border-bottom-color: transparent; }
.side-nav button .count { margin-inline-start: auto; }
.ni { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.side-me { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 16px; background: var(--soft); }
.side-me b { display: block; font-size: 13px; font-weight: 900; }
.side-me .small { display: block; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 140px; }
.side-av { width: 36px; height: 36px; border-radius: 12px; background: var(--grad); color: #fff; display: grid; place-items: center; font-weight: 900; flex-shrink: 0; }
.shell-main { flex: 1; min-width: 0; }
.topbar { position: static; background: transparent; border-bottom: 0; }
.topbar-inner { max-width: 1320px; padding: 16px 24px 6px; }
.top-logo { display: none; }
.page-t { font-size: 24px; font-weight: 900; line-height: 1.2; }
.rate-b { font-size: 13px; padding: 8px 14px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); color: var(--ink); }
.wrap { max-width: 1320px; padding: 16px 24px 60px; }

/* surfaces */
.card, .tile, .table-wrap { border-color: transparent; box-shadow: var(--shadow); border-radius: var(--radius); }
.btn { border-radius: 13px; font-weight: 800; }
.btn:not(.primary):not(.dark):not(.danger) { border-color: transparent; box-shadow: var(--shadow); }
.btn.primary { background: var(--grad); border: 0; box-shadow: 0 10px 22px -12px #C2410C; }
.btn.dark { background: var(--ink); color: var(--bg); }
.chip { border-color: transparent; box-shadow: var(--shadow); font-weight: 700; }
.chip.on { background: var(--ink); color: var(--bg); }
.badge { font-weight: 800; }
input, select, textarea { border-radius: 13px; }
th { background: transparent; border-bottom-width: 1px; }
.tile-v { font-weight: 900; }
.bar { border-radius: 8px 8px 3px 3px; background: var(--grad); }
.toast { border-radius: 16px; font-weight: 800; box-shadow: var(--shadow-lg); }
.items { border-radius: 14px; }

/* KPI bento */
.kpis { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 14px; margin-bottom: 18px; }
.kpi { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; display: flex; flex-direction: column; gap: 2px; position: relative; overflow: hidden; min-height: 104px; }
.kpi b { font-size: 30px; font-weight: 900; line-height: 1.25; }
.kpi.hero { background: #1C1917; color: #FAF7F2; }
.kpi.hero .tile-k, .kpi.hero .tile-s { color: #A8A29E; position: relative; }
.kpi.hero b { position: relative; }
.kpi.hero svg { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 56px; }
:root[data-theme="dark"] .kpi.hero { background: var(--grad); color: #fff; }
:root[data-theme="dark"] .kpi.hero .tile-k, :root[data-theme="dark"] .kpi.hero .tile-s { color: #FFE3D3; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .kpi.hero { background: var(--grad); color: #fff; } :root:not([data-theme="light"]) .kpi.hero .tile-k, :root:not([data-theme="light"]) .kpi.hero .tile-s { color: #FFE3D3; } }

/* order board */
.kanban { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
.kcol { background: var(--col); border-radius: 24px; padding: 12px; display: flex; flex-direction: column; gap: 12px; min-height: 200px; }
.kcol h3 { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 900; padding: 4px 6px 0; }
.kcol h3 i { width: 10px; height: 10px; border-radius: 4px; }
.kc { font-size: 12px; font-weight: 800; color: var(--muted); background: var(--surface); padding: 0 9px; border-radius: 99px; }
.kempty { text-align: center; color: var(--muted); font-size: 13px; font-weight: 700; padding: 26px 0; }
.kcol .card { padding: 14px; }
.order.s-pending { border-color: transparent; box-shadow: 0 0 0 2px var(--accent), 0 14px 30px -16px #C2410C; }

/* tablet & phone: sidebar becomes a top strip */
.hamb, .side-bg, .side-x { display: none; }
@media (max-width: 960px) {
  .shell { flex-direction: column; }
  /* sidebar becomes a drawer that slides in from the right */
  .side { position: fixed; top: 0; bottom: 0; right: 0; width: 292px; max-width: 86vw; height: 100dvh; z-index: 41; transform: translateX(105%); transition: transform .28s cubic-bezier(.2,.8,.2,1); box-shadow: -20px 0 60px -20px rgba(0,0,0,.45); padding-top: 18px; }
  body.nav-open .side { transform: none; }
  body.nav-open { overflow: hidden; }
  .side-bg { display: block; position: fixed; inset: 0; z-index: 40; background: rgba(12,10,9,.5); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); opacity: 0; pointer-events: none; transition: opacity .25s; }
  body.nav-open .side-bg { opacity: 1; pointer-events: auto; }
  .side-x { display: grid; place-items: center; position: absolute; top: 14px; left: 14px; width: 40px; height: 40px; border: 0; border-radius: 12px; background: var(--soft); color: var(--ink); font-size: 18px; cursor: pointer; }
  .hamb { display: inline-flex; flex-direction: column; justify-content: center; align-items: center; gap: 5px; width: 48px; height: 48px; flex-shrink: 0; border: 0; border-radius: 15px; background: var(--surface); box-shadow: var(--shadow); cursor: pointer; padding: 0; }
  .hamb span { display: block; width: 22px; height: 2.5px; border-radius: 3px; background: var(--ink); }
  .topbar-inner { flex-wrap: wrap; justify-content: flex-start; gap: 12px; }
  .topbar-inner > .brand { flex: 1; min-width: 0; }
  .topbar-inner > .row { width: 100%; }
  .topbar { position: static; }
  .topbar-inner, .wrap { padding-left: 14px; padding-right: 14px; }
  .kpis { grid-template-columns: repeat(3, 1fr); } .kpi.hero { grid-column: 1 / -1; }
  .kanban { grid-template-columns: 1fr; }
}
@media (max-width: 560px) { .kpis { grid-template-columns: 1fr 1fr; } .kpi:last-child { display: none; } .kpi b { font-size: 24px; } }

/* login page polish */
.auth .muted { color: #44403C; }
.auth-note { color: #44403C; background: var(--soft); border-radius: 10px; padding: 8px 10px; }
.auth input { border-color: #A8A29E; }
.pw-wrap { position: relative; display: block; }
.pw-wrap input { width: 100%; padding-right: 48px !important; }
.pw-eye { position: absolute; right: 8px; left: auto; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--accent-ink); cursor: pointer; padding: 6px; line-height: 0; display: flex; align-items: center; }

/* language switch */
.lang-btn { min-width: 40px; font-weight: 800; }
[dir="ltr"] .flip-ltr { transform: scaleX(-1); }

/* sub-pages that share one sidebar entry */
.subtabs .chip.on { background: var(--ink); color: var(--bg); }
.subtabs .chip .count { margin-inline-start: 6px; }

/* Authenticator (second login step) */
.mfa-steps { margin: 0; padding-inline-start: 20px; display: grid; gap: 6px; font-size: 14px; }
.mfa-qr { align-self: center; width: 200px; height: 200px; background: #fff; border-radius: 12px; padding: 8px; }
.mfa-alt { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.mfa-secret { align-self: center; font-size: 13px; letter-spacing: .5px; word-break: break-all; text-align: center; background: var(--soft); border-radius: 8px; padding: 6px 10px; user-select: all; }
.mfa-code { font-size: 22px; letter-spacing: 6px; text-align: center; font-variant-numeric: tabular-nums; }
.au-ch { margin: 0; padding-inline-start: 18px; display: grid; gap: 2px; }
