/* riderOK: основа — типографика, кнопки, поля, карточки, чипы, вкладки, уведомления. Цвета берём только из tokens.css. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 var(--fs-md)/1.5 var(--font);
       -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss03"; --header-h: 56px; }
[hidden] { display: none !important; }
a { color: var(--accent-text); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
p { margin: 0 0 var(--sp-3); }
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -0.02em; font-weight: 650; }
h1 { font-size: var(--fs-2xl); margin-bottom: var(--sp-3); }
h2 { font-size: var(--fs-lg); margin: var(--sp-6) 0 var(--sp-3); }
.muted { color: var(--muted); font-size: var(--fs-sm); }
.err { color: var(--danger); font-size: var(--fs-sm); margin: var(--sp-2) 0; }
.warn { color: var(--st-warn-fg); background: var(--st-warn-bg); border: 1px solid var(--st-warn-bd); border-radius: var(--r-sm);
        padding: var(--sp-2) var(--sp-3); font-size: var(--fs-sm); margin: var(--sp-2) 0; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---------- шапка и страница ---------- */
.top { position: sticky; top: 0; z-index: 20; background: var(--header-bg); backdrop-filter: saturate(1.4) blur(10px);
       -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--border); }
.top-in { max-width: 1200px; margin: 0 auto; height: var(--header-h); padding: 0 var(--sp-4); display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.logo { font-size: 22px; font-weight: 700; color: var(--text); text-decoration: none; letter-spacing: -0.03em; display: inline-flex; align-items: center; min-height: var(--tap); }
.logo b, h1 b { color: var(--accent-text); font-weight: 700; }
nav { display: flex; align-items: center; gap: var(--sp-1); font-size: var(--fs-sm); min-width: 0; }
.me-name { max-width: 30vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); font-weight: 500; padding: 0 var(--sp-2); }
main { max-width: 760px; margin: 0 auto; padding: var(--sp-5) var(--sp-4) var(--sp-7); }
main.wide { max-width: 1200px; }
footer { text-align: center; padding: var(--sp-5) var(--sp-4) var(--sp-6); }
.crumbs { font-size: var(--fs-sm); margin-bottom: var(--sp-2); }
.crumbs a { color: var(--muted); text-decoration: none; display: inline-flex; align-items: center; gap: 4px; min-height: 32px; }
.crumbs a:hover { color: var(--text); }
.page-head { margin-bottom: var(--sp-4); }
.page-head h1 { margin-bottom: var(--sp-1); }
.sub { color: var(--muted); font-size: var(--fs-sm); display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-4); align-items: center; }
.sub span { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- иконки ---------- */
.ic { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.ic.sm { width: 15px; height: 15px; }

/* ---------- кнопки ---------- */
button, .btn { font: 500 var(--fs-md)/1 var(--font); color: var(--text); min-height: var(--tap); padding: 0 var(--sp-4);
  border-radius: var(--r-md); border: 1px solid var(--border-strong); background: var(--surface); box-shadow: var(--shadow-sm);
  cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  transition: background .12s, border-color .12s, box-shadow .12s, transform .05s; -webkit-tap-highlight-color: transparent; }
button:hover, .btn:hover { background: var(--hover); border-color: var(--muted); }
button:active, .btn:active { transform: translateY(1px); }
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); font-weight: 600; }
button.primary:hover, .btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
button.danger, .btn.danger { color: var(--danger); }
button.danger:hover { background: var(--danger-soft); border-color: var(--danger); }
button.link, .btn.link, nav button, nav a.btn { background: none; border-color: transparent; box-shadow: none; color: var(--text-2); padding: 0 var(--sp-3); font-size: var(--fs-sm); }
button.link:hover, nav button:hover { background: var(--surface-2); color: var(--text); border-color: transparent; }
button.small, .btn.small { padding: 0 var(--sp-3); font-size: var(--fs-sm); }
button.icon { min-width: var(--tap); padding: 0; }
button:disabled { opacity: .45; cursor: default; box-shadow: none; transform: none; }
.actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; margin-top: var(--sp-3); align-items: center; }
.actions.start { margin-top: 0; }
@media (min-width: 900px) { button.small, .btn.small, button.icon { min-height: 36px; } button.icon { min-width: 36px; } }

/* ---------- поля ---------- */
input, select, textarea { font: 400 var(--fs-md)/1.4 var(--font); color: var(--text); width: 100%; min-height: var(--tap);
  padding: 0 var(--sp-3); border-radius: var(--r-md); border: 1px solid var(--border-strong); background: var(--surface);
  transition: border-color .12s, box-shadow .12s; }
textarea { padding: var(--sp-2) var(--sp-3); min-height: 84px; resize: vertical; }
select { appearance: none; -webkit-appearance: none; padding-right: 34px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23808797' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>");
  background-repeat: no-repeat; background-position: right 12px center; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .8; }
input:hover, select:hover, textarea:hover { border-color: var(--muted); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 28%, transparent); }
input:disabled, select:disabled, textarea:disabled { opacity: .6; }
label { display: block; font-size: var(--fs-sm); font-weight: 500; color: var(--text-2); margin: var(--sp-3) 0 var(--sp-1); }
.check { display: flex; align-items: center; gap: var(--sp-2); color: var(--text); font-size: var(--fs-md); font-weight: 400; margin: var(--sp-2) 0; min-height: var(--tap); cursor: pointer; }
.check input { width: 20px; height: 20px; min-height: 0; flex: none; accent-color: var(--accent); }
.grid2 { display: grid; gap: 0 var(--sp-3); }
@media (min-width: 560px) { .grid2 { grid-template-columns: 1fr 1fr; } }

/* ---------- карточки ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--sp-4); margin-bottom: var(--sp-3); box-shadow: var(--shadow-sm); }
a.card { display: block; color: inherit; text-decoration: none; transition: border-color .12s, box-shadow .12s, transform .12s; }
a.card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.card.row { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-3); flex-wrap: wrap; }
.card h3 { font-size: var(--fs-md); }
.row { display: flex; justify-content: space-between; align-items: baseline; gap: var(--sp-2); flex-wrap: wrap; }
.title { font-weight: 600; font-size: var(--fs-md); letter-spacing: -0.01em; }
.list-sub { color: var(--muted); font-size: var(--fs-sm); }
.link-box { word-break: break-all; font: var(--fs-sm)/1.5 var(--font-mono); padding: var(--sp-3); background: var(--surface-2); border: 1px dashed var(--border-strong); border-radius: var(--r-md); margin: var(--sp-2) 0; }
.preview { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent); }

/* карточка концерта */
a.card.cc, .cc { display: flex; gap: var(--sp-4); align-items: flex-start; }
.cc-date { flex: none; width: 56px; text-align: center; background: var(--surface-2); border-radius: var(--r-md); padding: var(--sp-2) 0; line-height: 1.1; }
.cc-date b { display: block; font-size: var(--fs-xl); font-weight: 700; letter-spacing: -0.02em; }
.cc-date span { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.cc-body { min-width: 0; flex: 1; }
.cc-body .title { display: block; }
.cc-past { opacity: .7; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); margin-bottom: var(--sp-4); }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--sp-4); box-shadow: var(--shadow-sm); }
.stat b { display: block; font-size: var(--fs-3xl); font-weight: 700; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: var(--fs-sm); }
.stat.attn b { color: var(--st-warn-fg); }
.avatar { flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); font-weight: 600; font-size: var(--fs-sm); display: inline-flex; align-items: center; justify-content: center; }
.who { display: flex; align-items: center; gap: var(--sp-3); min-width: 0; }
.who > div { min-width: 0; }
.dept-card h3 { display: flex; align-items: center; gap: var(--sp-2); }
.kind-ic { width: 32px; height: 32px; border-radius: var(--r-sm); background: var(--accent-soft); color: var(--accent-text); display: inline-flex; align-items: center; justify-content: center; }

/* пустое состояние */
.empty-state { text-align: center; padding: var(--sp-6) var(--sp-4); border: 1px dashed var(--border-strong); border-radius: var(--r-lg); color: var(--muted); background: color-mix(in srgb, var(--surface) 60%, transparent); }
.empty-state .ic-wrap { width: 44px; height: 44px; margin: 0 auto var(--sp-3); border-radius: 50%; background: var(--surface-2); color: var(--muted); display: flex; align-items: center; justify-content: center; }
.empty-state b { display: block; color: var(--text); font-size: var(--fs-md); margin-bottom: var(--sp-1); }
.empty-state p { margin: 0 auto; max-width: 36ch; font-size: var(--fs-sm); }

/* ---------- чипы (статусы: цвет + значок + подпись) ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--sp-3); }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 550; line-height: 1; padding: 5px 9px 5px 7px; border-radius: var(--r-pill);
        border: 1px solid var(--st-none-bd); background: var(--st-none-bg); color: var(--st-none-fg); white-space: nowrap; }
.chip .ic { width: 14px; height: 14px; stroke-width: 2; }
.chip.ok { background: var(--st-ok-bg); color: var(--st-ok-fg); border-color: var(--st-ok-bd); }
.chip.warn { background: var(--st-warn-bg); color: var(--st-warn-fg); border-color: var(--st-warn-bd); }
.chip.bad { background: var(--st-bad-bg); color: var(--st-bad-fg); border-color: var(--st-bad-bd); }
.chip.info { background: var(--st-info-bg); color: var(--st-info-fg); border-color: var(--st-info-bd); }
.chip.none { background: var(--st-none-bg); color: var(--st-none-fg); border-color: var(--st-none-bd); }
.chip.plain { background: transparent; color: var(--muted); border-color: var(--border); font-weight: 500; }

/* ---------- вкладки ---------- */
.tabs { display: inline-flex; max-width: 100%; gap: 2px; overflow-x: auto; margin: var(--sp-3) 0; padding: 3px; background: var(--surface-2); border-radius: var(--r-md); scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { white-space: nowrap; border: 0; background: transparent; box-shadow: none; color: var(--text-2); min-height: 40px; font-size: var(--fs-sm); border-radius: var(--r-sm); padding: 0 var(--sp-4); }
.tab:hover { background: color-mix(in srgb, var(--surface) 60%, transparent); border-color: transparent; }
.tab.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); font-weight: 600; }
.seg { display: flex; width: 100%; padding: 3px; gap: 2px; background: var(--surface-2); border-radius: var(--r-md); margin: var(--sp-2) 0; }
.seg button { flex: 1; border: 0; background: transparent; box-shadow: none; color: var(--text-2); min-height: 40px; font-size: var(--fs-sm); border-radius: var(--r-sm); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); font-weight: 600; }
.seg.fit { width: auto; display: inline-flex; }
.modes { margin-top: var(--sp-2); }

/* ---------- уведомления ---------- */
#toasts { position: fixed; z-index: 100; left: 0; right: 0; bottom: var(--sp-4); display: flex; flex-direction: column; align-items: center; gap: var(--sp-2); pointer-events: none; padding: 0 var(--sp-4); }
.toast { pointer-events: auto; max-width: 420px; background: var(--text); color: var(--bg); padding: 12px 16px; border-radius: var(--r-md); box-shadow: var(--shadow-lg);
         font-size: var(--fs-sm); font-weight: 500; display: flex; gap: var(--sp-2); align-items: center; animation: toast-in .18s ease-out; }
.toast.err { background: var(--danger); color: #fff; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.save-state { min-height: 1.4em; display: inline-flex; align-items: center; gap: 6px; }
.theme-demo { display: flex; flex-wrap: wrap; gap: var(--sp-2); }

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

.ic.flip { transform: rotate(180deg); }
.hero { max-width: 520px; margin: var(--sp-6) auto 0; }
.hero h1 { font-size: var(--fs-3xl); }
.lead { font-size: var(--fs-lg); color: var(--text-2); line-height: 1.5; }
.login-box { min-height: 52px; }
.nav-text { display: none; }
@media (min-width: 700px) { .nav-text { display: inline; } }
.who .title a, a.title { color: var(--text); text-decoration: none; }
a.title:hover { text-decoration: underline; }
.toolbar { margin-bottom: var(--sp-2); }
.dept-card h3 { font-size: var(--fs-lg); }

@media (max-width: 559px) {
  .me-name { display: none; }
  .tabs { display: flex; width: 100%; }
  .tab { flex: 1; padding: 0 var(--sp-2); font-size: 13.5px; }
}
.seg button { min-width: 0; padding: 0 var(--sp-2); gap: 6px; }
.lead { margin-bottom: var(--sp-5); }
