* { box-sizing: border-box; margin: 0; padding: 0; }
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; font-family: 'Manrope', sans-serif; }

[data-dash-root] {
  --bg:#eceefb; --surface:rgba(255,255,255,0.58); --surface-2:rgba(255,255,255,0.78);
  --border:rgba(28,27,51,0.09); --text:#1c1b33; --muted:#65647e; --faint:#9b9ab4;
  --accent:#5b5bd6; --accent-soft:rgba(91,91,214,0.13);
  --shadow:0 10px 34px rgba(28,27,51,0.09);
  --red:#e0484d; --red-soft:rgba(224,72,77,0.13);
  --yellow:#c98112; --yellow-soft:rgba(224,148,30,0.16);
  --green:#1f9c63; --green-soft:rgba(31,156,99,0.14);
  --blue:#3a6ff8; --blue-soft:rgba(58,111,248,0.13);
}
[data-dash-root][data-dash-theme="dark"] {
  --bg:#0b0b13; --surface:rgba(33,32,50,0.55); --surface-2:rgba(44,43,64,0.72);
  --border:rgba(255,255,255,0.09); --text:#edebf7; --muted:#a4a2bf; --faint:#737190;
  --accent:#9d9bf5; --accent-soft:rgba(157,155,245,0.17);
  --shadow:0 14px 44px rgba(0,0,0,0.5);
  --red:#ff6166; --red-soft:rgba(255,97,102,0.16);
  --yellow:#f3b449; --yellow-soft:rgba(243,180,73,0.16);
  --green:#3dd68c; --green-soft:rgba(61,214,140,0.16);
  --blue:#6a97ff; --blue-soft:rgba(106,151,255,0.16);
}

[data-dash-root] {
  min-height:100vh; width:100%; color:var(--text); padding:26px 0 46px;
  background-color:var(--bg);
  background-image:
    radial-gradient(820px 480px at 10% -8%, rgba(124,108,255,0.20), transparent 60%),
    radial-gradient(680px 460px at 96% -4%, rgba(56,178,255,0.15), transparent 56%),
    radial-gradient(760px 560px at 72% 108%, rgba(255,122,182,0.11), transparent 56%);
}
.wrap { max-width:1240px; margin:0 auto; padding:0 26px; display:flex; flex-direction:column; gap:16px; }
.card { background:var(--surface); backdrop-filter:blur(22px) saturate(140%); -webkit-backdrop-filter:blur(22px) saturate(140%); border:1px solid var(--border); box-shadow:var(--shadow); }
.mono { font-family:'JetBrains Mono', monospace; }
a.news-row:hover { background:var(--surface-2); }
button { font-family:inherit; }
.spin { animation:spin .8s linear infinite; }
@keyframes spin { to { transform:rotate(360deg); } }
.toast { position:fixed; bottom:22px; left:50%; transform:translateX(-50%) translateY(20px); opacity:0;
  background:var(--accent); color:#fff; font-weight:700; font-size:13px; padding:10px 18px; border-radius:12px;
  box-shadow:var(--shadow); transition:all .35s; z-index:9999; pointer-events:none; }
.toast.show { opacity:1; transform:translateX(-50%) translateY(0); }

/* Theme toggle — a single sliding switch (sun ⇄ moon). */
.theme-toggle { position:relative; width:64px; height:30px; flex-shrink:0; padding:0; cursor:pointer;
  border-radius:20px; border:1px solid var(--border); background:var(--surface);
  transition:background .45s ease, border-color .45s ease; }
.theme-toggle .tt-bg { position:absolute; top:0; bottom:0; display:flex; align-items:center;
  font-size:12px; line-height:1; color:var(--faint); transition:opacity .4s ease; }
.theme-toggle .tt-bg.sun { left:9px; }
.theme-toggle .tt-bg.moon { right:9px; }
.theme-toggle[data-theme-state="light"] .tt-bg.sun { opacity:0; }
.theme-toggle[data-theme-state="dark"] .tt-bg.moon { opacity:0; }
.theme-toggle .tt-knob { position:absolute; top:2px; left:2px; width:24px; height:24px; border-radius:50%;
  background:var(--accent); color:#fff; display:flex; align-items:center; justify-content:center;
  font-size:12px; line-height:1; box-shadow:0 2px 8px rgba(0,0,0,0.28);
  transition:transform .45s cubic-bezier(.34,1.35,.5,1), background .45s ease; }
.theme-toggle[data-theme-state="dark"] .tt-knob { transform:translateX(34px); }
.theme-toggle .k-moon { display:none; }
.theme-toggle[data-theme-state="dark"] .k-sun { display:none; }
.theme-toggle[data-theme-state="dark"] .k-moon { display:inline; }

/* Smooth colour cross-fade only while a theme switch is in progress. */
[data-dash-root].theming, [data-dash-root].theming * {
  transition: background-color .55s ease, border-color .55s ease, color .55s ease,
              box-shadow .55s ease, fill .55s ease !important;
}

/* Top navigation tabs (Дашборд / Отчёты). */
.nav-tab { font-family:inherit; font-size:13px; font-weight:700; color:var(--muted);
  background:transparent; border:1px solid transparent; padding:7px 15px; border-radius:11px;
  cursor:pointer; transition:background .15s ease, color .15s ease, border-color .15s ease; }
.nav-tab:hover { color:var(--text); background:var(--surface); }
.nav-tab.active { color:var(--accent); background:var(--accent-soft); border-color:var(--border); }

/* Report template tabs (Викли / Планинг). */
.rt-tab { font-family:inherit; font-size:12.5px; font-weight:700; color:var(--muted);
  background:var(--surface); border:1px solid var(--border); padding:8px 16px; border-radius:10px;
  cursor:pointer; transition:all .15s ease; }
.rt-tab:hover { color:var(--text); }
.rt-tab.active { color:#fff; background:var(--accent); border-color:var(--accent); }

/* Report form controls. */
.report-select { font-family:inherit; font-size:13px; font-weight:600; color:var(--text);
  background:var(--surface-2); border:1px solid var(--border); border-radius:10px; padding:9px 12px;
  width:100%; cursor:pointer; appearance:none; }
.report-select:focus { outline:none; border-color:var(--accent); }
.report-primary { font-family:inherit; font-size:12.5px; font-weight:700; color:#fff;
  background:var(--accent); border:none; padding:9px 16px; border-radius:10px; cursor:pointer;
  transition:filter .15s ease; }
.report-primary:hover { filter:brightness(1.07); }
.report-ghost { font-size:12px; font-weight:700; color:var(--muted); background:var(--surface);
  border:1px solid var(--border); padding:8px 13px; border-radius:10px; }
.report-field { font-family:inherit; font-size:12.5px; color:var(--text); background:var(--surface-2);
  border:1px solid var(--border); border-radius:9px; padding:8px 10px; width:100%; resize:vertical; line-height:1.4; }
.report-field:focus { outline:none; border-color:var(--accent); }
.report-del { font-family:inherit; font-size:12px; color:var(--muted); background:transparent;
  border:1px solid var(--border); border-radius:8px; cursor:pointer; height:32px; padding:0 6px; }
.report-del:hover { color:var(--red); border-color:var(--red); }
.report-table { width:100%; border-collapse:collapse; font-size:12px; }
.report-table th { text-align:left; font-size:9.5px; letter-spacing:0.03em; text-transform:uppercase;
  color:var(--faint); font-weight:700; padding:4px 6px; white-space:nowrap; }
.report-table td { padding:4px 6px; vertical-align:top; }
.report-select.score { min-width:62px; }

/* Logged-in user chip + logout (in the shared nav). */
.user-chip { display:flex; align-items:center; gap:8px; padding:5px 11px 5px 6px; border-radius:20px;
  background:var(--surface); border:1px solid var(--border); max-width:230px; }
.user-chip .user-ava { width:22px; height:22px; border-radius:50%; flex-shrink:0;
  background:linear-gradient(135deg,var(--accent),#8b7bff); color:#fff; font-weight:800; font-size:11px;
  display:flex; align-items:center; justify-content:center; }
.user-chip .user-mail { font-size:12px; font-weight:600; color:var(--muted);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.user-chip .user-badge { font-size:9.5px; font-weight:800; letter-spacing:0.04em; color:var(--accent);
  background:var(--accent-soft); padding:2px 7px; border-radius:20px; flex-shrink:0; }

/* Login screen. */
.login-wrap { min-height:74vh; display:flex; align-items:center; justify-content:center; padding:40px 0; }
.login-card { width:100%; max-width:380px; display:flex; flex-direction:column; gap:12px;
  border-radius:22px; padding:34px 32px; text-align:center; }
.login-logo { width:52px; height:52px; margin:0 auto 4px; border-radius:15px;
  background:linear-gradient(135deg,var(--accent),#8b7bff); box-shadow:0 8px 22px var(--accent-soft);
  display:flex; align-items:center; justify-content:center; color:#fff; font-weight:800; font-size:18px; }
.login-title { font-size:22px; font-weight:800; letter-spacing:-0.02em; }
.login-sub { font-size:13px; color:var(--muted); font-weight:500; margin-bottom:8px; }
.login-label { text-align:left; font-size:11px; font-weight:700; letter-spacing:0.04em;
  text-transform:uppercase; color:var(--faint); }
.login-card .report-field { font-size:14px; padding:12px 14px; text-align:left; }
.login-card .report-primary { padding:12px 16px; font-size:13.5px; margin-top:4px; }
.login-card .report-primary:disabled { opacity:0.6; cursor:default; }
.login-msg { font-size:12.5px; color:var(--muted); min-height:16px; }
.login-msg.err { color:var(--red); font-weight:600; }
.login-note { font-size:11px; color:var(--faint); line-height:1.4; }

/* Claude request progress (autofill / planning generation). */
.autofill-progress { display:flex; flex-direction:column; gap:9px; padding:13px 15px; border-radius:12px;
  background:var(--accent-soft); border:1px solid var(--border); }
.autofill-progress .ap-track { position:relative; height:6px; border-radius:6px; overflow:hidden;
  background:var(--surface-2); }
.autofill-progress .ap-bar { position:absolute; top:0; left:0; height:100%; width:38%; border-radius:6px;
  background:linear-gradient(90deg,var(--accent),#8b7bff); animation:apslide 1.25s ease-in-out infinite; }
@keyframes apslide {
  0% { left:-40%; } 100% { left:100%; }
}
.report-primary:disabled { opacity:0.7; cursor:default; }

@media (max-width:900px) {
  .grid-4 { grid-template-columns:repeat(2,1fr) !important; }
  .grid-mid { grid-template-columns:1fr !important; }
  .grid-2 { grid-template-columns:1fr !important; }
  .grid-3 { grid-template-columns:1fr !important; }
  .user-chip .user-mail { display:none; }
}
