/* =====================================================================
   Hounam Food · Executive Office — design system
   Themes: "midnight" (default, dark glass) and "ivory" (light).
   ===================================================================== */
@font-face {
  font-family: "Vazirmatn";
  src: url("../fonts/Vazirmatn.woff2") format("woff2-variations"), url("../fonts/Vazirmatn.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root, [data-theme="midnight"] {
  color-scheme: dark;
  --bg: #060a13;
  --bg-2: #0a1120;
  --glass: rgba(18, 26, 44, .55);
  --glass-2: rgba(26, 36, 60, .55);
  --glass-strong: rgba(14, 21, 38, .88);
  --solid: #0e1627;
  --line: rgba(255, 255, 255, .075);
  --line-2: rgba(255, 255, 255, .14);
  --text: #dfe5f1;
  --heading: #ffffff;
  --muted: #93a0b9;
  --faint: #616e88;
  --gold: #d6b06a;
  --gold-2: #f3dca6;
  --gold-3: #a8803d;
  --gold-ink: #f3dca6;
  --gold-soft: rgba(214, 176, 106, .12);
  --violet: #8c7cff;
  --cyan: #4fd1e8;
  --btn-bg: linear-gradient(135deg, #f3dca6 0%, #d6b06a 45%, #a8803d 100%);
  --btn-fg: #1a1408;
  --btn2-bg: rgba(255, 255, 255, .06);
  --btn2-fg: #e9edf6;
  --input-bg: rgba(255, 255, 255, .04);
  --sidebar-bg: rgba(10, 16, 30, .72);
  --shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 20px 50px -20px rgba(0, 0, 0, .6);
  --shadow-lg: 0 30px 80px -20px rgba(0, 0, 0, .75);
  --ring: 0 0 0 3px rgba(214, 176, 106, .22);
  --c-new: #7aa2ff;      --c-new-bg: rgba(122, 162, 255, .13);
  --c-prog: #4fd1e8;     --c-prog-bg: rgba(79, 209, 232, .12);
  --c-review: #ffb547;   --c-review-bg: rgba(255, 181, 71, .13);
  --c-ret: #ff7a90;      --c-ret-bg: rgba(255, 122, 144, .13);
  --c-done: #3ddc97;     --c-done-bg: rgba(61, 220, 151, .12);
  --c-cancel: #8a94a8;   --c-cancel-bg: rgba(138, 148, 168, .12);
  --c-danger: #ff6b7d;
}

[data-theme="ivory"] {
  color-scheme: light;
  --bg: #f4f1ea;
  --bg-2: #ece7dc;
  --glass: rgba(255, 255, 255, .72);
  --glass-2: rgba(255, 255, 255, .85);
  --glass-strong: rgba(255, 255, 255, .95);
  --solid: #ffffff;
  --line: rgba(20, 30, 50, .08);
  --line-2: rgba(20, 30, 50, .16);
  --text: #1d2433;
  --heading: #0c1526;
  --muted: #5f6a80;
  --faint: #939cb0;
  --gold: #b08a44;
  --gold-2: #d4b67a;
  --gold-3: #8a6a2e;
  --gold-ink: #8a6a2e;
  --gold-soft: rgba(176, 138, 68, .12);
  --btn-bg: linear-gradient(135deg, #1b2a48 0%, #0c1526 100%);
  --btn-fg: #fff;
  --btn2-bg: rgba(255, 255, 255, .9);
  --btn2-fg: #1d2433;
  --input-bg: #fff;
  --sidebar-bg: rgba(12, 21, 38, .96);
  --shadow: 0 1px 2px rgba(14, 26, 43, .04), 0 12px 32px -12px rgba(14, 26, 43, .14);
  --shadow-lg: 0 24px 60px -16px rgba(14, 26, 43, .25);
  --ring: 0 0 0 3px rgba(176, 138, 68, .18);
  --c-new: #2f5fb3;      --c-new-bg: #e8eefb;
  --c-prog: #13807a;     --c-prog-bg: #e0f3f1;
  --c-review: #a86a12;   --c-review-bg: #fbefd9;
  --c-ret: #b0482a;      --c-ret-bg: #fbe6de;
  --c-done: #2d7a4c;     --c-done-bg: #e1f3e8;
  --c-cancel: #6b7385;   --c-cancel-bg: #eceef2;
  --c-danger: #b42f2f;
}

* { box-sizing: border-box; }
html { font-size: 15px; scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100vh;
  font-family: "Vazirmatn", Tahoma, sans-serif;
  background: var(--bg); color: var(--text);
  line-height: 1.75; -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
::selection { background: rgba(214, 176, 106, .35); color: var(--heading); }
a { color: var(--gold-ink); text-decoration: none; transition: color .2s; }
a:hover { color: var(--gold); }
h1, h2, h3, h4 { margin: 0; font-weight: 700; line-height: 1.5; color: var(--heading); }
p { margin: 0 0 .6rem; }
.justify { text-align: justify; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: .86rem; }
.nowrap { white-space: nowrap; }
.ltr { direction: ltr; unicode-bidi: embed; }
.center { text-align: center; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.2rem 0; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(140, 150, 170, .25); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }

/* ---------------------------------------------------------------- living background */
#bg-canvas { position: fixed; inset: 0; z-index: -2; width: 100vw; height: 100vh; pointer-events: none; display: block; }
.bg-grid { position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(rgba(255,255,255,.08) 1px, transparent 1px); background-size: 26px 26px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 25%, #000 15%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 25%, #000 15%, transparent 75%); }
[data-theme="ivory"] .bg-grid { background-image: radial-gradient(rgba(12,21,38,.08) 1px, transparent 1px); }

/* ---------------------------------------------------------------- shell */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 272px; flex: none; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; color: #cdd5e4;
  background: var(--sidebar-bg);
  backdrop-filter: blur(22px) saturate(140%); -webkit-backdrop-filter: blur(22px) saturate(140%);
  border-left: 1px solid rgba(255,255,255,.06); z-index: 30;
}
.brand { padding: 1.5rem 1.4rem 1.2rem; text-align: center; position: relative; }
.brand::after { content: ""; position: absolute; bottom: 0; left: 1.4rem; right: 1.4rem; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(214,176,106,.4), transparent); }
.brand-mark {
  width: 54px; height: 54px; margin: 0 auto .7rem; border-radius: 16px; position: relative;
  display: grid; place-items: center;
  background: linear-gradient(145deg, #f6e2b3, #c99d55 55%, #8f6a2f);
  color: #17120a; font-family: Georgia, "Times New Roman", serif; font-weight: 700; font-size: 1.15rem; letter-spacing: 1px;
  box-shadow: 0 10px 30px -6px rgba(214, 176, 106, .55), inset 0 1px 0 rgba(255,255,255,.5);
}
.brand-mark::after { content: ""; position: absolute; inset: -6px; border-radius: 20px; border: 1px solid rgba(214,176,106,.25); }
.brand-title { color: #fff; font-weight: 800; font-size: 1.05rem; }
.brand-sub { color: #f3dca6; font-size: .78rem; margin-top: .1rem; }

.nav { padding: 1rem .85rem; flex: 1; overflow-y: auto; }
.nav-label { color: #6c7892; font-size: .72rem; padding: .9rem .8rem .35rem; letter-spacing: .3px; }
.nav a {
  display: flex; align-items: center; gap: .75rem; position: relative;
  color: #c3cbdb; padding: .62rem .9rem; border-radius: 12px; margin-bottom: 3px;
  font-size: .94rem; transition: background .2s, color .2s;
}
.nav a svg { width: 19px; height: 19px; flex: none; opacity: .75; transition: transform .25s, opacity .2s; }
.nav a:hover { background: rgba(255,255,255,.05); color: #fff; }
.nav a:hover svg { transform: translateX(-3px); opacity: 1; }
.nav a.active { color: #fff; background: linear-gradient(90deg, rgba(214,176,106,.04), rgba(214,176,106,.16)); box-shadow: inset 0 0 0 1px rgba(214,176,106,.18); }
.nav a.active svg { color: #f3dca6; opacity: 1; }
.nav a.active::before { content: ""; position: absolute; right: -0.85rem; top: 22%; bottom: 22%; width: 3px; border-radius: 3px 0 0 3px;
  background: linear-gradient(#f3dca6, #d6b06a); box-shadow: 0 0 14px #d6b06a; }
.nav .badge { margin-inline-start: auto; }

.sidebar-foot { padding: 1rem 1.1rem 1.2rem; border-top: 1px solid rgba(255,255,255,.06); font-size: .84rem; }
.who { display: flex; align-items: center; gap: .7rem; }
.avatar { width: 40px; height: 40px; border-radius: 12px; flex: none; display: grid; place-items: center; font-weight: 800;
  background: linear-gradient(145deg, #23345a, #121c33); color: #f3dca6; border: 1px solid rgba(214,176,106,.3); }
.who-name { color: #fff; font-weight: 700; }
.who-role { color: #8792a8; font-size: .76rem; }
.foot-links { display: flex; gap: .45rem; margin-top: .85rem; }
.foot-links a, .foot-links button {
  flex: 1; text-align: center; font: inherit; font-size: .78rem; cursor: pointer; display: grid; place-items: center;
  color: #b9c2d3; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.07);
  border-radius: 10px; padding: .4rem .3rem; transition: all .2s;
}
.foot-links a:hover, .foot-links button:hover { color: #fff; background: rgba(255,255,255,.09); border-color: rgba(214,176,106,.3); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: .9rem;
  padding: .8rem 2rem; position: sticky; top: 0; z-index: 25;
  background: color-mix(in srgb, var(--bg) 68%, transparent);
  backdrop-filter: blur(18px) saturate(150%); -webkit-backdrop-filter: blur(18px) saturate(150%);
  border-bottom: 1px solid var(--line);
}
.menu-btn { display: none; background: none; border: 0; padding: .3rem; cursor: pointer; color: var(--heading); }
.menu-btn svg { width: 24px; height: 24px; display: block; }
.search { flex: 1; max-width: 540px; position: relative; }
.topbar .search input {
  width: 100%; -webkit-appearance: none; appearance: none;
  border: 1px solid var(--line-2); background: var(--input-bg); color: var(--text);
  border-radius: 14px; padding: .6rem 2.8rem .6rem 4.6rem; font: inherit; font-size: .92rem; transition: all .2s;
}
.topbar .search input::placeholder { color: var(--faint); }
.topbar .search input:focus { outline: none; border-color: var(--gold); box-shadow: var(--ring); }
.search > svg { position: absolute; right: 1rem; top: 50%; transform: translateY(-50%); width: 17px; color: var(--faint); }
.kbd { font-family: inherit; font-size: .7rem; color: var(--muted); border: 1px solid var(--line-2); border-bottom-width: 2px;
  border-radius: 6px; padding: 0 .45rem; position: absolute; left: .7rem; top: 50%; transform: translateY(-50%); background: var(--btn2-bg); white-space: nowrap; direction: ltr; }
.top-actions { margin-inline-start: auto; display: flex; align-items: center; gap: .5rem; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--btn2-bg); color: var(--text);
  display: grid; place-items: center; cursor: pointer; transition: all .2s; }
.icon-btn:hover { border-color: var(--gold); color: var(--gold); transform: rotate(-12deg); }
.icon-btn svg { width: 18px; height: 18px; }
.today { color: var(--muted); font-size: .86rem; white-space: nowrap; padding: 0 .4rem; }
.today b { color: var(--heading); font-weight: 600; }

.content { padding: 2rem 2.2rem 7rem; max-width: 1360px; width: 100%; margin: 0 auto; }

/* ---------------------------------------------------------------- page header */
.page-head { text-align: center; margin: .4rem 0 2rem; position: relative; isolation: isolate; }
.page-head .eyebrow { display: inline-flex; align-items: center; gap: .45rem; font-size: .78rem; font-weight: 700; letter-spacing: .4px;
  padding: .24rem .85rem; border-radius: 999px; border: 1px solid rgba(214,176,106,.3); background: var(--gold-soft); color: var(--gold-ink); }
.page-head .eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 10px var(--gold); animation: pulse 2s infinite; }
.page-head h1 { font-size: clamp(1.6rem, 2.6vw, 2.35rem); font-weight: 900; margin-top: .6rem; letter-spacing: -.3px; }
.page-head .lead { color: var(--muted); margin: .45rem auto 0; max-width: 740px; text-align: center; }
.page-head .ornament { width: 90px; height: 2px; margin: 1rem auto 0; border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent); }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; margin-top: 1.25rem; }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem; position: relative; overflow: hidden;
  font: inherit; font-size: .92rem; font-weight: 700; cursor: pointer; white-space: nowrap;
  padding: .62rem 1.2rem; border-radius: 12px; border: 1px solid transparent;
  transition: transform .15s, box-shadow .25s, background .2s, border-color .2s, color .2s;
}
.btn svg { width: 17px; height: 17px; }
.btn:active { transform: translateY(1px) scale(.99); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn-primary { background: var(--btn-bg); color: var(--btn-fg); box-shadow: 0 8px 24px -8px rgba(214, 176, 106, .55); }
[data-theme="ivory"] .btn-primary { box-shadow: 0 8px 24px -10px rgba(12, 21, 38, .55); }
.btn-primary:hover { color: var(--btn-fg); box-shadow: 0 14px 34px -8px rgba(214, 176, 106, .75); }
.btn-gold { background: linear-gradient(135deg, #f3dca6, #d6b06a 50%, #a8803d); color: #1a1408; box-shadow: 0 8px 24px -8px rgba(214, 176, 106, .55); }
.btn-gold:hover { color: #1a1408; box-shadow: 0 14px 34px -8px rgba(214, 176, 106, .8); }
.btn-primary::after, .btn-gold::after, .btn-success::after { content: ""; position: absolute; inset: 0; transform: translateX(120%);
  background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.45) 50%, transparent 70%); transition: transform .8s; }
.btn-primary:hover::after, .btn-gold:hover::after, .btn-success:hover::after { transform: translateX(-120%); }
.btn-success { background: linear-gradient(135deg, #5be3a8, #22a86d); color: #04160d; box-shadow: 0 8px 24px -8px rgba(61, 220, 151, .5); }
.btn-success:hover { color: #04160d; }
.btn-warn { background: var(--c-ret-bg); color: var(--c-ret); border-color: color-mix(in srgb, var(--c-ret) 35%, transparent); }
.btn-ghost { background: var(--btn2-bg); color: var(--btn2-fg); border-color: var(--line-2); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold-ink); }
.btn-danger { background: transparent; color: var(--c-danger); border-color: color-mix(in srgb, var(--c-danger) 40%, transparent); }
.btn-danger:hover { background: color-mix(in srgb, var(--c-danger) 12%, transparent); color: var(--c-danger); }
.btn-sm { padding: .38rem .85rem; font-size: .82rem; border-radius: 10px; }
.btn-block { width: 100%; }

/* ---------------------------------------------------------------- glass cards */
.card {
  position: relative; border-radius: 20px;
  background: var(--glass);
  backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid var(--line); box-shadow: var(--shadow);
}
.card::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; padding: 1px;
  background: linear-gradient(160deg, rgba(255,255,255,.16), transparent 35%, transparent 70%, rgba(214,176,106,.2));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
[data-theme="ivory"] .card::before { background: linear-gradient(160deg, rgba(255,255,255,.9), transparent 40%, transparent 70%, rgba(176,138,68,.22)); }
.card-head { padding: 1rem 1.35rem; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: .6rem; }
.card-head h2, .card-head h3 { font-size: 1rem; flex: 1; text-align: center; font-weight: 800; }
.card-head .count { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 7px; margin-inline-start: .35rem;
  border-radius: 8px; font-size: .78rem; background: var(--gold-soft); color: var(--gold-ink); vertical-align: 2px; }
.card-body { padding: 1.25rem 1.35rem; }
.card-body.flush { padding: 0; }
.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; }
.stack > * + * { margin-top: 1.25rem; }

/* ---------------------------------------------------------------- KPI tiles */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 1rem; margin-bottom: 1.6rem; }
.kpi {
  position: relative; overflow: hidden; display: block; color: inherit; text-align: center;
  padding: 1.2rem 1rem 1.1rem; border-radius: 20px;
  background: var(--glass); border: 1px solid var(--line); box-shadow: var(--shadow);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  transition: transform .3s cubic-bezier(.2,.7,.2,1), box-shadow .3s, border-color .3s;
}
a.kpi:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--accent, var(--gold)) 45%, transparent); color: inherit; }
.kpi::before { content: ""; position: absolute; width: 150px; height: 150px; border-radius: 50%; top: -80px; left: 50%; transform: translateX(-50%);
  background: var(--accent, var(--gold)); filter: blur(50px); opacity: .3; transition: opacity .3s; pointer-events: none; }
a.kpi:hover::before { opacity: .55; }
.kpi .ic { width: 40px; height: 40px; margin: 0 auto .5rem; border-radius: 12px; display: grid; place-items: center; position: relative;
  color: var(--accent, var(--gold)); background: color-mix(in srgb, var(--accent, var(--gold)) 15%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent, var(--gold)) 32%, transparent); }
.kpi .ic svg { width: 19px; height: 19px; }
.kpi .num { font-size: 2.15rem; font-weight: 900; color: var(--heading); line-height: 1.15; position: relative; font-variant-numeric: tabular-nums; }
.kpi .lbl { color: var(--muted); font-size: .84rem; margin-top: .15rem; position: relative; }
.kpi.alert .num { color: var(--c-ret); }

/* ---------------------------------------------------------------- lists */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { padding: .9rem 1.35rem; border-bottom: 1px solid var(--line); }
.list > li:last-child { border-bottom: 0; }
.list > li.row { display: flex; align-items: center; gap: .9rem; }
.list a.row-link { display: flex; align-items: center; gap: .9rem; color: inherit; margin: -.9rem -1.35rem; padding: .9rem 1.35rem; transition: background .25s; position: relative; }
.list a.row-link:hover { background: linear-gradient(270deg, var(--gold-soft), transparent 75%); }
.list a.row-link::before { content: ""; position: absolute; right: 0; top: 18%; bottom: 18%; width: 3px; border-radius: 3px 0 0 3px; background: var(--gold); transform: scaleY(0); transition: transform .25s; }
.list a.row-link:hover::before { transform: scaleY(1); }
.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 700; color: var(--heading); }
.row-meta { color: var(--muted); font-size: .82rem; display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .8rem; margin-top: .25rem; }
.owner { display: inline-flex; align-items: center; gap: .3rem; }
.owner::before { content: ""; width: 12px; height: 12px; border-radius: 50%; background: linear-gradient(135deg, var(--violet), var(--cyan)); opacity: .85; }
.empty { text-align: center; color: var(--faint); padding: 2.4rem 1rem; }
.empty svg { width: 42px; height: 42px; opacity: .45; display: block; margin: 0 auto .6rem; }

/* ---------------------------------------------------------------- chips */
.chip { display: inline-flex; align-items: center; gap: .38rem; white-space: nowrap; font-size: .76rem; font-weight: 700;
  padding: .16rem .65rem; border-radius: 999px; background: var(--c-cancel-bg); color: var(--c-cancel); border: 1px solid transparent; }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.chip.plain::before { display: none; }
.s-new { background: var(--c-new-bg); color: var(--c-new); }
.s-in_progress { background: var(--c-prog-bg); color: var(--c-prog); }
.s-awaiting_review { background: var(--c-review-bg); color: var(--c-review); }
.s-awaiting_review::before { animation: pulse 1.6s infinite; }
.s-returned { background: var(--c-ret-bg); color: var(--c-ret); }
.s-done { background: var(--c-done-bg); color: var(--c-done); }
.s-cancelled { background: var(--c-cancel-bg); color: var(--c-cancel); }
.g-active { background: var(--c-prog-bg); color: var(--c-prog); }
.g-on_hold { background: var(--c-review-bg); color: var(--c-review); }
.g-achieved { background: var(--c-done-bg); color: var(--c-done); }
.g-cancelled { background: var(--c-cancel-bg); color: var(--c-cancel); }
.p-urgent { background: linear-gradient(135deg, #ff5f7a, #d7263d); color: #fff; box-shadow: 0 4px 14px -4px rgba(255, 80, 110, .6); }
.p-high { background: var(--c-ret-bg); color: var(--c-ret); border-color: color-mix(in srgb, var(--c-ret) 30%, transparent); }
.p-normal { background: transparent; color: var(--muted); border-color: var(--line-2); }
.p-low { background: transparent; color: var(--faint); border-color: var(--line); }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.7); } }
.tag { display: inline-block; font-size: .76rem; font-weight: 600; padding: .12rem .6rem; border-radius: 8px;
  background: var(--gold-soft); color: var(--gold-ink); border: 1px solid rgba(214,176,106,.22); margin: .12rem 0 .12rem .3rem; }
a.tag:hover { background: rgba(214,176,106,.22); }
.badge { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 8px; background: linear-gradient(135deg, #f3dca6, #d6b06a);
  color: #1a1408; font-size: .74rem; font-weight: 800; display: inline-grid; place-items: center; box-shadow: 0 0 16px -2px rgba(214,176,106,.7); }
.due { font-size: .8rem; }
.due.late { color: var(--c-ret); font-weight: 700; }
.due.soon { color: var(--c-review); font-weight: 700; }

/* ---------------------------------------------------------------- tabs / filters */
.tabs { display: flex; justify-content: center; flex-wrap: wrap; gap: .3rem; margin: 0 auto 1.4rem; width: fit-content; max-width: 100%;
  background: var(--glass); border: 1px solid var(--line); padding: .35rem; border-radius: 16px; backdrop-filter: blur(16px); }
.tabs a { padding: .45rem 1.05rem; border-radius: 12px; color: var(--muted); font-size: .88rem; font-weight: 700; transition: color .25s, background .25s; }
.tabs a:hover { color: var(--heading); }
.tabs a.on { color: var(--btn-fg); background: var(--btn-bg); box-shadow: 0 6px 18px -6px rgba(214,176,106,.5); }
.tabs a .n { opacity: .7; margin-inline-start: .35rem; }
.filters { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; margin-bottom: 1.4rem; }
.filters select { width: auto; min-width: 170px; }

/* ---------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tbl th { text-align: right; font-weight: 600; color: var(--faint); font-size: .78rem; padding: .85rem 1rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: .85rem 1rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background .2s; }
.tbl tbody tr:hover { background: linear-gradient(270deg, var(--gold-soft), transparent 80%); }
.tbl td.title a { color: var(--heading); font-weight: 700; }
.tbl td.title a:hover { color: var(--gold); }

/* ---------------------------------------------------------------- forms */
.form { max-width: 860px; margin: 0 auto; }
.field { margin-bottom: 1.15rem; }
.field > label, .label { display: block; font-weight: 700; font-size: .86rem; margin-bottom: .4rem; color: var(--heading); }
.field .hint { color: var(--faint); font-size: .78rem; margin-top: .3rem; }
.req::after { content: " *"; color: var(--c-ret); }
input[type=text], input[type=password], input[type=number], input[type=search], select, textarea {
  width: 100%; font: inherit; font-size: .94rem; color: var(--text);
  background-color: var(--input-bg); border: 1px solid var(--line-2); border-radius: 12px;
  padding: .62rem .9rem; transition: border-color .2s, box-shadow .2s, background-color .2s;
}
select { appearance: none; -webkit-appearance: none; padding-left: 2.2rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d6b06a' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: left .7rem center; background-size: 16px; }
select option { background: var(--solid); color: var(--text); }
textarea { min-height: 120px; resize: vertical; line-height: 1.85; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: var(--ring); }
input::placeholder, textarea::placeholder { color: var(--faint); }
.row-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 1rem; }
.form-actions { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; margin-top: 1.7rem; }
.check { display: inline-flex; align-items: center; gap: .5rem; cursor: pointer; font-size: .9rem; }
.check input { accent-color: var(--gold); width: 16px; height: 16px; }

.pick { display: flex; flex-wrap: wrap; gap: .45rem; padding: .7rem; border: 1px solid var(--line-2); border-radius: 14px;
  background: var(--input-bg); max-height: 250px; overflow-y: auto; }
.pick-group { width: 100%; font-size: .72rem; color: var(--faint); margin-top: .25rem; }
.pick label { cursor: pointer; }
.pick input { display: none; }
.pick span { display: inline-block; padding: .32rem .85rem; border-radius: 999px; border: 1px solid var(--line-2); font-size: .85rem;
  background: var(--btn2-bg); transition: all .18s; user-select: none; }
.pick span:hover { border-color: var(--gold); }
.pick input:checked + span { background: var(--btn-bg); color: var(--btn-fg); border-color: transparent; box-shadow: 0 6px 16px -6px rgba(214,176,106,.6); }

.drop { border: 1.5px dashed var(--line-2); border-radius: 18px; padding: 2.1rem 1rem; text-align: center; background: var(--input-bg);
  cursor: pointer; transition: all .25s; position: relative; overflow: hidden; }
.drop:hover, .drop.over { border-color: var(--gold); background: var(--gold-soft); }
.drop.over { transform: scale(1.01); box-shadow: 0 0 0 6px var(--gold-soft); }
.drop > svg { width: 44px; height: 44px; color: var(--gold); transition: transform .3s; }
.drop:hover > svg { transform: translateY(-4px); }
.drop .t { font-weight: 700; color: var(--heading); margin-top: .4rem; }
.drop .small svg { width: 16px; height: 16px; vertical-align: -3px; color: var(--gold); }
.drop input { display: none; }
.file-list { list-style: none; padding: 0; margin: .8rem 0 0; font-size: .86rem; }
.file-list li { display: flex; justify-content: space-between; gap: 1rem; padding: .4rem .8rem; background: var(--glass-2); border: 1px solid var(--line);
  border-radius: 10px; margin-top: .35rem; animation: slideIn .35s cubic-bezier(.2,.7,.2,1) both; }
@keyframes slideIn { from { opacity: 0; transform: translateX(-12px); } }

/* ---------------------------------------------------------------- flash */
.flash { max-width: 760px; margin: 0 auto 1.3rem; padding: .8rem 1.1rem; border-radius: 14px; text-align: center; font-size: .9rem; font-weight: 700;
  backdrop-filter: blur(14px); animation: dropIn .5s cubic-bezier(.2,.7,.2,1) both; border: 1px solid transparent; }
.flash.success { background: var(--c-done-bg); color: var(--c-done); border-color: color-mix(in srgb, var(--c-done) 30%, transparent); }
.flash.error { background: var(--c-ret-bg); color: var(--c-ret); border-color: color-mix(in srgb, var(--c-ret) 30%, transparent); }
.flash.message, .flash.info { background: var(--c-new-bg); color: var(--c-new); border-color: color-mix(in srgb, var(--c-new) 30%, transparent); }
@keyframes dropIn { from { opacity: 0; transform: translateY(-14px) scale(.98); } }

/* ---------------------------------------------------------------- entity cards */
.entity-group-title { text-align: center; font-size: .95rem; margin: 2rem 0 1.1rem; display: flex; align-items: center; gap: 1rem; color: var(--heading); }
.entity-group-title::before, .entity-group-title::after { content: ""; flex: 1; height: 1px; background: var(--line-2); }
.entity-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1.1rem; }
.ecard { position: relative; display: block; color: inherit; text-align: center; padding: 1.35rem 1.15rem 1.05rem; border-radius: 22px;
  background: var(--glass); border: 1px solid var(--line); box-shadow: var(--shadow); backdrop-filter: blur(18px);
  transition: transform .35s cubic-bezier(.2,.7,.2,1), box-shadow .3s, border-color .3s; overflow: hidden; }
.ecard:hover { box-shadow: var(--shadow-lg); border-color: rgba(214,176,106,.35); color: inherit; }
.ecard .mono { width: 54px; height: 54px; margin: 0 auto .7rem; border-radius: 16px; display: grid; place-items: center; font-weight: 900; font-size: 1.3rem;
  background: linear-gradient(145deg, rgba(243,220,166,.25), rgba(168,128,61,.12)); color: var(--gold-ink); border: 1px solid rgba(214,176,106,.3);
  box-shadow: 0 10px 24px -10px rgba(214,176,106,.6); }
.ecard.k-external .mono { background: linear-gradient(145deg, rgba(122,162,255,.25), rgba(122,162,255,.08)); color: var(--c-new); border-color: rgba(122,162,255,.3); box-shadow: 0 10px 24px -10px rgba(122,162,255,.6); }
.ecard.k-personal .mono { background: linear-gradient(145deg, rgba(140,124,255,.28), rgba(140,124,255,.08)); color: var(--violet); border-color: rgba(140,124,255,.3); box-shadow: 0 10px 24px -10px rgba(140,124,255,.6); }
.ecard.k-general .mono { background: linear-gradient(145deg, rgba(79,209,232,.25), rgba(79,209,232,.07)); color: var(--cyan); border-color: rgba(79,209,232,.3); box-shadow: 0 10px 24px -10px rgba(79,209,232,.5); }
.ecard h3 { font-size: 1.02rem; }
.ecard .act { color: var(--muted); font-size: .82rem; min-height: 1.4em; }
.ecard .nums { display: flex; justify-content: center; gap: 1.3rem; margin-top: .9rem; padding-top: .8rem; border-top: 1px solid var(--line); font-size: .78rem; color: var(--muted); }
.ecard .nums b { color: var(--heading); font-size: 1.1rem; display: block; font-weight: 800; }
.ecard.archived { opacity: .5; }

/* ---------------------------------------------------------------- documents */
.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 1.05rem; }
.dcard { display: flex; flex-direction: column; color: inherit; border-radius: 18px; overflow: hidden; position: relative;
  background: var(--glass); border: 1px solid var(--line); box-shadow: var(--shadow); backdrop-filter: blur(16px);
  transition: transform .35s cubic-bezier(.2,.7,.2,1), box-shadow .3s, border-color .3s; }
.dcard:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: rgba(214,176,106,.35); color: inherit; }
.dcard .cover { aspect-ratio: 4/3; display: grid; place-items: center; overflow: hidden; position: relative;
  background: radial-gradient(circle at 30% 20%, rgba(214,176,106,.16), transparent 60%), var(--glass-2); border-bottom: 1px solid var(--line); }
.dcard .cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.dcard:hover .cover img { transform: scale(1.06); }
.dcard .cover .many { position: absolute; bottom: .55rem; left: .55rem; background: rgba(6,10,19,.7); color: #fff; font-size: .72rem; padding: .05rem .55rem; border-radius: 8px; backdrop-filter: blur(6px); }
.ftype { width: 58px; height: 72px; border-radius: 10px; position: relative; display: grid; place-items: center; font-weight: 900; font-size: .74rem; letter-spacing: .6px;
  color: var(--gold-ink); background: linear-gradient(160deg, var(--glass-2), var(--glass)); border: 1px solid var(--line-2); box-shadow: 0 12px 24px -12px rgba(0,0,0,.5); }
.ftype::after { content: ""; position: absolute; top: -1px; left: -1px; width: 16px; height: 16px; background: var(--bg-2);
  border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); border-bottom-right-radius: 6px; }
.dcard .body { padding: .8rem .95rem .9rem; text-align: center; }
.dcard .t { font-weight: 700; font-size: .9rem; color: var(--heading); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dcard .m { font-size: .76rem; color: var(--faint); margin-top: .3rem; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .8rem; }
.gallery a { border-radius: 14px; overflow: hidden; border: 1px solid var(--line); aspect-ratio: 1; display: block; background: var(--glass-2); }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.gallery a:hover img { transform: scale(1.07); }
.pdf-frame { width: 100%; height: 75vh; border: 1px solid var(--line); border-radius: 14px; background: #fff; }

.dl { display: grid; grid-template-columns: auto 1fr; gap: .6rem 1.2rem; font-size: .9rem; }
.dl dt { color: var(--faint); white-space: nowrap; }
.dl dd { margin: 0; color: var(--heading); }

/* ---------------------------------------------------------------- timeline & feed */
.timeline { list-style: none; margin: 0; padding: 0 1.4rem 0 0; position: relative; }
.timeline::before { content: ""; position: absolute; right: .42rem; top: .4rem; bottom: .4rem; width: 2px; background: linear-gradient(var(--gold), var(--line) 85%); }
.timeline li { position: relative; padding: 0 1.3rem 1.35rem 0; }
.timeline li::before { content: ""; position: absolute; right: -1.27rem; top: .45rem; width: 12px; height: 12px; border-radius: 50%; background: var(--bg); border: 2px solid var(--gold); }
.timeline li.status::before { background: var(--gold); box-shadow: 0 0 0 4px var(--gold-soft), 0 0 14px var(--gold); }
.timeline .tl-who { font-weight: 700; color: var(--heading); font-size: .9rem; }
.timeline .when { color: var(--faint); font-size: .78rem; margin-inline-start: .5rem; }
.timeline .txt { margin-top: .35rem; background: var(--glass-2); border: 1px solid var(--line); border-radius: 14px; padding: .7rem .95rem; white-space: pre-wrap; text-align: justify; }

.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: .85rem; padding: .78rem 1.35rem; border-bottom: 1px solid var(--line); font-size: .88rem; }
.feed li:last-child { border-bottom: 0; }
.feed .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--gold); margin-top: .55rem; flex: none; box-shadow: 0 0 10px var(--gold); }
.feed .what { flex: 1; min-width: 0; }
.feed .what b { color: var(--heading); }
.feed .when { color: var(--faint); font-size: .76rem; white-space: nowrap; }

.progress { height: 8px; background: var(--line); border-radius: 6px; overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--gold-3), var(--gold), var(--gold-2));
  box-shadow: 0 0 12px rgba(214,176,106,.6); transition: width 1.2s cubic-bezier(.2,.7,.2,1); }
.desc { white-space: pre-wrap; text-align: justify; line-height: 2; }
.pager { display: flex; justify-content: center; gap: .45rem; margin-top: 1.5rem; }

/* ---------------------------------------------------------------- dashboard: hero, charts */
.hero-sub { margin-top: .6rem; color: var(--muted); font-size: 1.02rem; }
.rotating { display: inline-block; min-width: 10ch; color: var(--gold-ink); font-weight: 800; }
.rotating .rw { display: inline-block; animation: rotIn .55s cubic-bezier(.2,.7,.2,1) both; }
.rotating .rw.out { animation: rotOut .35s ease-in both; }
@keyframes rotIn { from { opacity: 0; transform: translateY(70%); filter: blur(6px); } }
@keyframes rotOut { to { opacity: 0; transform: translateY(-70%); filter: blur(6px); } }

.donut-wrap { display: flex; align-items: center; justify-content: center; gap: 1.8rem; flex-wrap: wrap; padding: .4rem 0; }
.donut { width: 190px; height: 190px; position: relative; flex: none; }
.donut svg { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.donut circle { fill: none; stroke-width: 15; }
.donut .track { stroke: var(--line); }
.donut .seg { transition: stroke-dasharray 1.4s cubic-bezier(.2,.7,.2,1); filter: drop-shadow(0 0 5px currentColor); }
.donut .center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.donut .center b { display: block; font-size: 2.2rem; font-weight: 900; color: var(--heading); line-height: 1.1; }
.donut .center span { font-size: .78rem; color: var(--muted); }
.legend { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; font-size: .86rem; min-width: 190px; }
.legend li { display: flex; align-items: center; gap: .55rem; }
.legend i { width: 10px; height: 10px; border-radius: 4px; background: currentColor; box-shadow: 0 0 10px currentColor; flex: none; }
.legend span { color: var(--text); }
.legend b { margin-inline-start: auto; padding-inline-start: 1.2rem; color: var(--heading); }

.bars { display: grid; gap: .85rem; }
.bar-row { display: grid; grid-template-columns: minmax(110px, 34%) 1fr 2rem; align-items: center; gap: .8rem; font-size: .86rem; }
.bar-row a { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-row a:hover { color: var(--gold); }
.bar { height: 10px; border-radius: 6px; background: var(--line); overflow: hidden; }
.bar span { display: block; height: 100%; border-radius: 6px; background: linear-gradient(270deg, var(--violet), var(--cyan));
  box-shadow: 0 0 14px rgba(79,209,232,.45); transition: width 1.3s cubic-bezier(.2,.7,.2,1); }
.bar-row b { color: var(--heading); text-align: left; }

/* ---------------------------------------------------------------- dock */
.dock { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 40;
  display: flex; align-items: flex-end; gap: .55rem; padding: .55rem .7rem; border-radius: 22px;
  background: var(--glass-strong); border: 1px solid var(--line-2); box-shadow: var(--shadow-lg);
  backdrop-filter: blur(20px) saturate(160%); -webkit-backdrop-filter: blur(20px) saturate(160%);
  animation: dockIn .7s .3s cubic-bezier(.2,.7,.2,1) both; }
@keyframes dockIn { from { opacity: 0; transform: translate(-50%, 30px); } }
.dock a, .dock button { --s: 1; width: calc(44px * var(--s)); height: calc(44px * var(--s)); border-radius: calc(13px * var(--s));
  display: grid; place-items: center; color: var(--text); background: var(--btn2-bg); border: 1px solid var(--line); cursor: pointer;
  transition: width .18s, height .18s, background .2s, color .2s, border-color .2s; position: relative; flex: none; font: inherit; padding: 0; }
.dock a:hover, .dock button:hover { color: var(--gold-ink); border-color: rgba(214,176,106,.45); background: var(--gold-soft); }
.dock svg { width: calc(20px * var(--s)); height: calc(20px * var(--s)); }
.dock .tip { position: absolute; bottom: calc(100% + 10px); left: 50%; transform: translate(-50%, 6px); white-space: nowrap;
  font-size: .74rem; font-weight: 700; padding: .22rem .65rem; border-radius: 8px; background: var(--solid); color: var(--heading);
  border: 1px solid var(--line-2); opacity: 0; pointer-events: none; transition: all .2s; }
.dock a:hover .tip, .dock button:hover .tip { opacity: 1; transform: translate(-50%, 0); }
.dock .sep { width: 1px; height: 30px; background: var(--line-2); align-self: center; }
.dock .primary { background: var(--btn-bg); color: var(--btn-fg); border-color: transparent; }
.dock .primary:hover { color: var(--btn-fg); background: var(--btn-bg); }

/* ---------------------------------------------------------------- command palette */
.palette-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(3, 6, 12, .55); backdrop-filter: blur(6px);
  display: none; align-items: flex-start; justify-content: center; padding-top: 12vh; }
.palette-backdrop.open { display: flex; animation: fadeIn .2s; }
@keyframes fadeIn { from { opacity: 0; } }
.palette { width: min(640px, 92vw); border-radius: 20px; overflow: hidden; background: var(--glass-strong); border: 1px solid var(--line-2);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(214,176,106,.14); backdrop-filter: blur(24px); animation: popIn .3s cubic-bezier(.2,.7,.2,1); }
@keyframes popIn { from { opacity: 0; transform: translateY(-12px) scale(.97); } }
.palette input[type=text] { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; padding: 1.05rem 1.3rem; font-size: 1.02rem; box-shadow: none; }
.palette ul { list-style: none; margin: 0; padding: .4rem; max-height: 52vh; overflow-y: auto; }
.palette li a { display: flex; align-items: center; gap: .8rem; padding: .62rem .9rem; border-radius: 12px; color: var(--text); }
.palette li a .k { margin-inline-start: auto; font-size: .72rem; color: var(--faint); }
.palette li a.sel, .palette li a:hover { background: var(--gold-soft); color: var(--heading); }
.palette li a svg { width: 17px; height: 17px; color: var(--gold); flex: none; }
.palette .foot { display: flex; justify-content: space-between; padding: .55rem 1.1rem; border-top: 1px solid var(--line); font-size: .74rem; color: var(--faint); }

/* ---------------------------------------------------------------- login */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 2rem; position: relative; }
.login-shell { width: min(1040px, 100%); display: grid; grid-template-columns: 1.05fr 1fr; border-radius: 30px; overflow: hidden; position: relative;
  background: var(--glass); border: 1px solid var(--line-2); box-shadow: var(--shadow-lg); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  animation: popIn .8s cubic-bezier(.2,.7,.2,1) both; }
.login-art { position: relative; overflow: hidden; isolation: isolate; color: #fff; padding: 3.2rem 2.6rem; display: flex; flex-direction: column;
  justify-content: center; align-items: center; text-align: center; min-height: 580px;
  background: radial-gradient(circle at 30% 15%, rgba(214,176,106,.25), transparent 55%), radial-gradient(circle at 80% 90%, rgba(140,124,255,.25), transparent 55%), #0a1120; }
.login-art .brand-mark { width: 80px; height: 80px; font-size: 1.65rem; border-radius: 22px; }
.login-art .brand-mark::after { border-radius: 28px; inset: -9px; }
.login-art h1 { font-size: 2.1rem; margin-top: 1.4rem; color: #fff; font-weight: 900; }
.login-art .sub2 { color: #f3dca6; font-weight: 700; margin-top: .2rem; }
.login-art p { color: #aab5ca; max-width: 380px; margin-top: 1.1rem; }
.login-art .line { width: 90px; height: 2px; background: linear-gradient(90deg, transparent, #d6b06a, transparent); margin: 1.3rem auto 0; }
.login-art .feats { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: center; margin-top: 1.6rem; }
.login-art .feats span { font-size: .76rem; padding: .28rem .8rem; border-radius: 999px; border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.05); color: #d7deea; }
.login-box { display: grid; place-items: center; padding: 3rem 2.4rem; }
.login-card { width: 100%; max-width: 360px; }
.login-card h2 { text-align: center; font-size: 1.5rem; font-weight: 900; }
.login-card .sub { text-align: center; color: var(--muted); margin: .35rem 0 1.9rem; font-size: .9rem; }
.login-card .btn { padding: .8rem; font-size: 1rem; margin-top: .7rem; }
.login-foot { text-align: center; color: var(--faint); font-size: .76rem; margin-top: 1.6rem; }

/* ---------------------------------------------------------------- jalali datepicker */
.jdp-wrap { position: relative; }
.jdp { position: absolute; z-index: 60; top: calc(100% + 8px); right: 0; width: 296px; padding: .75rem; border-radius: 18px; user-select: none;
  background: var(--glass-strong); border: 1px solid var(--line-2); box-shadow: var(--shadow-lg); backdrop-filter: blur(20px); animation: popIn .25s cubic-bezier(.2,.7,.2,1); }
.jdp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .5rem; }
.jdp-head b { color: var(--heading); font-size: .95rem; }
.jdp-head button { background: none; border: 0; cursor: pointer; font-size: 1.2rem; color: var(--muted); width: 32px; height: 32px; border-radius: 10px; }
.jdp-head button:hover { background: var(--gold-soft); color: var(--gold); }
.jdp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; text-align: center; font-size: .86rem; }
.jdp-grid .wd { color: var(--faint); font-size: .74rem; padding: .2rem 0; }
.jdp-grid button { border: 0; background: none; font: inherit; padding: .38rem 0; border-radius: 10px; cursor: pointer; color: var(--text); transition: background .15s; }
.jdp-grid button:hover { background: var(--gold-soft); }
.jdp-grid button.today { box-shadow: inset 0 0 0 1px var(--gold); }
.jdp-grid button.sel { background: var(--btn-bg); color: var(--btn-fg); font-weight: 800; }
.jdp-grid .fri { color: var(--c-ret); }
.jdp-foot { display: flex; justify-content: space-between; margin-top: .55rem; }
.jdp-foot button { background: none; border: 0; color: var(--gold-ink); cursor: pointer; font: inherit; font-size: .82rem; }

.attach { display: inline-flex; align-items: center; gap: .15rem; color: var(--faint); font-size: .78rem; margin-inline-start: .35rem; }
.attach svg { width: 14px; height: 14px; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1100px) { .grid-main, .grid-3 { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .sidebar { position: fixed; right: 0; top: 0; transform: translateX(105%); transition: transform .35s cubic-bezier(.2,.7,.2,1); box-shadow: var(--shadow-lg); z-index: 70; }
  body.nav-open .sidebar { transform: none; }
  body.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(3,6,12,.55); z-index: 65; backdrop-filter: blur(3px); }
  .menu-btn { display: block; }
  .topbar { padding: .7rem 1rem; }
  .today, .kbd { display: none; }
  .topbar .search input { padding-left: 1rem; }
  .content { padding: 1.3rem 1rem 6.5rem; }
  .grid-2 { grid-template-columns: 1fr; }
  .login-page { padding: 1rem; }
  .login-shell { grid-template-columns: 1fr; }
  .login-art { min-height: 0; padding: 2.4rem 1.5rem; }
  .tbl .hide-sm { display: none; }
  .dock { bottom: 10px; gap: .35rem; padding: .45rem .55rem; }
  .dock a, .dock button { width: 40px; height: 40px; }
  .dock .tip { display: none; }
}
@media print {
  .sidebar, .topbar, .actions, .form-actions, .dock, #bg-canvas, .bg-grid { display: none !important; }
  body { background: #fff; color: #000; }
  .content { padding: 0; }
  .card { box-shadow: none; backdrop-filter: none; background: #fff; }
}

/* ================================================================ board (kanban) */
.board { display: grid; grid-template-columns: repeat(5, minmax(205px, 1fr)); gap: 1rem; overflow-x: auto; padding-bottom: .5rem; align-items: start; }
.lane { border-radius: 20px; background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(16px); min-height: 320px;
  display: flex; flex-direction: column; transition: border-color .2s, box-shadow .2s, background .2s; position: relative; }
.lane::before { content: ""; position: absolute; top: 0; left: 18px; right: 18px; height: 2px; border-radius: 2px; background: var(--lane); box-shadow: 0 0 14px var(--lane); }
.lane-head { display: flex; align-items: center; gap: .6rem; padding: .95rem 1rem .8rem; border-bottom: 1px solid var(--line); }
.lane-head b { display: block; color: var(--heading); font-size: .92rem; }
.lane-head small { color: var(--faint); font-size: .72rem; }
.lane-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--lane); box-shadow: 0 0 10px var(--lane); flex: none; }
.lane-count { margin-inline-start: auto; min-width: 26px; height: 26px; border-radius: 9px; display: grid; place-items: center; font-size: .8rem; font-weight: 800;
  color: var(--lane); background: color-mix(in srgb, var(--lane) 14%, transparent); }
.lane-body { padding: .7rem; display: grid; gap: .65rem; align-content: start; flex: 1; }
.lane-empty { text-align: center; color: var(--faint); font-size: .8rem; padding: 1.5rem 0; border: 1px dashed var(--line-2); border-radius: 14px; }
.lane.can-drop { border-color: color-mix(in srgb, var(--lane) 55%, transparent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--lane) 35%, transparent), 0 0 30px -10px var(--lane); }
.lane.over { background: color-mix(in srgb, var(--lane) 10%, var(--glass)); }
.lane.no-drop { opacity: .45; }
.kcard { background: var(--glass-2); border: 1px solid var(--line); border-radius: 14px; padding: .8rem .85rem .7rem; cursor: grab; position: relative;
  transition: transform .2s, box-shadow .2s, border-color .2s, opacity .2s; }
.kcard:hover { border-color: rgba(214,176,106,.35); box-shadow: 0 12px 28px -14px rgba(0,0,0,.6); transform: translateY(-2px); }
.kcard.dragging { opacity: .45; transform: rotate(-2deg) scale(.98); cursor: grabbing; }
.kcard.saving { opacity: .6; pointer-events: none; }
.kcard-title { display: block; color: var(--heading); font-weight: 700; font-size: .9rem; line-height: 1.6; }
.kcard-title:hover { color: var(--gold); }
.kcard-desc { color: var(--muted); font-size: .78rem; margin: .3rem 0 0; line-height: 1.7; }
.kcard-meta { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .5rem; align-items: center; }
.kcard-meta .tag { margin: 0; font-size: .7rem; }
.kcard-foot { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-top: .55rem; padding-top: .5rem; border-top: 1px solid var(--line); font-size: .74rem; color: var(--muted); }

.modal { border: 1px solid var(--line-2); border-radius: 22px; background: var(--glass-strong); color: var(--text); padding: 1.4rem; width: min(480px, 92vw);
  box-shadow: var(--shadow-lg); backdrop-filter: blur(24px); }
.modal::backdrop { background: rgba(3,6,12,.55); backdrop-filter: blur(4px); }
.modal h3 { text-align: center; margin-bottom: .9rem; }
.modal[open] { animation: popIn .3s cubic-bezier(.2,.7,.2,1); }

/* ================================================================ calendar */
.cal-toolbar { display: flex; align-items: center; justify-content: center; gap: .7rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.cal-toolbar .icon-btn { font-size: 1.3rem; font-weight: 700; }
.cal-title { text-align: center; min-width: 170px; }
.cal-title b { display: block; font-size: 1.25rem; color: var(--heading); }
.cal-title small { color: var(--faint); }
.cal { overflow: hidden; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-wd div { text-align: center; font-size: .78rem; color: var(--faint); padding: .75rem 0; border-bottom: 1px solid var(--line); font-weight: 600; }
.cal-cell { min-height: 118px; padding: .45rem .45rem .55rem; border-left: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: .25rem;
  transition: background .2s; position: relative; min-width: 0; }
.cal-grid .cal-cell:last-child { border-left: 0; }
.cal-cell:hover { background: rgba(255,255,255,.02); }
.cal-cell.empty { background: repeating-linear-gradient(135deg, transparent 0 8px, rgba(255,255,255,.015) 8px 16px); }
.cal-day { font-weight: 800; font-size: .9rem; color: var(--muted); width: 28px; height: 28px; display: grid; place-items: center; border-radius: 9px; }
.cal-cell.fri .cal-day { color: var(--c-ret); }
.cal-cell.today { background: var(--gold-soft); }
.cal-cell.today .cal-day { background: var(--btn-bg); color: var(--btn-fg); box-shadow: 0 0 16px -2px rgba(214,176,106,.7); }
.cal-item { display: block; font-size: .72rem; font-weight: 600; padding: .16rem .45rem; border-radius: 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: var(--c-new-bg); color: var(--c-new); border-inline-start: 3px solid currentColor; }
.cal-item:hover { filter: brightness(1.2); }
.cal-item.s-in_progress { background: var(--c-prog-bg); color: var(--c-prog); }
.cal-item.s-awaiting_review { background: var(--c-review-bg); color: var(--c-review); }
.cal-item.s-returned, .cal-item.late { background: var(--c-ret-bg); color: var(--c-ret); }
.cal-item.s-done { background: var(--c-done-bg); color: var(--c-done); text-decoration: line-through; opacity: .8; }
.cal-item.s-cancelled { background: var(--c-cancel-bg); color: var(--c-cancel); text-decoration: line-through; }
.cal-item.goal { background: rgba(140,124,255,.14); color: var(--violet); }
.cal-more { font-size: .7rem; color: var(--faint); padding-inline-start: .3rem; }

/* ================================================================ order stepper */
.stepper { display: flex; align-items: flex-start; justify-content: center; gap: 0; margin: 1.3rem auto 0; max-width: 720px; position: relative; }
.step { flex: 1; text-align: center; position: relative; font-size: .78rem; color: var(--faint); }
.step::before { content: ""; position: absolute; top: 15px; right: 50%; width: 100%; height: 2px; background: var(--line-2); z-index: 0; }
.step:first-child::before { display: none; }
.step .bubble { width: 32px; height: 32px; border-radius: 50%; margin: 0 auto .4rem; display: grid; place-items: center; position: relative; z-index: 1;
  background: var(--solid); border: 2px solid var(--line-2); font-weight: 800; font-size: .8rem; color: var(--faint); transition: all .3s; }
.step .bubble svg { width: 15px; height: 15px; }
.step.done { color: var(--muted); }
.step.done::before { background: linear-gradient(270deg, var(--gold), var(--gold-2)); box-shadow: 0 0 10px rgba(214,176,106,.5); }
.step.done .bubble { background: var(--btn-bg); border-color: transparent; color: var(--btn-fg); }
.step.current { color: var(--heading); font-weight: 700; }
.step.current::before { background: linear-gradient(270deg, var(--gold), var(--gold-2)); }
.step.current .bubble { border-color: var(--gold); color: var(--gold-ink); box-shadow: 0 0 0 5px var(--gold-soft), 0 0 22px rgba(214,176,106,.55); animation: breathe 2.2s ease-in-out infinite; }
.step.warn .bubble { border-color: var(--c-ret); color: var(--c-ret); box-shadow: 0 0 0 5px var(--c-ret-bg); }
@keyframes breathe { 50% { box-shadow: 0 0 0 9px var(--gold-soft), 0 0 30px rgba(214,176,106,.7); } }
.stepper-note { text-align: center; margin-top: .6rem; font-size: .82rem; }

/* ================================================================ entity hero stats */
.hero-stats { display: grid; grid-template-columns: auto repeat(4, minmax(110px, 1fr)); gap: 1rem; align-items: stretch; margin: 0 auto 1.6rem; max-width: 1000px; }
.hero-ring { display: grid; place-items: center; padding: .9rem 1.2rem; }
.ring { width: 104px; height: 104px; position: relative; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 9; }
.ring .track { stroke: var(--line); }
.ring .val { stroke-linecap: round; transition: stroke-dasharray 1.5s cubic-bezier(.2,.7,.2,1); filter: drop-shadow(0 0 6px rgba(214,176,106,.6)); }
.ring .lbl { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring .lbl b { font-size: 1.45rem; font-weight: 900; color: var(--heading); line-height: 1.1; }
.ring .lbl span { font-size: .7rem; color: var(--muted); }
.mini { padding: 1rem .8rem; text-align: center; }
.mini b { display: block; font-size: 1.7rem; font-weight: 900; color: var(--heading); line-height: 1.2; }
.mini span { color: var(--muted); font-size: .8rem; }
.mini.alert b { color: var(--c-ret); }

/* ================================================================ print (report) */
@media print {
  :root, [data-theme] { --text: #1d2433; --heading: #0c1526; --muted: #4f5a70; --faint: #7a8396; --line: #d9dde5; --line-2: #c7ccd6;
    --glass: #fff; --glass-2: #fafafa; --solid: #fff; --gold-ink: #8a6a2e; --bg: #fff; }
  .no-print, .dock, .palette-backdrop, .cursor-halo, .aurora { display: none !important; }
  .kpi, .card { border: 1px solid #d9dde5; }
  .kpi, .list > li, .tbl tr { break-inside: avoid; }
  .kpi::before, .card::before, .edge-glow, .glare { display: none !important; }
  .reveal { opacity: 1 !important; transform: none !important; filter: none !important; }
  .page-head h1 { color: #0c1526; }
  a { color: #0c1526; }
  .main { width: 100%; }
  @page { size: A4; margin: 14mm; }
}
@media (max-width: 860px) {
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
  .hero-ring { grid-column: 1 / -1; }
  .cal-cell { min-height: 74px; padding: .25rem; }
  .cal-item { font-size: 0; padding: 0; height: 6px; border-radius: 3px; border: 0; background: currentColor; }
  .cal-more { display: none; }
}
@media (max-width: 600px) { .dock .opt { display: none; } }

/* ================================================================ developer footer */
.site-foot { display: flex; flex-direction: column; align-items: center; gap: .6rem; padding: 1.2rem 1rem 6.5rem; margin-top: -4.5rem;
  font-size: .8rem; color: var(--faint); text-align: center; }
.site-foot .foot-line { width: 120px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold), transparent); opacity: .6; }
.site-foot a { color: var(--gold-ink); font-weight: 600; letter-spacing: .2px; }
.site-foot a:hover { color: var(--gold); text-decoration: underline; text-underline-offset: 3px; }
.site-foot.login { margin-top: 1.4rem; padding: 0; }
.login-page { grid-template-rows: 1fr auto; }
@media print { .site-foot { margin-top: 1rem; padding: .5rem 0 0; color: #7a8396; } }
