/* Salom Univer admin panel — «Quiet desk» (design: claude.ai/artifact/4cf9oRbKUd2dVq63QGUyUb) */
:root {
  --ground: #F5F5F2; --side: #EEEDE8; --card: #FFFFFF; --line: #E2E0D8; --line2: #ECEAE3; --ctl: #D6D4CC;
  --text: #1B1B18; --text2: #3D3C37; --muted: #66655E;
  --accent: #2B59C3; --accent-h: #1F45A0; --accent-s: #E8EEFB; --accent-l: #C9D6F2; --accent-ava: #DCE5F8;
  --ok: #1E7046; --ok-bg: #E3F1E8; --ok-dot: #2E9E5F;
  --warn: #8A5300; --warn-bg: #FBF0DA; --warn-dot: #D99A1E;
  --bad: #B3261E; --bad-bg: #FCEBE9;
  --shadow: 0 1px 2px rgba(27,27,24,.08);
  --sans: Inter, system-ui, -apple-system, "Segoe UI", sans-serif; --head: "Inter Tight", Inter, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--ground); color: var(--text); font: 14px/1.45 var(--sans); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
a { color: var(--accent); }
a:hover { color: var(--accent-h); }
h1, h2, h3 { margin: 0; font-family: var(--head); font-weight: 600; }
h1 { font-size: 22px; letter-spacing: -.01em; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }
p { margin: 0; }
code, .mono { font-family: var(--mono); font-size: 12px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--muted); } .small { font-size: 13px; } .tiny { font-size: 12px; }
.ok { color: var(--ok); } .warn { color: var(--warn); } .bad { color: var(--bad); }
.row { display: flex; align-items: center; } .col { display: flex; flex-direction: column; }
.wrap { flex-wrap: wrap; } .between { justify-content: space-between; } .end { justify-content: flex-end; }
.gap2 { gap: 2px; } .gap4 { gap: 4px; } .gap8 { gap: 8px; } .gap12 { gap: 12px; } .gap16 { gap: 16px; } .gap24 { gap: 24px; }
.grow { flex: 1 1 auto; min-width: 0; }
.right { text-align: right; }

/* ---------- buttons, fields */
.btn { min-height: 40px; padding: 0 14px; border: 1px solid var(--ctl); border-radius: 8px; background: var(--card);
  color: var(--text); font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; text-decoration: none; white-space: nowrap; }
.btn:hover { background: #FAFAF7; color: var(--text); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; padding: 0 16px; }
.btn.primary:hover { background: var(--accent-h); border-color: var(--accent-h); }
.btn.danger { color: var(--bad); border-color: #EBC3BF; }
.btn.danger:hover { background: var(--bad-bg); }
.btn.danger-solid { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.sm { min-height: 32px; padding: 0 10px; font-size: 13px; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.icon-btn { width: 40px; height: 40px; border: 0; border-radius: 8px; background: transparent; color: var(--text2);
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; position: relative; flex: none; }
.icon-btn:hover { background: rgba(27,27,24,.05); }
.icon-btn.bordered { border: 1px solid var(--ctl); background: var(--card); border-radius: 9px; }
.icon-btn .dot { position: absolute; top: 8px; right: 9px; width: 8px; height: 8px; border-radius: 4px; background: var(--accent); border: 2px solid #fff; }
.field { display: flex; flex-direction: column; gap: 6px; font-weight: 500; }
input[type=text], input[type=password], input[type=search], input[type=number], select, textarea {
  min-height: 40px; padding: 8px 12px; border: 1px solid var(--ctl); border-radius: 9px; background: var(--card); width: 100%; }
textarea { resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-l); border-color: var(--accent); }
.pw { position: relative; }
.pw input { padding-right: 46px; }
.pw .icon-btn { position: absolute; right: 0; top: 0; }
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 9px; background: var(--side); flex-wrap: wrap; }
.seg button { min-height: 32px; padding: 0 12px; border: 0; border-radius: 7px; background: transparent; color: var(--text2); font-weight: 500; cursor: pointer; }
.seg button[aria-pressed=true], .seg button[aria-selected=true] { background: var(--card); box-shadow: var(--shadow); color: var(--text); font-weight: 600; }
.chip { min-height: 32px; padding: 0 10px; border: 1px solid var(--ctl); border-radius: 16px; background: var(--card); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
.chip span { color: var(--muted); font-family: var(--mono); font-size: 12px; }
.chip[aria-pressed=true] { background: var(--text); color: #fff; border-color: var(--text); }
.chip[aria-pressed=true] span { color: #D9D8D2; }
.tag { padding: 3px 8px; border-radius: 6px; font-size: 12px; font-weight: 600; white-space: nowrap; display: inline-block; }
.tag.blue { background: var(--accent-s); color: var(--accent-h); } .tag.green { background: var(--ok-bg); color: var(--ok); }
.tag.yellow { background: var(--warn-bg); color: var(--warn); } .tag.red { background: var(--bad-bg); color: var(--bad); }
.tag.gray { background: var(--side); color: var(--text2); }
.dotc { width: 8px; height: 8px; border-radius: 4px; flex: none; display: inline-block; }
.alert { padding: 12px 14px; border-radius: 10px; display: flex; gap: 10px; align-items: flex-start; }
.alert.danger { background: var(--bad-bg); color: var(--bad); } .alert.warn { background: var(--warn-bg); color: var(--warn); }
.alert.info { background: var(--accent-s); color: var(--accent-h); }

/* ---------- sign-in page */
.login { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; padding: 24px 16px; }
.login-brand { display: flex; align-items: center; gap: 10px; }
.login-card { width: 100%; max-width: 400px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 28px; display: flex; flex-direction: column; gap: 18px; }
.logo { width: 32px; height: 32px; border-radius: 8px; background: var(--text); color: #fff; display: flex; align-items: center; justify-content: center; font: 700 16px var(--head); flex: none; }

/* ---------- shell */
.app { display: flex; height: 100vh; }
.nav { flex: 0 0 232px; background: var(--side); border-right: 1px solid var(--line); padding: 20px 14px; display: flex; flex-direction: column; gap: 22px; overflow-y: auto; }
.nav .brand { display: flex; align-items: center; gap: 10px; padding: 0 6px; }
.nav .brand b { font: 600 15px var(--head); }
.nav .group { display: flex; flex-direction: column; gap: 2px; }
.nav .gl { padding: 0 10px 6px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.nav a.it { min-height: 40px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 10px; border-radius: 8px; color: var(--text2); text-decoration: none; font-weight: 500; }
.nav a.it > span:first-child { display: flex; align-items: center; gap: 10px; }
.nav a.it:hover { background: rgba(255,255,255,.6); }
.nav a.it[aria-current=page] { background: var(--card); box-shadow: var(--shadow); color: var(--text); font-weight: 600; }
.badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
.nav .foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.status-card { padding: 12px; border-radius: 10px; background: var(--card); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.me { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 4px 4px 6px; }
.ava { width: 32px; height: 32px; border-radius: 16px; background: var(--side); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 12px; flex: none; }
.ava.blue { background: var(--accent-ava); color: var(--accent-h); font-size: 14px; }
.ava.lg { width: 48px; height: 48px; border-radius: 24px; font-size: 16px; }
.body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.top { padding: 16px 32px; border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.search { display: flex; align-items: center; gap: 8px; min-height: 40px; width: 280px; max-width: 100%; padding: 0 10px 0 12px; border: 1px solid var(--ctl); border-radius: 9px; background: var(--card); color: var(--muted); }
.search input { border: 0; outline: 0; padding: 0; min-height: 0; background: transparent; color: var(--text); flex: 1; min-width: 0; }
.search kbd { font-family: var(--mono); font-size: 11px; padding: 2px 6px; border: 1px solid var(--ctl); border-radius: 5px; }
main { flex: 1 1 auto; overflow-y: auto; padding: 24px 32px 48px; }
main > .page { max-width: 1240px; display: flex; flex-direction: column; gap: 24px; }

/* ---------- cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.card.pad { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.card .hd { padding: 16px 20px; border-bottom: 1px solid var(--line2); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.list-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 14px 20px; border-bottom: 1px solid var(--line2); }
.list-row:last-child { border-bottom: 0; }
.empty { padding: 20px; color: var(--muted); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr)); gap: 12px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--text); }
.kpi .v { font: 600 30px var(--head); letter-spacing: -.02em; }
.kpi .v small { font-size: 16px; font-weight: 500; color: var(--muted); }
.kpi.dark { background: var(--text); color: #fff; border-color: var(--text); }
.kpi.dark .l { color: #D9D8D2; }
.kpi.dark:hover { color: #fff; background: #2C2C28; }
.split { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.split > .a { flex: 3 1 520px; min-width: 0; } .split > .b { flex: 2 1 320px; min-width: 0; }

/* chart */
.chart { display: flex; gap: 10px; }
.chart .ax { display: flex; flex-direction: column; justify-content: space-between; height: 180px; font: 11px var(--mono); color: var(--muted); text-align: right; min-width: 30px; }
.bars { flex: 1; display: grid; gap: 6px; align-items: end; height: 180px; border-bottom: 1px solid var(--line); }
.bars div { border-radius: 4px 4px 0 0; background: var(--accent-l); min-height: 2px; }
.bars div.today { background: var(--accent); }
.bars div:hover { background: var(--accent-h); }
.xlab { display: grid; gap: 6px; margin-left: 40px; font-size: 11px; color: var(--muted); text-align: center; }
.xlab .today { color: var(--text); font-weight: 600; }

.hl { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 40px; border-bottom: 1px solid var(--line2); }
.hl:last-child { border-bottom: 0; }
.hl > span:first-child { display: flex; align-items: center; gap: 10px; min-width: 0; }

/* table */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; text-align: left; }
.tbl th { padding: 6px 12px 8px; font-size: 12px; color: var(--muted); font-weight: 500; white-space: nowrap; }
.tbl td { padding: 11px 12px; border-top: 1px solid var(--line2); vertical-align: middle; }
.tbl th:first-child, .tbl td:first-child { padding-left: 0; } .tbl th:last-child, .tbl td:last-child { padding-right: 0; }
.tbl a.who { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 600; }
.tbl a.who:hover { color: var(--accent); }
.meter { width: 90px; height: 6px; border-radius: 3px; background: var(--side); position: relative; flex: none; }
.meter > i { display: block; height: 6px; border-radius: 3px; background: var(--accent); max-width: 100%; }
.meter.big { width: 100%; height: 8px; border-radius: 4px; } .meter.big > i { height: 8px; border-radius: 4px; }
.meter > i.warn { background: var(--warn-dot); } .meter > i.bad { background: var(--bad); }
.meter .mark { position: absolute; top: -3px; width: 2px; height: calc(100% + 6px); background: var(--text); border-radius: 1px; }

/* students */
.users { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.users .lst { flex: 1 1 340px; max-width: 420px; min-width: 0; }
.users .det { flex: 999 1 480px; min-width: 0; }
.ulist { list-style: none; margin: 0; padding: 6px; max-height: calc(100vh - 290px); overflow-y: auto; }
.ulist a { display: flex; gap: 10px; align-items: center; padding: 10px; border-radius: 10px; color: var(--text); text-decoration: none; }
.ulist a:hover { background: var(--ground); }
.ulist a[aria-current=true] { background: var(--accent-s); }
.ulist .l1, .ulist .l2 { display: flex; justify-content: space-between; gap: 8px; }
.ulist .l1 b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ulist .l2 { font-size: 13px; color: var(--muted); }
.box { border: 1px solid var(--line2); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--ctl); border-radius: 9px; overflow: hidden; }
.stepper button { width: 40px; height: 36px; border: 0; background: var(--card); cursor: pointer; font-size: 18px; }
.stepper button:hover { background: var(--ground); }
.stepper span { min-width: 48px; text-align: center; font: 500 14px var(--mono); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 12px; }
.ev { display: grid; grid-template-columns: 110px 1fr auto; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line2); font-size: 13px; }
.ev:last-child { border-bottom: 0; }
.dangerzone { border: 1px solid #EBC3BF; background: #FFFBFA; border-radius: 12px; padding: 14px 16px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }

/* requests */
.req { display: flex; flex-wrap: wrap; gap: 16px; padding: 18px 20px; align-items: flex-start; }
.req dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px 20px; margin: 8px 0 0; }
.req dt { font-size: 12px; color: var(--muted); } .req dd { margin: 0; font-weight: 500; }
.cmp { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 12px; }
.cmp > div { border: 1px solid var(--line2); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.cmp > div.new { border-color: var(--accent-l); background: #F7F9FE; }

/* messages */
.radios { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr)); gap: 8px; }
.radios label { border: 1px solid var(--ctl); border-radius: 10px; padding: 10px 12px; display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.radios label:has(input:checked) { border-color: var(--accent); background: #F7F9FE; }
.radios input { margin-top: 3px; accent-color: var(--accent); }
.tg { background: #DCE6EE; border-radius: 12px; padding: 16px; }
.bubble { background: #fff; border-radius: 12px 12px 12px 4px; padding: 8px 12px; max-width: 420px; display: flex; flex-direction: column; gap: 2px; box-shadow: var(--shadow); }
.bubble b { color: var(--accent); font-size: 13px; }
.bubble .t { white-space: pre-wrap; word-break: break-word; }
.bubble .tm { align-self: flex-end; font-size: 11px; color: var(--muted); }
fieldset { border: 0; padding: 0; margin: 0; } legend { font-weight: 600; margin-bottom: 8px; padding: 0; }

/* settings */
.setrow { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line2); }
.numin { display: inline-flex; align-items: center; gap: 8px; }
.numin input { width: 110px; text-align: right; font-family: var(--mono); }
.tbl input { min-height: 34px; width: 90px; text-align: right; font-family: var(--mono); padding: 4px 8px; }

/* dialog, toast */
.dlg { border: 0; border-radius: 16px; padding: 24px; width: min(460px, calc(100vw - 32px)); box-shadow: 0 20px 60px rgba(0,0,0,.25); color: var(--text); }
.dlg::backdrop { background: rgba(27,27,24,.35); }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--text); color: #fff; padding: 12px 18px; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.2); z-index: 50; max-width: calc(100vw - 32px); }
.toast.bad { background: var(--bad); }

/* ---------- phone */
@media (max-width: 860px) {
  .app { flex-direction: column; height: auto; min-height: 100vh; }
  .nav { flex: none; flex-direction: row; align-items: center; padding: 8px 10px; gap: 4px; border-right: 0; border-top: 1px solid var(--line);
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; overflow-x: auto; overflow-y: hidden; }
  .nav .brand, .nav .gl, .nav .foot .status-card, .nav .me .col { display: none; }
  .nav .group { flex-direction: row; gap: 2px; }
  .nav .groups { flex-direction: row; gap: 2px; }
  .nav .group.sys { display: none; }
  .nav > div:not(.brand):not(.foot) { flex-direction: row; gap: 2px; display: flex; }
  .nav a.it { flex-direction: column; justify-content: center; min-height: 52px; min-width: 64px; padding: 4px 6px; font-size: 11px; gap: 2px; position: relative; }
  .nav a.it > span:first-child { flex-direction: column; gap: 2px; }
  .nav a.it .badge { position: absolute; top: 2px; right: 6px; min-width: 16px; height: 16px; font-size: 10px; padding: 0 4px; }
  .nav .foot { margin: 0 0 0 auto; }
  .nav .me { padding: 0; }
  .body { overflow: visible; }
  .top { padding: 14px 16px; }
  .search { width: 100%; }
  .top > .row { width: 100%; }
  main { overflow: visible; padding: 16px 16px 96px; }
  .ulist { max-height: none; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 14px; } .kpi .v { font-size: 24px; }
  .nav a.it { white-space: nowrap; }
  .users .lst { max-width: none; }
  .ev { grid-template-columns: 90px 1fr; } .ev > :last-child { grid-column: 2; }
}
