﻿@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap");

:root {
  --bg: #f4f6f8;
  --ink: #11151c;
  --muted: #667085;
  --faint: #98a2b3;
  --panel: #ffffff;
  --soft: #f8fafc;
  --line: #dbe2ea;
  --accent: #0f766e;
  --accent-2: #2563eb;
  --warn: #d97706;
  --bad: #dc2626;
  --good: #15803d;
  --shadow: 0 16px 38px rgba(15, 23, 42, 0.07);
  --shadow-soft: 0 8px 22px rgba(15, 23, 42, 0.045);
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: Poppins, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  letter-spacing: 0;
}
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
.hidden { display: none !important; }
.icon { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }

.login-screen { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) 390px; background: #11151c; color: #fff; }
.login-copy { display: grid; align-content: end; gap: 14px; padding: 56px; background: linear-gradient(140deg, rgba(15,118,110,.35), transparent 42%), #11151c; }
.login-copy img, .brand img, .mobile-brand img { border-radius: 8px; }
.login-copy h1 { margin: 0; max-width: 760px; font-size: clamp(3rem, 7vw, 6rem); line-height: .94; letter-spacing: 0; }
.login-subtitle { max-width: 620px; margin: 0; color: rgba(255,255,255,.72); line-height: 1.6; }
.login-card { align-self: center; display: grid; gap: 16px; margin: 26px; padding: 24px; border: 1px solid rgba(255,255,255,.18); border-radius: 8px; background: #fff; color: var(--ink); box-shadow: var(--shadow); }
.login-card h2 { margin: 0; font-size: 2rem; }
.login-card label, label { display: grid; gap: 6px; color: var(--muted); font-size: .82rem; font-weight: 500; }
input, textarea, select { width: 100%; min-height: 40px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); padding: 9px 11px; outline: none; transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease; }
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(15,118,110,.12); }
.form-error { min-height: 20px; margin: 0; color: var(--bad); }
.eyebrow { margin: 0 0 5px; color: var(--faint); font-size: .7rem; font-weight: 600; text-transform: uppercase; }
.login-copy .eyebrow { color: rgba(255,255,255,.62); }

.app-shell { display: grid; grid-template-columns: clamp(204px, 15vw, 232px) minmax(0, 1fr) clamp(300px, 23vw, 380px); min-height: 100vh; max-height: 100vh; overflow: hidden; }
.sidebar { height: 100vh; display: flex; flex-direction: column; gap: 16px; padding: 14px; border-right: 1px solid var(--line); background: rgba(248,250,252,.92); overflow: auto; backdrop-filter: blur(18px); }
.brand, .mobile-brand { min-height: 42px; display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand span { display: grid; gap: 1px; }
.brand small { color: var(--muted); }
.nav-list { display: grid; gap: 3px; }
.nav-link { min-height: 38px; display: flex; align-items: center; gap: 10px; padding: 7px 9px; border-radius: 8px; color: #526071; text-decoration: none; font-weight: 500; }
.nav-link:hover, .nav-link.active { background: #e6f2f0; color: var(--accent); }
.nav-icon { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; background: #fff; border: 1px solid var(--line); box-shadow: 0 4px 10px rgba(15,23,42,.04); }
.sidebar-footer { margin-top: auto; }

.workspace { min-width: 0; height: 100vh; overflow: auto; padding: clamp(12px, 1.25vw, 20px); }
.assistant-rail { height: 100vh; min-width: 0; display: grid; grid-template-rows: auto auto minmax(0, 1fr); gap: 10px; padding: clamp(12px, 1.1vw, 18px); border-left: 1px solid var(--line); background: rgba(248,250,252,.94); backdrop-filter: blur(18px); overflow: hidden; }
.rail-header { display: flex; align-items: start; justify-content: space-between; gap: 10px; padding: 12px; border: 1px solid rgba(219,226,234,.92); border-radius: 8px; background: #fff; box-shadow: var(--shadow-soft); }
.rail-header h2 { margin: 0; font-size: 1.02rem; font-weight: 600; }
.status-pill { display: inline-flex; align-items: center; min-height: 26px; padding: 0 8px; border-radius: 999px; background: #e6f2f0; color: var(--accent); font-size: .72rem; font-weight: 500; white-space: nowrap; }
.rail-context { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.rail-context span { min-height: 34px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--muted); font-size: .78rem; font-weight: 500; }
.rail-note { margin: 0; color: var(--muted); line-height: 1.55; }
.mobile-header { display: none; }
.topbar { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.topbar h1 { margin: 0; font-size: clamp(1.7rem, 2.4vw, 2.4rem); line-height: 1; }
.topbar-actions { display: flex; align-items: end; gap: 8px; }
.search-field { min-width: 240px; }

.primary-button, .secondary-button, .icon-button, .mini-button, .ghost-dark { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border-radius: 8px; font-weight: 500; }
.primary-button { border: 0; background: #0f766e; color: #fff; padding: 0 14px; box-shadow: 0 8px 18px rgba(15,118,110,.18); }
.secondary-button, .icon-button, .ghost-dark { border: 1px solid var(--line); background: #fff; color: var(--ink); padding: 0 12px; box-shadow: var(--shadow-soft); }
.ghost-dark { width: 100%; }
.mini-button { min-height: 31px; border: 1px solid var(--line); background: #fff; color: var(--ink); padding: 0 8px; font-size: .78rem; box-shadow: 0 4px 12px rgba(15,23,42,.045); }
.mini-button span { max-width: 72px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill { min-height: 30px; display: inline-flex; align-items: center; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--accent); text-decoration: none; font-weight: 600; font-size: .78rem; box-shadow: var(--shadow-soft); }

.view-root { min-width: 0; }
.dashboard, .page-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 10px; min-width: 0; align-items: start; }
.hero-panel { grid-column: span 12; min-height: clamp(154px, 14vw, 180px); display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 22vw); gap: 10px; padding: 12px; border: 1px solid #0b3b37; border-radius: 8px; background: #10201f; color: #fff; box-shadow: var(--shadow); }
.hero-copy { display: grid; align-content: center; gap: 10px; padding: 18px; }
.hero-copy h2 { max-width: 880px; margin: 0; font-size: clamp(1.65rem, 2.65vw, 3rem); line-height: 1.04; letter-spacing: 0; overflow-wrap: anywhere; }
.hero-copy p { max-width: 640px; margin: 0; color: rgba(255,255,255,.72); }
.clock-card { display: grid; align-content: center; gap: 8px; padding: 18px; border: 1px solid rgba(255,255,255,.14); border-radius: 8px; background: rgba(255,255,255,.07); }
.clock-card span, .clock-card small { color: rgba(255,255,255,.65); font-weight: 500; }
.clock-card strong { font-size: clamp(2.05rem, 3.35vw, 3.35rem); line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: 0; }

.panel { min-width: 0; padding: 14px; border: 1px solid rgba(219,226,234,.92); border-radius: 8px; background: rgba(255,255,255,.94); box-shadow: var(--shadow-soft); }
.panel-header { display: flex; align-items: start; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.panel h2 { margin: 0; font-size: 1rem; }
.span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; }
.span-7 { grid-column: span 7; }
.span-8 { grid-column: span 8; }
.span-12 { grid-column: span 12; }

.metric-strip { grid-column: span 12; display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 10px; min-width: 0; }
.metric-strip.tight { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.metric { min-height: 86px; display: grid; align-content: center; gap: 6px; padding: 12px; border: 1px solid rgba(219,226,234,.92); border-radius: 8px; background: #fff; box-shadow: var(--shadow-soft); }
.metric span { color: var(--muted); font-weight: 500; }
.metric strong { font-size: 1.45rem; line-height: 1; font-weight: 600; font-variant-numeric: tabular-nums; }
.metric small { color: var(--faint); }

.list { display: grid; gap: 7px; max-height: 430px; overflow: auto; padding-right: 2px; }
.row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--soft); }
.row b { display: block; overflow-wrap: anywhere; }
.row small { display: block; margin-top: 3px; color: var(--muted); overflow-wrap: anywhere; }
.row.done { opacity: .58; }
.row.done b { text-decoration: line-through; }
.row-actions { display: flex; gap: 5px; flex-wrap: wrap; justify-content: end; }
.empty { padding: 18px; border: 1px dashed var(--line); border-radius: 8px; color: var(--muted); background: #fff; }

.stack { display: grid; gap: 10px; }
.stack.compact { gap: 8px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.inline-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 8px; margin-bottom: 10px; align-items: end; }
.inline-form .primary-button { min-width: 46px; }
.table { display: grid; gap: 6px; overflow: auto; max-height: 520px; }
.table-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); gap: 8px; align-items: center; padding: 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--soft); }
.table-row span { min-width: 0; overflow-wrap: anywhere; }
.good { color: var(--good); font-weight: 500; }
.bad { color: var(--bad); font-weight: 500; }
.skill-grid, .note-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 8px; }
.skill, .note { display: grid; gap: 9px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--soft); }
.skill small { color: var(--muted); }
.note p { margin: 0; color: var(--muted); line-height: 1.55; overflow-wrap: anywhere; }
.progress { height: 8px; overflow: hidden; border-radius: 999px; background: #e5e7eb; }
.progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.chat-box { min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 10px; }
.chat-log { display: grid; align-content: start; gap: 8px; max-height: none; min-height: 0; overflow: auto; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: #f8fafc; }
.chat-box.compact .chat-log { min-height: 150px; max-height: 180px; }
.chat-message { width: fit-content; max-width: min(760px, 92%); padding: 10px 12px; border-radius: 8px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-message.user { justify-self: end; background: var(--accent); color: #fff; }
.chat-message.assistant { justify-self: start; background: #fff; border: 1px solid var(--line); }
.chat-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.chart-panel { display: grid; align-content: start; }
.chart-canvas { width: 100%; max-width: 100%; height: 220px; min-height: 0; border: 1px solid #cbd5e1; border-radius: 8px; background: #fff; }
.compact-chart { height: 170px; }
.toast { position: fixed; right: 18px; bottom: 18px; z-index: 40; transform: translateY(18px); opacity: 0; transition: 180ms ease; padding: 10px 13px; border-radius: 8px; background: #111827; color: #fff; font-weight: 500; }
.toast.show { transform: translateY(0); opacity: 1; }

@media (max-width: 1320px) {
  .app-shell { grid-template-columns: 204px minmax(0, 1fr) 310px; }
  .hero-panel { grid-template-columns: minmax(0, 1fr) 230px; }
  .hero-copy { padding: 14px; }
  .clock-card { padding: 14px; }
  .clock-card strong { font-size: 2.35rem; }
  .metric { min-height: 84px; }
  .compact-chart { height: 160px; }
}

@media (max-width: 1120px) {
  .app-shell { grid-template-columns: 1fr; max-height: none; overflow: visible; }
  .sidebar { position: fixed; z-index: 30; inset: 0 auto 0 0; width: 250px; transform: translateX(-105%); transition: transform 180ms ease; box-shadow: 18px 0 40px rgba(15,23,42,.15); }
  .sidebar.open { transform: translateX(0); }
  .workspace { height: auto; min-height: 100vh; overflow: visible; }
  .assistant-rail { height: auto; min-height: 420px; border-left: 0; border-top: 1px solid var(--line); overflow: visible; }
  .mobile-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
  .topbar { align-items: start; flex-direction: column; }
  .topbar-actions { width: 100%; align-items: stretch; }
  .search-field { min-width: 0; flex: 1; }
  .hero-panel { grid-template-columns: 1fr; }
  .metric-strip { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
  .span-4, .span-5, .span-7, .span-8, .span-12 { grid-column: span 12; }
  .compact-chart, .chart-canvas { height: 190px; }
}

@media (max-width: 560px) {
  .workspace { padding: 10px; }
  .topbar-actions { flex-direction: column; }
  .metric-strip { grid-template-columns: 1fr; }
  .two { grid-template-columns: 1fr; }
  .clock-card strong { font-size: 2.25rem; }
  .row { grid-template-columns: 1fr; }
  .row-actions { justify-content: start; }
}

