@font-face {
  font-family: Inter;
  src: url("fonts/inter-cyrillic.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #f7f7f6;
  --paper: #ffffff;
  --ink: #121212;
  --muted: #777773;
  --line: #e8e8e5;
  --soft: #f1f1ef;
  --accent: #ff2b2b;
  --accent-dark: #df1010;
  --green: #178a52;
  --amber: #b86d08;
  --shadow: 0 18px 50px rgba(20, 20, 20, 0.08);
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, Arial, sans-serif;
  font-size: 14px;
  letter-spacing: -0.015em;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
.boot { min-height: 100vh; display: grid; place-items: center; font-weight: 800; letter-spacing: -.07em; font-size: 34px; }
.boot span, .brand span { color: var(--accent); }

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(420px, 0.9fr) 1.1fr;
  background: var(--paper);
}
.login-panel { display: flex; flex-direction: column; padding: 40px clamp(32px, 6vw, 92px); }
.brand { font-size: 20px; font-weight: 850; letter-spacing: -.06em; }
.login-copy { margin: auto 0; max-width: 440px; }
.login-copy h1 { font-size: clamp(42px, 4vw, 68px); line-height: .98; letter-spacing: -.065em; margin: 0 0 22px; font-weight: 650; }
.login-copy > p { color: var(--muted); font-size: 16px; line-height: 1.55; max-width: 380px; }
.login-form { margin-top: 38px; display: grid; gap: 12px; }
.login-form label, .field label { font-size: 12px; font-weight: 650; color: #575753; }
.input, .textarea, .select {
  width: 100%; border: 1px solid var(--line); background: var(--paper); border-radius: 12px;
  padding: 13px 14px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.input:focus, .textarea:focus, .select:focus { border-color: #aaa; box-shadow: 0 0 0 4px rgba(0,0,0,.035); }
.button { border: 0; border-radius: 12px; padding: 12px 16px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 650; }
.button.primary { background: var(--ink); color: white; }
.button.primary:hover { background: #2d2d2b; }
.button.accent { background: var(--accent); color: white; }
.button.accent:hover { background: var(--accent-dark); }
.button.ghost { background: var(--soft); }
.button.outline { background: white; border: 1px solid var(--line); }
.button.small { padding: 8px 11px; border-radius: 9px; font-size: 12px; }
.login-note { color: #9a9a95; font-size: 12px; margin-top: 14px; }
.login-art { margin: 16px; border-radius: 28px; overflow: hidden; background: #111; position: relative; padding: 72px; color: white; }
.login-art::before { content: ""; position: absolute; width: 520px; height: 520px; border-radius: 50%; background: var(--accent); filter: blur(100px); opacity: .34; right: -180px; bottom: -220px; }
.art-eyebrow { color: rgba(255,255,255,.5); text-transform: uppercase; font-size: 11px; letter-spacing: .14em; }
.art-title { position: relative; margin-top: 28px; font-size: clamp(32px, 4vw, 66px); max-width: 630px; letter-spacing: -.06em; line-height: 1; font-weight: 550; }
.mini-queue { position: absolute; left: 72px; right: 72px; bottom: 62px; display: grid; gap: 10px; }
.mini-item { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); backdrop-filter: blur(16px); border-radius: 16px; padding: 16px 18px; display: flex; align-items: center; gap: 14px; }
.mini-time { color: #ff7f7f; font-weight: 700; }
.mini-lines { flex: 1; height: 20px; background: linear-gradient(rgba(255,255,255,.76) 0 5px, transparent 5px 10px, rgba(255,255,255,.22) 10px 15px, transparent 15px); border-radius: 3px; }

.shell { min-height: 100vh; display: grid; grid-template-columns: 232px 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; background: var(--paper); border-right: 1px solid var(--line); padding: 28px 16px 20px; display: flex; flex-direction: column; z-index: 10; }
.sidebar .brand { padding: 0 12px 24px; }
.nav { display: grid; gap: 4px; }
.nav-button { border: 0; background: transparent; text-align: left; border-radius: 10px; padding: 10px 12px; display: flex; align-items: center; gap: 11px; color: #62625e; }
.nav-button:hover { background: var(--soft); color: var(--ink); }
.nav-button.active { background: var(--ink); color: white; }
.nav-icon { width: 18px; text-align: center; font-size: 16px; line-height: 1; }
.sidebar-foot { margin-top: auto; padding: 12px; border-top: 1px solid var(--line); }
.profile-mini { display: flex; gap: 10px; align-items: center; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: #eee; display: grid; place-items: center; font-size: 12px; font-weight: 750; flex: 0 0 auto; }
.avatar.dark { background: var(--ink); color: white; }
.profile-text { min-width: 0; }
.profile-text strong, .profile-text span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-text span { color: var(--muted); font-size: 11px; margin-top: 2px; }
.content { min-width: 0; }
.topbar { height: 74px; background: rgba(247,247,246,.88); backdrop-filter: blur(18px); border-bottom: 1px solid rgba(220,220,216,.8); display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 0 clamp(20px, 4vw, 54px); position: sticky; top: 0; z-index: 8; }
.account-switch { display: flex; align-items: center; gap: 10px; font-weight: 620; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: #bbb; box-shadow: 0 0 0 4px #eee; }
.page { padding: 38px clamp(20px, 4vw, 54px) 70px; max-width: 1500px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.eyebrow { color: var(--accent); text-transform: uppercase; font-size: 10px; font-weight: 750; letter-spacing: .15em; margin-bottom: 10px; }
h1, h2, h3, p { margin-top: 0; }
.page-head h1 { font-size: clamp(30px, 3vw, 48px); letter-spacing: -.055em; line-height: 1.03; margin-bottom: 8px; font-weight: 580; }
.page-head p { color: var(--muted); margin: 0; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 26px; }
.stat, .card { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; }
.stat { padding: 20px; min-height: 132px; display: flex; flex-direction: column; justify-content: space-between; }
.stat-label { color: var(--muted); font-size: 12px; }
.stat-value { font-size: 34px; letter-spacing: -.06em; font-weight: 580; }
.stat-foot { color: #aaa; font-size: 11px; }
.grid-two { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(320px, .7fr); gap: 18px; }
.card { padding: 22px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 18px; }
.card-head h2 { font-size: 17px; margin: 0; letter-spacing: -.035em; }
.card-head span { color: var(--muted); font-size: 12px; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.day { min-height: 225px; background: #fafaf9; border: 1px solid var(--line); border-radius: 13px; padding: 11px 9px; }
.day.today { border-color: #222; }
.day-name { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: #969691; }
.day-number { font-size: 21px; margin: 4px 0 13px; font-weight: 550; }
.day-item { background: white; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 8px; padding: 8px; margin-bottom: 7px; font-size: 10px; line-height: 1.25; overflow: hidden; }
.day-item time { display: block; color: var(--accent); font-weight: 700; margin-bottom: 4px; }
.empty-day { color: #c1c1bd; font-size: 10px; }
.queue-list { display: grid; gap: 10px; }
.queue-row { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.queue-row > * { min-width: 0; }
.queue-row:last-child { border-bottom: 0; }
.date-box { background: var(--soft); border-radius: 10px; padding: 7px 4px; text-align: center; }
.date-box strong { display: block; font-size: 16px; }
.date-box span { font-size: 9px; color: var(--muted); text-transform: uppercase; }
.queue-title { font-weight: 620; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.queue-meta { font-size: 11px; color: var(--muted); margin-top: 3px; }
.badge { display: inline-flex; align-items: center; border-radius: 100px; padding: 5px 8px; background: var(--soft); color: #656560; font-size: 10px; font-weight: 650; white-space: nowrap; }
.badge.draft { background: #f1f1ef; }
.badge.scheduled { background: #fff1dc; color: var(--amber); }
.badge.published { background: #eaf7f0; color: var(--green); }
.badge.waiting_api, .badge.error { background: #ffe8e8; color: var(--accent-dark); }
.badge.publishing { background: #e9efff; color: #3159a9; }
.empty { min-height: 220px; display: grid; place-items: center; text-align: center; color: var(--muted); padding: 30px; }
.empty strong { display: block; color: var(--ink); font-size: 16px; margin-bottom: 7px; }

.composer { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(350px, .75fr); gap: 24px; align-items: start; }
.form-card { background: white; border: 1px solid var(--line); border-radius: 18px; padding: 24px; }
.field { display: grid; gap: 8px; margin-bottom: 18px; }
.parts { display: grid; gap: 12px; }
.part { border: 1px solid var(--line); border-radius: 14px; padding: 13px; background: #fcfcfb; }
.part-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; color: var(--muted); font-size: 11px; }
.textarea { min-height: 104px; resize: vertical; line-height: 1.5; border: 0; padding: 0; background: transparent; box-shadow: none !important; }
.counter { color: #aaa; }
.counter.over { color: var(--accent); }
.composer-actions { display: flex; gap: 10px; flex-wrap: wrap; border-top: 1px solid var(--line); margin-top: 22px; padding-top: 20px; }
.schedule-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.preview-wrap { position: sticky; top: 98px; }
.preview-label { color: var(--muted); font-size: 11px; margin: 0 0 10px 6px; }
.phone { background: white; border: 1px solid #d9d9d5; border-radius: 30px; padding: 22px 19px 28px; box-shadow: var(--shadow); max-width: 430px; margin: auto; }
.phone-bar { height: 24px; display: flex; justify-content: center; margin-bottom: 18px; }
.phone-bar::before { content: ""; width: 76px; height: 6px; border-radius: 10px; background: #171717; }
.thread-preview { display: grid; gap: 0; }
.preview-post { display: grid; grid-template-columns: 38px 1fr; gap: 10px; position: relative; padding-bottom: 18px; }
.preview-post:not(:last-child)::before { content: ""; position: absolute; left: 18px; top: 39px; bottom: 0; width: 1px; background: #d9d9d6; }
.preview-post .avatar { width: 38px; height: 38px; }
.preview-user { font-size: 12px; font-weight: 680; margin-bottom: 6px; }
.preview-user span { color: #aaa; font-weight: 400; margin-left: 5px; }
.preview-text { white-space: pre-wrap; line-height: 1.42; font-size: 13px; min-height: 18px; }
.preview-actions { color: #aaa; font-size: 12px; letter-spacing: .15em; margin-top: 12px; }

.filters { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 17px; }
.filter { border: 1px solid var(--line); background: white; border-radius: 100px; padding: 8px 12px; font-size: 11px; }
.filter.active { background: var(--ink); color: white; border-color: var(--ink); }
.content-table { background: white; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.table-row { display: grid; grid-template-columns: minmax(220px, 1.6fr) 140px 140px 130px 118px; gap: 16px; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.table-row:last-child { border-bottom: 0; }
.table-row.header { background: #fafaf9; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.thread-title { font-weight: 620; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-excerpt { color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 4px; }
.more { border: 0; background: transparent; font-size: 18px; color: #999; }
.metric-chart { height: 220px; display: flex; align-items: end; gap: 10px; padding-top: 30px; }
.bar { flex: 1; background: #ececea; border-radius: 6px 6px 2px 2px; min-height: 4px; position: relative; }
.bar.active { background: var(--accent); }
.bar span { position: absolute; bottom: -24px; left: 50%; transform: translateX(-50%); font-size: 9px; color: #999; }
.account-card { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; }
.account-card .avatar { width: 46px; height: 46px; }
.notice { background: #fff5f5; border: 1px solid #ffd4d4; border-radius: 14px; padding: 16px; color: #8b2525; line-height: 1.5; font-size: 12px; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.setting-row:last-child { border-bottom: 0; }
.setting-row p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: #bbb; display: inline-block; margin-right: 7px; }
.status-dot.good { background: var(--green); }
.slot-list { display: flex; gap: 8px; flex-wrap: wrap; }
.slot { background: var(--soft); border-radius: 9px; padding: 9px 11px; font-weight: 650; }
.toast { position: fixed; right: 22px; bottom: 22px; background: var(--ink); color: white; padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow); transform: translateY(30px); opacity: 0; pointer-events: none; transition: .2s; z-index: 50; max-width: 340px; }
.toast.show { transform: none; opacity: 1; }

@media (max-width: 1050px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .grid-two, .composer { grid-template-columns: 1fr; }
  .preview-wrap { position: static; }
  .phone { margin-left: 0; }
  .week { overflow-x: auto; grid-template-columns: repeat(7, 120px); padding-bottom: 5px; }
  .settings-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .login-page { grid-template-columns: 1fr; }
  .login-panel { min-height: 100vh; padding: 28px 22px; }
  .login-art { display: none; }
  .shell { display: block; padding-bottom: 66px; }
  .sidebar { position: fixed; top: auto; left: 0; right: 0; bottom: 0; height: 66px; border: 0; border-top: 1px solid var(--line); padding: 8px; }
  .sidebar .brand, .sidebar-foot { display: none; }
  .nav { grid-template-columns: repeat(7, 1fr); }
  .nav-button { padding: 7px 4px; display: grid; place-items: center; gap: 3px; font-size: 8px; text-align: center; }
  .nav-icon { font-size: 14px; }
  .topbar { padding: 0 16px; height: 64px; }
  .topbar .button { padding: 10px 12px; }
  .page { padding: 26px 14px 50px; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .page-head h1 { font-size: 34px; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 9px; }
  .stat { min-height: 112px; padding: 16px; }
  .table-row { grid-template-columns: 1fr auto; }
  .table-row > *:nth-child(2), .table-row > *:nth-child(3), .table-row.header { display: none; }
  .schedule-fields { grid-template-columns: 1fr; }
  .composer-actions .button { flex: 1; }
}
