*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #ffffff;
  --bg-sidebar: #f7f7f8;
  --bg-input: #f4f4f5;
  --bg-hover: #ebebeb;
  --bg-3: #e8e8ea;
  --text: #0d0d0d;
  --text-2: #6b6b80;
  --text-3: #9b9bac;
  --border: #e0e0e5;
  --accent: #10a37f;
  --accent-h: #0d8a6a;
  --accent-dim: rgba(16,163,127,0.10);
  --danger: #d93025;
  --sidebar-w: 250px;
  --r: 12px;
}


html, body { height: 100%; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg); color: var(--text);
  display: flex; height: 100vh; overflow: hidden;
  font-size: 15px; line-height: 1.6;
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w); background: var(--bg-sidebar);
  display: flex; flex-direction: column;
  border-right: 1px solid var(--border);
  flex-shrink: 0; transition: width 0.2s ease; overflow: hidden;
}
.sidebar.collapsed { width: 0; border: none; }

.sidebar-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 12px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.school-name {
  display: flex; align-items: center; gap: 8px;
  font-weight: 600; font-size: 13px; color: var(--text); overflow: hidden;
}
.school-name svg { color: var(--accent); flex-shrink: 0; }
.school-name span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: 'Playfair Display', Georgia, serif; font-weight: 600; }

.chat-history { flex: 1; overflow-y: auto; padding: 8px 6px; }
.chat-history::-webkit-scrollbar { width: 4px; }
.chat-history::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.chat-history-label {
  font-size: 12px; font-weight: 600; color: var(--text-2);
  padding: 4px 10px 6px; letter-spacing: 0.01em;
}

.history-item {
  padding: 8px 10px; border-radius: 8px; cursor: pointer;
  font-size: 14px; font-weight: 400; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: background 0.15s; margin-bottom: 2px;
}
.history-item:hover { background: var(--bg-hover); }
.history-item.active { background: var(--bg-input); font-weight: 500; }

.sidebar-footer {
  padding: 10px; border-top: 1px solid var(--border); flex-shrink: 0;
}
.sidebar-link {
  display: flex; align-items: center; gap: 8px;
  background: none; border: none; color: var(--text-2);
  cursor: pointer; padding: 7px 8px; border-radius: 8px;
  font-size: 13px; width: 100%; transition: background 0.15s;
}
.sidebar-link:hover { background: var(--bg-hover); color: var(--text); }

/* ── Main ── */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; overflow: hidden; }

.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; border-bottom: 1px solid var(--border);
  min-height: 52px; flex-shrink: 0;
}
.topbar-title { font-size: 14px; color: var(--text-2); }

/* ── Chat area ── */
.chat-area { flex: 1; overflow-y: auto; padding: 24px 16px 8px; scroll-behavior: smooth; }
.chat-area::-webkit-scrollbar { width: 6px; }
.chat-area::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ── Welcome ── */
.welcome {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 48px 20px; max-width: 580px; margin: 0 auto;
}
.welcome-logo {
  background: var(--bg-input); border-radius: 16px; padding: 16px;
  margin-bottom: 20px; color: var(--accent);
}
.welcome h1 { font-size: 24px; font-weight: 600; margin-bottom: 8px; }
.welcome p { color: var(--text-2); font-size: 14px; margin-bottom: 28px; }

.suggestions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }
.suggestion-btn {
  background: var(--bg-input); border: 1px solid var(--border);
  color: var(--text-2); cursor: pointer; padding: 12px 14px;
  border-radius: 10px; font-size: 13px; text-align: left;
  transition: all 0.15s; line-height: 1.4;
}
.suggestion-btn:hover { background: var(--bg-hover); color: var(--text); border-color: var(--text-3); }

.recent-docs-label {
  font-size: 11px; font-weight: 600; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.06em;
  margin: 20px 0 8px;
}
.recent-docs-list { display: flex; flex-direction: column; gap: 4px; width: 100%; }
.recent-doc-item {
  display: flex; align-items: center; gap: 10px;
  background: none; border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 14px; cursor: pointer;
  text-align: left; width: 100%; transition: all 0.15s;
}
.recent-doc-item:hover { background: var(--bg-input); border-color: var(--text-3); }
.recent-doc-icon { font-size: 18px; flex-shrink: 0; }
.recent-doc-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.recent-doc-name { font-size: 13px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-doc-meta { font-size: 11px; color: var(--text-3); }
.recent-tag {
  display: inline-block; padding: 1px 6px; border-radius: 10px;
  background: #eff6ff; color: #3b82f6; font-size: 10px; font-weight: 500;
}

/* ── Messages ── */
.messages { max-width: 720px; margin: 0 auto; width: 100%; }

.message { display: flex; gap: 14px; padding: 16px 0; animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; } }

.message.user { flex-direction: row-reverse; }
.message.user .msg-content {
  background: var(--bg-input); border-radius: var(--r);
  padding: 11px 15px; max-width: 82%;
}
.message.assistant .msg-content { flex: 1; }

.msg-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; flex-shrink: 0; margin-top: 2px;
}
.message.user .msg-avatar { background: #5c6bc0; color: #fff; }
.message.assistant .msg-avatar { background: var(--accent); color: #fff; }

/* Markdown */
.msg-text p { margin-bottom: 10px; }
.msg-text p:last-child { margin-bottom: 0; }
.msg-text h1,.msg-text h2,.msg-text h3 { margin: 14px 0 6px; font-weight: 600; }
.msg-text h1 { font-size: 18px; } .msg-text h2 { font-size: 16px; } .msg-text h3 { font-size: 14px; }
.msg-text ul,.msg-text ol { padding-left: 20px; margin-bottom: 10px; }
.msg-text li { margin-bottom: 3px; }
.msg-text code { background: #1e1e1e; padding: 2px 5px; border-radius: 4px; font-family: Consolas,monospace; font-size: 12px; color: #e5c07b; }
.msg-text pre { background: #1e1e1e; border-radius: 8px; overflow: auto; margin: 10px 0; }
.msg-text pre code { background: none; padding: 12px 14px; display: block; color: inherit; font-size: 12px; }
.msg-text blockquote { border-left: 3px solid var(--accent); padding-left: 12px; color: var(--text-2); margin: 10px 0; }
.msg-text a { color: var(--accent); text-decoration: none; }
.msg-text a:hover { text-decoration: underline; }
.msg-text table { border-collapse: collapse; width: 100%; margin: 10px 0; font-size: 13px; }
.msg-text th,.msg-text td { border: 1px solid var(--border); padding: 7px 11px; text-align: left; }
.msg-text th { background: var(--bg-input); }
.msg-text strong { font-weight: 600; }

/* Sources */
.sources { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.sources-label {
  font-size: 11px; color: var(--text-3); text-transform: uppercase;
  letter-spacing: 0.5px; margin-bottom: 6px; font-weight: 600;
}
.source-list { display: flex; flex-wrap: wrap; gap: 5px; }
.source-chip {
  background: var(--accent-dim); border: 1px solid rgba(16,163,127,0.3);
  border-radius: 20px; padding: 3px 10px; font-size: 11px; color: var(--accent);
}

/* Cursor */
.cursor { display: inline-block; width: 2px; height: 1em; background: var(--text); margin-left: 1px; animation: blink 0.8s step-end infinite; vertical-align: text-bottom; }
@keyframes blink { 50% { opacity: 0; } }

/* Thinking indicator */
.thinking-indicator { display: flex; align-items: center; gap: 7px; padding: 4px 0; }
.thinking-spin { animation: spin 1.2s linear infinite; opacity: 0.75; flex-shrink: 0; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.thinking-text { font-size: 14px; color: var(--text-2); }
.thinking-dots span {
  font-size: 14px; color: var(--text-3);
  animation: dot-fade 1.2s ease-in-out infinite;
}
.thinking-dots span:nth-child(2) { animation-delay: 0.2s; }
.thinking-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dot-fade { 0%, 80%, 100% { opacity: 0.2; } 40% { opacity: 1; } }

.error-msg { font-size: 13.5px; color: var(--text-2); font-style: italic; }

/* ── Input ── */
.input-area { padding: 10px 16px 14px; border-top: 1px solid var(--border); flex-shrink: 0; }
.input-box {
  display: flex; align-items: flex-end; gap: 8px;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 14px; padding: 10px 12px;
  max-width: 720px; margin: 0 auto; transition: border-color 0.15s;
}
.input-box:focus-within { border-color: var(--text-3); }
textarea#messageInput {
  flex: 1; background: none; border: none; outline: none;
  color: var(--text); font-size: 14px; resize: none;
  max-height: 160px; line-height: 1.6; font-family: inherit;
}
textarea#messageInput::placeholder { color: var(--text-3); }
.send-btn {
  background: var(--accent); border: none; color: #fff;
  width: 32px; height: 32px; border-radius: 8px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: background 0.15s; align-self: flex-end;
}
.send-btn:hover:not(:disabled) { background: var(--accent-h); }
.send-btn:disabled { background: var(--bg-hover); color: var(--text-3); cursor: not-allowed; }
.disclaimer { font-size: 11px; color: var(--text-3); text-align: center; margin-top: 7px; max-width: 720px; margin-left: auto; margin-right: auto; }

/* ── Shared icon btn ── */
.icon-btn {
  background: none; border: none; color: var(--text-2);
  cursor: pointer; padding: 6px; border-radius: 6px;
  display: flex; align-items: center; flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}
.icon-btn:hover { background: var(--bg-hover); color: var(--text); }

/* ── Tooltip ── */
[data-tooltip] { position: relative; }
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-3, #2a2a2a);
  color: var(--text);
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 5px;
  white-space: nowrap;
  border: 1px solid var(--border);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 50;
}
[data-tooltip]:hover::after { opacity: 1; }

/* ── Modal ── */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 100; align-items: center; justify-content: center; }
.modal-overlay.open { display: flex; }
.modal { background: #2a2a2a; border: 1px solid var(--border); border-radius: 14px; width: 400px; max-width: 90vw; }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.modal-header h2 { font-size: 15px; font-weight: 600; }
.modal-close { background: none; border: none; color: var(--text-2); cursor: pointer; font-size: 20px; line-height: 1; }
.modal-close:hover { color: var(--text); }
.modal-body { padding: 18px; }
.modal-body label { display: block; font-size: 12px; color: var(--text-2); margin-bottom: 6px; font-weight: 500; margin-top: 14px; }
.modal-body label:first-child { margin-top: 0; }
.modal-body input, .modal-body select {
  width: 100%; background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 8px; padding: 9px 11px; color: var(--text); font-size: 13px; outline: none;
}
.modal-body input:focus, .modal-body select:focus { border-color: var(--accent); }
.hint { font-size: 11px; color: var(--text-3); margin-top: 6px; }
.hint a { color: var(--accent); }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 18px; border-top: 1px solid var(--border); }
.btn-primary { background: var(--accent); border: none; color: #fff; padding: 7px 16px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.btn-primary:hover { background: var(--accent-h); }
.btn-secondary { background: none; border: 1px solid var(--border); color: var(--text-2); padding: 7px 16px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.btn-secondary:hover { background: var(--bg-hover); color: var(--text); }
.btn-danger { background: var(--danger); border: none; color: #fff; padding: 7px 16px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.btn-danger:hover { background: #b91c1c; }

/* ── Confirm modal ── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.4); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn 0.15s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-card {
  background: #fff; border-radius: 20px; width: 400px; max-width: calc(100vw - 32px);
  box-shadow: 0 24px 80px rgba(0,0,0,0.22); overflow: hidden;
  animation: slideUp 0.18s ease;
}
.modal-icon {
  display: flex; align-items: center; justify-content: center;
  padding: 32px 24px 0;
}
.modal-icon-inner {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--accent-dim); border: 1.5px solid rgba(16,163,127,0.25);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent);
}
.modal-body { padding: 20px 32px 10px; text-align: center; }
.modal-title { font-size: 17px; font-weight: 650; color: var(--text); margin-bottom: 8px; letter-spacing: -0.2px; }
.modal-message { font-size: 13.5px; color: var(--text-2); line-height: 1.65; }
.modal-actions {
  display: flex; gap: 10px; padding: 24px 28px 28px;
  justify-content: stretch;
}
.modal-actions .btn-secondary, .modal-actions .btn-danger {
  flex: 1; padding: 10px 16px; font-size: 14px; font-weight: 500; border-radius: 10px;
}

/* ── Admin page ── */
.admin-layout { display: flex; height: 100vh; overflow: hidden; width: 100%; }

.admin-sidebar {
  width: 220px; background: var(--bg-sidebar); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; flex-shrink: 0;
  transition: width 0.2s ease; overflow: hidden;
}
.admin-sidebar.collapsed { width: 0; border: none; }
.admin-sidebar-header { padding: 16px 14px; border-bottom: 1px solid var(--border); }
.admin-sidebar-header .school-name { font-size: 13px; }
.admin-nav { flex: 1; padding: 8px; }
.admin-nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; border-radius: 8px; cursor: pointer;
  font-size: 13px; color: var(--text-2); transition: background 0.15s;
  background: none; border: none; width: 100%; text-align: left; text-decoration: none;
}
.admin-nav-item:hover { background: var(--bg-hover); color: var(--text); }
.admin-nav-item.active { background: var(--bg-input); color: var(--text); }

.admin-main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

.admin-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.admin-topbar h1 { font-size: 16px; font-weight: 600; }

.admin-content { flex: 1; overflow-y: auto; padding: 24px; }

/* Stats row */
.stats-row { display: flex; gap: 14px; margin-bottom: 24px; }
.stat-card {
  flex: 1; background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--r); padding: 16px 18px;
}
.stat-value { font-size: 28px; font-weight: 700; color: var(--accent); }
.stat-label { font-size: 12px; color: var(--text-2); margin-top: 2px; }

/* Upload zone */
.upload-card {
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--r); padding: 16px 20px; margin-bottom: 20px;
}
.upload-card-title { font-size: 14px; font-weight: 600; margin-bottom: 14px; }
.folder-toggle { display: flex; gap: 8px; margin-bottom: 14px; }
.folder-btn {
  padding: 6px 14px; border-radius: 20px; border: 1px solid var(--border);
  background: none; color: var(--text-2); cursor: pointer; font-size: 13px; transition: all 0.15s;
}
.folder-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.folder-btn:not(.active):hover { background: var(--bg-hover); color: var(--text); }

.drop-zone {
  border: 1.5px dashed var(--border); border-radius: 10px;
  padding: 14px 20px; text-align: center; cursor: pointer;
  transition: all 0.15s; display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 10px;
  color: var(--text-2); font-size: 13px;
}
.drop-zone:hover, .drop-zone.drag-over { border-color: var(--accent); background: var(--accent-dim); }
.drop-zone svg { color: var(--text-3); flex-shrink: 0; }
.drop-zone:hover svg, .drop-zone.drag-over svg { color: var(--accent); }
.drop-hint { font-size: 11px; color: var(--text-3); display: none; }
.link-btn { background: none; border: none; color: var(--accent); cursor: pointer; font-size: 13px; text-decoration: underline; }

.upload-progress { margin-top: 12px; display: none; }
.progress-bar { height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--accent); transition: width 0.3s; width: 0; }
.progress-label { font-size: 12px; color: var(--text-2); margin-top: 5px; }

/* Files table */
.files-card {
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--r); overflow: hidden;
}
.files-card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
}
.files-card-title { font-size: 14px; font-weight: 600; }
.folder-filter { display: flex; gap: 6px; }
.filter-btn {
  padding: 4px 12px; border-radius: 20px; border: 1px solid var(--border);
  background: none; color: var(--text-2); cursor: pointer; font-size: 12px; transition: all 0.15s;
}
.filter-btn.active { background: var(--bg-hover); color: var(--text); }

.file-table { width: 100%; border-collapse: collapse; }
.file-table th { padding: 10px 16px; font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; text-align: left; border-bottom: 1px solid var(--border); }
.file-table td { padding: 11px 16px; font-size: 13px; border-bottom: 1px solid var(--border); }
.file-table tr:last-child td { border-bottom: none; }
.file-table tr:hover td { background: rgba(255,255,255,0.02); }

.folder-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 500;
}
.folder-badge.public { background: var(--accent-dim); color: var(--accent); }
.folder-badge.private { background: rgba(139,92,246,0.12); color: #a78bfa; }
.folder-badge.website { background: rgba(59,130,246,0.10); color: #3b82f6; }

.file-status.ok { color: var(--accent); font-size: 11px; }
.file-status.expired { color: #f59e0b; font-size: 11px; }

.tags-input-row { margin-bottom: 10px; }
.tags-cell { max-width: 200px; }
.tags-display { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.tag-chip {
  display: inline-block; padding: 2px 7px; border-radius: 20px;
  font-size: 11px; font-weight: 500;
  background: #eff6ff; color: #3b82f6; border: 1px solid #bfdbfe;
}
.tag-edit-btn {
  background: none; border: 1px dashed var(--border); color: var(--text-3);
  border-radius: 20px; padding: 1px 7px; font-size: 11px; cursor: pointer;
  line-height: 1.4;
}
.tag-edit-btn:hover { border-color: var(--accent); color: var(--accent); }

.del-btn {
  background: none; border: none; color: var(--text-3); cursor: pointer;
  padding: 4px 6px; border-radius: 5px; transition: all 0.15s;
}
.del-btn:hover { background: rgba(229,62,62,0.1); color: var(--danger); }

.empty-row td { text-align: center; color: var(--text-3); padding: 32px; }

/* ── Login page ── */
#loginPage {
  position: fixed; inset: 0; display: flex;
  align-items: center; justify-content: center;
  background: #f0fdf9;
  background-image:
    radial-gradient(ellipse at 20% 40%, rgba(16,163,127,0.12) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 20%, rgba(99,179,237,0.10) 0%, transparent 50%),
    radial-gradient(ellipse at 65% 80%, rgba(16,163,127,0.08) 0%, transparent 45%);
  z-index: 200;
}
.login-wrap {
  display: flex; align-items: center; justify-content: center;
  width: 100%; padding: 20px;
}
.login-card {
  background: #ffffff; border: 1px solid #e5e7eb;
  border-radius: 20px; padding: 40px 36px; width: 400px; max-width: 100%;
  box-shadow: 0 8px 40px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.04);
}
.login-logo {
  background: #f0fdf9; border-radius: 14px; padding: 12px;
  display: block; width: fit-content;
  color: var(--accent); margin: 0 auto 24px;
}
.login-title { font-size: 24px; font-weight: 700; color: #111827; margin-bottom: 4px; text-align: center; }
.login-sub { color: #6b7280; font-size: 14px; margin-bottom: 28px; text-align: center; }
.login-error {
  background: #fef2f2; border: 1px solid #fecaca;
  color: #dc2626; border-radius: 8px; padding: 10px 12px; font-size: 13px; margin-bottom: 16px;
}
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 12px; color: #374151; margin-bottom: 6px; font-weight: 600; letter-spacing: 0.02em; }
.form-group input {
  width: 100%; background: #f9fafb; border: 1px solid #e5e7eb;
  border-radius: 10px; padding: 11px 14px; color: #111827; font-size: 14px; outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-group input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(16,163,127,0.12); background: #fff; }
.login-btn {
  width: 100%; background: var(--accent); border: none; color: #fff;
  padding: 11px; border-radius: 9px; font-size: 15px; font-weight: 600;
  cursor: pointer; margin-top: 4px; transition: background 0.15s;
}
.login-btn:hover { background: var(--accent-h); }
.login-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.login-copy {
  position: absolute; bottom: 20px; left: 0; right: 0;
  text-align: center; font-size: 11px; color: #6b7280;
}
.login-copy a { color: #6b7280; text-decoration: none; }
.login-copy a:hover { color: var(--accent); }

/* Admin sidebar extras */
.admin-sidebar-footer {
  padding: 10px; border-top: 1px solid var(--border);
}
.admin-user-info {
  font-size: 11px; color: var(--text-3); padding: 4px 10px 8px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.school-select {
  background: var(--bg-input); border: 1px solid var(--border);
  color: var(--text); border-radius: 8px; padding: 6px 10px;
  font-size: 13px; outline: none; cursor: pointer;
}
.school-select-row {
  display: flex; align-items: center; gap: 12px; margin-bottom: 16px;
}
.field-label {
  font-size: 13px; font-weight: 500; color: var(--text-2); white-space: nowrap;
}
.school-select-inline {
  background: var(--bg-input); border: 1px solid var(--border);
  color: var(--text); border-radius: 8px; padding: 7px 12px;
  font-size: 14px; outline: none; cursor: pointer; min-width: 220px;
}
.table-input {
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 10px; color: var(--text);
  font-size: 13px; outline: none; width: 100%;
}
.table-input:focus { border-color: var(--accent); }

/* Sidebar backdrop (mobile overlay) */
.sidebar-backdrop {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.4); z-index: 49;
}
.sidebar-backdrop.visible { display: block; }

@media (max-width: 640px) {
  /* ── Chat sidebar ── */
  .sidebar {
    position: fixed; z-index: 50; height: 100%; top: 0; left: 0;
    width: var(--sidebar-w) !important;
    transform: translateX(-100%);
    transition: transform 0.25s ease, box-shadow 0.25s;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0,0,0,0.18);
  }
  .sidebar.collapsed { width: var(--sidebar-w) !important; }

  /* ── Admin sidebar ── */
  .admin-sidebar {
    position: fixed; z-index: 50; height: 100%; top: 0; left: 0;
    width: 240px !important;
    transform: translateX(-100%);
    transition: transform 0.25s ease, box-shadow 0.25s;
  }
  .admin-sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0,0,0,0.18);
  }
  .admin-content { padding: 16px; }
  .admin-topbar { padding: 12px 14px; }
  .suggestions { grid-template-columns: 1fr; }
  .stats-row { flex-direction: column; }
  .welcome { padding: 32px 16px; }
  .school-select-inline { min-width: 0; width: 100%; }
  .school-select-row { flex-direction: column; align-items: flex-start; gap: 6px; }
  .files-table th:nth-child(3),
  .files-table td:nth-child(3),
  .files-table th:nth-child(4),
  .files-table td:nth-child(4) { display: none; }
}
