/* Общие стили Мини-CRM: каркас (левое меню, шапка страницы), карточки, формы, кнопки, бейджи, таблицы,
   вход и «Главная». Разделы дописывают своё в tasks.css, contracts.css, projects.css.
   Шрифты системные, всё локально — без CDN. */

:root {
  /* Фон и поверхности */
  --bg: #eef2f7;              /* светлый серо-голубой фон контента */
  --surface: #ffffff;
  --surface-2: #f6f8fb;       /* ховер строк, подложки */
  --text: #1d2a3a;
  --muted: #6b7a8d;
  --border: #dfe5ee;
  --border-strong: #c9d2de;

  /* Акценты */
  --accent: #2381e8;
  --accent-hover: #1a6cc8;
  --accent-soft: #e6f1fd;
  --success: #2f9e5f;
  --danger: #d9434e;
  --danger-hover: #b8323c;
  --danger-soft: #fdecee;
  --warn-soft: #fff5d6;

  /* Меню */
  --nav-w: 248px;
  --nav-bg: linear-gradient(180deg, #16365c 0%, #144a72 58%, #0f6475 100%);
  --nav-text: rgba(235, 244, 255, 0.82);
  --nav-text-strong: #ffffff;
  --nav-hover: rgba(255, 255, 255, 0.08);
  --nav-active: rgba(255, 255, 255, 0.16);

  --radius: 10px;
  --radius-lg: 14px;
  --shadow: 0 1px 2px rgba(20, 38, 66, 0.05), 0 2px 10px rgba(20, 38, 66, 0.06);
  --shadow-hover: 0 2px 4px rgba(20, 38, 66, 0.06), 0 8px 22px rgba(20, 38, 66, 0.1);
  --gutter: 28px;

  /* Состояния (этапы договоров, приоритеты, пометки) */
  --state-open: #d3d9e2;      /* серый — не выполнено */
  --state-done: #36a865;      /* зелёный — выполнено */
  --state-partial: #f1bf2c;   /* жёлтый — частично / скоро срок */
  --state-overdue: #e04a4a;   /* красный — срок прошёл */
  --state-na-a: #f0f2f5;      /* штриховка — не нужен */
  --state-na-b: #dce1e8;

  --priority-high: #e04a4a;
  --priority-normal: #2381e8;
  --priority-low: #94a3b8;
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
}

img, svg, video { max-width: 100%; }
.icon { flex: 0 0 auto; width: 20px; height: 20px; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: 1.25; margin: 0 0 0.75rem; color: var(--text); }

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

/* =========================================================================
   Каркас: левое меню + контент
   ========================================================================= */

.app { min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--nav-w);
  display: flex;
  flex-direction: column;
  background: var(--nav-bg);
  color: var(--nav-text);
  z-index: 40;
  overflow-y: auto;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 1.15rem 1.25rem 1.1rem;
  color: var(--nav-text-strong);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.01em;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.sidebar-brand:hover { text-decoration: none; }
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 10px;
  background: linear-gradient(135deg, #3fb6e8 0%, #2381e8 100%);
  color: #fff;
  font-weight: 800;
  font-size: 1.05rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), inset 0 0 0 1px rgba(255, 255, 255, 0.18);
  flex: 0 0 auto;
}

.menu { display: flex; flex-direction: column; gap: 2px; padding: 0.85rem 0.7rem; }
.menu-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.62rem 0.8rem;
  border: 0;
  border-radius: 9px;
  background: none;
  color: var(--nav-text);
  font: inherit;
  font-weight: 500;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  position: relative;
}
.menu-item:hover { background: var(--nav-hover); color: var(--nav-text-strong); text-decoration: none; }
.menu-item:focus-visible { outline: 2px solid rgba(255, 255, 255, 0.7); outline-offset: -2px; }
.menu-item.is-active {
  background: var(--nav-active);
  color: var(--nav-text-strong);
  font-weight: 600;
}
.menu-item.is-active::before {
  content: "";
  position: absolute;
  left: -0.7rem;
  top: 0.45rem;
  bottom: 0.45rem;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: #5fd0f3;
}
.menu-label { flex: 1 1 auto; min-width: 0; }
.menu-count {
  flex: 0 0 auto;
  min-width: 1.45rem;
  height: 1.3rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.3rem;
  text-align: center;
}
.menu-count-alert { background: #f0444f; color: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); }
.menu-count-soft { background: rgba(255, 255, 255, 0.2); color: #fff; }

.sidebar-foot { margin-top: auto; padding: 0.6rem 0.7rem 1rem; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.sidebar-status { display: flex; align-items: center; gap: 0.5rem; margin: 0.25rem 0.8rem 0.5rem; font-size: 0.8rem; opacity: 0.75; }
.status-dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: #9aa9bb; }
.status-dot.is-on { background: #4ade80; box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.2); }
.logout { margin: 0; }

.main { margin-left: var(--nav-w); min-width: 0; min-height: 100vh; }

/* Мобильная панель и гамбургер (CSS-only через checkbox) */
.nav-toggle { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.mobilebar { display: none; }
.nav-backdrop { display: none; }

@media (max-width: 899px) {
  :root { --gutter: 16px; }
  .mobilebar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    height: 56px;
    padding: 0 0.6rem;
    background: var(--nav-bg);
    color: #fff;
    box-shadow: 0 2px 8px rgba(10, 30, 60, 0.18);
  }
  .mobilebar-brand { display: inline-flex; align-items: center; gap: 0.55rem; color: #fff; font-weight: 700; font-size: 1.05rem; }
  .mobilebar-brand:hover { text-decoration: none; }
  .mobilebar .brand-mark { width: 1.85rem; height: 1.85rem; font-size: 0.95rem; border-radius: 8px; }
  .burger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 10px;
    color: #fff;
    cursor: pointer;
    margin: 0;
  }
  .burger:hover { background: rgba(255, 255, 255, 0.1); }
  .burger .icon { width: 24px; height: 24px; }
  .burger-close { display: none; }
  .nav-toggle:checked ~ .mobilebar .burger-open { display: none; }
  .nav-toggle:checked ~ .mobilebar .burger-close { display: inline-flex; }
  .nav-toggle:focus-visible ~ .mobilebar .burger { outline: 2px solid #fff; outline-offset: -3px; }

  .sidebar {
    top: 56px;
    width: min(280px, 86vw);
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: none;
  }
  .sidebar-brand { display: none; }
  .nav-toggle:checked ~ .sidebar { transform: none; box-shadow: 8px 0 30px rgba(10, 30, 60, 0.3); }
  .nav-toggle:checked ~ .nav-backdrop {
    display: block;
    position: fixed;
    inset: 56px 0 0 0;
    background: rgba(12, 24, 44, 0.45);
    z-index: 35;
    margin: 0;
  }
  .main { margin-left: 0; min-height: calc(100vh - 56px); }
}

/* =========================================================================
   Страница: белая шапка + контент
   ========================================================================= */

.page { padding: 0 var(--gutter) 2.5rem; min-width: 0; }

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  margin: 0 calc(-1 * var(--gutter)) 1.5rem;
  padding: 1.1rem var(--gutter);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(20, 38, 66, 0.04);
}
.page-head-main { min-width: 0; flex: 1 1 16rem; }
.page-title { font-size: 1.5rem; font-weight: 700; margin: 0; letter-spacing: -0.01em; }
.page-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.9rem; margin: 0.35rem 0 0; color: var(--muted); font-size: 0.92rem; }
.page-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.page-actions form { margin: 0; }

.crumbs { margin: 0 0 0.3rem; font-size: 0.85rem; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--accent); }

.page-narrow { max-width: 860px; }

@media (max-width: 899px) {
  .page-head { padding: 0.9rem var(--gutter); margin-bottom: 1rem; }
  .page-title { font-size: 1.3rem; }
}

/* =========================================================================
   Карточки, пустые состояния, баннеры
   ========================================================================= */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.35rem;
  margin-bottom: 1.25rem;
  min-width: 0;
}
.card-title { font-size: 1.05rem; font-weight: 700; margin: 0 0 0.9rem; }
.card-title:not(:first-child) { margin-top: 1.5rem; }
.card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 0.9rem;
}
.card-head .card-title { margin: 0; }
.card-link { font-size: 0.9rem; font-weight: 600; white-space: nowrap; }

@media (max-width: 559px) {
  .card { padding: 1rem; border-radius: 12px; }
}

.empty {
  text-align: center;
  padding: 2.25rem 1rem;
  background: var(--surface);
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-lg);
}
.card .empty { background: var(--surface-2); border-color: var(--border); padding: 1.5rem 1rem; }
.empty-text { color: var(--muted); margin: 0 0 1rem; }
.empty-text:last-child { margin-bottom: 0; }
.empty .btn + .btn { margin-left: 0.4rem; }

.banner {
  border-radius: var(--radius);
  padding: 0.8rem 1rem;
  margin-bottom: 1.25rem;
  border: 1px solid transparent;
  border-left-width: 4px;
}
.banner-ok { background: #e9f7ef; border-color: #b9e3c8; border-left-color: var(--success); }
.banner-warn { background: var(--warn-soft); border-color: #f1dc95; border-left-color: var(--state-partial); }
.banner-error { background: var(--danger-soft); border-color: #f3c0c4; border-left-color: var(--danger); }

.muted, .hint { color: var(--muted); }
.hint { font-size: 0.88rem; margin: 0 0 1rem; }

/* =========================================================================
   Формы
   ========================================================================= */

.form .field { margin-bottom: 1.1rem; min-width: 0; }
.field-row { display: grid; grid-template-columns: 1fr; gap: 0 1.1rem; }
@media (min-width: 560px) {
  .field-row { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
}

label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 0.35rem; color: #2c3a4d; }
label .muted { font-weight: 400; }
label.inline { display: inline-flex; align-items: center; gap: 0.45rem; font-weight: 400; font-size: 0.95rem; }

input[type="text"], input[type="password"], input[type="number"], input[type="date"],
input[type="time"], input[type="datetime-local"], input[type="search"], select, textarea {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  font: inherit;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
  min-height: 2.6rem;
  transition: border-color 0.12s, box-shadow 0.12s;
}
input:hover, select:hover, textarea:hover { border-color: #aebbcc; }
textarea { min-height: 6rem; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(35, 129, 232, 0.18);
}
input[type="checkbox"], input[type="radio"] { width: 1.1rem; height: 1.1rem; accent-color: var(--accent); }
::placeholder { color: #9aa7b8; }

@media (max-width: 559px) {
  input[type="text"], input[type="password"], input[type="number"], input[type="date"],
  input[type="time"], input[type="datetime-local"], input[type="search"], select, textarea { font-size: 16px; }
}

.field-error { color: var(--danger); font-size: 0.86rem; margin: 0.3rem 0 0; }
.has-error input, .has-error select, .has-error textarea { border-color: var(--danger); background: #fffafa; }

.actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.form > .actions { margin-top: 0.5rem; padding-top: 1.1rem; border-top: 1px solid var(--border); }
.form-section { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 1.5rem 0 0.85rem; }

/* =========================================================================
   Кнопки
   ========================================================================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font: inherit;
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  min-height: 2.5rem;
  white-space: nowrap;
  transition: background-color 0.12s, border-color 0.12s, color 0.12s, box-shadow 0.12s;
}
.btn:hover { background: var(--surface-2); border-color: #aebbcc; text-decoration: none; }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(35, 129, 232, 0.3); }
.btn .icon { width: 18px; height: 18px; }
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 1px 2px rgba(20, 80, 160, 0.25);
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn-create {
  background: linear-gradient(180deg, #34b56e 0%, #27a05e 100%);
  border-color: #23945a;
  color: #fff;
  box-shadow: 0 1px 2px rgba(20, 110, 60, 0.3);
}
.btn-create:hover { background: #22914f; border-color: #1e8449; color: #fff; }
.btn-danger { background: var(--surface); border-color: #efb3b8; color: var(--danger); }
.btn-danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-link { border: 0; background: none; color: var(--accent); padding: 0.4rem 0.5rem; min-height: 0; box-shadow: none; }
.btn-link:hover { background: none; text-decoration: underline; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.btn-small { padding: 0.28rem 0.7rem; min-height: 2rem; font-size: 0.84rem; border-radius: 7px; }
.btn-block { width: 100%; }
.btn:disabled, .btn.is-busy { opacity: 0.6; cursor: progress; }

/* =========================================================================
   Вкладки, бейджи
   ========================================================================= */

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 1.1rem;
  padding: 0.3rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 11px;
  box-shadow: var(--shadow);
  width: fit-content;
  max-width: 100%;
}
.tab {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.42rem 0.85rem;
  border-radius: 8px;
  color: #43536a;
  font-weight: 500;
  font-size: 0.92rem;
  text-decoration: none;
  white-space: nowrap;
}
.tab:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.tab.is-active { background: var(--accent); color: #fff; font-weight: 600; }
.tab-count {
  display: inline-block;
  min-width: 1.4em;
  padding: 0 0.4em;
  border-radius: 999px;
  background: rgba(20, 38, 66, 0.08);
  font-size: 0.78rem;
  font-weight: 600;
  text-align: center;
}
.tab.is-active .tab-count { background: rgba(255, 255, 255, 0.25); }

@media (max-width: 559px) {
  .tabs { width: 100%; }
  .tab { flex: 1 1 auto; justify-content: center; padding: 0.42rem 0.6rem; }
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1.45;
  background: #e8edf3;
  color: #46566c;
  white-space: nowrap;
}
.badge-high { background: #fde8e8; color: #c22f38; }
.badge-normal { background: var(--accent-soft); color: #1a68bd; }
.badge-low { background: #eef1f5; color: #66768b; }
.badge-high::before, .badge-normal::before, .badge-low::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: currentColor;
}
.badge-overdue { background: var(--state-overdue); color: #fff; }
.badge-done { background: #e3f5ea; color: #1f7a48; }
.badge-warn { background: #fff1c7; color: #7a5700; }
.badge-archived { background: #e8edf3; color: #5a6a80; }

/* =========================================================================
   Таблицы: на узком экране прокручиваются внутри своего блока
   ========================================================================= */

.table-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; background: var(--surface); }
.table th, .table td { padding: 0.65rem 0.75rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.table thead th {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--surface-2);
}
.table tbody tr:hover td { background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: 0; }
[data-href] { cursor: pointer; }

/* =========================================================================
   Вход
   ========================================================================= */

.guest {
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% 20%, rgba(95, 208, 243, 0.25) 0, transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(54, 168, 101, 0.18) 0, transparent 45%),
    linear-gradient(160deg, #16365c 0%, #144a72 55%, #0f6475 100%);
}
.guest-main {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 16px;
}
.login { width: 100%; max-width: 400px; }
.login-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  margin-bottom: 1.4rem;
  color: #fff;
}
.login-brand .brand-mark { width: 2.6rem; height: 2.6rem; font-size: 1.3rem; border-radius: 12px; }
.login-title { font-size: 1.7rem; margin: 0; color: #fff; letter-spacing: -0.01em; }
.login-card {
  padding: 1.75rem 1.75rem 1.5rem;
  border: 0;
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(5, 20, 45, 0.35);
}
.login-card h2 { font-size: 1.15rem; margin-bottom: 0.25rem; }
.login-card .hint { margin-bottom: 1.25rem; }
.login-card .btn { min-height: 2.8rem; font-size: 1rem; }
.login-foot { margin: 1.1rem 0 0; text-align: center; color: rgba(235, 244, 255, 0.7); font-size: 0.85rem; }

/* Гость видит заглушку ошибки без меню */
.guest .page { max-width: 480px; width: 100%; padding: 0; }
.guest .page-head { margin: 0 0 1rem; border-radius: 14px; border: 0; }

.stub p { margin: 0; color: var(--muted); }
.stub .actions { margin-top: 1rem; }
.stub-code { font-size: 3rem; font-weight: 800; color: var(--border-strong); line-height: 1; margin: 0 0 0.5rem; }

/* =========================================================================
   Главная: плитки и списки
   ========================================================================= */

.tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
@media (min-width: 900px) {
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
}
@media (min-width: 1560px) {
  .tiles { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
.tile {
  --tile-color: var(--accent);
  --tile-soft: var(--accent-soft);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
  padding: 1.05rem 1.15rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  color: var(--text);
  text-decoration: none;
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.15s, transform 0.15s, border-color 0.15s;
}
.tile::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 3px;
  background: var(--tile-color);
  opacity: 0.85;
}
.tile:hover { box-shadow: var(--shadow-hover); transform: translateY(-1px); border-color: #cfd8e4; text-decoration: none; }
.tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tile-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.tile-label { font-size: 0.86rem; font-weight: 600; color: var(--muted); }
.tile-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 10px;
  background: var(--tile-soft);
  color: var(--tile-color);
  flex: 0 0 auto;
}
.tile-value { font-size: 2rem; font-weight: 750; line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.tile-value-sep { color: var(--border-strong); font-weight: 400; margin: 0 0.15rem; }
.tile-money { display: flex; flex-direction: column; gap: 0.1rem; }
.tile-money-row { font-size: 1.2rem; font-weight: 700; line-height: 1.3; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-money-row.is-zero { color: var(--muted); font-weight: 500; }
.tile-note { font-size: 0.82rem; color: var(--muted); margin-top: auto; }
.tile-red { --tile-color: #e04a4a; --tile-soft: #fdeaea; }
.tile-blue { --tile-color: #2381e8; --tile-soft: #e6f1fd; }
.tile-amber { --tile-color: #d99a00; --tile-soft: #fff4d4; }
.tile-green { --tile-color: #2f9e5f; --tile-soft: #e3f5ea; }
.tile-violet { --tile-color: #7a5af0; --tile-soft: #efebfe; }
.tile-teal { --tile-color: #0f8fa3; --tile-soft: #e0f4f6; }
.tile.is-zero .tile-value { color: #9aa7b8; }
@media (max-width: 559px) {
  .tile { padding: 0.85rem 0.9rem 0.8rem; }
  .tile-icon { width: 1.9rem; height: 1.9rem; border-radius: 8px; }
  .tile-icon .icon { width: 17px; height: 17px; }
  .tile-label { font-size: 0.8rem; line-height: 1.25; }
  .tile-value { font-size: 1.6rem; }
  .tile-money-row { font-size: 1rem; }
  .tile-note { font-size: 0.76rem; }
}

.dash-grid { display: grid; grid-template-columns: 1fr; gap: 0 1.25rem; align-items: start; }
@media (min-width: 1100px) {
  .dash-grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
}

.welcome {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
  align-items: center;
  padding: 1.75rem;
  background: linear-gradient(120deg, #ffffff 0%, #f1f7fe 100%);
}
.welcome h2 { font-size: 1.35rem; margin-bottom: 0.4rem; }
.welcome p { margin: 0; color: var(--muted); max-width: 40rem; }
.welcome-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
@media (min-width: 900px) {
  .welcome { grid-template-columns: 1fr auto; }
}

.stuck-list { list-style: none; margin: 0; padding: 0; }
.stuck-item { border-top: 1px solid var(--border); }
.stuck-item:first-child { border-top: 0; }
.stuck-link {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.15rem 1rem;
  align-items: center;
  padding: 0.7rem 0.6rem;
  margin: 0 -0.6rem;
  border-radius: 9px;
  color: var(--text);
  text-decoration: none;
}
.stuck-link:hover { background: var(--surface-2); text-decoration: none; }
.stuck-title { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stuck-link:hover .stuck-title { color: var(--accent); }
.stuck-sub { grid-column: 1; font-size: 0.84rem; color: var(--muted); min-width: 0; }
.stuck-left { grid-column: 2; grid-row: 1; text-align: right; font-weight: 600; font-size: 0.9rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stuck-dots { grid-column: 2; grid-row: 2; display: flex; gap: 3px; justify-content: flex-end; }
.dot {
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 3px;
  background: var(--state-open);
}
.dot-done { background: var(--state-done); }
.dot-partial, .dot-warn { background: var(--state-partial); }
.dot-overdue { background: var(--state-overdue); }
.dot-na { background: repeating-linear-gradient(135deg, var(--state-na-a) 0 2px, var(--state-na-b) 2px 4px); }
