:root {
  color-scheme: dark;
  --bg: #070d18;
  --surface: #0d1727;
  --surface-2: #111f34;
  --line: rgba(255,255,255,.09);
  --text: #f5f7fb;
  --muted: #93a4bb;
  --cyan: #43d8ff;
  --purple: #9b7cff;
  --green: #4ae2ad;
  --amber: #ffbf69;
  --red: #ff6b7a;
  --radius: 18px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 15% 0%, #142946 0, var(--bg) 38%); color: var(--text); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.eyebrow { margin: 0 0 .45rem; color: var(--cyan); font-size: .75rem; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(430px, 100%); padding: 38px; border: 1px solid var(--line); border-radius: 28px; background: rgba(13,23,39,.9); box-shadow: 0 35px 100px rgba(0,0,0,.45); backdrop-filter: blur(24px); }
.login-card h1 { margin: .35rem 0; font-size: clamp(2rem, 8vw, 3rem); letter-spacing: -.055em; }
.brand-mark { width: 62px; height: 62px; border-radius: 50%; background: linear-gradient(135deg, var(--cyan), var(--purple)); padding: 3px; box-shadow: 0 0 45px rgba(67,216,255,.22); }
.brand-mark::before { content: ""; display: block; width: 100%; height: 100%; border-radius: 50%; background: var(--surface); }
.brand-mark span { display: block; position: relative; width: 22px; height: 22px; margin: -42px auto 0; border-radius: 50%; background: var(--cyan); box-shadow: 12px 0 0 var(--surface); }
.brand-mark.small { width: 40px; height: 40px; flex: 0 0 40px; }
.brand-mark.small span { width: 14px; height: 14px; margin-top: -27px; box-shadow: 8px 0 0 var(--surface); }
.stack { display: grid; gap: 16px; margin-top: 28px; }
label { display: grid; gap: 7px; color: #c7d2e1; font-size: .86rem; font-weight: 650; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 11px; padding: 11px 12px; color: var(--text); background: #091321; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(67,216,255,.12); }
textarea { min-height: 88px; resize: vertical; }
button { border: 0; border-radius: 11px; padding: 10px 14px; color: var(--text); background: var(--surface-2); font-weight: 750; }
button:hover { filter: brightness(1.12); }
button:disabled { opacity: .55; cursor: wait; }
.primary { color: #051017; background: linear-gradient(135deg, var(--cyan), #65efcc); }
.danger { color: #ffdbe0; background: rgba(255,107,122,.18); }
.ghost { border: 1px solid var(--line); background: transparent; }
.form-error { min-height: 1.2em; margin: 0; color: var(--red); }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 240px minmax(0,1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 22px 16px; display: flex; flex-direction: column; border-right: 1px solid var(--line); background: rgba(7,13,24,.94); backdrop-filter: blur(18px); z-index: 20; }
.brand-row { display: flex; align-items: center; gap: 12px; padding: 0 8px 22px; }
.brand-row div:last-child { display: grid; }
.brand-row small { color: var(--muted); }
nav { display: grid; gap: 6px; }
nav button { text-align: left; color: var(--muted); background: transparent; }
nav button.active { color: var(--text); background: linear-gradient(90deg, rgba(67,216,255,.16), rgba(155,124,255,.08)); box-shadow: inset 3px 0 var(--cyan); }
.sidebar-foot { margin-top: auto; display: grid; gap: 10px; padding: 14px 8px 0; color: var(--muted); }
.mobile-header { display: none; }
.workspace { min-width: 0; padding: 34px clamp(18px, 4vw, 54px) 60px; }
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.page-head h1 { margin: 0; font-size: clamp(1.8rem, 4vw, 2.7rem); letter-spacing: -.045em; }
.page-head p { margin: .35rem 0 0; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 9px; }
.grid { display: grid; grid-template-columns: repeat(12, minmax(0,1fr)); gap: 16px; }
.card { grid-column: span 4; min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(145deg, rgba(17,31,52,.94), rgba(10,19,33,.94)); box-shadow: 0 16px 40px rgba(0,0,0,.18); }
.card.wide { grid-column: span 8; }
.card.full { grid-column: 1 / -1; }
.card h2, .card h3 { margin: 0 0 14px; }
.metric { font-size: clamp(2rem, 5vw, 3.3rem); font-weight: 800; letter-spacing: -.06em; }
.metric small { font-size: .9rem; color: var(--muted); letter-spacing: 0; }
.bar { height: 8px; margin-top: 16px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.08); }
.bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--cyan), var(--purple)); }
.status { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 999px; background: rgba(74,226,173,.12); color: var(--green); font-size: .75rem; font-weight: 800; }
.status.error { color: var(--red); background: rgba(255,107,122,.12); }
.status.warn { color: var(--amber); background: rgba(255,191,105,.12); }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th, td { padding: 11px 10px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; }
.editor-list { display: grid; gap: 12px; }
.editor-row { display: grid; grid-template-columns: 1.2fr 1fr 1fr 1.2fr auto; gap: 10px; align-items: end; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: rgba(0,0,0,.12); }
.editor-row.news { grid-template-columns: .8fr 1.1fr 1.4fr 1.1fr auto auto; }
.day { margin-bottom: 20px; }
.day-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.day-head h3 { margin: 0; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.search-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: end; }
.result { padding: 14px 0; border-bottom: 1px solid var(--line); }
.result:last-child { border: 0; }
.result-head { display: flex; justify-content: space-between; gap: 12px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag { padding: 3px 7px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: .74rem; }
.toast { position: fixed; right: 24px; top: 20px; max-width: min(400px, calc(100vw - 48px)); padding: 13px 16px; border: 1px solid rgba(74,226,173,.3); border-radius: 12px; background: #102b25; color: #d9fff1; box-shadow: 0 18px 50px rgba(0,0,0,.35); z-index: 100; }
.toast.error { border-color: rgba(255,107,122,.4); background: #321822; color: #ffe6ea; }
.loading { padding: 70px 0; text-align: center; color: var(--muted); }
.empty { padding: 22px; border: 1px dashed var(--line); border-radius: 14px; color: var(--muted); text-align: center; }
code { color: #bdefff; }
@media (max-width: 1040px) {
  .card { grid-column: span 6; }
  .card.wide { grid-column: 1 / -1; }
  .editor-row, .editor-row.news { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; left: 0; transform: translateX(-105%); width: min(290px, 86vw); transition: transform .2s ease; box-shadow: 30px 0 70px rgba(0,0,0,.5); }
  .sidebar.open { transform: translateX(0); }
  .mobile-header { position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between; min-height: 58px; padding: 8px 14px; border-bottom: 1px solid var(--line); background: rgba(7,13,24,.92); backdrop-filter: blur(16px); z-index: 15; }
  .icon-button { font-size: 1.25rem; padding: 7px 10px; }
  .workspace { padding: 24px 14px 50px; }
  .page-head { align-items: start; flex-direction: column; }
  .card, .card.wide { grid-column: 1 / -1; }
  .split { grid-template-columns: 1fr; }
  .search-form, .editor-row, .editor-row.news { grid-template-columns: 1fr; }
  .editor-row button { width: 100%; }
}
