/* Дизайн-система кабинета АВТМ. Фирменные цвета сайта: navy #1F3864, gold #C5A028. */

@font-face { font-family: 'Inter'; font-weight: 400; font-display: swap; src: url('/assets/fonts/inter-400-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122; }
@font-face { font-family: 'Inter'; font-weight: 400; font-display: swap; src: url('/assets/fonts/inter-400-cyrillic.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Inter'; font-weight: 500; font-display: swap; src: url('/assets/fonts/inter-500-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122; }
@font-face { font-family: 'Inter'; font-weight: 500; font-display: swap; src: url('/assets/fonts/inter-500-cyrillic.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Inter'; font-weight: 600; font-display: swap; src: url('/assets/fonts/inter-600-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122; }
@font-face { font-family: 'Inter'; font-weight: 600; font-display: swap; src: url('/assets/fonts/inter-600-cyrillic.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Inter'; font-weight: 700; font-display: swap; src: url('/assets/fonts/inter-700-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122; }
@font-face { font-family: 'Inter'; font-weight: 700; font-display: swap; src: url('/assets/fonts/inter-700-cyrillic.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Playfair Display'; font-weight: 700; font-display: swap; src: url('/assets/fonts/playfair-display-700-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: 'Playfair Display'; font-weight: 700; font-display: swap; src: url('/assets/fonts/playfair-display-700-cyrillic.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }

:root {
  --navy-900: #0F1E38; --navy-800: #162A4A; --navy-700: #1F3864; --navy-600: #2A4A7A; --navy-100: #E8EDF5; --navy-50: #F3F6FA;
  --gold-600: #A8871F; --gold-500: #C5A028; --gold-100: #F7EFD6;
  --ink: #111827; --ink-2: #374151; --ink-3: #6B7280; --ink-4: #9CA3AF;
  --line: #E5E7EB; --line-2: #EEF0F3; --surface: #FFFFFF; --canvas: #F6F7F9;
  --green-700: #15803D; --green-50: #ECFDF3; --amber-700: #B45309; --amber-50: #FFF7E6;
  --red-700: #B91C1C; --red-50: #FEF2F2; --blue-700: #1D4ED8; --blue-50: #EFF4FF;
  --radius-sm: 8px; --radius: 12px; --radius-lg: 16px; --radius-xl: 20px;
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-sm: 0 1px 3px rgba(16, 24, 40, .08), 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-md: 0 8px 24px -6px rgba(16, 24, 40, .10), 0 2px 6px rgba(16, 24, 40, .05);
  --shadow-lg: 0 24px 48px -12px rgba(16, 24, 40, .18);
  --ring: 0 0 0 4px rgba(31, 56, 100, .14);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --serif: 'Playfair Display', Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--canvas); color: var(--ink);
  font: 400 15px/1.55 var(--font); letter-spacing: -.005em;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
a { color: var(--navy-700); text-decoration: none; }
a:hover { color: var(--navy-600); text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--radius-sm); }
.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; }
[hidden] { display: none !important; }

/* ---------- Брендинг ---------- */
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--navy-700); text-decoration: none; }
.brand:hover { text-decoration: none; color: var(--navy-700); }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(145deg, var(--navy-700), var(--navy-900)); color: var(--gold-500);
  font: 700 15px/1 var(--serif); letter-spacing: .02em; box-shadow: inset 0 0 0 1px rgba(197, 160, 40, .35);
}
.brand-name { font: 700 20px/1 var(--serif); letter-spacing: .01em; }
.brand-sub { display: block; margin-top: 3px; font: 500 10.5px/1 var(--font); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }

/* ---------- Экран авторизации ---------- */
.auth { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); min-height: 100vh; }
.auth-aside {
  position: relative; overflow: hidden; padding: 48px 56px; color: #fff; display: flex; flex-direction: column;
  background:
    radial-gradient(1200px 600px at -10% -20%, rgba(197, 160, 40, .18), transparent 60%),
    radial-gradient(900px 500px at 120% 120%, rgba(42, 74, 122, .9), transparent 60%),
    linear-gradient(160deg, var(--navy-700) 0%, var(--navy-900) 100%);
}
.auth-aside::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 44px 44px; mask-image: radial-gradient(ellipse at 30% 40%, #000 20%, transparent 75%);
}
.auth-aside .brand { color: #fff; position: relative; z-index: 1; }
.auth-aside .brand-sub { color: rgba(255,255,255,.55); }
.auth-aside-body { margin-top: auto; position: relative; z-index: 1; max-width: 460px; }
.auth-eyebrow { display: inline-flex; align-items: center; gap: 8px; font: 600 12px/1 var(--font); letter-spacing: .14em; text-transform: uppercase; color: var(--gold-500); }
.auth-eyebrow::before { content: ''; width: 24px; height: 1px; background: currentColor; }
.auth-aside h2 { margin: 18px 0 16px; font: 700 40px/1.15 var(--serif); letter-spacing: -.01em; }
.auth-aside p { margin: 0; color: rgba(255,255,255,.72); font-size: 16px; line-height: 1.65; }
.auth-points { list-style: none; padding: 0; margin: 32px 0 0; display: grid; gap: 14px; }
.auth-points li { display: flex; gap: 12px; align-items: flex-start; color: rgba(255,255,255,.85); font-size: 14.5px; }
.auth-points li::before { content: ''; flex: none; margin-top: 7px; width: 6px; height: 6px; border-radius: 50%; background: var(--gold-500); box-shadow: 0 0 0 4px rgba(197,160,40,.18); }
.auth-foot { position: relative; z-index: 1; margin-top: 48px; font-size: 12.5px; color: rgba(255,255,255,.45); }

.auth-main { display: flex; align-items: center; justify-content: center; padding: 48px 24px; background: var(--surface); }
.auth-card { width: 100%; max-width: 420px; animation: rise .5s var(--ease) both; }
.auth-card .brand { display: none; margin-bottom: 40px; }
.auth-card h1 { margin: 0 0 8px; font: 700 30px/1.2 var(--serif); letter-spacing: -.01em; color: var(--ink); }
.auth-card .lead { margin: 0 0 32px; color: var(--ink-3); font-size: 15px; }
.auth-switch { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line-2); text-align: center; font-size: 14px; color: var(--ink-3); }

/* ---------- Формы ---------- */
.field { margin-bottom: 18px; }
.label { display: block; margin-bottom: 7px; font-weight: 500; font-size: 13.5px; color: var(--ink-2); }
.label .req { color: var(--gold-600); margin-left: 2px; }
.input, .select {
  display: block; width: 100%; height: 46px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink); font: inherit; font-size: 15px; box-shadow: var(--shadow-xs);
  transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: var(--ink-4); }
.input:hover, .select:hover { border-color: #D1D5DB; }
.input:focus, .select:focus { outline: none; border-color: var(--navy-600); box-shadow: var(--ring); }
.input[aria-invalid="true"] { border-color: #F2B8B5; box-shadow: 0 0 0 4px rgba(185, 28, 28, .08); }
.select { appearance: none; padding-right: 40px; cursor: pointer;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%236B7280' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center; }
.hint { margin-top: 6px; font-size: 12.5px; color: var(--ink-3); }
.error-text { margin-top: 6px; font-size: 12.5px; color: var(--red-700); }
.code-input { height: 60px; text-align: center; font: 600 28px/1 var(--font); letter-spacing: .5em; padding-left: .5em; font-variant-numeric: tabular-nums; }

.check { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; transition: border-color .15s, background .15s; }
.check + .check { margin-top: 10px; }
.check:hover { border-color: #D1D5DB; background: var(--navy-50); }
.check input { flex: none; appearance: none; width: 20px; height: 20px; margin: 1px 0 0; border: 1.5px solid #C4C9D1; border-radius: 6px; background: #fff; cursor: pointer; display: grid; place-items: center; transition: all .15s; }
.check input:checked { background: var(--navy-700); border-color: var(--navy-700); }
.check input:checked::after { content: ''; width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: translateY(-1px) rotate(45deg); }
.check input:focus-visible { box-shadow: var(--ring); }
.check span { font-size: 13.5px; line-height: 1.5; color: var(--ink-2); }
.check a { text-decoration: underline; text-underline-offset: 2px; }

.honeypot { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Кнопки ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px;
  border: 1px solid transparent; border-radius: var(--radius-sm); font: 600 14.5px/1 var(--font); letter-spacing: -.005em;
  cursor: pointer; white-space: nowrap; text-decoration: none; user-select: none;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .05s;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { cursor: not-allowed; opacity: .55; transform: none; }
.btn-primary { background: var(--navy-700); color: #fff; box-shadow: 0 1px 2px rgba(15,30,56,.2), inset 0 1px 0 rgba(255,255,255,.08); }
.btn-primary:hover:not(:disabled) { background: var(--navy-800); color: #fff; }
.btn-gold { background: var(--gold-500); color: var(--navy-900); }
.btn-gold:hover:not(:disabled) { background: var(--gold-600); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--ink-2); border-color: var(--line); box-shadow: var(--shadow-xs); }
.btn-secondary:hover:not(:disabled) { background: var(--canvas); color: var(--ink); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover:not(:disabled) { background: var(--line-2); color: var(--ink); }
.btn-danger { background: var(--surface); color: var(--red-700); border-color: #F5CFCC; }
.btn-danger:hover:not(:disabled) { background: var(--red-50); }
.btn-block { width: 100%; height: 48px; font-size: 15px; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 7px; }
.btn[aria-busy="true"] { color: transparent !important; pointer-events: none; }
.btn[aria-busy="true"]::after { content: ''; position: absolute; width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
.btn-secondary[aria-busy="true"]::after, .btn-danger[aria-busy="true"]::after, .btn-ghost[aria-busy="true"]::after { border-color: rgba(17,24,39,.15); border-top-color: var(--ink-2); }

/* ---------- Уведомления ---------- */
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius); font-size: 14px; line-height: 1.5; border: 1px solid; margin-bottom: 20px; animation: fade .25s var(--ease); }
.alert::before { flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font: 700 12px/1 var(--font); color: #fff; margin-top: 1px; }
.alert-error { background: var(--red-50); border-color: #F8D4D1; color: #7F1D1D; }
.alert-error::before { content: '!'; background: var(--red-700); }
.alert-success { background: var(--green-50); border-color: #C6EFD5; color: #14532D; }
.alert-success::before { content: '✓'; background: var(--green-700); }
.alert-info { background: var(--blue-50); border-color: #D4E0FD; color: #1E3A8A; }
.alert-info::before { content: 'i'; background: var(--blue-700); font-family: var(--serif); }

.toast-region { position: fixed; right: 24px; bottom: 24px; z-index: 100; display: grid; gap: 10px; }
.toast { min-width: 280px; max-width: 420px; padding: 14px 18px; border-radius: var(--radius); background: var(--navy-900); color: #fff; font-size: 14px; box-shadow: var(--shadow-lg); animation: rise .3s var(--ease); display: flex; gap: 10px; align-items: center; }
.toast::before { content: ''; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--gold-500); }
.toast.is-error::before { background: #F87171; }

/* ---------- Итоговые экраны ---------- */
.result { text-align: center; padding: 8px 0; }
.result-icon { width: 64px; height: 64px; margin: 0 auto 24px; border-radius: 50%; display: grid; place-items: center; }
.result-icon svg { width: 30px; height: 30px; }
.result-icon.ok { background: var(--green-50); color: var(--green-700); box-shadow: 0 0 0 8px rgba(21,128,61,.06); }
.result-icon.mail { background: var(--navy-50); color: var(--navy-700); box-shadow: 0 0 0 8px rgba(31,56,100,.05); }
.result-icon.err { background: var(--red-50); color: var(--red-700); box-shadow: 0 0 0 8px rgba(185,28,28,.05); }
.result h1 { margin-bottom: 12px; }
.result p { color: var(--ink-3); margin: 0 auto 28px; max-width: 360px; }

/* ---------- Каркас кабинета ---------- */
.shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar { min-height: 65px; position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.85); backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px); border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: 1240px; margin: 0 auto; height: 64px; padding: 0 32px; display: flex; align-items: center; gap: 36px; }
.topbar .brand-mark { width: 32px; height: 32px; font-size: 13px; }
.topbar .brand-name { font-size: 18px; }
.nav { display: flex; gap: 4px; height: 100%; }
.nav a { position: relative; display: flex; align-items: center; padding: 0 14px; color: var(--ink-3); font-weight: 500; font-size: 14px; }
.nav a:hover { color: var(--ink); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--navy-700); }
.nav a[aria-current="page"]::after { content: ''; position: absolute; left: 14px; right: 14px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--navy-700); }
.topbar-user { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--gold-100); color: var(--gold-600); font: 600 13px/1 var(--font); flex: none; }
.who { line-height: 1.25; text-align: right; }
.who b { display: block; font-weight: 600; font-size: 13.5px; }
.who span { font-size: 12px; color: var(--ink-3); }

.page { flex: 1; width: 100%; max-width: 1240px; margin: 0 auto; padding: 36px 32px 72px; animation: fade .35s var(--ease); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 28px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font: 700 30px/1.2 var(--serif); letter-spacing: -.01em; }
.page-head p { margin: 6px 0 0; color: var(--ink-3); }
.crumbs { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; font-size: 13.5px; color: var(--ink-3); }
.crumbs a { color: var(--ink-3); }
.crumbs a:hover { color: var(--navy-700); }

/* ---------- Метрики ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat { padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-xs); cursor: pointer; text-align: left; font: inherit; color: inherit; transition: border-color .15s, box-shadow .15s, transform .15s; }
.stat:hover { border-color: #D1D5DB; box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.stat[aria-pressed="true"] { border-color: var(--navy-700); box-shadow: 0 0 0 1px var(--navy-700), var(--shadow-sm); }
.stat-label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-3); font-weight: 500; }
.stat-value { margin-top: 8px; font: 600 28px/1 var(--font); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dot-amber { background: #F59E0B; box-shadow: 0 0 0 3px rgba(245,158,11,.18); }
.dot-green { background: #22C55E; box-shadow: 0 0 0 3px rgba(34,197,94,.18); }
.dot-gray { background: #9CA3AF; box-shadow: 0 0 0 3px rgba(156,163,175,.18); }
.dot-red { background: #EF4444; box-shadow: 0 0 0 3px rgba(239,68,68,.18); }
.dot-navy { background: var(--navy-700); box-shadow: 0 0 0 3px rgba(31,56,100,.15); }

/* ---------- Карточки ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-xs); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 24px; border-bottom: 1px solid var(--line-2); }
.card-head h2 { margin: 0; font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.card-head .muted { font-size: 13px; }
.card-body { padding: 24px; }
.muted { color: var(--ink-3); }

/* ---------- Панель фильтров ---------- */
.toolbar { display: flex; gap: 12px; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.search { position: relative; flex: 1 1 280px; }
.search .input { padding-left: 42px; height: 40px; font-size: 14px; }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--ink-4); pointer-events: none; }
.toolbar .select { width: auto; height: 40px; font-size: 14px; min-width: 170px; }
.toolbar .count { margin-left: auto; font-size: 13px; color: var(--ink-3); white-space: nowrap; }

/* ---------- Таблица ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.table th { position: sticky; top: 0; padding: 11px 20px; text-align: left; font: 500 12px/1 var(--font); letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); background: #FAFBFC; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table th button { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.table th button:hover { color: var(--ink); }
.table th button:focus-visible { box-shadow: var(--ring); border-radius: 4px; }
.table th .arrow { opacity: .35; font-size: 11px; transition: opacity .15s; }
.table th[aria-sort] .arrow { opacity: 1; color: var(--navy-700); }
.table td { padding: 14px 20px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tbody tr { transition: background .12s; }
.table tbody tr.is-link { cursor: pointer; }
.table tbody tr.is-link:hover { background: var(--navy-50); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tr.is-pending td:first-child { box-shadow: inset 3px 0 0 #F59E0B; }
.table tr.is-pending { background: linear-gradient(90deg, rgba(255,247,230,.9), rgba(255,247,230,.25) 60%, transparent); }
.table tr.is-pending:hover { background: var(--amber-50); }
.person { display: flex; align-items: center; gap: 12px; min-width: 220px; }
.person > div { min-width: 0; }
.person > div > b { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 600; color: var(--ink); }
.person > div > span { display: block; font-size: 13px; color: var(--ink-3); }
.doc-actions { display: inline-flex; gap: 6px; }
.table td.email { white-space: nowrap; }
.cell-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--ink-2); }

.badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font: 500 12.5px/1 var(--font); white-space: nowrap; border: 1px solid transparent; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-amber { background: var(--amber-50); color: var(--amber-700); border-color: #FBE3B6; }
.badge-green { background: var(--green-50); color: var(--green-700); border-color: #C6EFD5; }
.badge-gray { background: #F3F4F6; color: #4B5563; border-color: var(--line); }
.badge-red { background: var(--red-50); color: var(--red-700); border-color: #F8D4D1; }
.badge-navy { background: var(--navy-100); color: var(--navy-700); border-color: #D5DEEB; }
.badge-gold { background: var(--gold-100); color: var(--gold-600); border-color: #EFDFA9; }
.badge.no-dot::before { display: none; }

/* ---------- Пустые состояния и загрузка ---------- */
.empty { padding: 64px 24px; text-align: center; color: var(--ink-3); }
.empty-icon { width: 52px; height: 52px; margin: 0 auto 16px; border-radius: 14px; display: grid; place-items: center; background: var(--navy-50); color: var(--navy-600); }
.empty-icon svg { width: 24px; height: 24px; }
.empty b { display: block; margin-bottom: 4px; color: var(--ink); font-weight: 600; font-size: 15px; }
.sk-w40 { width: 40%; } .sk-w60 { width: 60%; } .sk-w80 { width: 80%; } .sk-center { margin: 0 auto 14px; }
.skeleton { display: block; height: 12px; border-radius: 6px; background: linear-gradient(90deg, #EEF0F3 25%, #F6F7F9 50%, #EEF0F3 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }

/* ---------- Карточка пользователя ---------- */
.profile { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; align-items: start; }
.profile-hero { display: flex; gap: 20px; align-items: center; padding: 24px; }
.profile-hero .avatar { width: 64px; height: 64px; font-size: 22px; font-family: var(--serif); font-weight: 700; background: linear-gradient(145deg, var(--navy-700), var(--navy-900)); color: var(--gold-500); }
.profile-hero h1 { margin: 0 0 6px; font: 700 26px/1.2 var(--serif); }
.profile-hero .tags { display: flex; gap: 8px; flex-wrap: wrap; }
.dl { display: grid; grid-template-columns: 180px minmax(0, 1fr); margin: 0; }
.dl dt, .dl dd { padding: 13px 24px; border-top: 1px solid var(--line-2); margin: 0; font-size: 14px; }
.dl dt { color: var(--ink-3); }
.dl dd { color: var(--ink); word-break: break-word; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; padding: 18px 24px; border-top: 1px solid var(--line-2); background: #FAFBFC; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.stack { display: grid; gap: 24px; }

.dropzone {
  position: relative; display: block; padding: 32px 20px; text-align: center; border: 1.5px dashed #CBD2DC; border-radius: var(--radius);
  background: var(--navy-50); cursor: pointer; transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.is-over { border-color: var(--navy-600); background: var(--navy-100); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone:focus-within { box-shadow: var(--ring); }
.dropzone-icon { width: 44px; height: 44px; margin: 0 auto 12px; border-radius: 12px; display: grid; place-items: center; background: #fff; color: var(--navy-700); box-shadow: var(--shadow-sm); }
.dropzone-icon svg { width: 22px; height: 22px; }
.dropzone b { display: block; font-weight: 600; color: var(--ink); margin-bottom: 4px; }
.dropzone span { font-size: 13px; color: var(--ink-3); }
.file-chip { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; margin-top: 14px; }
.file-icon { flex: none; width: 38px; height: 44px; border-radius: 6px; display: grid; place-items: center; font: 700 10px/1 var(--font); letter-spacing: .04em; color: #fff; }
.file-icon.pdf { background: #D14343; }
.file-icon.docx { background: #2B6CD9; }
.file-chip .meta { flex: 1; min-width: 0; }
.file-chip .meta b { display: block; font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-chip .meta span { font-size: 12.5px; color: var(--ink-3); }
.progress { height: 4px; border-radius: 4px; background: var(--line-2); overflow: hidden; margin-top: 14px; }
.progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--navy-700), var(--gold-500)); transition: width .4s var(--ease); }
.steps { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 8px; font-size: 13.5px; }
.steps li { display: flex; gap: 10px; align-items: center; color: var(--ink-4); }
.steps li::before { content: ''; width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid currentColor; flex: none; box-sizing: border-box; }
.steps li.is-active { color: var(--navy-700); font-weight: 500; }
.steps li.is-active::before { border-color: var(--navy-700); border-top-color: transparent; animation: spin .8s linear infinite; }
.steps li.is-done { color: var(--green-700); }
.steps li.is-done::before { background: var(--green-700); border-color: var(--green-700); box-shadow: inset 0 0 0 3px #fff; }

/* ---------- Всплывающее окно документа ---------- */
.modal { width: min(760px, calc(100vw - 32px)); max-height: min(86vh, 900px); padding: 0; border: 0; border-radius: var(--radius-xl);
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg); overflow: hidden; }
.modal[open] { display: flex; flex-direction: column; animation: rise .25s var(--ease); }
.modal::backdrop { background: rgba(15, 30, 56, .55); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 24px; border-bottom: 1px solid var(--line-2); }
.modal-head h2 { margin: 0; font: 700 22px/1.25 var(--serif); }
.modal-close { width: 34px; padding: 0; font-size: 16px; }
.modal-body { flex: 1; overflow-y: auto; padding: 24px 28px; overscroll-behavior: contain; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 16px 24px; border-top: 1px solid var(--line-2); background: #FAFBFC; }
.legal-text { font-size: 14.5px; line-height: 1.7; color: var(--ink-2); }
/* Заголовок документа уже в шапке окна */
.legal-text h1 { display: none; }
.modal-body:focus { outline: none; box-shadow: none; }
.legal-text h2 { margin: 26px 0 10px; font: 600 15.5px/1.4 var(--font); color: var(--ink); }
.legal-text p { margin: 0 0 10px; }
.legal-text ul { margin: 0 0 12px; padding-left: 22px; }
.legal-text li { margin-bottom: 4px; }
.legal-text a { text-decoration: underline; text-underline-offset: 2px; }
.legal-text .download { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line-2); }
.legal-text .download a { display: inline-flex; align-items: center; height: 36px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); text-decoration: none; font-weight: 500; font-size: 13.5px; color: var(--ink-2); }
.legal-text .download a:hover { background: var(--canvas); }
@media (max-width: 640px) {
  .modal { width: 100vw; max-width: 100vw; max-height: 92vh; border-radius: var(--radius-xl) var(--radius-xl) 0 0; margin: auto 0 0; }
  .modal-body { padding: 18px; }
  .modal-foot { flex-direction: column-reverse; }
  .modal-foot .btn { width: 100%; }
}

/* ---------- Анимации ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }

/* ---------- Адаптив ---------- */
@media (max-width: 1080px) {
  .profile { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .auth-card .brand { display: inline-flex; }
  .topbar-inner { padding: 0 16px; gap: 16px; }
  .who { display: none; }
  .page { padding: 24px 16px 56px; }
}
@media (max-width: 640px) {
  .nav a { padding: 0 8px; font-size: 13.5px; }
  .topbar .brand-name, .topbar .brand-sub { display: none; }
  .page-head h1 { font-size: 24px; }
  .stats { gap: 10px; }
  .stat { padding: 14px; }
  .stat-value { font-size: 22px; }
  .dl { grid-template-columns: 1fr; }
  .dl dt { padding-bottom: 0; border-top: 1px solid var(--line-2); }
  .dl dd { padding-top: 4px; border-top: 0; }
  .table .hide-sm { display: none; }
  .toast-region { left: 16px; right: 16px; bottom: 16px; }
  .toast { min-width: 0; }
}
