:root {
  --bg: #0A0A0A;
  --bg-elev: #141414;
  --bg-elev-2: #1c1c1c;
  --border: rgba(255,255,255,0.10);
  --border-strong: rgba(255,255,255,0.22);
  --text: #FFFFFF;
  --text-muted: rgba(255,255,255,0.62);
  --text-dim: rgba(255,255,255,0.42);
  --teal: #06B6D4;
  --teal-soft: rgba(6,182,212,0.15);
  --teal-strong: #22d3ee;
  --amber: #f59e0b;
  --rose: #f43f5e;
  --green: #10b981;
  --radius: 10px;
  --radius-lg: 14px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font-family: var(--font-sans); font-size: 15px; line-height: 1.55; }
a { color: var(--teal); text-decoration: none; }
a:hover { color: var(--teal-strong); }
button { font: inherit; cursor: pointer; }

.app-shell { display: grid; grid-template-rows: auto 1fr; min-height: 100vh; }
.topbar { display: flex; align-items: center; gap: 16px; padding: 14px 24px; border-bottom: 1px solid var(--border); background: var(--bg); position: sticky; top: 0; z-index: 10; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 500; letter-spacing: 0.2px; }
.brand-mark { width: 26px; height: 26px; }
.brand-name { font-size: 16px; }
.brand-name .accent { color: var(--teal); }
.brand-sub { font-size: 12px; color: var(--text-dim); margin-left: 8px; padding-left: 10px; border-left: 1px solid var(--border); }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.who { font-size: 13px; color: var(--text-muted); }

.main { display: grid; grid-template-columns: 280px 1fr; gap: 0; min-height: 0; }
.sidebar { border-right: 1px solid var(--border); padding: 20px 16px; background: var(--bg); }
.sidebar h3 { font-size: 11px; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-dim); margin: 18px 8px 8px; }
.sidebar h3:first-child { margin-top: 0; }
.room-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 2px; }
.room-list li button { width: 100%; text-align: left; padding: 9px 10px; background: transparent; border: 1px solid transparent; color: var(--text-muted); border-radius: var(--radius); }
.room-list li button:hover { background: var(--bg-elev); color: var(--text); }
.room-list li.active button { background: var(--teal-soft); border-color: var(--teal); color: var(--text); }

.content { padding: 28px 32px; min-width: 0; }
.page-h { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 0 20px; }
h1 { font-size: 22px; font-weight: 500; margin: 0; }
h2 { font-size: 18px; font-weight: 500; margin: 28px 0 12px; }
h3 { font-size: 15px; font-weight: 500; margin: 16px 0 8px; }

.btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: var(--radius); border: 1px solid var(--border-strong); background: var(--bg-elev); color: var(--text); transition: border-color 120ms, background 120ms; }
.btn:hover { border-color: var(--teal); }
.btn.primary { background: var(--teal); border-color: var(--teal); color: #001318; font-weight: 500; }
.btn.primary:hover { background: var(--teal-strong); border-color: var(--teal-strong); }
.btn.danger { border-color: var(--rose); color: var(--rose); }
.btn.danger:hover { background: rgba(244,63,94,0.1); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Room notes (per-room chat) */
.chat-section { margin-top: 28px; border-top: 1px solid var(--border-strong); padding-top: 18px; }
.chat-h { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; margin: 0 0 12px; }
.chat-list { max-height: 320px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding-right: 4px; }
.chat-empty { color: var(--text-dim); font-size: 13px; padding: 8px 0; }
.chat-msg { background: var(--bg-elev); border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 10px 12px; }
.chat-meta { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.chat-author { color: var(--teal); font-size: 12px; font-weight: 600; }
.chat-time { color: var(--text-dim); font-size: 12px; }
.chat-text { font-size: 14px; white-space: pre-wrap; word-break: break-word; }
.chat-compose { display: flex; gap: 8px; margin-top: 12px; align-items: flex-end; }
.chat-compose textarea { flex: 1; resize: vertical; }

.card { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; }
.cards { display: grid; gap: 12px; }

.empty { text-align: center; padding: 60px 20px; color: var(--text-muted); border: 1px dashed var(--border-strong); border-radius: var(--radius-lg); }
.empty i { font-size: 32px; color: var(--text-dim); margin-bottom: 12px; display: block; }

.dropzone { border: 1px dashed var(--border-strong); border-radius: var(--radius-lg); padding: 36px 20px; text-align: center; color: var(--text-muted); transition: border-color 120ms, background 120ms; cursor: pointer; background: var(--bg-elev); }
.dropzone.over { border-color: var(--teal); background: var(--teal-soft); color: var(--text); }
.dropzone i { font-size: 28px; color: var(--teal); display: block; margin-bottom: 10px; }

.files-table { width: 100%; border-collapse: collapse; }
.files-table th, .files-table td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--border); font-size: 13px; }
.files-table th { color: var(--text-dim); font-weight: 500; text-transform: uppercase; letter-spacing: 0.06em; font-size: 11px; }
.files-table tr:hover td { background: var(--bg-elev); }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 500; }
.badge.scan-pending { background: rgba(245,158,11,0.15); color: var(--amber); }
.badge.scan-clean   { background: rgba(16,185,129,0.15); color: var(--green); }
.badge.scan-infected{ background: rgba(244,63,94,0.18); color: var(--rose); }

input[type="text"], input[type="email"], input[type="number"], input[type="password"], select, textarea {
  width: 100%; padding: 9px 12px; border-radius: var(--radius); border: 1px solid var(--border-strong);
  background: var(--bg); color: var(--text); font: inherit;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--teal); }
label { display: block; font-size: 12px; color: var(--text-muted); margin: 12px 0 6px; }

.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.7); display: flex; align-items: center; justify-content: center; z-index: 50; }
.modal { background: var(--bg-elev); border: 1px solid var(--border-strong); border-radius: var(--radius-lg); padding: 24px; width: 480px; max-width: 92vw; }
.modal h2 { margin-top: 0; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

.link-callout { background: var(--bg-elev-2); border: 1px solid var(--teal); border-radius: var(--radius); padding: 12px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: var(--teal-strong); word-break: break-all; }

.toast { position: fixed; bottom: 20px; right: 20px; background: var(--bg-elev-2); border: 1px solid var(--border-strong); padding: 12px 16px; border-radius: var(--radius); z-index: 100; }

.guest-shell { min-height: 100vh; display: flex; flex-direction: column; }
.guest-hero { padding: 36px 32px 20px; border-bottom: 1px solid var(--border); }
.guest-body { padding: 28px 32px; max-width: 920px; }
.guest-meta { color: var(--text-muted); font-size: 13px; margin-top: 4px; }

.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--border-strong); border-top-color: var(--teal); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
