/* ژرفا هاب — سیستم طراحی سبز جنگلی */
:root {
  --forest-950: #06190f;
  --forest-900: #0b2a1d;
  --forest-800: #113a28;
  --forest-700: #18523a;
  --forest-600: #1f6a4a;
  --forest-500: #2b8560;
  --forest-400: #4aa37c;
  --moss-200: #cfe5d6;
  --moss-100: #e6f2ea;
  --moss-50: #f2f8f4;
  --gold: #c8a24a;
  --gold-soft: #f6eed8;

  --bg: #f3f6f3;
  --surface: #ffffff;
  --surface-2: #f7faf8;
  --text: #11231a;
  --text-2: #3c5247;
  --muted: #6c7f75;
  --border: #dde7e0;
  --border-strong: #c5d5ca;
  --ring: rgba(43, 133, 96, .28);

  --ok: #1f8a57; --ok-bg: #e3f4ea;
  --warn: #b7791f; --warn-bg: #fbf1dc;
  --danger: #c0392b; --danger-bg: #fbe6e3;
  --info: #2f6f9f; --info-bg: #e3eef7;

  --radius: 14px; --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(10, 40, 25, .06);
  --shadow: 0 1px 2px rgba(10, 40, 25, .05), 0 8px 24px -12px rgba(10, 40, 25, .18);
  --shadow-lg: 0 24px 60px -20px rgba(6, 25, 15, .45);

  --stripes: repeating-linear-gradient(135deg, rgba(255,255,255,.045) 0 2px, transparent 2px 13px);
  --stripes-dark: repeating-linear-gradient(135deg, rgba(17,58,40,.05) 0 2px, transparent 2px 13px);
  --font: 'Vazirmatn', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #08140e; --surface: #0f2018; --surface-2: #132a1f; --text: #e4efe8; --text-2: #b9cdc1; --muted: #87a092;
  --border: #1e3a2c; --border-strong: #2a4d3b; --moss-100: #16301f; --moss-50: #112519; --moss-200: #234a35;
  --ok-bg: #12301f; --warn-bg: #33270f; --danger-bg: #3a1714; --info-bg: #10263a; --gold-soft: #2e2713;
  --stripes-dark: repeating-linear-gradient(135deg, rgba(255,255,255,.025) 0 2px, transparent 2px 13px);
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
svg:not([width]) { width: 1.15em; height: 1.15em; flex: none; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 14.5px; line-height: 1.7; -webkit-font-smoothing: antialiased; }
a { color: var(--forest-500); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.4; font-weight: 700; }
::selection { background: var(--moss-200); }

/* ---------- layout ---------- */
.app { display: grid; grid-template-columns: 264px 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; color: #dcebe2;
  background: var(--stripes), linear-gradient(180deg, var(--forest-800), var(--forest-950));
  display: flex; flex-direction: column; padding: 20px 14px; border-left: 1px solid rgba(255,255,255,.06);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 10px 22px; }
.brand-mark { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none;
  background: linear-gradient(135deg, var(--forest-400), var(--forest-600)); box-shadow: inset 0 0 0 1px rgba(255,255,255,.18), 0 6px 18px -6px rgba(0,0,0,.5); }
.brand-mark svg { width: 24px; height: 24px; }
.brand-name { font-weight: 800; font-size: 17px; color: #fff; letter-spacing: -.2px; }
.brand-sub { font-size: 11.5px; color: #9fc2ae; letter-spacing: .4px; }
.nav-group { font-size: 11px; color: #7fa592; padding: 16px 12px 6px; font-weight: 600; letter-spacing: .5px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; color: #cfe2d7; font-weight: 500; transition: background .15s, color .15s; position: relative; }
.nav a svg { width: 19px; height: 19px; opacity: .85; flex: none; }
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a.active { background: rgba(255,255,255,.1); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.nav a.active::before { content: ''; position: absolute; right: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 3px 0 0 3px; background: var(--gold); }
.nav .badge { margin-inline-start: auto; }
.sidebar-foot { margin-top: auto; padding-top: 16px; }
.me-card { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; background: rgba(0,0,0,.22); }
.me-card .name { color: #fff; font-weight: 600; font-size: 13.5px; }
.me-card .role { font-size: 11.5px; color: #9fc2ae; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 14px 28px;
  background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.search { flex: 1; max-width: 480px; position: relative; }
.search input { width: 100%; padding: 9px 40px 9px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); }
.search svg { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); width: 18px; color: var(--muted); }
.search-results { position: absolute; top: calc(100% + 6px); inset-inline: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 8px; max-height: 420px; overflow: auto; }
.search-results .grp { font-size: 11.5px; color: var(--muted); padding: 6px 8px 2px; font-weight: 600; }
.search-results a { display: block; padding: 7px 10px; border-radius: 8px; color: var(--text); }
.search-results a:hover { background: var(--moss-50); }
.topbar .spacer { flex: 1; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--border); cursor: pointer; position: relative; color: var(--text-2); }
.icon-btn:hover { border-color: var(--border-strong); color: var(--text); }
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn .dot { position: absolute; top: 7px; left: 8px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px; background: var(--danger); color: #fff; font-size: 10px; line-height: 16px; text-align: center; font-weight: 700; }
.menu-toggle { display: none; }
.content { padding: 26px 28px 60px; max-width: 1320px; width: 100%; margin: 0 auto; }

/* ---------- page header ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; letter-spacing: -.3px; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.hero { position: relative; overflow: hidden; border-radius: 20px; padding: 28px 30px; color: #eaf5ee; margin-bottom: 22px;
  background: var(--stripes), radial-gradient(120% 140% at 0% 0%, var(--forest-500) 0%, var(--forest-700) 45%, var(--forest-900) 100%); box-shadow: var(--shadow); }
.hero::after { content: ''; position: absolute; left: -60px; bottom: -80px; width: 280px; height: 280px; border-radius: 50%; border: 36px solid rgba(255,255,255,.05); }
.hero h1 { font-size: 26px; color: #fff; }
.hero .date { color: #b9dcc7; font-size: 13.5px; margin-bottom: 6px; }
.hero .ai-brief { margin-top: 14px; background: rgba(0,0,0,.18); border: 1px solid rgba(255,255,255,.1); border-radius: 14px; padding: 14px 16px; max-width: 760px; white-space: pre-wrap; font-size: 14px; }
.hero .btn-ghost { color: #fff; border-color: rgba(255,255,255,.25); background: rgba(255,255,255,.06); }
.hero .btn-ghost:hover { background: rgba(255,255,255,.12); }

/* ---------- cards & grid ---------- */
.grid { display: grid; gap: 18px; }
.g-4 { grid-template-columns: repeat(4, 1fr); }
.g-3 { grid-template-columns: repeat(3, 1fr); }
.g-2 { grid-template-columns: repeat(2, 1fr); }
.g-main { grid-template-columns: 1.6fr 1fr; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-pad { padding: 18px 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-head h3 { font-size: 15.5px; display: flex; align-items: center; gap: 8px; }
.card-head h3 svg { width: 18px; color: var(--forest-500); }
.card-body { padding: 14px 20px 18px; }
.stat { padding: 18px 20px; position: relative; overflow: hidden; }
.stat::before { content: ''; position: absolute; inset: 0; background: var(--stripes-dark); pointer-events: none; }
.stat .label { color: var(--muted); font-size: 13px; }
.stat .value { font-size: 28px; font-weight: 800; letter-spacing: -.5px; margin-top: 4px; }
.stat .ico { position: absolute; left: 16px; top: 16px; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--moss-100); color: var(--forest-600); }
.stat .ico svg { width: 20px; }
.stat .foot { font-size: 12px; color: var(--muted); margin-top: 2px; }
.progress { height: 6px; border-radius: 99px; background: var(--moss-100); overflow: hidden; margin-top: 10px; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--forest-400), var(--forest-600)); border-radius: inherit; }

/* ---------- buttons & forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 16px; border-radius: 11px; border: 1px solid transparent; font-weight: 600; cursor: pointer; transition: all .15s; white-space: nowrap; font-size: 14px; }
.btn svg { width: 17px; height: 17px; }
.btn-primary { background: linear-gradient(180deg, var(--forest-500), var(--forest-600)); color: #fff; box-shadow: 0 1px 0 rgba(255,255,255,.15) inset, 0 4px 12px -4px rgba(31,106,74,.55); }
.btn-primary:hover { background: linear-gradient(180deg, var(--forest-600), var(--forest-700)); }
.btn-ghost { background: var(--surface); border-color: var(--border); color: var(--text-2); }
.btn-ghost:hover { border-color: var(--border-strong); color: var(--text); }
.btn-ai { background: linear-gradient(135deg, #1f6a4a, #2b8560 50%, #c8a24a); color: #fff; }
.btn-ai:hover { filter: brightness(1.08); }
.btn-danger { background: var(--danger-bg); color: var(--danger); }
.btn-sm { padding: 5px 11px; font-size: 13px; border-radius: 9px; }
.btn-sm svg { width: 15px; height: 15px; }
.btn[disabled] { opacity: .55; pointer-events: none; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field .hint { font-size: 12px; color: var(--muted); }
.input, select.input, textarea.input { width: 100%; padding: 10px 13px; border-radius: 11px; border: 1px solid var(--border-strong); background: var(--surface); transition: border .15s, box-shadow .15s; }
textarea.input { min-height: 110px; resize: vertical; line-height: 1.8; }
.input:focus { outline: none; border-color: var(--forest-500); box-shadow: 0 0 0 4px var(--ring); }
.input[dir="ltr"] { text-align: left; }
.row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 14px; }
.row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 14px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.check input { width: 17px; height: 17px; accent-color: var(--forest-600); }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 6px 14px; border-radius: 9px; cursor: pointer; color: var(--text-2); font-weight: 500; font-size: 13.5px; }
.seg button.on { background: var(--forest-600); color: #fff; }

/* ---------- badges, avatars ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--moss-100); color: var(--forest-700); white-space: nowrap; }
.nav .badge { background: var(--gold); color: var(--forest-950); }
.b-ok { background: var(--ok-bg); color: var(--ok); }
.b-warn { background: var(--warn-bg); color: var(--warn); }
.b-danger { background: var(--danger-bg); color: var(--danger); }
.b-info { background: var(--info-bg); color: var(--info); }
.b-muted { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.b-gold { background: var(--gold-soft); color: #8a6a1c; }
.avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; flex: none; display: grid; place-items: center; font-weight: 700; color: #fff; font-size: 14px;
  background: linear-gradient(135deg, var(--forest-400), var(--forest-700)); border: 2px solid var(--surface); }
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.avatar.lg { width: 96px; height: 96px; font-size: 32px; border-width: 4px; }
.avatar-stack { display: flex; }
.avatar-stack .avatar { margin-inline-start: -8px; }
.avatar-stack .avatar:first-child { margin-inline-start: 0; }

/* ---------- lists ---------- */
.list { display: flex; flex-direction: column; }
.item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px dashed var(--border); }
.item:last-child { border-bottom: 0; }
.item .grow { flex: 1; min-width: 0; }
.item .t { font-weight: 600; }
.item .s { font-size: 12.5px; color: var(--muted); }
.empty { text-align: center; padding: 34px 16px; color: var(--muted); }
.empty svg { width: 42px; height: 42px; color: var(--moss-200); margin-bottom: 6px; }
.clamp { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.pre { white-space: pre-wrap; }

/* tasks */
.task { display: flex; gap: 12px; align-items: flex-start; padding: 13px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); margin-bottom: 9px; transition: border .15s, box-shadow .15s; }
.task:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.task.done .t { text-decoration: line-through; color: var(--muted); }
.tick { width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--border-strong); display: grid; place-items: center; cursor: pointer; flex: none; margin-top: 2px; background: var(--surface); }
.tick.on { background: var(--forest-500); border-color: var(--forest-500); color: #fff; }
.tick.half { border-color: var(--warn); background: var(--warn-bg); }
.tick svg { width: 14px; }
.pri-high { box-shadow: inset -3px 0 0 var(--danger); }
.pri-low { box-shadow: inset -3px 0 0 var(--info); }
.kanban { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.kcol { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; min-height: 200px; }
.kcol h4 { font-size: 14px; display: flex; justify-content: space-between; padding: 2px 4px 10px; }
.kcol.over { outline: 2px dashed var(--forest-400); }
.daybar { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 18px; }
.daybar button { flex: none; border: 1px solid var(--border); background: var(--surface); border-radius: 12px; padding: 8px 14px; cursor: pointer; text-align: center; min-width: 76px; }
.daybar button .d { font-size: 18px; font-weight: 800; display: block; }
.daybar button .w { font-size: 11.5px; color: var(--muted); }
.daybar button.on { background: var(--forest-600); border-color: var(--forest-600); color: #fff; }
.daybar button.on .w { color: #cfe5d6; }
.daybar button.today:not(.on) { border-color: var(--forest-400); }

/* notes */
.notes { columns: 3 260px; column-gap: 16px; }
.note { break-inside: avoid; margin-bottom: 16px; border-radius: 14px; padding: 16px 18px; border: 1px solid var(--border); cursor: pointer; position: relative; transition: transform .15s, box-shadow .15s; background: var(--surface); }
.note:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.note h4 { font-size: 15px; margin-bottom: 6px; }
.note .body { white-space: pre-wrap; color: var(--text-2); font-size: 14px; max-height: 220px; overflow: hidden; }
.note .meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 10px; font-size: 12px; color: var(--muted); }
.note.c-leaf { background: var(--moss-50); border-color: var(--moss-200); }
.note.c-sand { background: #fbf6ea; border-color: #eee0bd; }
.note.c-sky { background: #eef5fa; border-color: #cfe1ee; }
.note.c-rose { background: #fbefee; border-color: #f0d2cf; }
.note.c-white { background: var(--surface); }
:root[data-theme="dark"] .note.c-sand { background: #2a2413; border-color: #4a3f1f; }
:root[data-theme="dark"] .note.c-sky { background: #10222f; border-color: #1f3c52; }
:root[data-theme="dark"] .note.c-rose { background: #2c1514; border-color: #4f2522; }
.note .pin { position: absolute; left: 12px; top: 12px; color: var(--gold); }
.note .pin svg { width: 16px; }
.swatches { display: flex; gap: 8px; }
.swatches label { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--border-strong); cursor: pointer; }
.swatches input { display: none; }
.swatches input:checked + label { outline: 3px solid var(--forest-500); outline-offset: 2px; }

/* timeline (events) */
.timeline { position: relative; padding-right: 28px; }
.timeline::before { content: ''; position: absolute; right: 9px; top: 6px; bottom: 6px; width: 2px; background: repeating-linear-gradient(180deg, var(--border-strong) 0 6px, transparent 6px 10px); }
.tl-item { position: relative; margin-bottom: 14px; }
.tl-item::before { content: ''; position: absolute; right: -25px; top: 20px; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); border: 3px solid var(--forest-500); }
.tl-item.sev-warning::before { border-color: var(--warn); }
.tl-item.sev-critical::before { border-color: var(--danger); background: var(--danger); }
.tl-item.sev-success::before { border-color: var(--ok); }
.tl-item.sev-info::before { border-color: var(--info); }
.tl-item .card { padding: 14px 18px; cursor: pointer; }
.tl-item .card:hover { border-color: var(--border-strong); }

/* meetings / calendar */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); border-top: 1px solid var(--border); border-right: 1px solid var(--border); }
.cal .h { padding: 8px; text-align: center; font-size: 12.5px; font-weight: 700; color: var(--muted); background: var(--surface-2); border-left: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.cal .d { min-height: 104px; padding: 6px; border-left: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--surface); cursor: pointer; }
.cal .d:hover { background: var(--moss-50); }
.cal .d.out { background: var(--surface-2); color: var(--muted); }
.cal .d.today .n { background: var(--forest-600); color: #fff; }
.cal .d.fri .n { color: var(--danger); }
.cal .n { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font-weight: 700; font-size: 13px; }
.cal .ev { display: block; font-size: 11.5px; padding: 2px 6px; border-radius: 6px; margin-top: 3px; background: var(--moss-100); color: var(--forest-700); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal .ev.leave { background: var(--gold-soft); color: #8a6a1c; }
.cal .ev.task { background: var(--info-bg); color: var(--info); }
.meet { display: flex; gap: 16px; padding: 16px 18px; align-items: center; }
.meet .when { width: 64px; flex: none; text-align: center; border-radius: 12px; padding: 8px 4px; background: var(--moss-100); color: var(--forest-700); }
.meet .when b { display: block; font-size: 20px; line-height: 1.2; }
.meet .when span { font-size: 11.5px; }

/* people */
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.person { text-align: center; padding: 0 0 18px; overflow: hidden; cursor: pointer; transition: transform .15s, box-shadow .15s; }
.person:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.person .cover { height: 64px; background: var(--stripes), linear-gradient(135deg, var(--forest-600), var(--forest-800)); }
.person .avatar { margin: -36px auto 8px; width: 72px; height: 72px; font-size: 24px; border-width: 4px; }
.person .t { font-weight: 700; }
.profile-cover { height: 150px; border-radius: 20px 20px 0 0; background: var(--stripes), radial-gradient(120% 160% at 100% 0%, var(--forest-500), var(--forest-900)); }
.profile-head { display: flex; align-items: flex-end; gap: 18px; padding: 0 26px 20px; flex-wrap: wrap; }
.profile-head > .avatar.lg { margin-top: -48px; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 10px 14px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; }

/* table */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: right; font-size: 12.5px; color: var(--muted); font-weight: 600; padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; }

/* AI chat */
.chat { display: flex; flex-direction: column; height: calc(100vh - 190px); min-height: 460px; }
.chat-log { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.msg { max-width: 78%; padding: 12px 16px; border-radius: 16px; white-space: pre-wrap; line-height: 1.85; }
.msg.user { align-self: flex-start; background: var(--forest-600); color: #fff; border-bottom-right-radius: 4px; }
.msg.model { align-self: flex-end; background: var(--surface-2); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.chat-input { display: flex; gap: 10px; padding: 14px; border-top: 1px solid var(--border); }
.chat-input textarea { min-height: 48px; max-height: 160px; }
.suggest { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.suggest button { border: 1px solid var(--border); background: var(--surface); border-radius: 99px; padding: 7px 14px; cursor: pointer; font-size: 13px; color: var(--text-2); }
.suggest button:hover { border-color: var(--forest-400); color: var(--forest-600); }
.ai-out { background: var(--moss-50); border: 1px solid var(--moss-200); border-radius: 12px; padding: 14px 16px; white-space: pre-wrap; margin-top: 10px; font-size: 14px; }
.typing span { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--forest-400); margin: 0 2px; animation: blink 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: .2s; } .typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25 } 40% { opacity: 1 } }

/* modal, toast, popover */
.modal-bg { position: fixed; inset: 0; background: rgba(6, 25, 15, .55); backdrop-filter: blur(3px); z-index: 100; display: grid; place-items: center; padding: 20px; animation: fade .15s; }
.modal { background: var(--surface); border-radius: 18px; width: min(620px, 100%); max-height: calc(100vh - 40px); overflow: auto; box-shadow: var(--shadow-lg); animation: pop .18s; }
.modal.wide { width: min(860px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); z-index: 1;
  background-image: var(--stripes-dark); }
.modal-head h3 { font-size: 17px; }
.modal-body { padding: 20px 22px; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-start; padding: 14px 22px; border-top: 1px solid var(--border); background: var(--surface-2); position: sticky; bottom: 0; }
@keyframes fade { from { opacity: 0 } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98) } }
.toasts { position: fixed; bottom: 20px; left: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--forest-900); color: #fff; padding: 11px 18px; border-radius: 12px; box-shadow: var(--shadow-lg); font-size: 14px; animation: pop .2s; max-width: 380px; }
.toast.err { background: var(--danger); }
.popover { position: absolute; top: calc(100% + 8px); left: 0; width: 360px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); z-index: 50; max-height: 460px; overflow: auto; }
.notif { display: block; padding: 11px 16px; border-bottom: 1px solid var(--border); color: var(--text); font-size: 13.5px; }
.notif.unread { background: var(--moss-50); }
.notif .s { font-size: 11.5px; color: var(--muted); }

/* jalali date picker */
.jdp { position: absolute; z-index: 300; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 12px; width: 288px; }
.jdp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; font-weight: 700; }
.jdp-head button { border: 0; background: var(--moss-100); color: var(--forest-700); width: 30px; height: 30px; border-radius: 8px; cursor: pointer; }
.jdp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; text-align: center; }
.jdp-grid .w { font-size: 11.5px; color: var(--muted); padding: 4px 0; }
.jdp-grid button { border: 0; background: transparent; height: 34px; border-radius: 8px; cursor: pointer; font-size: 13.5px; }
.jdp-grid button:hover { background: var(--moss-100); }
.jdp-grid button.sel { background: var(--forest-600); color: #fff; }
.jdp-grid button.today { box-shadow: inset 0 0 0 1.5px var(--forest-400); }
.jdp-foot { display: flex; justify-content: space-between; margin-top: 8px; }
input.jdate { cursor: pointer; }

/* auth */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth-art { position: relative; overflow: hidden; color: #e6f3ea; padding: 56px; display: flex; flex-direction: column; justify-content: space-between;
  background: var(--stripes), radial-gradient(140% 120% at 100% 0%, var(--forest-500) 0%, var(--forest-800) 50%, var(--forest-950) 100%); }
.auth-art::before, .auth-art::after { content: ''; position: absolute; border-radius: 50%; border: 1px solid rgba(255,255,255,.08); }
.auth-art::before { width: 520px; height: 520px; left: -160px; bottom: -200px; }
.auth-art::after { width: 340px; height: 340px; left: -70px; bottom: -110px; }
.auth-art h2 { font-size: 34px; line-height: 1.5; color: #fff; max-width: 460px; font-weight: 800; }
.auth-art p { color: #b5d6c2; max-width: 440px; }
.auth-feats { display: grid; grid-template-columns: repeat(2, minmax(0, 220px)); gap: 12px; margin-top: 26px; position: relative; z-index: 1; }
.auth-feats div { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); border-radius: 12px; padding: 10px 14px; font-size: 13.5px; }
.auth-form { display: grid; place-items: center; padding: 40px 24px; }
.auth-form .box { width: min(400px, 100%); }
.auth-form h1 { font-size: 24px; margin-bottom: 4px; }
.auth-form .sub { color: var(--muted); margin-bottom: 26px; }
.link-btn { background: none; border: 0; color: var(--forest-500); cursor: pointer; font-weight: 600; padding: 0; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.tabs button { border: 0; background: none; padding: 10px 14px; cursor: pointer; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--forest-600); border-color: var(--forest-600); }
.bars { display: flex; align-items: flex-end; gap: 10px; height: 120px; padding-top: 8px; }
.bars .b { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bars .b i { width: 100%; max-width: 34px; border-radius: 8px 8px 3px 3px; background: var(--moss-200); position: relative; display: block; min-height: 4px; }
.bars .b i > s { position: absolute; bottom: 0; left: 0; right: 0; background: linear-gradient(180deg, var(--forest-400), var(--forest-600)); border-radius: inherit; display: block; }
.bars .b span { font-size: 11.5px; color: var(--muted); }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--moss-200); border-top-color: var(--forest-500); animation: spin .8s linear infinite; margin: 40px auto; }
@keyframes spin { to { transform: rotate(360deg) } }

/* ---------- responsive ---------- */
@media (max-width: 1100px) { .g-4 { grid-template-columns: repeat(2, 1fr); } .g-main, .g-3 { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 0 0 auto; width: 280px; z-index: 90; transform: translateX(100%); transition: transform .25s; }
  .app.nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  .app.nav-open::after { content: ''; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 80; }
  .menu-toggle { display: grid; }
  .topbar { padding: 12px 16px; }
  .topbar .spacer { display: none; }
  .content { padding: 18px 16px 50px; }
  .kanban, .g-2, .row, .row-3 { grid-template-columns: 1fr; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { padding: 32px 24px; min-height: 0; }
  .auth-art h2 { font-size: 24px; }
  .auth-feats { display: none; }
  .cal .d { min-height: 64px; } .cal .ev { font-size: 0; height: 6px; padding: 0; }
  .popover { width: calc(100vw - 32px); left: -60px; }
  .msg { max-width: 92%; }
  .kv { grid-template-columns: 110px 1fr; }
}

/* ---------- installed app (PWA) & phone polish ---------- */
.topbar { padding-top: max(14px, env(safe-area-inset-top)); }
.sidebar { padding-top: max(20px, env(safe-area-inset-top)); padding-bottom: max(20px, env(safe-area-inset-bottom)); }
.content { padding-bottom: max(60px, calc(env(safe-area-inset-bottom) + 40px)); }
.toasts { bottom: max(20px, env(safe-area-inset-bottom)); }
.install-banner { display: flex; align-items: center; gap: 12px; padding: 12px 16px; margin-bottom: 16px; border-radius: 14px; color: #eaf5ee;
  background: var(--stripes), linear-gradient(135deg, var(--forest-600), var(--forest-800)); box-shadow: var(--shadow); }
.install-banner img { width: 44px; height: 44px; border-radius: 11px; flex: none; }
.install-banner .grow { flex: 1; min-width: 0; font-size: 13.5px; }
.install-banner b { display: block; color: #fff; font-size: 14.5px; }
.install-banner .btn-primary { background: #fff; color: var(--forest-700); }
.install-banner .x { background: none; border: 0; color: #cfe5d6; cursor: pointer; padding: 4px; }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: s; display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px dashed var(--border); }
.steps li::before { content: counter(s, persian); flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--moss-100); color: var(--forest-700); font-weight: 800; }
.steps svg { width: 18px; height: 18px; vertical-align: -4px; color: var(--forest-500); }
@media (display-mode: standalone) { .hide-installed { display: none !important; } }
@media (max-width: 860px) {
  input.input, select.input, textarea.input, .search input { font-size: 16px; }
  .page-head h1 { font-size: 21px; }
  .modal-bg { padding: 0; align-items: end; }
  .modal { width: 100%; max-height: 92vh; border-radius: 20px 20px 0 0; padding-bottom: env(safe-area-inset-bottom); }
  .daybar button { min-width: 64px; padding: 6px 10px; }
}
