/* ===========================================================
   دفتري — notes · tasks · finance
   Se7en design system · warm paper, full RTL, light & dark
   =========================================================== */

:root {
  --accent: #4f5fe0;
  --accent-2: #8a6bff;
  --accent-soft: rgba(79, 95, 224, 0.11);
  --accent-line: rgba(79, 95, 224, 0.32);
  --green: #1f9d55;
  --red: #dc4b3e;
  --amber: #cf8509;
  --teal: #0f9a90;
  --violet: #8257e6;

  --bg: #ecebe7;
  --tint-1: rgba(79, 95, 224, 0.07);
  --tint-2: rgba(207, 133, 9, 0.05);
  --glow: rgba(79, 95, 224, 0.12);
  --sidebar-bg: rgba(247, 246, 242, 0.74);
  --pane-bg: #f8f7f3;
  --content-bg: #fffefb;
  --card: #fffefb;
  --field-bg: #ffffff;
  --seg-bg: rgba(28, 26, 20, 0.055);

  --text: #1a1915;
  --secondary: #7d7b72;
  --tertiary: rgba(26, 25, 21, 0.34);
  --line: rgba(26, 25, 21, 0.08);
  --line-strong: rgba(26, 25, 21, 0.13);
  --hover: rgba(26, 25, 21, 0.042);
  --ring-track: rgba(26, 25, 21, 0.07);
  --scroll: rgba(26, 25, 21, 0.2);
  --shadow: 0 1px 2px rgba(40, 34, 20, 0.05);
  --shadow-lift: 0 20px 42px -28px rgba(40, 34, 20, 0.4), 0 2px 6px rgba(40, 34, 20, 0.04);
  --shadow-pop: 0 30px 80px -26px rgba(30, 26, 16, 0.36);
  --ring: 0 0 0 3px var(--accent-soft);

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur: 0.18s;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --accent: #8b9bff;
    --accent-2: #b08cff;
    --accent-soft: rgba(139, 155, 255, 0.16);
    --accent-line: rgba(139, 155, 255, 0.4);
    --green: #3cc47a;
    --red: #f2705f;
    --amber: #f0b03f;
    --teal: #2ec0b4;
    --violet: #a987ff;

    --bg: #121210;
    --tint-1: rgba(139, 155, 255, 0.1);
    --tint-2: rgba(240, 176, 63, 0.05);
    --glow: rgba(139, 155, 255, 0.13);
    --sidebar-bg: rgba(26, 26, 22, 0.76);
    --pane-bg: #191915;
    --content-bg: #141410;
    --card: #1d1d18;
    --field-bg: #23231d;
    --seg-bg: rgba(255, 255, 255, 0.07);

    --text: #f4f3ee;
    --secondary: #9c9a90;
    --tertiary: rgba(244, 243, 238, 0.36);
    --line: rgba(255, 255, 255, 0.075);
    --line-strong: rgba(255, 255, 255, 0.13);
    --hover: rgba(255, 255, 255, 0.055);
    --ring-track: rgba(255, 255, 255, 0.07);
    --scroll: rgba(255, 255, 255, 0.2);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
    --shadow-lift: 0 24px 48px -30px rgba(0, 0, 0, 0.9), 0 2px 8px rgba(0, 0, 0, 0.32);
    --shadow-pop: 0 30px 80px -22px rgba(0, 0, 0, 0.82);
  }
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Arabic", "Segoe UI",
    "Noto Sans Arabic", system-ui, sans-serif;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  user-select: none;
  cursor: default;
  overscroll-behavior: none;
}

button { font: inherit; color: inherit; }

::selection { background: var(--accent-soft); }

:where(button, [role="button"], .nav-item, .folder-row, .row, .legend-row,
  .chip-btn, .icon-btn, .mini-btn, .check):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------------- layout ---------------- */

.app {
  position: relative;
  display: flex;
  height: 100vh;
  min-width: 0;
  isolation: isolate;
}

.app::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(900px 520px at 100% 0%, var(--tint-1), transparent 68%),
    radial-gradient(760px 540px at 0% 100%, var(--tint-2), transparent 70%);
}


.sidebar {
  position: relative;
  z-index: 3;
  flex: 0 0 244px;
  width: 244px;
  background: var(--sidebar-bg);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  backdrop-filter: blur(40px) saturate(180%);
  border-inline-end: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 0 10px 10px;
  overflow: hidden;
}

.list-pane {
  position: relative;
  z-index: 2;
  flex: 0 0 328px;
  width: 328px;
  background: var(--pane-bg);
  border-inline-end: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.detail-pane {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  min-width: 0;
  background: var(--content-bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ---------------- sidebar ---------------- */

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 36px 8px 16px;
  -webkit-app-region: drag;
}

.brand-mark {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 12px;
  background: linear-gradient(145deg, var(--accent), var(--accent-2));
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 19px;
  font-weight: 700;
  box-shadow:
    0 8px 20px -12px var(--accent-line),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.brand-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.brand-title { font-size: 16.5px; font-weight: 700; letter-spacing: -0.3px; line-height: 1.2; }
.brand-sub { font-size: 10.5px; color: var(--secondary); }

.side-scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 2px 0 8px;
}

.nav-item,
.folder-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: default;
  color: var(--text);
  margin-bottom: 2px;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}

.nav-item:hover,
.folder-row:hover { background: var(--hover); }

.nav-item.active {
  background: var(--accent);
  color: #fff;
  box-shadow:
    0 10px 22px -14px var(--accent-line),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.nav-item .icon,
.folder-row .icon {
  width: 17px;
  display: grid;
  place-items: center;
  color: var(--secondary);
  transition: color var(--dur) var(--ease);
}

.nav-item:hover .icon,
.folder-row:hover .icon { color: var(--text); }
.nav-item.active .icon { color: rgba(255, 255, 255, 0.94); }

.icon { flex: 0 0 auto; }

.nav-label {
  flex: 1 1 auto;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-item.active .nav-label { font-weight: 600; }
.folder-row.active .nav-label { font-weight: 600; }

.nav-count {
  font-size: 11px;
  color: var(--secondary);
  font-variant-numeric: tabular-nums;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--seg-bg);
}

.nav-item.active .nav-count {
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 10px 6px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.2px;
  color: var(--secondary);
}

.folder-row .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: 0 0 8px;
}

.folder-row.active { background: var(--accent-soft); }

.folder-tools { display: none; gap: 2px; }
.folder-row:hover .folder-tools { display: flex; }
.folder-row:hover .nav-count { display: none; }

.mini-btn {
  border: 0;
  background: transparent;
  border-radius: 6px;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  color: var(--secondary);
  cursor: default;
  padding: 0;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.mini-btn:hover { background: var(--hover); color: var(--text); }

.side-foot {
  border-top: 1px solid var(--line);
  padding: 13px 8px 4px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.side-foot .ring-small { flex: 0 0 auto; }
.side-foot .txt { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.side-foot .t1 { font-size: 11.5px; font-weight: 600; }
.side-foot .t2 { font-size: 10.5px; color: var(--secondary); }

/* ---------------- list pane ---------------- */

.pane-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 36px 14px 12px;
  -webkit-app-region: drag;
}

.pane-head > * { -webkit-app-region: no-drag; }

.pane-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.2px;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-btn {
  border: 0;
  background: transparent;
  border-radius: 7px;
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  color: var(--secondary);
  cursor: default;
  padding: 0;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn.accent { color: var(--accent); }
.icon-btn.on { color: var(--accent); background: var(--accent-soft); }

.search {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 12px 9px;
  padding: 6px 9px;
  border-radius: 9px;
  background: var(--seg-bg);
  color: var(--secondary);
  transition: background var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.search:focus-within { background: var(--card); box-shadow: var(--ring); }

.search input {
  border: 0;
  outline: 0;
  background: transparent;
  flex: 1 1 auto;
  font: inherit;
  font-size: 12px;
  color: var(--text);
  min-width: 0;
}
.search input::placeholder { color: var(--tertiary); }

.search .clear {
  border: 0;
  background: transparent;
  color: var(--secondary);
  cursor: default;
  padding: 0;
  display: grid;
  place-items: center;
}

.quick-add {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 12px 11px;
  padding: 7px 9px;
  border-radius: 9px;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--secondary);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.quick-add:focus-within { border-color: var(--accent-line); box-shadow: var(--ring); }

.quick-add input {
  border: 0;
  outline: 0;
  background: transparent;
  flex: 1 1 auto;
  font: inherit;
  font-size: 12.5px;
  color: var(--text);
  min-width: 0;
}

.scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 8px 16px;
}

.row {
  padding: 9px 11px;
  border-radius: 10px;
  cursor: default;
  margin-bottom: 2px;
  transition: background var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.row:hover { background: var(--hover); }

.row.selected {
  background: var(--accent-soft);
  box-shadow: inset -3px 0 0 var(--accent);
}
.row.selected .row-sub,
.row.selected .row-snippet { color: var(--secondary); }
.row.selected .check { border-color: var(--accent-line); }

.row-title {
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-sub {
  font-size: 10.5px;
  color: var(--secondary);
  margin-top: 2px;
  display: flex;
  gap: 5px;
  align-items: center;
}

.row-snippet {
  font-size: 11px;
  color: var(--secondary);
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-task { display: flex; gap: 10px; align-items: flex-start; }

.check {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  display: grid;
  place-items: center;
  flex: 0 0 17px;
  margin-top: 2px;
  color: transparent;
  background: transparent;
  padding: 0;
  transition: background 0.16s var(--ease), border-color 0.16s var(--ease),
    color 0.16s var(--ease), transform 0.16s var(--ease);
}

.check:hover { border-color: var(--accent); transform: scale(1.06); }

.check.done {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.task-title.done {
  text-decoration: line-through;
  color: var(--secondary);
}

.task-title {
  font-size: 12.5px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.overdue { color: var(--red) !important; font-weight: 600; }

.tx-row { display: flex; gap: 9px; align-items: center; }

.tx-badge {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: 0 0 26px;
}

.tx-badge.pos { background: color-mix(in srgb, var(--green) 14%, transparent); color: var(--green); }
.tx-badge.neg { background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--red); }

.amount {
  font-size: 11.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.amount.pos { color: var(--green); }
.amount.neg { color: var(--red); }

.empty-list {
  text-align: center;
  color: var(--secondary);
  font-size: 12px;
  padding: 44px 10px;
}

/* ---------------- note detail ---------------- */

.note-wrap { display: flex; flex-direction: column; height: 100%; min-height: 0; }

.note-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 34px 22px 11px;
  border-bottom: 1px solid var(--line);
  -webkit-app-region: drag;
}

.note-toolbar > * { -webkit-app-region: no-drag; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--seg-bg);
  font-size: 11.5px;
  font-weight: 500;
}

.pill select {
  border: 0;
  background: transparent;
  font: inherit;
  color: inherit;
  outline: 0;
  max-width: 130px;
}

.spacer { flex: 1 1 auto; }

.meta { font-size: 11px; color: var(--secondary); }

.save-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  color: var(--secondary);
  opacity: 0.65;
  transition: opacity 0.2s var(--ease), color 0.2s var(--ease);
}

.save-chip.flash { opacity: 1; color: var(--green); }

.note-title {
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1.35;
  padding-block: 22px 4px;
  padding-inline: max(26px, calc((100% - 760px) / 2));
  color: var(--text);
  width: 100%;
}

.note-title::placeholder { color: var(--tertiary); }

.note-body {
  border: 0;
  outline: 0;
  resize: none;
  background: transparent;
  font: inherit;
  font-size: 14.5px;
  line-height: 1.95;
  padding-block: 8px 24px;
  padding-inline: max(26px, calc((100% - 760px) / 2));
  color: var(--text);
  flex: 1 1 auto;
  width: 100%;
  user-select: text;
}

.note-body::placeholder { color: var(--tertiary); }

.note-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-block: 9px;
  padding-inline: max(26px, calc((100% - 760px) / 2));
  border-top: 1px solid var(--line);
  font-size: 10.5px;
  color: var(--secondary);
}

/* ---------------- dashboards ---------------- */

.dash {
  flex: 1 1 auto;
  min-width: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 34px 30px 32px;
}

.dash-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 20px;
}

.dash-title { font-size: 23px; font-weight: 700; letter-spacing: -0.6px; line-height: 1.2; }
.dash-sub { font-size: 12px; color: var(--secondary); margin-top: 4px; }

.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 16px;
  box-shadow: var(--shadow);
}

/* pointer-reactive sheen — the parallax hint, kept inside the surface */
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s var(--ease);
  background: radial-gradient(
    300px 220px at var(--mx, 50%) var(--my, 0%),
    color-mix(in srgb, var(--accent) 8%, transparent),
    transparent 72%
  );
}

.card:hover::after { opacity: 1; }

.stat-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--secondary);
  margin-bottom: 8px;
}

.stat-value {
  font-size: 22px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.7px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 16px;
  margin-bottom: 16px;
  align-items: start;
}

.card-title { font-size: 13px; font-weight: 650; letter-spacing: -0.1px; margin-bottom: 14px; }

.hint { font-size: 10.5px; color: var(--secondary); font-weight: 400; }

.ring-row { display: flex; align-items: center; gap: 22px; }

.stat-lines { display: flex; flex-direction: column; gap: 8px; min-width: 150px; }

.stat-line {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--secondary);
}

.stat-line .dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 7px; }
.stat-line b {
  margin-inline-start: auto;
  color: var(--text);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

.note-line {
  font-size: 11px;
  color: var(--secondary);
  margin-top: 12px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
}

.project-list { display: flex; flex-direction: column; gap: 10px; }

.project { display: flex; align-items: center; gap: 11px; }
.project .pname { font-size: 12px; font-weight: 500; }
.project .pmeta { font-size: 10.5px; color: var(--secondary); }
.project .pbody { display: flex; flex-direction: column; gap: 1px; min-width: 0; }

.upcoming { display: flex; flex-direction: column; }
.upcoming-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
}
.upcoming-row:last-child { border-bottom: 0; }
.upcoming-row .utitle { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.chip {
  font-size: 10.5px;
  font-weight: 500;
  padding: 2px 9px;
  border-radius: 999px;
  white-space: nowrap;
}

/* ---------------- donut ---------------- */

.donut-layout { display: flex; gap: 20px; align-items: center; }

.donut-wrap {
  position: relative;
  width: 232px;
  height: 232px;
  flex: 0 0 232px;
}

.donut-wrap svg { filter: drop-shadow(0 12px 20px rgba(40, 34, 20, 0.09)); }

.donut-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  pointer-events: none;
  padding: 0 52px;
}

.donut-center .label { font-size: 11.5px; color: var(--secondary); }
.donut-center .value {
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.5px;
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}

.slice { transition: stroke-width 0.18s var(--ease), opacity 0.18s var(--ease); cursor: default; }
.slice:hover,
.slice.lit { stroke-width: 37; }

.legend { display: flex; flex-direction: column; gap: 1px; flex: 1 1 auto; min-width: 0; }

.legend-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 8px;
  cursor: default;
  transition: background 0.14s var(--ease);
}

.legend-row:hover,
.legend-row.active { background: var(--accent-soft); }

.legend-row .ldot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 8px; }
.legend-row .lname { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend-row .lval {
  margin-inline-start: auto;
  font-size: 12.5px;
  font-weight: 550;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.legend-row .lshare {
  font-size: 10.5px;
  color: var(--secondary);
  width: 46px;
  text-align: end;
  font-variant-numeric: tabular-nums;
}

.recent-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}
.recent-row:last-child { border-bottom: 0; }
.recent-row .rtitle { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-row .rdate {
  font-size: 10.5px;
  color: var(--secondary);
  width: 60px;
  text-align: end;
  font-variant-numeric: tabular-nums;
}

/* ---------------- segmented / inputs ---------------- */

.segmented {
  display: inline-flex;
  background: var(--seg-bg);
  border-radius: 9px;
  padding: 2px;
  gap: 2px;
}

.segmented button {
  border: 0;
  background: transparent;
  padding: 5px 15px;
  border-radius: 7px;
  font-size: 12px;
  color: var(--secondary);
  cursor: default;
  transition: background 0.16s var(--ease), color 0.16s var(--ease);
}

.segmented button:hover { color: var(--text); }

.segmented button.active {
  background: var(--card);
  color: var(--text);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(30, 26, 16, 0.12);
}

/* ---------------- modal ---------------- */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: color-mix(in srgb, #12100a 26%, transparent);
  -webkit-backdrop-filter: blur(6px) saturate(120%);
  backdrop-filter: blur(6px) saturate(120%);
  display: grid;
  place-items: center;
  animation: fade 0.16s var(--ease);
}

.modal {
  width: 440px;
  max-width: calc(100vw - 40px);
  max-height: calc(100vh - 60px);
  overflow-y: auto;
  background: var(--content-bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-xl);
  padding: 22px;
  box-shadow: var(--shadow-pop);
  animation: pop 0.2s var(--ease);
}

.modal h3 {
  margin: 0 0 16px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.field-group { margin-bottom: 12px; }
.field-label { font-size: 11px; font-weight: 500; color: var(--secondary); margin-bottom: 6px; display: block; }

.field {
  width: 100%;
  padding: 8px 11px;
  border-radius: 9px;
  border: 1px solid var(--line-strong);
  background: var(--field-bg);
  color: var(--text);
  font: inherit;
  font-size: 12.5px;
  outline: 0;
  user-select: text;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.field:focus { border-color: var(--accent); box-shadow: var(--ring); }
.field::placeholder { color: var(--tertiary); }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }

.chip-btn {
  border: 0;
  background: var(--seg-bg);
  color: var(--secondary);
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  cursor: default;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}

.chip-btn:hover { color: var(--text); }

.chip-btn.active { background: var(--accent); color: #fff; }

.modal-actions {
  display: flex;
  justify-content: flex-start;
  gap: 8px;
  margin-top: 20px;
}

.btn {
  border: 1px solid var(--line-strong);
  background: var(--card);
  color: var(--text);
  padding: 6px 17px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: default;
  box-shadow: var(--shadow);
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease),
    transform var(--dur) var(--ease);
}

.btn:hover { background: var(--hover); border-color: var(--secondary); }
.btn:active { transform: scale(0.985); }

.btn.primary {
  background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 88%, #000));
  border-color: transparent;
  color: #fff;
  font-weight: 600;
  box-shadow:
    0 10px 22px -12px var(--accent-line),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn.primary:disabled { opacity: 0.45; }
.btn.primary:hover { filter: brightness(1.07); border-color: transparent; }

/* ---------------- scrollbars ---------------- */

::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 999px;
  border: 3px solid transparent;
  background-clip: content-box;
}
.scroll:hover::-webkit-scrollbar-thumb,
.dash:hover::-webkit-scrollbar-thumb,
.side-scroll:hover::-webkit-scrollbar-thumb,
.modal:hover::-webkit-scrollbar-thumb { background: var(--scroll); background-clip: content-box; }

/* ---------------- animation ---------------- */

@keyframes pop {
  from { opacity: 0; transform: scale(0.99) translateY(6px); }
  to { opacity: 1; transform: none; }
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: no-preference) {
  .dash > *,
  .note-wrap { animation: rise 0.34s var(--ease) both; }
  .dash > *:nth-child(2) { animation-delay: 0.04s; }
  .dash > *:nth-child(3) { animation-delay: 0.08s; }
  .dash > *:nth-child(4) { animation-delay: 0.12s; }
  .dash > *:nth-child(n+5) { animation-delay: 0.16s; }
}

.reveal-word {
  display: inline-block;
  will-change: opacity, filter, transform;
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .card::after { display: none; }
}

/* ---------------- charts / states ---------------- */

.ring-block { position: relative; display: grid; place-items: center; flex: 0 0 auto; }

.ring-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  pointer-events: none;
}

.rc-val { font-size: 24px; font-weight: 650; letter-spacing: -0.6px; font-variant-numeric: tabular-nums; }
.rc-cap { font-size: 11px; color: var(--secondary); margin-top: 2px; }
.rc-mini { font-size: 8.5px; font-weight: 600; color: var(--secondary); font-variant-numeric: tabular-nums; }

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 100%;
  color: var(--secondary);
}

.empty-state .icon { opacity: 0.4; }
.empty-state .es-title { font-size: 16px; font-weight: 650; color: var(--text); letter-spacing: -0.2px; }
.empty-state .es-sub { font-size: 12px; max-width: 330px; text-align: center; line-height: 1.7; }

.row-tools { display: none; margin-inline-start: 2px; }
.row:hover .row-tools { display: grid; }
.btn.danger { color: var(--red); border-color: color-mix(in srgb, var(--red) 26%, transparent); }
.btn.danger:hover { background: color-mix(in srgb, var(--red) 9%, transparent); }

/* ---------------- responsive ---------------- */

@media (max-width: 1200px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .donut-layout { flex-direction: column; align-items: stretch; }
  .donut-wrap { align-self: center; }
}

@media (max-width: 980px) {
  .sidebar { flex-basis: 210px; width: 210px; }
  .list-pane { flex-basis: 290px; width: 290px; }
  .dash { padding-inline: 20px; }
}
