/* ================================================================
   Khodkar Task — dashboard
   vibe: "graphite glass"  ·  base #0B0C0E · accent #E8A33D
   type: Vazirmatn (self-hosted, falls back to system Persian stack)
   ================================================================ */

@font-face {
  font-family: 'Vazirmatn';
  src: url('assets/fonts/Vazirmatn-Regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('assets/fonts/Vazirmatn-Medium.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('assets/fonts/Vazirmatn-Bold.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('assets/fonts/Vazirmatn-Black.woff2') format('woff2');
  font-weight: 900;
  font-display: swap;
}

:root {
  --bg:        #0B0C0E;
  --bg-soft:   #101216;
  --shell:     rgba(255,255,255,.045);
  --shell-2:   rgba(255,255,255,.03);
  --line:      rgba(255,255,255,.09);
  --line-soft: rgba(255,255,255,.055);
  --ink:       #ECEDEF;
  --ink-2:     #A7ABB4;
  --ink-3:     #6E737E;
  --gold:      #E8A33D;
  --gold-dim:  rgba(232,163,61,.16);
  --good:      #4ED8A0;
  --bad:       #FF6B6B;
  --warn:      #F0B429;
  --r-out:     26px;
  --r-in:      18px;
  --ease:      cubic-bezier(.32,.72,0,1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Vazirmatn', Vazirmatn, Tahoma, 'Iranian Sans', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(720px 480px at 82% -8%, rgba(232,163,61,.16), transparent 62%),
    radial-gradient(640px 520px at 8% 4%, rgba(78,216,160,.07), transparent 60%),
    radial-gradient(900px 700px at 50% 118%, rgba(255,255,255,.05), transparent 70%);
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: .035;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/></filter><rect width='140' height='140' filter='url(%23n)' opacity='.55'/></svg>");
}

.wrap { position: relative; z-index: 1; max-width: 1240px; margin: 0 auto; padding: 26px 20px 90px; }

/* ---------------------------------------------------------- shell / cards */
.plate {
  background: var(--shell-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-out);
  padding: 7px;
}
.core {
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.018));
  border: 1px solid var(--line);
  border-radius: calc(var(--r-out) - 7px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.09);
  padding: 20px 22px;
}

.card {
  background: var(--shell-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-out);
  padding: 20px 22px;
}
.card > .inner { padding: 4px 0; }

/* ------------------------------------------------------------------ header */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.brand { display: flex; align-items: center; gap: 14px; }
.mark {
  width: 44px; height: 44px;
  border-radius: 14px;
  display: grid; place-items: center;
  background: linear-gradient(145deg, rgba(232,163,61,.9), rgba(232,163,61,.35));
  color: #1A1206;
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -.02em;
  box-shadow: 0 10px 30px rgba(232,163,61,.22), inset 0 1px 0 rgba(255,255,255,.5);
}
.brand h1 { font-size: 17px; margin: 0; font-weight: 700; letter-spacing: -.01em; }
.brand .sub { color: var(--ink-3); font-size: 12.5px; margin-top: 1px; }

.pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--ink-2);
  white-space: nowrap;
}
.pill b { color: var(--ink); font-weight: 600; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 4px rgba(78,216,160,.14); }
.dot.off { background: var(--bad); box-shadow: 0 0 0 4px rgba(255,107,107,.14); }
.dot.wait { background: var(--warn); box-shadow: 0 0 0 4px rgba(240,180,41,.14); }

/* -------------------------------------------------------------------- tabs */
.tabs { display: flex; gap: 6px; padding: 5px; border-radius: 999px; background: rgba(255,255,255,.04); border: 1px solid var(--line-soft); width: max-content; max-width: 100%; overflow-x: auto; }
.tab {
  border: 0; cursor: pointer;
  background: transparent;
  color: var(--ink-2);
  font: inherit; font-size: 13.5px;
  padding: 9px 18px;
  border-radius: 999px;
  transition: transform .5s var(--ease), background .5s var(--ease), color .5s var(--ease);
  white-space: nowrap;
}
.tab:hover { color: var(--ink); background: rgba(255,255,255,.05); }
.tab[aria-selected="true"] {
  background: linear-gradient(180deg, rgba(232,163,61,.95), rgba(232,163,61,.7));
  color: #1A1206;
  font-weight: 700;
  box-shadow: 0 8px 22px rgba(232,163,61,.2);
}

/* ------------------------------------------------------------------- grid */
.bento { display: grid; gap: 16px; grid-template-columns: repeat(12, 1fr); }
.c8 { grid-column: span 8; }
.c6 { grid-column: span 6; }
.c4 { grid-column: span 4; }
.c12 { grid-column: span 12; }
@media (max-width: 900px) {
  .c8, .c6, .c4 { grid-column: span 12; }
  .wrap { padding: 18px 14px 80px; }
}

h2.sect {
  font-size: 12px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 600;
  margin: 0 0 14px;
}
h3 { font-size: 15.5px; margin: 0 0 12px; font-weight: 650; letter-spacing: -.01em; }

/* ------------------------------------------------------------------ stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
@media (max-width: 760px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat {
  background: rgba(255,255,255,.04);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-in);
  padding: 14px 15px;
  transition: transform .6s var(--ease), border-color .6s var(--ease);
}
.stat:hover { transform: translateY(-3px); border-color: rgba(255,255,255,.14); }
.stat .k { font-size: 11.5px; color: var(--ink-3); letter-spacing: .04em; }
.stat .v { font-size: 22px; font-weight: 700; margin-top: 4px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat .v small { font-size: 11.5px; font-weight: 500; color: var(--ink-3); margin-inline-start: 4px; }
.stat .v.pos { color: var(--good); }
.stat .v.neg { color: var(--bad); }

/* ------------------------------------------------------------------ tasks */
.task {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 13px 14px;
  border-radius: 15px;
  background: rgba(255,255,255,.035);
  border: 1px solid var(--line-soft);
  margin-bottom: 9px;
  transition: transform .55s var(--ease), background .55s var(--ease), border-color .55s var(--ease);
}
.task:hover { transform: translateX(-4px); background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.13); }
.task.running { border-color: rgba(232,163,61,.45); background: var(--gold-dim); }
.task .t-title { font-size: 14.5px; font-weight: 600; }
.task .t-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 5px; }
.chip {
  font-size: 11.5px;
  color: var(--ink-2);
  background: rgba(255,255,255,.06);
  border: 1px solid var(--line-soft);
  padding: 2px 9px;
  border-radius: 999px;
}
.chip.late { color: #FFB4B4; background: rgba(255,107,107,.12); border-color: rgba(255,107,107,.3); }
.chip.soon { color: #FFDFA6; background: rgba(240,180,41,.12); border-color: rgba(240,180,41,.3); }
.chip.done { color: #A9F3D4; background: rgba(78,216,160,.12); border-color: rgba(78,216,160,.3); }

.prio {
  width: 34px; height: 34px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.05);
  color: var(--ink-2);
  font: inherit; font-size: 12px; font-weight: 700;
  cursor: pointer;
  transition: transform .45s var(--ease), background .45s var(--ease), color .45s var(--ease);
}
.prio:hover { transform: scale(1.08); color: var(--ink); }
.prio[data-p="2"] { background: rgba(255,107,107,.18); border-color: rgba(255,107,107,.4); color: #FFC9C9; }
.prio[data-p="1"] { background: rgba(240,180,41,.16); border-color: rgba(240,180,41,.35); color: #FFE1A6; }
.prio[data-p="0"] { background: rgba(255,255,255,.05); }

.timer {
  border: 0; cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 650;
  padding: 9px 16px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  color: var(--ink);
  display: inline-flex; align-items: center; gap: 8px;
  transition: transform .5s var(--ease), background .5s var(--ease), box-shadow .5s var(--ease);
}
.timer:hover { transform: translateY(-2px); background: rgba(255,255,255,.13); }
.timer.on { background: linear-gradient(180deg, var(--gold), #D08C24); color: #1A1206; box-shadow: 0 10px 26px rgba(232,163,61,.28); }
.timer .tm { font-variant-numeric: tabular-nums; }

/* ----------------------------------------------------------------- timeline */
.tl { position: relative; margin-top: 4px; }
.tl-grid { position: absolute; inset: 0 0 22px 0; display: flex; pointer-events: none; }
.tl-hour { flex: 1; border-inline-start: 1px dashed rgba(255,255,255,.07); position: relative; }
.tl-hour span { position: absolute; bottom: -20px; inset-inline-start: 4px; font-size: 10.5px; color: var(--ink-3); }
.tl-rows { position: relative; display: flex; flex-direction: column; gap: 7px; min-height: 120px; }
.tl-row { position: relative; height: 34px; }
.tl-block {
  position: absolute; top: 0; height: 34px;
  border-radius: 11px;
  background: linear-gradient(180deg, rgba(232,163,61,.85), rgba(232,163,61,.55));
  color: #1A1206;
  font-size: 12.5px; font-weight: 700;
  display: flex; align-items: center;
  padding: 0 11px;
  overflow: hidden; white-space: nowrap;
  box-shadow: 0 8px 22px rgba(232,163,61,.16);
  animation: drop .7s var(--ease) both;
}
.tl-block.alt { background: linear-gradient(180deg, rgba(78,216,160,.8), rgba(78,216,160,.5)); box-shadow: 0 8px 22px rgba(78,216,160,.14); }
.tl-block.now { outline: 1.5px solid rgba(255,255,255,.55); outline-offset: -1.5px; }
@keyframes drop { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.tl-now-line { position: absolute; top: -4px; bottom: 22px; width: 2px; background: linear-gradient(180deg, transparent, #fff, transparent); opacity: .75; }

/* ----------------------------------------------------------------- tables */
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th, table.data td { padding: 9px 8px; text-align: start; }
table.data th { color: var(--ink-3); font-weight: 600; font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; }
table.data tr + tr td { border-top: 1px solid var(--line-soft); }
table.data td.num { font-variant-numeric: tabular-nums; }
tr.st-late td { color: #FFC9C9; }
tr.st-wait td { color: var(--ink-3); }

/* ------------------------------------------------------------------ money */
.money-line { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line-soft); font-size: 13.5px; }
.money-line .lbl { color: var(--ink-2); }
.money-line .val { font-variant-numeric: tabular-nums; font-weight: 700; }
.money-line .val.pen { color: var(--bad); }
.money-line .val.rew { color: var(--good); }
.net {
  margin-top: 14px; padding: 16px;
  border-radius: var(--r-in);
  background: rgba(255,255,255,.05);
  border: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
}
.net .big { font-size: 27px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.net .big.pos { color: var(--good); }
.net .big.neg { color: var(--bad); }

/* ---------------------------------------------------------------- buttons */
.btn {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.06);
  color: var(--ink);
  font: inherit; font-size: 13.5px; font-weight: 600;
  padding: 11px 20px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 9px;
  transition: transform .5s var(--ease), background .5s var(--ease), border-color .5s var(--ease);
}
.btn:hover { transform: translateY(-2px); background: rgba(255,255,255,.11); }
.btn:active { transform: translateY(0) scale(.985); }
.btn.primary {
  background: linear-gradient(180deg, var(--gold), #D08C24);
  border-color: transparent;
  color: #1A1206;
  box-shadow: 0 12px 28px rgba(232,163,61,.24);
}
.btn.primary:hover { box-shadow: 0 16px 34px rgba(232,163,61,.32); }
.btn .ico {
  width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255,255,255,.14);
  font-size: 13px;
  transition: transform .5s var(--ease);
}
.btn.primary .ico { background: rgba(0,0,0,.16); color: #1A1206; }
.btn:hover .ico { transform: translate(-2px, -2px) scale(1.06); }
.btn.ghost { background: transparent; }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none !important; }

.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---------------------------------------------------------------- inputs */
.inp {
  width: 100%;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  font: inherit; font-size: 14px;
  padding: 12px 15px;
  transition: border-color .5s var(--ease), background .5s var(--ease);
}
.inp:focus { outline: none; border-color: rgba(232,163,61,.55); background: rgba(255,255,255,.07); }
.inp::placeholder { color: var(--ink-3); }

/* ------------------------------------------------------------------ lists */
.item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 4px;
  font-size: 14px;
  border-top: 1px solid var(--line-soft);
}
.item .n { color: var(--ink-3); font-size: 12px; min-width: 18px; font-variant-numeric: tabular-nums; }
.item .x { margin-inline-start: auto; background: none; border: 0; color: var(--ink-3); cursor: pointer; font-size: 15px; padding: 4px 8px; border-radius: 8px; transition: color .4s var(--ease), background .4s var(--ease); }
.item .x:hover { color: var(--bad); background: rgba(255,107,107,.1); }

.muted { color: var(--ink-3); font-size: 12.5px; }
.ok { color: var(--good); }
.err { color: var(--bad); }

/* ------------------------------------------------------------------ login */
.login {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login .box { width: min(420px, 100%); }
.login h1 { font-size: 26px; margin: 0 0 6px; letter-spacing: -.02em; }
.login p { color: var(--ink-2); margin: 0 0 22px; font-size: 13.5px; }

/* ----------------------------------------------------------------- reveal */
.rise { animation: rise .8s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
.rise-2 { animation-delay: .08s; }
.rise-3 { animation-delay: .16s; }
.rise-4 { animation-delay: .24s; }

/* --------------------------------------------------------------- skeleton */
.sk { height: 14px; border-radius: 8px; background: linear-gradient(90deg, rgba(255,255,255,.05), rgba(255,255,255,.11), rgba(255,255,255,.05)); background-size: 200% 100%; animation: sk 1.4s var(--ease) infinite; }
@keyframes sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ----------------------------------------------------------------- toast */
#toast {
  position: fixed;
  bottom: 22px;
  inset-inline-start: 50%;
  transform: translate(50%, 140%);
  z-index: 70;
  background: rgba(20,22,26,.94);
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 13.5px;
  backdrop-filter: blur(14px);
  transition: transform .7s var(--ease);
  max-width: 90vw;
}
#toast.show { transform: translate(50%, 0); }

.hidden { display: none !important; }
