@import url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/Vazirmatn-font-face.css');
@import url('base.css');

:root {
  /* تم تیره جدید: سبز سازمانی + بک‌گراند تیره */
  --bg:
    radial-gradient(circle at 12% -8%, rgba(0, 227, 140, 0.08), transparent 55%),
    radial-gradient(circle at 100% 100%, rgba(15, 23, 42, 0.35), transparent 65%),
    #050609;
  --panel: #0b0d12;
  --panel-strong: #090b10;
  --border: rgba(148, 163, 184, 0.22);
  --text: #e5e7eb;
  --muted: #9ca3af;
  --accent: #00e38c;
  --accent-2: #33f3a1;
  --success: #00e38c;
  --danger: #f87171;
  --warning: #facc15;
  --shadow-strong: 0 26px 70px rgba(3, 7, 18, 0.9);
  --shadow-soft: 0 18px 44px rgba(3, 7, 18, 0.55);
  --radius: 14px;
  --app-sidebar-icon-bg: rgba(0, 227, 140, 0.08);
  --app-sidebar-icon-border: rgba(0, 227, 140, 0.25);
  --app-sidebar-icon-active-bg: rgba(0, 227, 140, 0.16);
  --app-sidebar-icon-active-border: rgba(0, 227, 140, 0.45);
  --app-sidebar-desc-active: rgba(0, 227, 140, 0.75);
  --app-sidebar-nav-border: rgba(0, 227, 140, 0.25);
  --app-sidebar-nav-active-border: rgba(0, 227, 140, 0.35);
  --app-sidebar-nav-active-bg: rgba(0, 227, 140, 0.08);
  --app-sidebar-mini-icon-bg: #12151c;
  --app-sidebar-mini-icon-border: rgba(255, 255, 255, 0.12);
  --app-sidebar-nav-border: rgba(0, 227, 140, 0.25);
  --app-sidebar-nav-active-border: rgba(0, 227, 140, 0.35);
  --app-sidebar-nav-active-bg: rgba(0, 227, 140, 0.08);
}

html[data-theme="light"] {
  --bg:
    radial-gradient(circle at 12% -8%, rgba(31, 107, 79, 0.14), transparent 55%),
    radial-gradient(circle at 100% 100%, rgba(214, 180, 127, 0.30), transparent 55%),
    linear-gradient(155deg, #fdf5ea, #f3e1c8 52%, #fbf2e3);
  --panel: #fff8ee;
  --panel-strong: rgba(255, 248, 238, 0.96);
  --border: rgba(145, 103, 49, 0.35);
  --text: #3b2b1f;
  --muted: #8d7460;
  --accent: #1f6b4f;
  --accent-2: #23845f;
  --success: #1f6b4f;
  --danger: #c2410c;
  --warning: #c97a2d;
  --app-sidebar-icon-bg: rgba(31, 107, 79, 0.08);
  --app-sidebar-icon-border: rgba(31, 107, 79, 0.3);
  --app-sidebar-icon-active-bg: rgba(31, 107, 79, 0.15);
  --app-sidebar-icon-active-border: rgba(31, 107, 79, 0.45);
  --app-sidebar-desc-active: rgba(31, 107, 79, 0.65);
  --app-sidebar-nav-border: rgba(31, 107, 79, 0.3);
  --app-sidebar-nav-active-border: rgba(31, 107, 79, 0.45);
  --app-sidebar-nav-active-bg: rgba(31, 107, 79, 0.12);
  --app-sidebar-mini-icon-bg: #f7eee2;
  --app-sidebar-mini-icon-border: rgba(31, 107, 79, 0.25);
  --app-sidebar-icon-shadow: 0 8px 20px rgba(23, 36, 40, 0.12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Vazirmatn, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

html[data-theme="light"] body {
  background: var(--bg);
}

body.ajax-loading {
  cursor: progress;
}
body.ajax-loading::before {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(2px);
  z-index: 9998;
}
body.ajax-loading::after {
  content: "Loading...";
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel-strong);
  color: var(--text);
  font-weight: 700;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  z-index: 9999;
}

.filter-field {
  width: 100%;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel-strong);
  color: var(--text);
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.filter-field--compact { padding: 8px 10px; border-radius: 8px; min-width: 160px; }
.filter-field:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.08);
}
.filter-field::placeholder { color: var(--muted); }

a { color: var(--accent); text-decoration: none; transition: color 0.18s ease; }
a:hover { color: var(--accent-2); }

.container { width: min(1220px, 95%); margin: 0 auto; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--panel-strong);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}
.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  color: var(--text);
  font-weight: 800;
  letter-spacing: 0.4px;
}
.nav-toggle {
  display: none;
  width: 44px;
  height: 40px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-direction: column;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel);
  cursor: pointer;
}
.nav-mode-toggle {
  display: none;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--panel);
  cursor: pointer;
  position: relative;
  box-shadow: 0 10px 24px rgba(0,0,0,0.28);
}
.nav-mode-toggle span {
  position: absolute;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: var(--text);
  transition: transform 0.18s ease, opacity 0.18s ease;
}
.nav-mode-toggle span:nth-child(1) { transform: translateY(-6px); }
.nav-mode-toggle span:nth-child(2) { transform: translateY(0); }
.nav-mode-toggle span:nth-child(3) { transform: translateY(6px); }
.nav-mode-toggle[data-state="mini"] span:nth-child(1) { transform: translateY(0) rotate(45deg); }
.nav-mode-toggle[data-state="mini"] span:nth-child(2) { opacity: 0; }
.nav-mode-toggle[data-state="mini"] span:nth-child(3) { transform: translateY(0) rotate(-45deg); }
.nav-mode-toggle { transition: transform 0.15s ease; }
.nav-mode-toggle:hover { transform: translateY(-1px); }
.nav-mode-toggle { display: none; }
.nav-toggle span {
  width: 100%;
  height: 2px;
  border-radius: 999px;
  background: var(--text);
}
.nav-links {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px 10px;
  box-shadow: var(--shadow-soft);
}
.nav-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex: 0 1 auto; }
.nav-items { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.nav-links .nav-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--text);
  border: 1px solid transparent;
  white-space: nowrap;
  min-height: 44px;
  background: linear-gradient(160deg, rgba(255,255,255,0.02), rgba(0,227,140,0.03));
  transition: all 0.18s ease;
}
.nav-links .nav-link:not(.nav-cta):hover {
  border-color: rgba(0, 227, 140, 0.45);
  color: var(--accent);
  background: rgba(0, 227, 140, 0.08);
}
.nav-links .nav-icon {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: 10px;
  background: rgba(0, 227, 140, 0.1);
  border: 1px solid rgba(0, 227, 140, 0.35);
  color: var(--accent);
  box-shadow: 0 8px 20px rgba(0,0,0,0.18);
}
.nav-links .nav-icon svg { width: 100%; height: 100%; stroke: currentColor; fill: none; stroke-width: 1.6; }
.nav-links .nav-label { color: var(--text); font-weight: 800; letter-spacing: 0.1px; }
.nav-links .nav-sub {
  display: none;
  margin-top: 4px;
  font-size: 0.72rem;
  letter-spacing: 0.2px;
  color: var(--muted);
  text-align: center;
}
.nav-actions { display: inline-flex; align-items: center; gap: 8px; margin-inline-start: auto; }
.nav-sprite { position: absolute; width: 0; height: 0; pointer-events: none; }

@media (min-width: 821px) {
  body.nav-mini .nav-row { align-items: flex-start; justify-content: flex-start; gap: 12px; }
  body.nav-mini .nav-header { width: auto; }
  body.nav-mini .nav-links {
    flex: 0 0 auto;
    width: 88px;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 12px 8px;
  }
  body.nav-mini .nav-items,
  body.nav-mini .nav-actions {
    width: 100%;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-inline-start: 0;
  }
  body.nav-mini .nav-links .nav-link {
    width: 100%;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 6px;
    padding: 10px 8px 12px;
  }
  body.nav-mini .nav-links .nav-icon { width: 30px; height: 30px; }
  body.nav-mini .nav-links .nav-label { display: none; }
  body.nav-mini .nav-links .nav-sub { display: block; }
  body.nav-mini .nav-actions .nav-cta { width: 100%; }
}

@media (min-width: 821px) {
  .nav-mode-toggle { display: inline-flex; }
}
@media (max-width: 820px) {
  .nav-mode-toggle { display: none !important; }
  body.nav-mini .nav-links {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  body.nav-mini .nav-links .nav-link {
    flex-direction: row;
    text-align: right;
    align-items: center;
  }
  body.nav-mini .nav-links .nav-label { display: inline; }
  body.nav-mini .nav-links .nav-sub { display: none; }
}
@media (max-width: 960px) {
  .app-sidebar__collapse { display: none !important; }
}

.site-footer {
  margin-top: 32px;
  border-top: 1px solid var(--border);
  padding: 16px 0 22px;
  color: var(--muted);
  font-size: 0.92rem;
}
.site-footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.site-footer__brand {
  color: var(--text);
  font-weight: 700;
}
.site-footer__tagline {
  color: var(--muted);
}
@media (max-width: 640px) {
  .site-footer__inner {
    flex-direction: column;
    text-align: center;
  }
}

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 700;
  border: 1px solid var(--border);
  color: var(--text);
  background: var(--panel);
  transition: all 0.18s ease;
  box-shadow: none;
}
.cta.primary { background: linear-gradient(135deg, rgba(0,227,140,0.18), rgba(0,0,0,0)); color: var(--accent); border-color: rgba(0,227,140,0.35); }
.cta.primary:hover { transform: translateY(-1px); }
.cta.ghost { background: rgba(0,0,0,0.2); color: var(--text); border-color: rgba(255,255,255,0.06); }
.cta.ghost:hover { color: var(--accent); border-color: rgba(0,227,140,0.35); }

.panel {
  padding: 16px;
  margin-top: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-strong);
  position: relative;
  overflow: hidden;
  /* background: var(--panel); */
  /* border: 1px solid var(--border); */
  border-radius: var(--radius);
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.panel-head h1, .panel-head h2, .panel-head h3 { margin: 0; color: var(--text); font-size: 1.2rem; letter-spacing: 0.2px; }

.card {
  border-radius: var(--radius);
  padding: 14px;
  /* border: 1px solid var(--border); */
  /* background: var(--color-bg-card) ; */
  /* box-shadow: none; */
  transition: transform 0.12s ease, border-color 0.12s ease;
}
.card:hover { transform: translateY(-1px); border-color: rgba(0,227,140,0.35); }

.grid { display: grid; gap: 12px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.applications-grid { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.applications-grid .stat-card { min-width: 0; }
.applications-grid .stat-card form .grid.grid-2 { gap: 10px; }
.mini-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-top: 8px; }
.mini-metric {
  display: grid;
  gap: 4px;
  padding: 12px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(0, 227, 140, 0.22), rgba(5, 6, 9, 0.75));
  border: 1px solid rgba(0, 227, 140, 0.35);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.24);
}
.mini-metric__value { display: block; color: var(--text); font-size: 1.3rem; font-weight: 800; line-height: 1.25; }
.mini-metric__label { color: var(--muted); font-size: 0.95rem; line-height: 1.5; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  border: 1px solid rgba(0,227,140,0.35);
  background: rgba(0,227,140,0.12);
  color: var(--accent);
  white-space: nowrap;
  box-shadow: none;
}
.tone-success { color: var(--success); border-color: rgba(0,227,140,0.35); background: rgba(0,227,140,0.1); }
.tone-danger { color: var(--danger); border-color: rgba(248,113,113,0.45); background: rgba(127,29,29,0.25); }
.tone-info { color: var(--accent); border-color: rgba(0,227,140,0.35); background: rgba(0,227,140,0.08); }
.tone-muted { color: var(--muted); border-color: rgba(255,255,255,0.08); background: rgba(255,255,255,0.02); }
.tone-warning { color: var(--warning); border-color: rgba(250,204,21,0.4); background: rgba(71,43,12,0.35); }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: rgba(0,227,140,0.08);
  border-radius: 10px;
  color: var(--accent);
  font-size: 0.9rem;
  border: 1px solid rgba(0,227,140,0.25);
}

.task-checklist {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 8px 0 0 0;
}
.task-checklist-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(0,227,140,0.18);
  background: rgba(255,255,255,0.03);
}
.task-check-toggle {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 1px solid rgba(0,227,140,0.45);
  background: rgba(15,23,42,0.9);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  color: transparent;
}
.task-checklist-item.is-done {
  border-color: rgba(0,227,140,0.6);
  background: rgba(0,227,140,0.12);
}
.task-checklist-item.is-done .task-check-toggle {
  border-color: rgba(0,227,140,0.9);
  background: linear-gradient(135deg, #00e38c, #33f3a1);
  color: #050609;
}
.task-check-label {
  flex: 1;
  color: var(--text);
  font-size: 0.9rem;
}
.task-checklist-item form {
  margin-inline-start: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}

.muted { color: var(--muted); }
.list-clean { list-style: none; padding: 0; margin: 0; }

.table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.table th, .table td { text-align: right; padding: 10px 8px; border-bottom: 1px solid var(--border); }
.table th { color: var(--muted); font-weight: 700; background: var(--panel); }
.table tr:hover td { background: rgba(0, 0, 0, 0.25); }

input, select, textarea {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  padding: 10px 12px;
}
input:focus, select:focus, textarea:focus {
  outline: 1px solid rgba(0, 227, 140, 0.45);
  box-shadow: none;
}

.search-bar {
  display: grid;
  grid-template-columns: 2fr repeat(2, minmax(140px, 1fr)) auto;
  gap: 10px;
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 12px;
  border-radius: 12px;
  box-shadow: none;
}
@media (max-width: 860px) { .search-bar { grid-template-columns: 1fr; } }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  color: #4b5a6d;
  border: 1px solid rgba(255,255,255,0.08);
  font-weight: 700;
}

.hero-panel {
  padding: clamp(18px, 2vw + 14px, 30px);
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
}
.hero-panel__grid { align-items: start; gap: 18px; }
.hero-panel__copy { display: flex; flex-direction: column; gap: 12px; }
.hero-chip-row { display: flex; gap: 8px; flex-wrap: wrap; }
.hero-panel__title { margin: 0; color: var(--text); font-size: clamp(1.7rem, 1vw + 1.4rem, 2.35rem); line-height: 1.4; letter-spacing: 0.2px; }
.hero-sub, .hero-panel__sub { margin: 0; color: var(--muted); line-height: 1.8; }
.hero-list { list-style: none; padding: 0; margin: 4px 0 2px 0; display: grid; gap: 8px; }
.hero-list li { color: var(--text); position: relative; padding-right: 18px; line-height: 1.7; }
.hero-list li::before { content: "•"; position: absolute; right: 0; color: var(--accent); font-weight: 900; }
.hero-panel__aside { display: flex; flex-direction: column; gap: 12px; }
.panel {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: var(--panel);
  box-shadow: none;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.panel-title { color: var(--text); font-weight: 800; font-size: 1.1rem; margin-bottom: 4px; }
.panel-desc { margin: 6px 0 10px 0; color: var(--muted); line-height: 1.6; }
.panel-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; }

.kpi-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  background: var(--panel);
  box-shadow: none;
}
.kpi-card strong { display: block; font-size: 1.5rem; color: var(--text); }
.kpi-card span { color: var(--muted); font-weight: 700; }
.kpi-trend { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); font-weight: 800; }
.partner-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.partner-pill { padding: 7px 12px; background: #181818; border: 1px solid #242424; border-radius: 12px; color: #e2e8f0; font-weight: 700; }

.section-title { margin: 0 0 6px 0; color: var(--text); font-size: 1.3rem; }
.section-intro { margin: 0 0 8px 0; color: var(--muted); line-height: 1.6; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.feature-card { border: 1px solid var(--border); border-radius: 12px; padding: 12px; background: var(--panel); box-shadow: none; color: var(--text); }
.feature-card h4 { margin: 0 0 6px 0; color: var(--text); }
.feature-steps { display: grid; gap: 10px; }
.feature-step { display: flex; gap: 10px; align-items: flex-start; }

.divider { height: 1px; background: #1f1f1f; margin: 12px 0; }

.cta-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.hero { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; background: var(--panel); border: 1px solid var(--border); position: relative; overflow: hidden; }
.hero h1 { margin: 0; color: var(--text); font-size: 1.8rem; letter-spacing: 0.2px; }
.hero-sub { color: var(--muted); line-height: 1.7; margin: 8px 0 12px 0; }

.applications-grid .stat-card form textarea {
  min-height: 120px;
}

.applications-grid .stat-card form textarea,
.applications-grid .stat-card form select {
  width: 100%;
}

@media (max-width: 960px) {
  .applications-grid {
    grid-template-columns: 1fr;
  }
  .applications-grid .stat-card {
    padding: 12px;
  }
  .applications-grid .stat-card form .grid.grid-2 {
    grid-template-columns: 1fr;
  }
  .applications-grid .stat-card .panel-head {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  .applications-grid {
    grid-template-columns: 1fr;
  }
  .applications-grid .stat-card {
    padding: 10px;
  }
  .applications-grid .stat-card .panel-head {
    gap: 6px;
  }
}

.hero-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }

.job-card {
  position: relative;
  border: 1px solid rgba(92, 225, 230, 0.22);
  border-radius: 16px;
  padding: 14px 14px 16px;
  background: linear-gradient(150deg, rgba(92, 225, 230, 0.1), rgba(10, 14, 24, 0.95));
  box-shadow: 0 18px 42px rgba(0,0,0,0.3);
  display: grid;
  gap: 10px;
}
.job-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.job-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.job-deadline { font-size: 0.85rem; }
.profile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.profile-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.panel-profile-summary {
  border-radius: 18px;
  background: radial-gradient(circle at 10% 0, rgba(99,102,241,0.22), transparent 40%), rgba(15,15,23,0.96);
}
.profile-summary-card {
  background: rgba(15, 23, 42, 0.96);
  box-shadow: 0 16px 40px rgba(15,23,42,0.75);
}

.playbook { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.playbook__block { border: 1px solid rgba(255,255,255,0.08); border-radius: 14px; padding: 12px; background: rgba(255,255,255,0.02); box-shadow: var(--shadow-soft); }
.playbook__title { margin: 0 0 4px 0; color: #fff; }
.card-ghost { border: 1px dashed rgba(255,255,255,0.12); border-radius: 14px; padding: 14px; background: rgba(255,255,255,0.01); }
.mini-card {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  padding: 10px;
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.2);
}

.stat-card {
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 12px;
  background: rgba(15, 23, 42, 0.9);
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.2s ease;
}
.stat-card strong { display: block; font-size: 1.4rem; color: #fff; }
.stat-card span { color: var(--muted); font-size: 0.95rem; }
.stat-card:hover { transform: translateY(-2px); border-color: rgba(99,102,241,0.35); box-shadow: 0 14px 32px rgba(15,23,42,0.6); }

.card-grid { display: grid; gap: 12px; }
.card-grid.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.card-grid.grid-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.meta-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.metric-chart {
  border: 1px solid rgba(145, 163, 255, 0.18);
  border-radius: 16px;
  padding: 14px;
  background: radial-gradient(circle at 50% 18%, rgba(120, 164, 255, 0.12), transparent 44%), linear-gradient(180deg, #0f1324 0%, #0b0f1a 100%);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.34);
  display: grid;
  gap: 12px;
}
.metric-chart__canvas {
  height: 300px;
  position: relative;
  padding: 10px;
  border-radius: 12px;
  background: radial-gradient(circle at 50% 30%, rgba(148, 163, 255, 0.16), rgba(15, 19, 32, 0.92));
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.metric-chart__legend { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; margin-bottom: 10px; }
.metric-chart__legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.03);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.2);
}
.metric-chart__legend-label { display: inline-flex; align-items: center; gap: 8px; color: var(--text); font-weight: 700; }
.metric-chart__dot {
  width: 26px;
  height: 10px;
  border-radius: 8px;
  background: var(--dot-color, var(--accent));
  box-shadow: 0 6px 18px rgba(0, 227, 140, 0.38);
}
.metric-chart__legend-value { color: var(--muted); font-weight: 700; font-size: 0.95rem; }
.metric-chart__note { color: var(--muted); font-size: 0.95rem; }

.avatar { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, rgba(0,227,140,0.24), rgba(255,255,255,0.05)); display: inline-flex; align-items: center; justify-content: center; color: var(--text); font-weight: 800; }

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(0, 227, 140, 0.35);
  color: #050609;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  font-weight: 800;
  box-shadow: 0 10px 26px rgba(0,227,140,0.25);
}
.nav-cta.ghost { background: rgba(0,227,140,0.08); border-color: rgba(0,227,140,0.25); color: var(--accent); box-shadow: none; }
.nav-cta .nav-icon { background: rgba(5, 6, 9, 0.5); color: #fdf5ea; border: 1px solid rgba(0,227,140,0.4); box-shadow: none; }
.nav-cta.ghost .nav-icon { background: rgba(0,227,140,0.12); color: var(--accent); border-color: transparent; }
.nav-links .nav-link.nav-cta:hover { box-shadow: 0 14px 32px rgba(0,227,140,0.35); border-color: rgba(0,227,140,0.25); }

.nav-links.is-open { max-height: 420px; opacity: 1; pointer-events: auto; margin-top: 6px; }
.nav-links { max-height: none; opacity: 1; pointer-events: auto; }

/* Theme toggle button (عمومی در هدر و سایدبار) */
.theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid rgba(0, 227, 140, 0.45);
  background: radial-gradient(circle at 30% 30%, #00e38c, #0b8a58);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  margin-inline-start: 6px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.35);
  color: #050609;
  position: relative;
}
.theme-toggle::before,
.theme-toggle::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.theme-toggle::before {
  width: 18px;
  height: 18px;
  background: #050609;
  box-shadow: 0 0 0 2px rgba(5,6,9,0.4);
  transform: translateX(6px);
  opacity: 0;
}
.theme-toggle::after {
  width: 14px;
  height: 14px;
  background: #fdf5ea;
  box-shadow: 0 0 0 2px rgba(253,245,234,0.6);
}
.theme-toggle:hover {
  transform: translateY(-1px);
}

html[data-theme="light"] .theme-toggle {
  background: radial-gradient(circle at 70% 30%, #fff8ee42, #f3e1c81f);
  color: #1f6b4f;
  border-color: rgba(145,103,49,0.35);
}
html[data-theme="light"] .theme-toggle::before {
  opacity: 1;
  transform: translateX(-4px);
  background: #1f6b4f;
  box-shadow: 0 0 0 2px rgba(31,107,79,0.35);
}
html[data-theme="light"] .theme-toggle::after {
  opacity: 0;
}

/* حالت روشن برای چند سطح اصلی UI */
html[data-theme="light"] .site-header {
  background: var(--panel-strong);
  border-bottom-color: var(--border);
  box-shadow: 0 8px 26px rgba(214, 180, 127, 0.35);
}
html[data-theme="light"] .nav-links {
  background: var(--panel);
  border-color: var(--border);
}
html[data-theme="light"] .nav-links .nav-link {
  color: var(--text);
  background: linear-gradient(180deg, rgba(243,225,198,0.35), rgba(255,248,238,0.1));
}
html[data-theme="light"] .nav-links .nav-link:not(.nav-cta):hover {
  background: rgba(31,107,79,0.08);
}
html[data-theme="light"] .nav-links .nav-icon {
  background: rgba(31,107,79,0.12);
  border-color: rgba(31,107,79,0.35);
  color: var(--accent);
}
html[data-theme="light"] .nav-links .nav-label {
  color: var(--text);
}
html[data-theme="light"] .nav-links .nav-sub {
  color: var(--muted);
}

html[data-theme="light"] .site-footer {
  border-top-color: var(--border);
}
html[data-theme="light"] .site-footer__brand {
  color: var(--text);
}
html[data-theme="light"] .site-footer__tagline {
  color: var(--muted);
}

html[data-theme="light"] .panel {
  background: linear-gradient(145deg, #fff8ee, #f9ead3);
  border-radius: 16px;
  border: 1px solid rgba(145,103,49,0.35);
  box-shadow: 0 18px 38px rgba(214,180,127,0.35);
}
html[data-theme="light"] .panel-head h1,
html[data-theme="light"] .panel-head h2,
html[data-theme="light"] .panel-head h3 {
  color: var(--text);
}

html[data-theme="light"] .badge {
  background: rgba(255,248,238,0.95);
  border-color: rgba(145,103,49,0.45);
  color: var(--text);
}
html[data-theme="light"] .tone-muted {
  background: rgba(243,225,198,0.65);
  color: #6d4f36;
  border-color: rgba(145,103,49,0.45);
}
html[data-theme="light"] .tone-info {
  background: rgba(223, 250, 236, 0.9);
  color: #1f6b4f;
  border-color: rgba(31,107,79,0.35);
}
html[data-theme="light"] .tone-success {
  background: rgba(209, 250, 229, 0.95);
  color: #1f6b4f;
  border-color: rgba(31,107,79,0.45);
}
html[data-theme="light"] .tone-danger {
  background: #fee2e2;
  color: #dc2626;
  border-color: rgba(248,113,113,0.7);
}
html[data-theme="light"] .tone-warning {
  background: #fef3c7;
  color: #b45309;
  border-color: rgba(251,191,36,0.7);
}

html[data-theme="light"] .pill {
  background: rgba(255,248,238,0.95);
  border-color: rgba(145,103,49,0.45);
  color: var(--text);
}

html[data-theme="light"] .task-checklist-item {
  border-color: rgba(145,103,49,0.4);
  background: rgba(255,248,238,0.85);
}
html[data-theme="light"] .task-check-toggle {
  border-color: rgba(145,103,49,0.6);
  background: rgba(255, 248, 238, 0.65);
}

html[data-theme="light"] .table th {
  background: rgba(243,225,198,0.65);
  color: #6d4f36;
}
html[data-theme="light"] .table tr:hover td {
  background: rgba(255,248,238,0.65);
}

html[data-theme="light"] input,
html[data-theme="light"] select,
html[data-theme="light"] textarea {
  background: #fffdf8;
  color: var(--text);
  border-color: rgba(145,103,49,0.5);
}
html[data-theme="light"] input:focus,
html[data-theme="light"] select:focus,
html[data-theme="light"] textarea:focus {
  outline-color: rgba(31,107,79,0.65);
}

html[data-theme="light"] .search-bar {
  background: #fffdf8;
  border-color: rgba(145,103,49,0.35);
}

html[data-theme="light"] .stat-card {
  border-color: rgba(145,103,49,0.35);
  background: rgba(255,248,238,0.95);
  box-shadow: 0 14px 32px rgba(214,180,127,0.35);
}
html[data-theme="light"] .stat-card strong {
  color: var(--text);
}
html[data-theme="light"] .stat-card span {
  color: var(--muted);
}


.popup-alert-layer {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}
.popup-alert-layer.show { opacity: 1; pointer-events: auto; }
.popup-alert-box {
  width: min(440px, 92vw);
  background: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.06), transparent 60%), #0b1220;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 16px 16px 12px;
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.38);
  text-align: center;
  transform: translateY(6px) scale(0.98);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.popup-alert-layer.show .popup-alert-box { transform: translateY(0) scale(1); box-shadow: 0 22px 66px rgba(0, 0, 0, 0.5); }
.popup-alert-box[data-tone="danger"] { border-color: #4c1d1d; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 77, 79, 0.3); }
.popup-alert-box[data-tone="success"] { border-color: #22543d; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(48, 209, 88, 0.25); }
.popup-alert-box[data-tone="warning"] { border-color: #4b3a12; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(245, 165, 36, 0.28); }
.popup-alert-title { font-weight: 800; color: #fff; margin-bottom: 6px; letter-spacing: 0.2px; }
.popup-alert-message { color: #dbeafe; line-height: 1.8; font-weight: 700; }
.popup-alert-close {
  margin-top: 12px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, var(--accent), #4fd1c5);
  color: #0b1220;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(92, 225, 230, 0.28);
}
.popup-alert-close:hover { box-shadow: 0 16px 38px rgba(92, 225, 230, 0.35); }
.popup-alert-hidden { display: none !important; }

.container-app-shell { width: 100%; padding: 0 10px; }
.app-shell {
  margin: 0;
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 18px;
  align-items: stretch;
}
.app-main { display: grid; gap: 14px; width: min(1480px, 94%); margin: 0 auto; }
.app-sidebar {
  width: fit-content;
  height: 100vh;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 12px;
  align-self: start;
  padding: 12px 12px 16px;
  max-height: calc(100vh - 24px);
  overflow: hidden;
  border-radius: var(--radius);
  /* background: var(--panel); */
  /* border: 1px solid var(--border); */
  /* box-shadow: var(--shadow-soft); */
  margin-top: 10px;
}
.app-sidebar__head {
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  padding: 4px 2px;
}
.app-sidebar__overlay {
  display: none;
}
.app-sidebar-open {
  overflow: hidden;
}
.app-sidebar-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 46px;
  height: 42px;
  margin: 8px 0;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel);
  cursor: pointer;
}
.app-sidebar-toggle span {
  width: 70%;
  height: 2px;
  border-radius: 999px;
  background: var(--text);
}
.page-app {
  /* background: linear-gradient(180deg, #0b0c0f 0%, #0b0d12 40%, #0a0c10 100%); */
  min-height: 100vh;
  margin: 0;
  padding: 0;
}
.page-app .panel,
.page-app .card {

  box-shadow: none;
}
.page-app .panel::after { display: none; }
.page-app .badge { box-shadow: none; }
.app-sidebar__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  position: relative;
  z-index: 1;
  margin-bottom: 8px;
  padding: 4px 2px;
}
.app-sidebar__titles { display: flex; flex-direction: column; gap: 2px; }
.app-sidebar__title { margin: 0; color: var(--text); font-size: 1.05rem; letter-spacing: 0.2px; }
.app-sidebar__note { color: var(--muted); font-size: 0.9rem; letter-spacing: 0.2px; text-transform: none; }
.app-sidebar__controls { display: inline-flex; align-items: center; gap: 6px; }
.app-sidebar__collapse {
  display: none;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  cursor: pointer;
  position: relative;
}
.app-sidebar__collapse span {
  position: absolute;
  width: 14px;
  height: 2px;
  background: #e7edf8;
  border-radius: 999px;
  transition: transform 0.18s ease, opacity 0.18s ease;
}
.app-sidebar__collapse span:nth-child(1) { transform: translateY(-5px); }
.app-sidebar__collapse span:nth-child(2) { transform: translateY(0); }
.app-sidebar__collapse span:nth-child(3) { transform: translateY(5px); }
.app-sidebar__collapse[data-state="mini"] span:nth-child(1) { transform: translateY(0) rotate(45deg); }
.app-sidebar__collapse[data-state="mini"] span:nth-child(2) { opacity: 0; }
.app-sidebar__collapse[data-state="mini"] span:nth-child(3) { transform: translateY(0) rotate(-45deg); }
.app-sidebar__close {
  display: none !important;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 40px;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.app-sidebar__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 14px;
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(0, 227, 140, 0.45);
  background: linear-gradient(145deg, rgba(0,227,140,0.18), rgba(5,6,9,0.4));
  color: #050609;
  font-weight: 800;
  margin: 6px 0 12px;
  box-shadow: 0 12px 22px rgba(15,23,42,0.35);
}
.app-sidebar__cta:hover { transform: translateY(-1px); border-color: rgba(0,227,140,0.85); }
.app-sidebar__nav {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 10px;
  margin: 12px 0;
  padding: 0 6px 0 0;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1 1 auto;
  min-height: 0;
}
.app-sidebar__nav::-webkit-scrollbar { width: 6px; }
.app-sidebar__nav::-webkit-scrollbar-thumb { background: rgba(0,227,140,0.35); border-radius: 10px; }
.app-sidebar__nav::-webkit-scrollbar-track { background: transparent; }
.app-sidebar__nav a {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 12px 14px;
  min-height: 52px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  font-weight: 700;
  transition: all 0.16s ease;
  position: relative;
  text-align: right;
}
.app-sidebar__nav a small { color: var(--muted); font-weight: 600; display: block; }
/* .app-sidebar__nav a::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  position: absolute;
  inset-inline-end: 12px;
  background: #4dd7db;
  box-shadow: 0 0 0 2px rgba(77,215,219,0.08);
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.16s ease, transform 0.16s ease;
} */
.app-sidebar__nav a:hover {
  background: var(--app-sidebar-icon-bg);
  color: var(--accent);
  border: 1px solid var(--app-sidebar-nav-border);
  border-radius: 14px;
}
.app-sidebar__nav a.is-active {
  background: var(--app-sidebar-nav-active-bg);
  color: var(--accent);
  border-color: var(--app-sidebar-nav-active-border);
  box-shadow: none;
  border-radius: 14px;
}
.app-sidebar__nav a:hover::before,
.app-sidebar__nav a.is-active::before {
  opacity: 1;
  transform: scale(1);
}
.app-sidebar__icon {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--app-sidebar-icon-bg);
  border: 1px solid var(--app-sidebar-icon-border);
  color: var(--accent);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), 0 8px 20px rgba(0,0,0,0.14);
}
.app-sidebar__icon svg { width: 100%; height: 100%; stroke: currentColor; fill: none; stroke-width: 1.6; }
.app-sidebar__label { color: var(--text); font-weight: 800; }
.app-sidebar__desc { color: var(--muted); font-size: 0.85rem; }
.app-sidebar__nav a.is-active .app-sidebar__icon {
  color: var(--accent);
  border-color: var(--app-sidebar-icon-active-border);
  background: var(--app-sidebar-icon-active-bg);
}
.app-sidebar__nav a.is-active .app-sidebar__icon svg {
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 1.8;
}
.app-sidebar__nav a.is-active .app-sidebar__label {
  font-weight: 900;
  color: var(--accent);
}
.app-sidebar__nav a.is-active .app-sidebar__desc {
  color: var(--app-sidebar-desc-active);
  font-weight: 700;
}
.app-sidebar__footer {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.app-sidebar__footer-link {
  color: var(--muted);
  font-weight: 700;
  padding: 6px 0;
}
.app-sidebar__footer-link:hover { color: var(--accent); }
.app-sidebar__footer-link.danger { color: var(--danger); }
@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 1fr; }
}

@media (max-width: 960px) {
  .app-main { width: 100%; }
  .app-sidebar-toggle { display: inline-flex; }
  .app-shell { grid-template-columns: 1fr; }
  .app-sidebar__overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
    z-index: 25;
  }
  .app-sidebar {
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0 auto 0 0;
    width: 240px;
    height: 100vh;
    margin-left: 10px;
    /* background: #4c4c4d; */
    padding: 14px 10px 16px;
    box-shadow: 14px 0 38px rgba(0,0,0,0.4);
    transform: translateX(-260px);
    transition: transform 0.2s ease;
    z-index: 30;
    border-inline-end: 1px solid #1a1b1f;
  }
  .app-sidebar__close { display: inline-flex; }
  .app-sidebar__nav { padding-inline-end: 0; }
  .app-main { padding-bottom: 12px; }
  body.app-sidebar-open .app-sidebar { transform: translateX(0); }
  body.app-sidebar-open .app-sidebar__overlay {
    opacity: 1;
    pointer-events: auto;
  }
}

/* Chat workspace */
.chat-shell {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 12px;
  align-items: stretch;
}
.chat-pane {
  position: relative;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}
.chat-pane__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.chat-pane__title { margin: 0; color: #fff; font-size: 1.02rem; }
.chat-pane__meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; color: var(--muted); }
.chat-search { position: relative; margin-bottom: 8px; }
.chat-search input {
  width: 100%;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  color: #fff;
}
.chat-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 70vh;
  overflow-y: auto;
  padding: 4px;
}
.chat-dialog {
  width: 100%;
  text-align: right;
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.07);
  background: rgba(255,255,255,0.02);
  color: #e5e7eb;
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.14s ease, background 0.14s ease;
  position: relative;
}
.chat-dialog:hover { border-color: rgba(99,102,241,0.65); transform: translateY(-1px); }
.chat-dialog.is-active {
  background: linear-gradient(135deg, rgba(99,102,241,0.18), rgba(139,92,246,0.18));
  border-color: rgba(99,102,241,0.9);
  box-shadow: 0 16px 42px rgba(0,0,0,0.32);
}
.chat-dialog__avatar {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(160deg, rgba(99,102,241,0.4), rgba(139,92,246,0.3));
  border: 1px solid rgba(255,255,255,0.1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(0,0,0,0.28);
}
.chat-dialog__body { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; flex: 1; min-width: 0; }
.chat-dialog__title {
  margin: 0;
  color: #fff;
  font-weight: 800;
  font-size: 0.98rem;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.chat-dialog__title small { color: var(--muted); font-weight: 700; }
.chat-dialog__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  color: #9fb0c4;
  font-size: 0.88rem;
}
.chat-dialog__preview {
  color: #cbd5e1;
  font-size: 0.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.chat-dialog__unread {
  min-width: 22px;
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 6px;
  border-radius: 8px;
  background: rgba(99,102,241,0.22);
  color: #fff;
  font-weight: 800;
}
.chat-thread-wrap { display: grid; gap: 10px; }
.chat-thread-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.chat-thread-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--muted); font-size: 0.9rem; }
.chat-thread {
  min-height: 320px;
  max-height: 65vh;
  padding: 12px;
  border-radius: 16px;
  background:
    radial-gradient(circle at 30% 10%, rgba(99,102,241,0.08), transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(139,92,246,0.1), transparent 50%),
    rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
}
.chat-bubble {
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  color: #e5e7eb;
  max-width: 88%;
  box-shadow: 0 12px 28px rgba(0,0,0,0.26);
}
.chat-bubble.in { align-self: flex-start; border-color: rgba(255,255,255,0.1); }
.chat-bubble.out {
  align-self: flex-end;
  background: linear-gradient(145deg, rgba(99,102,241,0.24), rgba(139,92,246,0.22));
  border-color: rgba(99,102,241,0.55);
}
.chat-bubble__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 0.86rem;
  color: #cbd5e1;
}
.chat-bubble__body { white-space: pre-wrap; line-height: 1.7; }
.chat-bubble__body--deleted {
  font-style: italic;
  color: #9ca3af;
}
.chat-bubble__reply {
  margin-bottom: 6px;
  padding: 6px 8px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.45);
  font-size: 0.82rem;
  color: #cbd5e1;
}
.chat-bubble__reply-author {
  display: block;
  margin-bottom: 2px;
  font-weight: 700;
}
.chat-bubble__reply-body {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-bubble__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
  font-size: 0.78rem;
}
.chat-bubble__actions button {
  border: none;
  background: transparent;
  color: #9fb0c4;
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 999px;
}
.chat-bubble.out .chat-bubble__actions button {
  color: #e5e7eb;
}
.chat-bubble__actions button:hover {
  background: rgba(148, 163, 184, 0.2);
}
.chat-composer {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.02);
}
.chat-composer textarea {
  flex: 1 1 300px;
  min-height: 68px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  background: #0f1116;
  color: #fff;
  padding: 10px;
}
.chat-hint { color: var(--muted); font-size: 0.9rem; }
.chat-empty {
  padding: 12px;
  border-radius: 12px;
  border: 1px dashed rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.03);
}

@media (max-width: 1080px) {
  .chat-shell { grid-template-columns: 1fr; }
  .chat-thread { max-height: none; }
}
@media (max-width: 700px) {
  .chat-dialog { align-items: flex-start; }
  .chat-dialog__avatar { width: 38px; height: 38px; }
  .chat-bubble { max-width: 100%; }
  .chat-composer textarea { flex-basis: 100%; }
}


@media (min-width: 961px) {
  .app-sidebar__collapse { display: inline-flex; }
  body.app-sidebar-mini .app-shell { grid-template-columns: 96px 1fr; }
  body.app-sidebar-mini .app-sidebar {
    width: 96px;
    padding: 12px 10px;
  }
  body.app-sidebar-mini .app-sidebar__titles,
  body.app-sidebar-mini .app-sidebar__note,
  body.app-sidebar-mini .app-sidebar__cta,
  body.app-sidebar-mini .app-sidebar__footer { display: none; }
  body.app-sidebar-mini .app-sidebar__head { justify-content: center; }
  body.app-sidebar-mini .app-sidebar__controls { width: 100%; justify-content: center; }
  body.app-sidebar-mini .app-sidebar__nav { padding-inline: 0; gap: 8px; }
  body.app-sidebar-mini .app-sidebar__nav a {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 8px;
    border-radius: 16px;
    border: 1px solid transparent;
    background: transparent;
  }
  body.app-sidebar-mini .app-sidebar__nav a::before { display: none; }
  body.app-sidebar-mini .app-sidebar__nav a .app-sidebar__label {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text);
    text-align: center;
  }
  body.app-sidebar-mini .app-sidebar__nav a .app-sidebar__desc { display: none; }
  body.app-sidebar-mini .app-sidebar__icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: var(--app-sidebar-mini-icon-bg);
    border-color: var(--app-sidebar-mini-icon-border);
  }
  body.app-sidebar-mini .app-sidebar__nav a.is-active {
    border-color: transparent;
    background: transparent;
    box-shadow: none;
  }
}

.task-timer-status {
  min-width: 190px;
  text-align: center;
  font-weight: 700;
  letter-spacing: 0.2px;
}
.task-timer-status.is-finished {
  color: var(--danger);
  border-color: rgba(255, 77, 79, 0.35);
  background: rgba(255, 77, 79, 0.12);
}
.task-timer-btn {
  min-width: 190px;
  text-align: center;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.2s ease, color 0.2s ease;
}
.task-timer-btn:not([disabled]):hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 32px rgba(99, 102, 241, 0.28);
}
.task-timer-btn.is-countdown {
  color: #e5e7eb;
  background: linear-gradient(130deg, rgba(99,102,241,0.98), rgba(139,92,246,0.96));
  border-color: rgba(191,219,254,0.5);
}
.task-timer-btn.is-finished {
  color: #ffd7d7;
  background: rgba(255, 77, 79, 0.22);
  border-color: rgba(255, 77, 79, 0.55);
  cursor: not-allowed;
}
.task-timer-btn[disabled] {
  opacity: 0.94;
  cursor: not-allowed;
}

@media (max-width: 1024px) {
  .panel { padding: 14px; }
  .card { padding: 12px; }
  .panel-head { gap: 8px; }
}
@media (max-width: 820px) {
  .nav-row { flex-direction: column; align-items: stretch; gap: 8px; }
  .nav-toggle { display: inline-flex; align-self: flex-end; }
  .nav-links {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    transition: max-height 0.22s ease, opacity 0.18s ease;
  }
  .nav-links .nav-link { width: 100%; text-align: right; justify-content: flex-start; }
  .nav-links .nav-sub { display: none; }
  .nav-items { width: 100%; justify-content: space-between; }
  .nav-actions { width: 100%; justify-content: stretch; margin-inline-start: 0; }
  .nav-actions .nav-cta { flex: 1 1 auto; text-align: center; }
  .panel-head { flex-direction: column; align-items: flex-start; }
  .panel-head .badge { align-self: flex-start; }
  .hero-panel__grid { gap: 12px; }
  .hero-panel { padding: 14px; }
  .hero-panel__title { font-size: 1.55rem; }
  .cta-row { flex-direction: column; }
  .cta-row .cta { width: 100%; }
  .card-grid.grid-2 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
}
@media (max-width: 540px) {
  .nav-links { gap: 6px; }
  .meta-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
  .panel, .card { padding: 12px; }
  .panel-head h1, .panel-head h2, .panel-head h3 { font-size: 1.1rem; }
}

@media (max-width: 780px) {
  .nav-links { flex-direction: column; align-items: stretch; }
  .nav-actions { width: 100%; justify-content: flex-start; }
  .nav-toggle { display: inline-flex; }
}
