:root { color-scheme: dark; --bg:#071018; --panel:#101d28; --line:#223647; --text:#eaf4f8; --muted:#8fa8b7; --accent:#56e0b4; --blue:#65a8ff; --warn:#ffcb6b; }
* { box-sizing:border-box; }
body { margin:0; font-family:Inter,ui-sans-serif,system-ui,-apple-system,sans-serif; background:radial-gradient(circle at 20% 0,#133044 0,transparent 34%),var(--bg); color:var(--text); min-height:100vh; }
a { color:inherit; text-decoration:none; }
.shell { display:grid; grid-template-columns:260px 1fr; min-height:100vh; }
nav { border-right:1px solid var(--line); padding:28px 20px; background:rgba(7,16,24,.78); backdrop-filter:blur(18px); }
.brand { display:flex; align-items:center; gap:10px; font-size:22px; font-weight:800; letter-spacing:.04em; margin-bottom:36px; }
.brand img { width:38px; height:38px; flex:0 0 38px; filter:drop-shadow(0 0 12px rgba(86,224,180,.32)); }
.brand span { color:var(--accent); }
.nav-link { display:block; padding:12px 14px; border-radius:12px; color:var(--muted); margin:6px 0; }
.nav-link.active,.nav-link:hover { background:#172937; color:var(--text); }
.logout { margin-top:28px; }
main { padding:28px; overflow:auto; }
.header { display:flex; justify-content:space-between; align-items:center; margin-bottom:22px; }
.header h1 { margin:0; font-size:28px; }
.badge { border:1px solid #2b6555; color:var(--accent); background:#102d27; padding:7px 11px; border-radius:999px; font-size:12px; }
.panel { background:linear-gradient(145deg,rgba(18,34,47,.96),rgba(12,25,35,.96)); border:1px solid var(--line); border-radius:18px; box-shadow:0 20px 60px rgba(0,0,0,.22); }
.chat-grid { display:grid; grid-template-columns:310px minmax(0,1fr); gap:18px; height:calc(100vh - 110px); }
.conversations { padding:16px; overflow:auto; }
.conversation { padding:14px; border:1px solid transparent; border-radius:14px; margin-bottom:9px; background:#0b1720; }
.conversation:hover { border-color:#315168; }
.conversation strong { display:block; margin-bottom:7px; }
.meta { color:var(--muted); font-size:12px; line-height:1.5; }
.composer { display:flex; flex-direction:column; padding:20px; }
.messages { flex:1; overflow:auto; display:flex; flex-direction:column; gap:12px; padding:6px 2px 18px; }
.bubble { max-width:76%; border-radius:16px; padding:12px 14px; background:#152735; border:1px solid #294153; }
.bubble.self { align-self:flex-end; background:#123a34; border-color:#28685a; }
.controls { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
input,select,textarea,button { width:100%; border:1px solid var(--line); background:#09141d; color:var(--text); border-radius:11px; padding:11px 12px; font:inherit; }
textarea { min-height:76px; resize:vertical; grid-column:1/-1; }
button { background:linear-gradient(135deg,#2b8e75,#3979ca); border:0; font-weight:750; cursor:pointer; }
.cards { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; margin-bottom:18px; }
.card { padding:18px; }
.card .value { font-size:30px; font-weight:800; margin-top:8px; }
.dashboard-grid { display:grid; grid-template-columns:1.2fr .8fr; gap:18px; }
.section { padding:20px; }
.row { display:flex; justify-content:space-between; gap:16px; padding:11px 0; border-bottom:1px solid var(--line); }
.row:last-child { border-bottom:0; }
.status-dot { width:8px; height:8px; border-radius:50%; background:var(--accent); display:inline-block; margin-right:7px; box-shadow:0 0 12px var(--accent); }
pre { white-space:pre-wrap; color:#bdd4df; }
@media(max-width:900px){.shell{grid-template-columns:1fr}nav{display:flex;align-items:center;gap:8px;padding:14px;border-right:0;border-bottom:1px solid var(--line)}.brand{margin:0 auto 0 0}.nav-link{display:inline-block}.chat-grid,.dashboard-grid{grid-template-columns:1fr}.chat-grid{height:auto}.conversations{max-height:260px}.composer{min-height:620px}.cards{grid-template-columns:repeat(2,1fr)}main{padding:16px}}
.conversation-title,.conversation-head,.thread-header { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.conversation.selected { border-color:#56e0b4; background:#102b2a; box-shadow:inset 3px 0 #56e0b4; }
.preview { margin:7px 0; color:#c4d6df; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.unread { min-width:22px; height:22px; display:inline-grid; place-items:center; padding:0 7px; border-radius:999px; background:var(--accent); color:#052019; font-size:11px; font-weight:850; }
.ghost { background:transparent; border:1px solid var(--line); color:var(--muted); margin-top:10px; }
.ghost:hover { border-color:#4d7189; color:var(--text); }
.ghost.small { width:auto; margin:0; padding:7px 10px; font-size:12px; }
.thread-header { min-height:52px; border-bottom:1px solid var(--line); margin-bottom:12px; padding-bottom:12px; }
.cards-six { grid-template-columns:repeat(6,minmax(0,1fr)); }
.card small { color:var(--muted); font-size:12px; }
@media(max-width:1300px){.cards-six{grid-template-columns:repeat(3,1fr)}}
@media(max-width:700px){.cards-six{grid-template-columns:repeat(2,1fr)}}
.login-page { display:grid; place-items:center; min-height:100vh; padding:24px; }
.login-card { width:min(440px,100%); padding:30px; }
.login-card h1 { margin:0 0 8px; }
.login-card form { display:grid; gap:14px; margin-top:24px; }
.login-card .error { color:#ff8f8f; min-height:24px; }
.login-card .token-hint { margin-top:18px; padding:12px; border-radius:12px; background:#09141d; }
.admin-login-dialog { width:min(460px,calc(100% - 32px)); padding:0; color:var(--text); }
.admin-login-dialog::backdrop { background:rgba(1,8,13,.82); backdrop-filter:blur(8px); }
.admin-login-form { display:grid; gap:14px; padding:30px; }
.admin-login-form h2 { margin:0; }
.admin-login-form .brand { margin-bottom:4px; }
.admin-login-form .error { min-height:24px; color:#ff8f8f; }
@media(max-width:900px){nav{flex-wrap:wrap;align-items:center}.brand{width:100%;margin:0}.nav-link{flex:1 1 auto;text-align:center;margin:0;padding:9px 8px}.logout{margin-left:auto}}
