:root {
  color-scheme: light;
  --ink: #172b3b;
  --muted: #748392;
  --line: #e3e9ed;
  --paper: #ffffff;
  --canvas: #f4f7f8;
  --blue: #087e8b;
  --blue-dark: #06616d;
  --teal-soft: #e5f5f3;
  --red: #b74742;
  --amber: #9a6817;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--canvas); }
button, input { font: inherit; }
a { color: inherit; text-decoration: none; }
.topbar { min-height: 70px; padding: 0 max(24px, calc((100vw - 1240px) / 2)); background: var(--paper); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.brand, .topbar-actions { display: flex; align-items: center; gap: 12px; }
.brand { font-family: Manrope, sans-serif; font-weight: 800; font-size: 17px; letter-spacing: -.03em; }
.brand-mark { width: 34px; height: 34px; display: inline-grid; place-items: center; color: white; background: var(--blue); border-radius: 11px; font-family: Manrope, sans-serif; font-size: 17px; font-weight: 800; }
.topbar-actions { gap: 22px; }
.page-shell { max-width: 1240px; margin: 0 auto; padding: 46px 24px 72px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.eyebrow { margin: 0 0 8px; color: var(--blue); font-size: 10px; font-weight: 700; letter-spacing: .14em; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-family: Manrope, sans-serif; font-size: clamp(27px, 3vw, 35px); line-height: 1.15; letter-spacing: -.045em; }
.muted { margin-bottom: 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.count-card { min-width: 100px; padding: 12px 17px; display: flex; align-items: baseline; gap: 8px; background: var(--paper); border: 1px solid var(--line); border-radius: 13px; }
.count-card strong { font-family: Manrope, sans-serif; font-size: 21px; }
.count-card span { color: var(--muted); font-size: 12px; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.search-form { flex: 1; }
.search-box { max-width: 540px; height: 44px; display: flex; align-items: center; gap: 10px; padding: 0 6px 0 14px; background: var(--paper); border: 1px solid var(--line); border-radius: 11px; }
.search-box span { color: #8a99a4; font-size: 21px; }
.search-box input { flex: 1; min-width: 0; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 13px; }
.search-box button { border: 0; padding: 9px 13px; border-radius: 8px; color: var(--blue-dark); background: var(--teal-soft); font-size: 12px; font-weight: 700; cursor: pointer; }
.button { min-height: 38px; padding: 0 14px; border: 1px solid transparent; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; cursor: pointer; transition: background .15s ease, border-color .15s ease; }
.button-primary { color: white; background: var(--blue); }
.button-primary:hover { background: var(--blue-dark); }
.button-secondary { color: #385264; background: white; border-color: var(--line); }
.button-secondary:hover { border-color: #bdcbd3; }
.button-quiet { min-height: 34px; padding: 0 10px; color: #5f7180; background: transparent; }
.button-small { min-height: 33px; padding: 0 11px; white-space: nowrap; }
.button-wide { width: 100%; min-height: 45px; }
.upload-panel { position: relative; }
.upload-panel summary { list-style: none; }
.upload-panel summary::-webkit-details-marker { display: none; }
.upload-form { position: absolute; z-index: 5; top: 48px; right: 0; width: min(360px, calc(100vw - 36px)); padding: 18px; display: grid; gap: 14px; background: white; border: 1px solid var(--line); border-radius: 13px; box-shadow: 0 16px 40px #17344720; }
.upload-form label, .stack label { display: grid; gap: 7px; color: #526575; font-size: 12px; font-weight: 600; }
input[type=file] { width: 100%; padding: 9px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); font-size: 12px; }
.table-card { overflow: hidden; background: var(--paper); border: 1px solid var(--line); border-radius: 15px; box-shadow: 0 4px 15px #18314206; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { padding: 14px 16px; color: #81909b; background: #fbfcfc; border-bottom: 1px solid var(--line); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
td { padding: 15px 16px; border-bottom: 1px solid #edf1f3; color: #405363; font-size: 12px; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fcfefe; }
td strong { display: block; color: var(--ink); font-size: 13px; font-weight: 700; }
td small { display: block; margin-top: 4px; color: #9aa6af; font-size: 10px; }
.course-cell { min-width: 220px; max-width: 330px; }
.person-cell { min-width: 190px; }
.person-cell a:hover { color: var(--blue-dark); text-decoration: underline; }
.application-status { white-space: nowrap; }
.type-pill { min-width: 34px; padding: 5px 8px; display: inline-flex; justify-content: center; border-radius: 7px; font-size: 10px; font-weight: 800; }
.type-пп { color: #386b82; background: #e9f2f6; }
.type-пк { color: #6a6191; background: #f0edf8; }
.status { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; font-size: 11px; }
.status i { width: 7px; height: 7px; border-radius: 50%; background: #aab5bc; }
.status-ready { color: #348073; }
.status-ready i { background: #45aa91; }
.status-stale { color: var(--amber); }
.status-stale i { background: #d49a39; }
.status-new { color: #778792; }
.actions-cell { min-width: 210px; }
.actions-cell form { display: inline-block; margin-right: 5px; }
.footnote { margin: 13px 3px 0; color: #8a98a2; font-size: 11px; }
.pagination { margin: 14px 3px 0; display: flex; align-items: center; justify-content: space-between; gap: 14px; color: #7f8f9a; font-size: 11px; }
.pagination > div { display: flex; align-items: center; gap: 10px; }
.page-number { color: #526575; font-weight: 700; }
.empty-state { padding: 68px 20px; text-align: center; }
.empty-state h2 { margin: 8px 0; font-family: Manrope, sans-serif; font-size: 19px; letter-spacing: -.03em; }
.empty-state p { margin: 0; color: var(--muted); font-size: 13px; }
.empty-icon { color: #97b5b9; font-size: 31px; }
.alert { margin-bottom: 14px; padding: 12px 15px; border: 1px solid transparent; border-radius: 10px; font-size: 13px; }
.alert-success { color: #266b5f; background: #e8f6f2; border-color: #cdebe3; }
.alert-error { color: #973e3a; background: #fff0ef; border-color: #f2d7d5; }
.text-link { color: var(--blue-dark); font-size: 12px; font-weight: 700; }
.login-page { display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 50% 10%, #dcefee 0, transparent 35%), var(--canvas); }
.login-card { width: min(100%, 390px); padding: 36px; background: white; border: 1px solid var(--line); border-radius: 19px; box-shadow: 0 20px 70px #16364712; }
.login-card .brand-mark { width: 42px; height: 42px; margin-bottom: 25px; font-size: 20px; }
.login-card h1 { margin-bottom: 8px; }
.login-card .muted { margin-bottom: 24px; }
.stack { display: grid; gap: 15px; }
.stack input { width: 100%; height: 42px; padding: 0 12px; color: var(--ink); background: white; border: 1px solid var(--line); border-radius: 8px; outline-color: #59aeb4; }
.stack .button { margin-top: 5px; }

@media (max-width: 760px) {
  .topbar { min-height: 62px; padding: 0 18px; }
  .topbar-actions { gap: 9px; }
  .topbar-actions .text-link { display: none; }
  .page-shell { padding: 31px 16px 50px; }
  .page-heading { align-items: flex-start; }
  .count-card { min-width: auto; padding: 9px 12px; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .search-box { max-width: none; }
  .upload-panel summary { width: 100%; }
  .upload-form { right: 0; }
  .table-card { background: transparent; border: 0; box-shadow: none; overflow: visible; }
  .table-scroll { overflow: visible; }
  table, tbody { display: block; }
  thead { display: none; }
  tbody { display: grid; gap: 10px; }
  tbody tr { padding: 13px 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px 8px; background: white; border: 1px solid var(--line); border-radius: 12px; }
  td { min-width: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; border: 0; font-size: 12px; }
  td::before { content: attr(data-label); color: #8b99a2; font-size: 9px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
  td:first-child { grid-column: 1 / -1; }
  td:first-child::before { display: none; }
  td.actions-cell { grid-column: 1 / -1; padding-top: 10px; flex-direction: row; flex-wrap: wrap; border-top: 1px solid #edf1f3; }
  td.actions-cell::before { display: none; }
  .actions-cell form { margin-right: 0; }
  .course-cell { max-width: none; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: .01ms !important; } }
