/* ==========================================================================
   حضور — Design system & styles
   Mobile-first, RTL, Vazirmatn
   ========================================================================== */

@font-face {
  font-family: Vazirmatn;
  src: url("../fonts/Vazirmatn-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: Vazirmatn;
  src: url("../fonts/Vazirmatn-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: Vazirmatn;
  src: url("../fonts/Vazirmatn-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: Vazirmatn;
  src: url("../fonts/Vazirmatn-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: Vazirmatn;
  src: url("../fonts/Vazirmatn-ExtraBold.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #eef2f7;
  --surface: #ffffff;
  --surface-2: #f6f8fb;
  --surface-3: #eef2f7;
  --ink: #0f1f33;
  --ink-2: #243b53;
  --muted: #64748b;
  --muted-2: #8a99ab;
  --line: #e5ebf3;
  --line-strong: #d7e0eb;

  --brand: #0d9488;
  --brand-dark: #0f766e;
  --brand-deep: #0b3c4a;
  --brand-ink: #053b3a;
  --brand-soft: #e4f7f4;
  --brand-soft-2: #d3f1ec;

  --indigo: #4f46e5;
  --indigo-soft: #ecebff;
  --amber: #d97706;
  --amber-bright: #f59e0b;
  --amber-soft: #fef3e2;
  --rose: #e11d48;
  --rose-soft: #ffe9ee;
  --violet: #7c3aed;
  --violet-soft: #f2ebff;
  --sky: #0284c7;
  --sky-soft: #e5f4ff;
  --slate: #64748b;
  --slate-soft: #eef2f7;

  --radius-xl: 26px;
  --radius-lg: 20px;
  --radius-md: 15px;
  --radius-sm: 11px;

  --shadow-xs: 0 1px 2px rgba(15, 31, 51, 0.05);
  --shadow-sm: 0 6px 18px -12px rgba(15, 31, 51, 0.25);
  --shadow: 0 18px 42px -26px rgba(15, 31, 51, 0.35);
  --shadow-lg: 0 30px 70px -32px rgba(15, 31, 51, 0.5);
  --shadow-nav: 0 22px 48px -22px rgba(9, 35, 45, 0.45);

  --sidebar-w: 268px;
  --ease: cubic-bezier(0.22, 0.8, 0.3, 1);
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Vazirmatn, "Segoe UI", Tahoma, sans-serif;
  font-weight: 400;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body::selection { background: var(--brand-soft-2); }

h1, h2, h3, h4, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
input, select, textarea { font-family: inherit; }
img, svg { max-width: 100%; }
button, [role="button"] { -webkit-tap-highlight-color: transparent; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

svg.ico {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  width: 1.1em;
  height: 1.1em;
  flex: 0 0 auto;
}

.link {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--brand-dark);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.link svg { width: 14px; height: 14px; }

.bg-orbs {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(900px 520px at 88% -12%, rgba(13, 148, 136, 0.16), transparent 68%),
    radial-gradient(760px 520px at 4% 2%, rgba(79, 70, 229, 0.09), transparent 70%),
    radial-gradient(700px 600px at 50% 115%, rgba(245, 158, 11, 0.07), transparent 70%),
    var(--bg);
}

:focus-visible {
  outline: 3px solid rgba(13, 148, 136, 0.45);
  outline-offset: 2px;
  border-radius: 8px;
}

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ── App shell ─────────────────────────────────────────────────────────── */
.app {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

.main-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.view {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 16px 118px;
  flex: 1;
}

.page-footer {
  display: none;
  padding: 8px 32px 30px;
  color: var(--muted-2);
  font-size: 11px;
  gap: 10px;
  align-items: center;
  justify-content: center;
}
.dot-sep {
  width: 3px; height: 3px; border-radius: 50%;
  background: var(--muted-2); display: inline-block;
}

/* ── Sidebar (desktop) ─────────────────────────────────────────────────── */
.sidebar {
  display: none;
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  padding: 22px 18px;
  color: #dcecee;
  background:
    radial-gradient(420px 280px at 90% 0%, rgba(20, 184, 166, 0.2), transparent 70%),
    radial-gradient(360px 280px at 10% 100%, rgba(79, 70, 229, 0.16), transparent 70%),
    linear-gradient(180deg, #08323c 0%, #062b34 55%, #05242c 100%);
  border-inline-end: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-inner {
  position: sticky;
  top: 22px;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 44px);
}

.side-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 6px 22px;
}
.side-brand img { width: 44px; height: 44px; border-radius: 13px; box-shadow: 0 8px 18px -8px rgba(0,0,0,.6); }
.side-brand b {
  display: block;
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.2px;
  line-height: 1.3;
}
.side-brand small {
  display: block;
  color: #8fb4b9;
  font-size: 11px;
  font-weight: 400;
}

.side-caption {
  color: #6f979d;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.4px;
  padding: 10px 14px 8px;
}

.side-nav { display: flex; flex-direction: column; gap: 4px; }

.side-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  border-radius: 14px;
  color: #b6d2d6;
  font-size: 13.5px;
  font-weight: 500;
  transition: background 0.2s var(--ease), color 0.2s;
}
.side-link .nav-ico {
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.055);
  transition: background 0.2s, color 0.2s;
}
.side-link .nav-ico svg { width: 18px; height: 18px; }
.side-link:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.side-link.is-active {
  background: linear-gradient(90deg, rgba(20, 184, 166, 0.24), rgba(20, 184, 166, 0.08));
  color: #fff;
  font-weight: 700;
}
.side-link.is-active .nav-ico {
  background: linear-gradient(135deg, #14b8a6, #0d9488);
  color: #042f2e;
  box-shadow: 0 8px 18px -10px rgba(20, 184, 166, 0.9);
}
.side-link.is-active::before {
  content: "";
  position: absolute;
  inset-inline-start: -18px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px; height: 22px;
  border-radius: 4px;
  background: #fbbf24;
}
.side-badge {
  margin-inline-start: auto;
  min-width: 21px;
  height: 21px;
  padding: 0 6px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #fbbf24;
  color: #3d2600;
  font-size: 10.5px;
  font-weight: 800;
}

.side-foot { margin-top: auto; padding-top: 18px; }

.side-promo {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  padding: 16px;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.side-promo::after {
  content: "";
  position: absolute;
  width: 120px; height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(251, 191, 36, 0.3), transparent 70%);
  top: -50px; inset-inline-start: -30px;
}
.side-promo b { display: block; color: #fff; font-size: 12.5px; font-weight: 700; }
.side-promo p { color: #a4c2c7; font-size: 11px; line-height: 1.9; margin-top: 4px; }
.side-promo .pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 10px;
  padding: 3px 9px;
  border-radius: 20px;
  background: rgba(251, 191, 36, 0.15);
  color: #fcd34d;
  font-size: 10px;
  font-weight: 700;
}

.side-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 10px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.07);
  cursor: pointer;
  width: 100%;
  text-align: start;
  color: inherit;
}
.side-user:hover { background: rgba(255, 255, 255, 0.09); }
.side-user b { display: block; font-size: 12px; color: #fff; line-height: 1.5; }
.side-user small { display: block; font-size: 10px; color: #8fb4b9; }
.side-user .chev { margin-inline-start: auto; color: #6f979d; }
.side-user .chev svg { width: 16px; height: 16px; }

/* ── Topbar ────────────────────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(243, 246, 250, 0.82);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  border-bottom: 1px solid rgba(15, 31, 51, 0.05);
}
.topbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 62px;
}
.topbar-brand { display: flex; align-items: center; gap: 9px; min-width: 0; }
.topbar-brand img { width: 36px; height: 36px; border-radius: 11px; }
.topbar-brand .tb-text { min-width: 0; }
.topbar-brand b {
  display: block;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-brand small {
  display: block;
  font-size: 10.5px;
  color: var(--muted);
  line-height: 1.5;
}
.topbar-titles { display: none; min-width: 0; }
.topbar-titles h1 { font-size: 19px; font-weight: 800; letter-spacing: -0.2px; line-height: 1.4; }
.topbar-titles p { font-size: 11px; color: var(--muted); line-height: 1.5; }

.topbar-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 7px; }
.today-chip {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 11px;
  color: var(--ink-2);
  box-shadow: var(--shadow-xs);
  white-space: nowrap;
}
.today-chip svg { width: 14px; height: 14px; color: var(--brand); }

.icon-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 38px; height: 38px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: transform 0.18s var(--ease), background 0.2s, color 0.2s, border-color 0.2s;
}
.icon-btn:hover { background: var(--brand-soft); color: var(--brand-dark); border-color: var(--brand-soft-2); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn .notif-dot {
  position: absolute;
  top: 6px; inset-inline-end: 6px;
  min-width: 15px; height: 15px;
  padding: 0 3px;
  border-radius: 8px;
  background: var(--rose);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  display: grid;
  place-items: center;
  border: 2px solid var(--surface);
  line-height: 1;
}

.topbar-user {
  width: 38px; height: 38px;
  border-radius: 13px;
  border: 0;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 4px 12px -6px rgba(15, 31, 51, 0.4);
}

/* ── Bottom navigation (mobile) ────────────────────────────────────────── */
.bottomnav {
  position: fixed;
  z-index: 60;
  left: 10px;
  right: 10px;
  bottom: calc(10px + env(safe-area-inset-bottom));
  height: 68px;
  padding: 6px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
  border-radius: 23px;
  border: 1px solid rgba(15, 31, 51, 0.07);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  box-shadow: var(--shadow-nav);
}
.bn-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 18px;
  cursor: pointer;
  transition: color 0.2s, background 0.2s, transform 0.15s;
}
.bn-item:active { transform: scale(0.93); }
.bn-ico {
  display: grid;
  place-items: center;
  width: 38px; height: 30px;
  border-radius: 11px;
  transition: background 0.25s var(--ease), color 0.2s, box-shadow 0.25s;
}
.bn-ico svg { width: 20px; height: 20px; }
.bn-label { font-size: 9.5px; font-weight: 600; line-height: 1.4; }
.bn-item.is-active { color: var(--brand-dark); }
.bn-item.is-active .bn-ico {
  background: linear-gradient(140deg, #14b8a6, #0d9488);
  color: #fff;
  box-shadow: 0 8px 16px -9px rgba(13, 148, 136, 0.95);
}
.bn-item.is-active .bn-label { font-weight: 800; }
.bn-badge {
  position: absolute;
  top: 3px;
  inset-inline-end: 12px;
  min-width: 15px; height: 15px;
  padding: 0 3px;
  border-radius: 8px;
  background: var(--rose);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  display: grid;
  place-items: center;
  border: 1.5px solid #fff;
  line-height: 1;
}

/* ── Page scaffolding ──────────────────────────────────────────────────── */
.page { display: flex; flex-direction: column; gap: 16px; animation: pageIn 0.4s var(--ease) both; }
@keyframes pageIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 2px 0;
  flex-wrap: wrap;
}
.page-head h1 { font-size: 20px; font-weight: 800; letter-spacing: -0.3px; line-height: 1.4; }
.page-head p { font-size: 11.5px; color: var(--muted); margin-top: 2px; line-height: 1.7; }
.page-head-actions { display: flex; gap: 7px; align-items: center; }

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.section-head h2 { font-size: 13.5px; font-weight: 800; }
.section-head .link {
  font-size: 11px;
  font-weight: 700;
  color: var(--brand-dark);
  display: inline-flex;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  background: none;
  border: 0;
}
.section-head .link svg { width: 14px; height: 14px; }
.section-head p { font-size: 10.5px; color: var(--muted); }

/* ── Cards ─────────────────────────────────────────────────────────────── */
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid rgba(15, 31, 51, 0.06);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  padding: 17px;
}
.card.pad-sm { padding: 14px; }
.card.flush { padding: 0; overflow: hidden; }
.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.card-head h3 { font-size: 13px; font-weight: 800; line-height: 1.5; }
.card-head p { font-size: 10.5px; color: var(--muted); margin-top: 1px; }
.card-head .head-ico {
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  border-radius: 11px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  flex: 0 0 auto;
}
.card-head .head-ico svg { width: 17px; height: 17px; }

/* ── Buttons ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 8px 15px;
  border-radius: 13px;
  border: 1px solid transparent;
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.16s var(--ease), background 0.2s, box-shadow 0.2s, border-color 0.2s, color 0.2s;
  white-space: nowrap;
  user-select: none;
}
.btn svg { width: 17px; height: 17px; flex: 0 0 auto; }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(135deg, #0d9488, #0f766e);
  color: #fff;
  box-shadow: 0 10px 22px -12px rgba(13, 148, 136, 0.85);
}
.btn-primary:hover { background: linear-gradient(135deg, #0f9e91, #0e6b64); }
.btn-dark {
  background: linear-gradient(135deg, #123c47, #072a35);
  color: #fff;
  box-shadow: 0 10px 22px -14px rgba(7, 42, 53, 0.9);
}
.btn-soft { background: var(--brand-soft); color: var(--brand-dark); border-color: var(--brand-soft-2); }
.btn-soft:hover { background: var(--brand-soft-2); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-amber { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #451a03; box-shadow: 0 10px 22px -14px rgba(245, 158, 11, 0.9); }
.btn-danger { background: var(--rose-soft); color: #b4123a; border-color: #ffd6e0; }
.btn-danger:hover { background: #ffdbe4; }
.btn-danger-solid { background: linear-gradient(135deg, #e11d48, #be123c); color: #fff; }
.btn-sm { min-height: 33px; padding: 5px 11px; font-size: 11px; border-radius: 11px; gap: 5px; }
.btn-sm svg { width: 14px; height: 14px; }
.btn-block { width: 100%; }
.btn-icon { min-width: 40px; padding: 8px; }
.btn-icon.btn-sm { min-width: 33px; padding: 5px; }

/* ── Chips / badges ────────────────────────────────────────────────────── */
.chips-row {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 1px 1px 4px;
  scrollbar-width: none;
}
.chips-row::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s var(--ease);
}
.chip:hover { border-color: var(--line-strong); color: var(--ink-2); }
.chip svg { width: 14px; height: 14px; }
.chip.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
  font-weight: 700;
}
.chip .count {
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 6px;
  background: var(--surface-3);
  color: var(--muted);
  font-size: 9.5px;
  display: inline-grid;
  place-items: center;
  font-weight: 800;
}
.chip.is-active .count { background: rgba(255, 255, 255, 0.18); color: #fff; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 8px;
  font-size: 9.5px;
  font-weight: 700;
  line-height: 1.6;
  white-space: nowrap;
}
.badge svg { width: 11px; height: 11px; }
.badge-teal { background: var(--brand-soft); color: #0b6b62; }
.badge-amber { background: var(--amber-soft); color: #a85a05; }
.badge-rose { background: var(--rose-soft); color: #be123c; }
.badge-indigo { background: var(--indigo-soft); color: #4338ca; }
.badge-violet { background: var(--violet-soft); color: #6d28d9; }
.badge-sky { background: var(--sky-soft); color: #0369a1; }
.badge-slate { background: var(--slate-soft); color: #526277; }
.badge-outline { background: transparent; border: 1px solid var(--line-strong); color: var(--muted); }

/* ── Avatars ───────────────────────────────────────────────────────────── */
.avatar {
  --av: #0d9488;
  position: relative;
  display: inline-grid;
  place-items: center;
  width: var(--size, 40px);
  height: var(--size, 40px);
  border-radius: calc(var(--size, 40px) * 0.34);
  background: color-mix(in srgb, var(--av) 15%, #fff);
  color: color-mix(in srgb, var(--av) 82%, #062a30);
  font-size: calc(var(--size, 40px) * 0.32);
  font-weight: 800;
  flex: 0 0 auto;
  letter-spacing: -0.3px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--av) 20%, transparent);
}
.avatar.solid {
  background: linear-gradient(140deg, color-mix(in srgb, var(--av) 92%, #fff), color-mix(in srgb, var(--av) 70%, #042b31));
  color: #fff;
}
.avatar .status-dot {
  position: absolute;
  bottom: 1px;
  inset-inline-end: 1px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: #22c55e;
  border: 2px solid #fff;
}

/* ── Stats ─────────────────────────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.stat-card {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid rgba(15, 31, 51, 0.06);
  border-radius: 19px;
  padding: 13px 14px;
  box-shadow: var(--shadow-sm);
  min-height: 96px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.stat-card::after {
  content: "";
  position: absolute;
  width: 76px; height: 76px;
  border-radius: 50%;
  top: -36px; inset-inline-start: -26px;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent, #0d9488) 13%, transparent), transparent 70%);
  pointer-events: none;
}
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stat-ico {
  display: grid;
  place-items: center;
  width: 33px; height: 33px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent, #0d9488) 12%, #fff);
  color: color-mix(in srgb, var(--accent, #0d9488) 85%, #0b2b33);
}
.stat-ico svg { width: 17px; height: 17px; }
.stat-trend { font-size: 9.5px; font-weight: 700; color: var(--muted); display: inline-flex; align-items: center; gap: 2px; }
.stat-trend.up { color: #0f8a6f; }
.stat-trend.down { color: var(--rose); }
.stat-value { font-size: 23px; font-weight: 800; line-height: 1.35; letter-spacing: -0.8px; margin-top: 2px; }
.stat-value small { font-size: 10px; font-weight: 600; color: var(--muted); letter-spacing: 0; margin-inline-start: 3px; }
.stat-label { font-size: 10.5px; color: var(--muted); line-height: 1.6; }

/* ── Hero ──────────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
  padding: 20px;
  color: #fff;
  background:
    radial-gradient(100% 140% at 96% 0%, rgba(20, 184, 166, 0.5), transparent 55%),
    radial-gradient(120% 130% at 0% 100%, rgba(79, 70, 229, 0.32), transparent 60%),
    linear-gradient(135deg, #0b3f4b 0%, #072f39 52%, #062630 100%);
  box-shadow: 0 24px 48px -28px rgba(7, 42, 53, 0.75);
  isolation: isolate;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(rgba(255, 255, 255, 0.13) 1px, transparent 1px);
  background-size: 17px 17px;
  mask-image: linear-gradient(115deg, rgba(0,0,0,.8), transparent 65%);
  opacity: 0.5;
}
.hero::after {
  content: "";
  position: absolute;
  width: 190px; height: 190px;
  border-radius: 50%;
  top: -90px; inset-inline-start: 24%;
  background: radial-gradient(circle, rgba(251, 191, 36, 0.26), transparent 68%);
  z-index: -1;
}
.hero-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.hero-greet { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  color: #9fd9d6;
  font-weight: 500;
}
.hero-eyebrow svg { width: 13px; height: 13px; color: #fcd34d; }
.hero-greet h2 { font-size: 19px; font-weight: 800; letter-spacing: -0.3px; line-height: 1.5; }
.hero-greet h2 span { color: #fcd34d; }
.hero-greet p { font-size: 10.5px; color: #a9c9cd; }
.hero-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 9.5px;
  color: #d8f3ef;
  white-space: nowrap;
}
.hero-status i { width: 6px; height: 6px; border-radius: 50%; background: #34d399; display: inline-block; box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.18); }
.hero-status.warn i { background: #fbbf24; box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.18); }
.hero-status.off i { background: #94a3b8; box-shadow: none; }

.hero-clock { display: flex; align-items: flex-end; gap: 6px; margin: 14px 0 2px; }
.hero-clock strong {
  font-size: 38px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 1px;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}
.hero-clock span { font-size: 11px; color: #9fd9d6; padding-bottom: 3px; }
.hero-meta { font-size: 10.5px; color: #a9c9cd; display: flex; flex-wrap: wrap; gap: 10px; }
.hero-meta span { display: inline-flex; align-items: center; gap: 4px; }
.hero-meta svg { width: 12px; height: 12px; opacity: 0.8; }

.hero-actions { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.hero-actions .btn { min-height: 38px; font-size: 11.5px; border-radius: 12px; }
.hero .btn-light {
  background: rgba(255, 255, 255, 0.96);
  color: #06353d;
  box-shadow: 0 10px 20px -14px rgba(0, 0, 0, 0.7);
}
.hero .btn-light:hover { background: #fff; }
.hero .btn-glass {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #e7fbf8;
}
.hero .btn-glass:hover { background: rgba(255, 255, 255, 0.18); }
.hero .btn-amber { color: #422006; }

/* ── Dashboard layout ──────────────────────────────────────────────────── */
.dash-grid { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
.span-2 { grid-column: 1 / -1; }

/* ── Charts ────────────────────────────────────────────────────────────── */
.chart-wrap { width: 100%; }
.chart-wrap svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-empty {
  min-height: 140px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
  font-size: 11px;
  gap: 6px;
}
.chart-empty svg { width: 28px; height: 28px; color: var(--muted-2); }
.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-top: 8px;
}
.legend-item { display: inline-flex; align-items: center; gap: 5px; font-size: 10px; color: var(--muted); }
.legend-dot { width: 7px; height: 7px; border-radius: 3px; display: inline-block; }
.donut-layout { display: flex; align-items: center; gap: 8px; }
.donut-layout .donut-svg { width: 132px; flex: 0 0 132px; }
.donut-side { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.donut-row { display: flex; align-items: center; gap: 7px; font-size: 10px; color: var(--muted); }
.donut-row b { margin-inline-start: auto; color: var(--ink-2); font-size: 10.5px; font-weight: 700; }
.donut-row .legend-dot { width: 8px; height: 8px; border-radius: 3px; }
.donut-row .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

svg .axis-text { font-family: Vazirmatn, Tahoma, sans-serif; font-size: 9.5px; fill: #8a99ab; }
svg .grid-line { stroke: #e9eef5; stroke-width: 1; }
svg .bar { transform-box: fill-box; transform-origin: bottom; animation: growBar 0.75s var(--ease) both; }
@keyframes growBar { from { transform: scaleY(0.02); opacity: 0.4; } to { transform: scaleY(1); opacity: 1; } }
svg .line-path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: drawLine 1.1s var(--ease) 0.15s forwards; vector-effect: non-scaling-stroke; }
@keyframes drawLine { to { stroke-dashoffset: 0; } }
svg .area-fill { opacity: 0; animation: fadeIn 0.8s ease 0.45s forwards; }
svg .dot { opacity: 0; animation: fadeIn 0.4s ease forwards; }
svg .donut-seg { animation: donutGrow 0.9s var(--ease) both; }
@keyframes donutGrow { from { stroke-dasharray: 0 999; } }
@keyframes fadeIn { to { opacity: 1; } }

/* ── Meter / progress ──────────────────────────────────────────────────── */
.meter {
  height: 7px;
  border-radius: 10px;
  background: var(--surface-3);
  overflow: hidden;
  width: 100%;
}
.meter > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #14b8a6, #0d9488);
  transition: width 0.7s var(--ease);
}
.meter.amber > span { background: linear-gradient(90deg, #fbbf24, #f59e0b); }
.meter.rose > span { background: linear-gradient(90deg, #fb7185, #e11d48); }
.meter.indigo > span { background: linear-gradient(90deg, #818cf8, #4f46e5); }

.progress-row { display: flex; flex-direction: column; gap: 5px; }
.progress-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 10px; color: var(--muted); }
.progress-top b { color: var(--ink-2); font-size: 10.5px; }

/* ── Lists ─────────────────────────────────────────────────────────────── */
.stack { display: flex; flex-direction: column; gap: 10px; }
.stack-sm { display: flex; flex-direction: column; gap: 7px; }
.hstack { display: flex; align-items: center; gap: 9px; }
.hstack.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.tiny { font-size: 10px; }
.small { font-size: 11px; }
.nowrap { white-space: nowrap; }
.divider { height: 1px; background: var(--line); border: 0; margin: 12px 0; }

.mini-person { display: flex; align-items: center; gap: 9px; min-width: 0; }
.mini-person .mp-text { min-width: 0; }
.mini-person b {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.5;
}
.mini-person small {
  display: block;
  font-size: 9.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.5;
}

.emp-rank {
  display: grid;
  grid-template-columns: 18px 34px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}
.emp-rank .rank {
  font-size: 10px;
  font-weight: 800;
  color: var(--muted-2);
  text-align: center;
}
.emp-rank .rank.top { color: var(--amber); }
.emp-rank .bar-line { grid-column: 3; }

/* ── Forms ─────────────────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 5px; }
.field-label {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--ink-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.field-label span { font-weight: 400; color: var(--muted-2); font-size: 9.5px; }
.input, .select, .textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--ink);
  font-size: 12px;
  font-weight: 500;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  appearance: none;
}
.input::placeholder, .textarea::placeholder { color: var(--muted-2); font-weight: 400; }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--brand);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.1);
}
.textarea { min-height: 78px; resize: vertical; line-height: 1.8; }
.select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 11px center;
  padding-inline-start: 32px;
  cursor: pointer;
}
input[type="time"].input { direction: ltr; text-align: right; font-variant-numeric: tabular-nums; }
input[type="number"].input { direction: ltr; text-align: right; }
.form-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
.form-hint { font-size: 9.5px; color: var(--muted-2); line-height: 1.7; }
.form-error {
  display: none;
  align-items: center;
  gap: 5px;
  padding: 7px 10px;
  border-radius: 10px;
  background: var(--rose-soft);
  color: #b4123a;
  font-size: 10.5px;
  font-weight: 600;
}
.form-error.show { display: flex; }
.form-error svg { width: 14px; height: 14px; flex: 0 0 auto; }
.form-actions { display: flex; gap: 8px; margin-top: 4px; }
.form-actions .btn { flex: 1; }
.form-section { display: flex; flex-direction: column; gap: 11px; }
.form-section + .form-section { margin-top: 4px; }

.date-field {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-align: start;
  transition: border-color 0.2s, background 0.2s;
}
.date-field:hover { border-color: var(--brand); background: #fff; }
.date-field svg { width: 16px; height: 16px; color: var(--brand-dark); flex: 0 0 auto; }
.date-field .chev { margin-inline-start: auto; color: var(--muted-2); width: 14px; height: 14px; }

.segmented {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 3px;
  padding: 3px;
  border-radius: 13px;
  background: var(--surface-3);
  border: 1px solid var(--line);
}
.segmented label {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 7px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s;
}
.segmented label:has(input:checked) {
  background: #fff;
  color: var(--ink);
  font-weight: 800;
  box-shadow: 0 2px 8px -3px rgba(15, 31, 51, 0.2);
}
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented svg { width: 14px; height: 14px; }

.type-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.type-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  cursor: pointer;
  transition: all 0.2s var(--ease);
}
.type-option svg { width: 17px; height: 17px; color: var(--type-color, var(--brand)); flex: 0 0 auto; }
.type-option b { font-size: 10.5px; font-weight: 600; color: var(--ink-2); line-height: 1.4; }
.type-option input { position: absolute; opacity: 0; pointer-events: none; }
.type-option:has(input:checked) {
  border-color: var(--type-color, var(--brand));
  background: color-mix(in srgb, var(--type-color, var(--brand)) 8%, #fff);
  box-shadow: inset 0 0 0 1px var(--type-color, var(--brand));
}
.type-option:has(input:checked) b { color: var(--ink); font-weight: 800; }

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.switch-row b { font-size: 11.5px; font-weight: 600; display: block; }
.switch-row small { font-size: 9.5px; color: var(--muted); }
.switch { position: relative; width: 40px; height: 23px; flex: 0 0 auto; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch span {
  position: absolute;
  inset: 0;
  border-radius: 20px;
  background: #cbd5e1;
  transition: background 0.2s;
  pointer-events: none;
}
.switch span::after {
  content: "";
  position: absolute;
  top: 3px; inset-inline-start: 3px;
  width: 17px; height: 17px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s var(--ease);
}
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::after { transform: translateX(-17px); }

.searchbox { position: relative; }
.searchbox svg {
  position: absolute;
  top: 50%;
  inset-inline-start: 12px;
  transform: translateY(-50%);
  width: 16px; height: 16px;
  color: var(--muted-2);
  pointer-events: none;
}
.searchbox .input { padding-inline-start: 36px; background: var(--surface); }

/* ── Filter bar ────────────────────────────────────────────────────────── */
.filter-bar { display: flex; flex-direction: column; gap: 9px; }
.filter-row { display: flex; gap: 7px; align-items: center; }
.filter-row .searchbox { flex: 1; }
.filter-row .select { width: auto; min-width: 108px; }

/* ── Attendance rows ───────────────────────────────────────────────────── */
.att-list { display: flex; flex-direction: column; }
.att-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "person state"
    "times actions";
  gap: 8px 10px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--line);
  align-items: center;
}
.att-row:last-child { border-bottom: 0; }
.att-person { grid-area: person; }
.att-person .mini-person b { font-size: 12px; }
.att-times { grid-area: times; display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.att-time {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.att-time b { color: var(--ink-2); font-size: 11px; font-weight: 700; }
.att-time svg { width: 12px; height: 12px; opacity: 0.7; }
.att-time.miss b { color: var(--muted-2); font-weight: 500; }
.att-worked { font-size: 10px; font-weight: 700; color: var(--ink-2); background: var(--surface-2); padding: 2px 7px; border-radius: 7px; }
.att-worked.ot { color: #a85a05; background: var(--amber-soft); }
.att-state { grid-area: state; justify-self: end; }
.att-actions { grid-area: actions; justify-self: end; display: flex; gap: 5px; }

.day-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 12px;
}
.day-summary .ds {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 7px 4px;
  border-radius: 11px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.day-summary b { font-size: 14px; font-weight: 800; line-height: 1.4; }
.day-summary small { font-size: 9px; color: var(--muted); }
.day-summary .ds.present b { color: var(--brand-dark); }
.day-summary .ds.leave b { color: var(--indigo); }
.day-summary .ds.late b { color: #b45309; }
.day-summary .ds.absent b { color: var(--rose); }

.date-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px;
}
.date-nav .dn-mid { flex: 1; text-align: center; min-width: 0; }
.date-nav .dn-mid b { display: block; font-size: 14px; font-weight: 800; line-height: 1.5; }
.date-nav .dn-mid small { display: block; font-size: 10px; color: var(--muted); }
.date-nav .icon-btn { width: 34px; height: 34px; border-radius: 10px; flex: 0 0 auto; }
.week-strip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-top: 9px;
}
.day-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 6px 2px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  cursor: pointer;
  color: var(--muted);
  transition: all 0.2s;
}
.day-pill small { font-size: 8.5px; font-weight: 500; }
.day-pill b { font-size: 13px; font-weight: 700; color: var(--ink-2); line-height: 1.4; }
.day-pill:hover { background: var(--surface-2); }
.day-pill.is-active { background: var(--brand); border-color: var(--brand); color: #d7fbf4; }
.day-pill.is-active b { color: #fff; }
.day-pill.is-today:not(.is-active) { border-color: var(--brand-soft-2); }
.day-pill.is-today:not(.is-active) b { color: var(--brand-dark); }
.day-pill.is-off b { color: var(--muted-2); }

/* ── Leave cards ───────────────────────────────────────────────────────── */
.leave-card {
  background: var(--surface);
  border: 1px solid rgba(15, 31, 51, 0.06);
  border-radius: 19px;
  padding: 13px;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: 9px;
  animation: pageIn 0.35s var(--ease) both;
}
.leave-card.pending { border-inline-start: 3px solid var(--amber-bright); }
.leave-card.rejected { opacity: 0.78; }
.leave-top { display: flex; align-items: flex-start; gap: 9px; }
.leave-top .grow { min-width: 0; }
.leave-badges { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-top: 2px; }
.leave-date {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 9px;
  border-radius: 10px;
  background: var(--surface-2);
  font-size: 10.5px;
  color: var(--ink-2);
  font-weight: 600;
  flex-wrap: wrap;
}
.leave-date svg { width: 13px; height: 13px; color: var(--brand-dark); flex: 0 0 auto; }
.leave-date .sep { color: var(--line-strong); }
.leave-date .dur { color: var(--muted); font-weight: 500; font-size: 10px; }
.leave-reason {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  font-size: 10.5px;
  color: var(--muted);
  line-height: 1.9;
}
.leave-reason svg { width: 12px; height: 12px; flex: 0 0 auto; margin-top: 3px; }
.leave-reason span { min-width: 0; }
.leave-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.leave-foot .meta { font-size: 9px; color: var(--muted-2); }
.leave-foot .acts { display: flex; gap: 5px; }

.leave-type-ico {
  display: grid;
  place-items: center;
  width: 36px; height: 36px;
  border-radius: 11px;
  background: color-mix(in srgb, var(--tc, #0d9488) 11%, #fff);
  color: var(--tc, #0d9488);
  flex: 0 0 auto;
}
.leave-type-ico svg { width: 18px; height: 18px; }

.leave-summary-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}
.lsb {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 13px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.lsb .ico { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; background: var(--soft, var(--brand-soft)); color: var(--clr, var(--brand-dark)); flex: 0 0 auto; }
.lsb .ico svg { width: 15px; height: 15px; }
.lsb b { display: block; font-size: 14px; font-weight: 800; line-height: 1.35; }
.lsb small { display: block; font-size: 8.5px; color: var(--muted); }

/* ── Employee cards ────────────────────────────────────────────────────── */
.emp-grid { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); }
.emp-card {
  position: relative;
  background: var(--surface);
  border: 1px solid rgba(15, 31, 51, 0.06);
  border-radius: 20px;
  padding: 14px;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: 11px;
  transition: transform 0.25s var(--ease), box-shadow 0.25s, border-color 0.2s;
  animation: pageIn 0.35s var(--ease) both;
}
.emp-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: rgba(13, 148, 136, 0.2); }
.emp-card.inactive { opacity: 0.72; }
.emp-top { display: flex; align-items: flex-start; gap: 10px; }
.emp-top .grow { min-width: 0; padding-top: 1px; }
.emp-top b { display: block; font-size: 13px; font-weight: 800; line-height: 1.5; }
.emp-top small { display: block; font-size: 10px; color: var(--muted); line-height: 1.6; }
.emp-top .code { font-size: 8.5px; color: var(--muted-2); font-family: Vazirmatn; letter-spacing: 0.4px; }
.emp-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  padding: 8px 0 0;
  border-top: 1px dashed var(--line);
}
.emp-stat { text-align: center; display: flex; flex-direction: column; gap: 0; }
.emp-stat b { font-size: 13px; font-weight: 800; line-height: 1.4; }
.emp-stat b small { font-size: 8px; font-weight: 500; color: var(--muted); margin-inline-start: 1px; }
.emp-stat small { font-size: 8px; color: var(--muted); }
.emp-foot { display: flex; align-items: center; gap: 6px; }
.emp-foot .btn { flex: 1; }

/* ── Employee detail ───────────────────────────────────────────────────── */
.detail-hero {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.detail-hero .grow h3 { font-size: 16px; font-weight: 800; line-height: 1.5; }
.detail-hero .grow p { font-size: 10.5px; color: var(--muted); }
.detail-hero .grow .hstack { margin-top: 3px; gap: 4px; flex-wrap: wrap; }
.info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 12px;
}
.info-cell {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 9px;
  background: var(--surface-2);
  border-radius: 10px;
  min-width: 0;
}
.info-cell svg { width: 14px; height: 14px; color: var(--brand-dark); flex: 0 0 auto; }
.info-cell small { display: block; font-size: 8px; color: var(--muted); line-height: 1.5; }
.info-cell b { display: block; font-size: 10px; font-weight: 600; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.6; direction: ltr; text-align: start; }
.info-cell b.rtl { direction: rtl; }
.detail-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin-top: 10px; }
.detail-stat {
  text-align: center;
  padding: 9px 4px;
  border-radius: 12px;
  background: var(--surface-2);
}
.detail-stat b { display: block; font-size: 16px; font-weight: 800; line-height: 1.35; color: var(--accent, var(--ink)); }
.detail-stat small { display: block; font-size: 8px; color: var(--muted); margin-top: 1px; }
.detail-section { margin-top: 15px; }
.detail-section h4 { font-size: 11.5px; font-weight: 800; display: flex; align-items: center; gap: 5px; margin-bottom: 7px; }
.detail-section h4 svg { width: 14px; height: 14px; color: var(--brand-dark); }
.mini-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 9px;
  border-radius: 10px;
  background: var(--surface-2);
  font-size: 10px;
}
.mini-row + .mini-row { margin-top: 4px; }
.mini-row .l { display: flex; align-items: center; gap: 6px; color: var(--ink-2); font-weight: 600; min-width: 0; }
.mini-row .l svg { width: 12px; height: 12px; color: var(--muted); flex: 0 0 auto; }
.mini-row .r { color: var(--muted); font-size: 9.5px; white-space: nowrap; }
.mini-row .r b { color: var(--ink-2); }

/* ── More page ─────────────────────────────────────────────────────────── */
.report-hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
  padding: 18px;
  color: #fff;
  background:
    radial-gradient(90% 130% at 100% 0%, rgba(251, 191, 36, 0.28), transparent 55%),
    linear-gradient(135deg, #123c47, #062630);
  display: flex;
  align-items: center;
  gap: 13px;
}
.report-hero .rh-ico {
  display: grid;
  place-items: center;
  width: 46px; height: 46px;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #fcd34d;
  flex: 0 0 auto;
}
.report-hero .rh-ico svg { width: 23px; height: 23px; }
.report-hero h2 { font-size: 15px; font-weight: 800; line-height: 1.5; }
.report-hero p { font-size: 10px; color: #a9c9cd; line-height: 1.8; margin-top: 1px; }
.report-hero .badge { margin-top: 5px; }

.dept-row { display: flex; flex-direction: column; gap: 5px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.dept-row:last-child { border: 0; padding-bottom: 0; }
.dept-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 10px; }
.dept-top b { font-size: 11px; font-weight: 700; }
.dept-top span { color: var(--muted); font-size: 9.5px; }

.data-counts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin: 10px 0; }
.data-count {
  text-align: center;
  padding: 8px 3px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.data-count b { display: block; font-size: 15px; font-weight: 800; color: #fff; line-height: 1.35; }
.data-count small { display: block; font-size: 8px; color: #a9c9cd; }

.json-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
  padding: 18px;
  color: #fff;
  background:
    radial-gradient(90% 120% at 0% 0%, rgba(20, 184, 166, 0.28), transparent 60%),
    linear-gradient(140deg, #0d3340, #071f29);
  box-shadow: 0 22px 45px -28px rgba(7, 31, 41, 0.8);
}
.json-card::before {
  content: "{ }";
  position: absolute;
  inset-inline-start: 12px;
  bottom: -26px;
  font-size: 96px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.045);
  letter-spacing: -8px;
  font-family: ui-monospace, monospace;
  pointer-events: none;
}
.json-card h3 { font-size: 14px; font-weight: 800; display: flex; align-items: center; gap: 7px; }
.json-card h3 svg { width: 19px; height: 19px; color: #5eead4; }
.json-card p { font-size: 10px; color: #9fc2c7; line-height: 1.9; margin-top: 3px; position: relative; }
.json-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 11px; position: relative; }
.json-actions .btn { min-height: 37px; font-size: 10.5px; }
.json-actions .wide { grid-column: 1 / -1; }
.json-card .btn-white { background: #fff; color: #08313a; }
.json-card .btn-outline-light { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.18); color: #d9f2f0; }
.json-card .btn-outline-light:hover { background: rgba(255, 255, 255, 0.14); }
.json-meta { display: flex; align-items: center; gap: 5px; margin-top: 10px; font-size: 8.5px; color: #7fa5aa; flex-wrap: wrap; position: relative; }
.json-meta .dot { width: 3px; height: 3px; background: #527b81; border-radius: 50%; }

.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.settings-grid .full { grid-column: 1 / -1; }

.about-list { display: flex; flex-direction: column; gap: 7px; }
.about-item { display: flex; gap: 8px; font-size: 10.5px; color: var(--muted); line-height: 1.8; }
.about-item svg { width: 14px; height: 14px; color: var(--brand); flex: 0 0 auto; margin-top: 3px; }

/* ── Timeline ──────────────────────────────────────────────────────────── */
.timeline { display: flex; flex-direction: column; }
.tl-item {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 9px;
  position: relative;
  padding-bottom: 13px;
}
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: "";
  position: absolute;
  top: 20px;
  bottom: 0;
  inset-inline-start: 10px;
  width: 1px;
  background: var(--line);
}
.tl-item:last-child::before { display: none; }
.tl-dot {
  width: 21px; height: 21px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--soft, var(--brand-soft));
  color: var(--clr, var(--brand-dark));
  z-index: 1;
}
.tl-dot svg { width: 11px; height: 11px; }
.tl-text b { display: block; font-size: 10.5px; font-weight: 600; color: var(--ink-2); line-height: 1.7; }
.tl-text small { display: block; font-size: 9px; color: var(--muted); line-height: 1.6; }

/* ── Empty state ───────────────────────────────────────────────────────── */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 5px;
  padding: 30px 16px;
  color: var(--muted);
}
.empty .empty-ico {
  display: grid;
  place-items: center;
  width: 50px; height: 50px;
  border-radius: 16px;
  background: var(--surface-2);
  color: var(--muted-2);
  margin-bottom: 4px;
}
.empty .empty-ico svg { width: 24px; height: 24px; }
.empty b { font-size: 12px; color: var(--ink-2); font-weight: 700; }
.empty p { font-size: 10px; color: var(--muted); max-width: 240px; line-height: 1.9; }
.empty .btn { margin-top: 7px; }

/* ── Modal / sheet ─────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(6, 30, 38, 0.46);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  animation: overlayIn 0.25s ease both;
}
@keyframes overlayIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: 100%;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: 26px 26px 0 0;
  box-shadow: var(--shadow-lg);
  animation: sheetIn 0.35s var(--ease) both;
  overflow: hidden;
}
@keyframes sheetIn { from { transform: translateY(32px); opacity: 0.6; } to { transform: none; opacity: 1; } }
.modal.wide { max-width: 560px; }
.modal-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}
.modal-head .grow h2 { font-size: 15px; font-weight: 800; line-height: 1.5; }
.modal-head .grow p { font-size: 10px; color: var(--muted); margin-top: 1px; line-height: 1.7; }
.modal-close {
  flex: 0 0 auto;
  width: 32px; height: 32px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  cursor: pointer;
}
.modal-close:hover { background: var(--surface-3); color: var(--ink); }
.modal-close svg { width: 16px; height: 16px; }
.modal-body {
  padding: 15px 18px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.modal-foot {
  padding: 11px 18px calc(13px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
  background: var(--surface);
}
.modal-foot .btn { flex: 1; }
.modal-foot .btn-ghost { flex: 0 0 auto; }
.sheet-handle {
  width: 38px; height: 4px;
  border-radius: 4px;
  background: var(--line-strong);
  margin: 7px auto 0;
  flex: 0 0 auto;
}
.modal-note {
  display: flex;
  gap: 7px;
  padding: 9px 11px;
  border-radius: 11px;
  background: var(--brand-soft);
  color: #0b6b62;
  font-size: 9.5px;
  line-height: 1.9;
  margin-bottom: 12px;
}
.modal-note svg { width: 14px; height: 14px; flex: 0 0 auto; margin-top: 2px; }
.modal-note.amber { background: var(--amber-soft); color: #92500a; }
.modal-note.rose { background: var(--rose-soft); color: #b4123a; }

/* ── Date picker ───────────────────────────────────────────────────────── */
.dp-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 11px; }
.dp-head b { font-size: 13px; font-weight: 800; }
.dp-nav { display: flex; gap: 5px; }
.dp-nav .icon-btn { width: 32px; height: 32px; border-radius: 9px; }
.dp-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; margin-bottom: 4px; }
.dp-weekdays span { text-align: center; font-size: 9px; color: var(--muted-2); font-weight: 600; padding: 3px 0; }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.dp-day {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  font-variant-numeric: tabular-nums;
}
.dp-day:hover { background: var(--surface-2); }
.dp-day.out { color: var(--muted-2); opacity: 0.4; cursor: default; pointer-events: none; }
.dp-day.friday { color: var(--rose); }
.dp-day.today { border-color: var(--brand); color: var(--brand-dark); font-weight: 800; }
.dp-day.selected { background: var(--brand); color: #fff; border-color: var(--brand); box-shadow: 0 6px 14px -7px rgba(13, 148, 136, 0.8); }
.dp-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 11px; padding-top: 10px; border-top: 1px solid var(--line); }
.dp-foot small { font-size: 9px; color: var(--muted-2); }
.dp-controls { display: grid; grid-template-columns: 1fr 1fr auto; gap: 6px; margin-bottom: 11px; }
.dp-controls .select {
  min-height: 36px;
  font-size: 11px;
  padding: 6px 8px;
  padding-inline-start: 26px;
  background-position: left 8px center;
  border-radius: 10px;
}
.dp-controls .btn { min-height: 36px; border-radius: 10px; }

body.modal-open { overflow: hidden; }

.code-block {
  direction: ltr;
  text-align: left;
  margin: 8px 0 0;
  padding: 10px 12px;
  border-radius: 11px;
  background: #0b2530;
  color: #b9e8e2;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9.5px;
  line-height: 1.8;
  overflow-x: auto;
  white-space: pre;
}

/* ── Toasts ────────────────────────────────────────────────────────────── */
.toast-root {
  position: fixed;
  z-index: 200;
  left: 50%;
  bottom: calc(90px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  width: max-content;
  max-width: calc(100vw - 32px);
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 13px;
  background: rgba(8, 40, 48, 0.96);
  color: #eefcf9;
  font-size: 11px;
  font-weight: 600;
  box-shadow: 0 16px 35px -18px rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  animation: toastIn 0.3s var(--ease) both;
  line-height: 1.7;
}
.toast svg { width: 16px; height: 16px; flex: 0 0 auto; }
.toast.success svg { color: #5eead4; }
.toast.error { background: rgba(76, 5, 25, 0.96); }
.toast.error svg { color: #fda4af; }
.toast.info svg { color: #93c5fd; }
.toast.out { animation: toastOut 0.25s ease both; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px) scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-6px) scale(0.98); } }

/* ── Misc ──────────────────────────────────────────────────────────────── */
.noscript {
  position: fixed;
  inset: auto 16px 16px;
  z-index: 300;
  padding: 14px;
  border-radius: 14px;
  background: #fff3cd;
  color: #664d03;
  font-size: 12px;
  text-align: center;
}

.insight {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--amber-soft);
  border: 1px solid #fde7c3;
  font-size: 10px;
  color: #8a5308;
  line-height: 1.9;
}
.insight svg { width: 15px; height: 15px; flex: 0 0 auto; margin-top: 2px; }
.insight.teal { background: var(--brand-soft); border-color: var(--brand-soft-2); color: #0b6b62; }

.kv-list { display: flex; flex-direction: column; gap: 6px; }
.kv { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 10.5px; }
.kv span { color: var(--muted); }
.kv b { color: var(--ink-2); font-weight: 700; }

.skeleton { height: 10px; border-radius: 6px; background: linear-gradient(90deg, #eef2f7, #f8fafc, #eef2f7); background-size: 200% 100%; animation: shimmer 1.3s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 519px) {
  .att-worked { display: none; }
}

@media (min-width: 520px) {
  .view { padding: 18px 22px 120px; }
  .topbar-inner { padding: 10px 22px; }
  .hero { padding: 24px; }
  .hero-greet h2 { font-size: 21px; }
  .hero-clock strong { font-size: 42px; }
  .stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .emp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .type-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .att-row {
    grid-template-columns: minmax(0, 1.5fr) 1.2fr auto auto auto;
    grid-template-areas: "person times worked state actions";
    gap: 8px;
    padding: 10px 4px;
  }
  .att-worked { grid-area: worked; justify-self: center; }
  .week-strip { gap: 6px; }
}

@media (min-width: 900px) {
  .sidebar { display: block; }
  .bottomnav { display: none; }
  .view { padding: 24px 32px 10px; }
  .topbar { background: rgba(238, 242, 247, 0.72); }
  .topbar-inner { padding: 12px 32px; min-height: 68px; }
  .topbar-brand { display: none; }
  .topbar-titles { display: block; }
  .today-chip { display: inline-flex; }
  .page-footer { display: flex; }
  .dash-grid { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 16px; }
  .hero { padding: 26px; }
  .dash-grid .span-2 { grid-column: 1 / -1; }
  .emp-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
  .modal-overlay { align-items: center; padding: 20px; }
  .modal { border-radius: 24px; max-width: 460px; max-height: 88vh; animation: dialogIn 0.28s var(--ease) both; }
  .modal.wide { max-width: 640px; }
  .modal.large { max-width: 680px; }
  @keyframes dialogIn { from { opacity: 0; transform: translateY(14px) scale(0.98); } to { opacity: 1; transform: none; } }
  .sheet-handle { display: none; }
  .modal-foot { padding-bottom: 15px; }
  .toast-root { bottom: 28px; }
  .date-nav { padding: 6px 10px; }
  .date-nav .dn-mid b { font-size: 16px; }
  .leave-list-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .leave-list-grid .empty { grid-column: 1 / -1; }
}

@media (min-width: 1180px) {
  .emp-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 899px) {
  .page-head h1 { font-size: 18px; }
  .page-head { padding-top: 2px; }
}

@media (max-width: 380px) {
  .view { padding-inline: 12px; }
  .hero { padding: 17px; }
  .hero-clock strong { font-size: 34px; }
  .hero-greet h2 { font-size: 17px; }
  .stat-grid { gap: 8px; }
  .stat-card { padding: 11px 12px; min-height: 90px; }
  .stat-value { font-size: 20px; }
  .bottomnav { left: 7px; right: 7px; height: 64px; }
  .bn-label { font-size: 9px; }
  .btn { padding: 8px 12px; }
  .json-actions { grid-template-columns: 1fr; }
}

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