/*
  Документы Estate Invest — оформление по дизайн-системе Александра Никулина
  (та же, что в задачнике tasks.estateinvest.online): токены shadcn/zinc, шрифт Inter,
  плашки без обводок (форму даёт заливка), каркас «панель контента на подложке».
  Значения токенов взяты из `Задачник EI/src/styles/globals.css`; здесь — чистый CSS
  без сборки, поэтому компоненты ДС повторены по виду, а не подключены.
*/
@font-face { font-family: 'Inter Variable'; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(/assets/fonts/inter-cyrillic-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: 'Inter Variable'; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(/assets/fonts/inter-latin-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }

:root {
  --background: oklch(1 0 0);
  --foreground: oklch(0.141 0.005 285.823);
  --muted: oklch(0.967 0.001 286.375);
  --muted-foreground: oklch(0.552 0.016 285.938);
  --card: oklch(1 0 0);
  --primary: oklch(0.21 0.006 285.885);
  --primary-foreground: oklch(0.985 0 0);
  --border: oklch(0.92 0.004 286.32);
  --input: oklch(0.92 0.004 286.32);
  --ring: oklch(0.58 0.015 286.067);
  --destructive: oklch(0.577 0.245 27.325);
  --sidebar: oklch(0.985 0 0);
  --brand: oklch(0.58 0.18 12);
  --tile: oklch(0.97 0.001 286.375);
  --tile-foreground: oklch(0.141 0.005 285.823);
  --tile-hover: oklch(0.95 0.002 286.375);
  --ei-gold: #a67c00;
  --chart: oklch(0.6 0.118 184.704);           /* --chart-3: на белом читается лучше */
  /* статусы объектов: пара проверена валидатором палитры (различимость при дальтонизме, контраст) */
  --done: #009689;
  --work: #d56a10;
  --radius: 0.625rem;
  --radius-xl: calc(var(--radius) * 1.4);
  --radius-2xl: calc(var(--radius) * 1.8);
  --shell-gap: 0.5rem;
  --shell-radius: 40px;
  --font-sans: 'Inter Variable', Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --warn: oklch(0.65 0.17 55);
  --ok: oklch(0.6 0.15 150);
  color-scheme: light;
}
.dark {
  --background: oklch(0.17 0.005 285.823);
  --foreground: oklch(0.985 0 0);
  --muted: oklch(0.274 0.006 286.033);
  --muted-foreground: oklch(0.705 0.015 286.067);
  --card: oklch(0.21 0.006 285.885);
  --primary: oklch(0.92 0.004 286.32);
  --primary-foreground: oklch(0.21 0.006 285.885);
  --border: oklch(1 0 0 / 10%);
  --input: oklch(1 0 0 / 15%);
  --ring: oklch(0.6 0.016 285.938);
  --destructive: oklch(0.704 0.191 22.216);
  --sidebar: oklch(0 0 0);
  --brand: oklch(0.68 0.17 12);
  --tile: oklch(0.21 0.006 285.885);
  --tile-foreground: oklch(0.985 0 0);
  --tile-hover: oklch(0.235 0.006 286);
  --ei-gold: #f5c000;
  --chart: oklch(0.704 0.14 182.503);           /* --chart-2 */
  --done: #00a594;
  --work: #cf701d;
  --warn: oklch(0.75 0.15 60);
  --ok: oklch(0.72 0.15 150);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--sidebar);
  color: var(--foreground);
  font: 14px/1.5 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}
::selection { background: color-mix(in oklab, var(--brand) 30%, transparent); }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }

/* ---------- каркас: панель контента на подложке ---------- */
.shell { padding: var(--shell-gap); min-height: 100vh; }
.panel {
  background: var(--background);
  border-radius: var(--shell-radius);
  min-height: calc(100vh - 2 * var(--shell-gap));
  overflow: hidden;
  overflow: clip; /* clip, а не hidden: иначе не работает position:sticky у сцены */
}
@media (max-width: 767.98px) {
  .shell { padding: 0; }
  .panel { border-radius: 0; min-height: 100vh; }
}
.header {
  height: 4.5rem;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 32px;
}
@media (max-width: 767.98px) { .header { height: 4rem; padding: 0 16px; } }
.crumbs { display: flex; align-items: baseline; gap: 10px; min-width: 0; font-weight: 600; letter-spacing: -0.02em; }
.crumbs .brand { color: var(--ei-gold); font-size: 15px; white-space: nowrap; text-decoration: none; }
.crumbs .sep { color: var(--muted-foreground); font-size: 20px; }
.crumbs .up { color: var(--muted-foreground); font-size: 24px; text-decoration: none; white-space: nowrap; }
.crumbs .up:hover { color: var(--foreground); }
.crumbs .here { font-size: 28px; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 767.98px) {
  .crumbs .up, .crumbs .sep.hide-sm, .crumbs .brand.hide-sm { display: none; }
  .crumbs .here { font-size: 16px; }
}
.actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.content { max-width: 1120px; margin: 0 auto; padding: 8px 32px 48px; }
@media (max-width: 767.98px) { .content { padding: 4px 16px 40px; } }

/* ---------- кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 40px; padding: 0 18px; border: 0; border-radius: 9999px;
  background: var(--primary); color: var(--primary-foreground);
  font: 500 14px var(--font-sans); cursor: pointer; text-decoration: none;
}
.btn:hover { opacity: .9; }
.btn-ghost {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px;
  border: 0; border-radius: 9999px; background: transparent; color: var(--muted-foreground);
  font: 500 13px var(--font-sans); cursor: pointer; text-decoration: none;
}
.btn-ghost:hover { background: var(--muted); color: var(--foreground); }
.icon-btn { width: 36px; padding: 0; justify-content: center; }

/* ---------- плашки ---------- */
.tile {
  background: var(--tile); color: var(--tile-foreground);
  border-radius: var(--radius-2xl); padding: 20px;
}
.tile.link { display: block; text-decoration: none; transition: background .15s; }
.tile.link:hover { background: var(--tile-hover); }
.label { font-size: 13px; color: var(--muted-foreground); font-weight: 500; margin-bottom: 4px; }
h2 { font-size: 18px; line-height: 1.3; font-weight: 600; letter-spacing: -0.01em; margin: 0 0 14px; }
.muted { color: var(--muted-foreground); }
.small { font-size: 13px; }
.section { margin-top: 28px; }
.section > h2 { margin-bottom: 12px; }

/* ---------- бейджи ---------- */
.badge {
  display: inline-flex; align-items: center; height: 20px; padding: 0 8px;
  border-radius: 9999px; font-size: 12px; font-weight: 500; line-height: 1; white-space: nowrap;
  background: color-mix(in oklab, var(--muted-foreground) 18%, transparent); color: var(--muted-foreground);
}
.badge.green { background: color-mix(in oklab, var(--ok) 18%, transparent); color: var(--ok); }
.badge.orange { background: color-mix(in oklab, var(--warn) 18%, transparent); color: var(--warn); }
.badge.red { background: color-mix(in oklab, var(--destructive) 15%, transparent); color: var(--destructive); }

/* ---------- сегментный переключатель ---------- */
.segmented {
  display: inline-flex; padding: 3px; border-radius: 17px;
  border: 1px solid color-mix(in oklab, var(--border) 50%, transparent);
  background: color-mix(in oklab, var(--input) 50%, transparent);
}
.segmented button {
  height: 32px; padding: 0 14px; border: 0; border-radius: 14px; background: transparent;
  color: var(--muted-foreground); font: 500 13px var(--font-sans); cursor: pointer;
}
.segmented button.on { background: var(--background); color: var(--foreground); box-shadow: 0 1px 3px rgb(0 0 0 / .12); }

/* ---------- таблица ---------- */
.tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 10px 8px; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
th { height: 40px; font-weight: 500; font-size: 13px; color: var(--muted-foreground); border-bottom: 1px solid var(--border); }
td { border-bottom: 1px solid var(--border); }
tbody tr:last-child td { border-bottom: 0; }
th.left, td.left { text-align: left; white-space: normal; }
tbody tr:hover td { background: color-mix(in oklab, var(--muted) 50%, transparent); }

/* ---------- форма входа ---------- */
.center { min-height: calc(100vh - 2 * var(--shell-gap)); display: flex; align-items: center; justify-content: center; padding: 16px; }
.login { width: 100%; max-width: 380px; }
.login h1 { font-size: 28px; letter-spacing: -0.02em; margin: 4px 0 6px; }
.login label { display: block; margin: 14px 0; font-size: 13px; font-weight: 500; color: var(--muted-foreground); }
.login input {
  display: block; width: 100%; margin-top: 6px; height: 44px; padding: 0 14px;
  background: color-mix(in oklab, var(--input) 50%, transparent); border: 1px solid transparent; border-radius: 14px;
  color: var(--foreground); font: 16px var(--font-sans);
}
.login input:focus { outline: none; border-color: var(--ring); }
.login .btn { width: 100%; margin-top: 10px; height: 44px; }
.error { color: var(--destructive); font-size: 13px; }
