:root {
  --bg: #080a1a;
  --bg-gradient: radial-gradient(ellipse 80% 60% at 50% -10%, #1a1f4a 0%, #0a0d22 45%, #080a1a 100%);
  --surface: #141838;
  --surface-2: #1c2148;
  --surface-hover: #242a58;
  --border: #2a2f5a;
  --border-strong: #3a4180;
  --primary: #3b44a3;
  --primary-hover: #4a55c2;
  --primary-light: #6b74d9;
  --primary-glow: rgba(107, 116, 217, 0.35);
  --accent: #F0742A;
  --accent-hover: #ff8640;
  --accent-glow: rgba(240, 116, 42, 0.3);
  --text: #e8eaf5;
  --text-dim: #9196b8;
  --text-muted: #6b6f8e;
  --danger: #e04b4b;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-pill: 999px;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  background: var(--bg);
  background-image: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--primary-light); text-decoration: none; }
a:hover { color: var(--accent); }

code {
  background: rgba(0, 0, 0, 0.35);
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  font-size: 0.85em;
  font-family: ui-monospace, "SF Mono", Menlo, Monaco, monospace;
  color: var(--accent);
  border: 1px solid var(--border);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  border: 0;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  text-decoration: none;
  user-select: none;
  font-family: inherit;
}

.btn:focus-visible {
  outline: 2px solid var(--primary-light);
  outline-offset: 2px;
}

.btn-primary {
  background: linear-gradient(180deg, #4a55c2 0%, #3b44a3 100%);
  color: #fff;
  box-shadow: 0 4px 14px var(--primary-glow), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(74, 85, 194, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  color: #fff;
}
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-accent {
  background: linear-gradient(180deg, #ff8640 0%, #F0742A 100%);
  color: #fff;
  box-shadow: 0 4px 14px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.btn-accent:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(240, 116, 42, 0.45);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  color: var(--text);
  border-color: var(--primary-light);
  background: rgba(107, 116, 217, 0.08);
}

.btn-full { width: 100%; padding: 0.95rem 1.5rem; font-size: 1rem; }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.85rem; }

/* ---------- Forms ---------- */
.field {
  display: block;
  margin-bottom: 1.1rem;
}
.field-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-dim);
  margin-bottom: 0.45rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 0.8rem 1rem;
  font-size: 0.95rem;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  font-family: inherit;
}
.field input::placeholder { color: var(--text-muted); }
.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--primary-light);
  background: rgba(0, 0, 0, 0.35);
  box-shadow: 0 0 0 3px rgba(107, 116, 217, 0.18);
}
.field input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* ---------- Auth / login ---------- */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}
.auth-card {
  position: relative;
  background: linear-gradient(180deg, rgba(28, 33, 72, 0.92) 0%, rgba(20, 24, 56, 0.92) 100%);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(107, 116, 217, 0.1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.auth-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 20%;
  right: 20%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--primary-light), transparent);
  opacity: 0.6;
}

.auth-brand { text-align: center; margin-bottom: 2rem; }
.auth-logo {
  width: 130px;
  height: auto;
  margin: 0 auto 1.25rem;
  display: block;
  filter: drop-shadow(0 4px 20px rgba(107, 116, 217, 0.2));
}
.auth-logo-white {
  background: #fff;
  padding: 20px;
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.1);
  width: 280px;
}
.auth-logo-sm { width: 80px; margin-bottom: 1rem; }
.auth-title {
  font-size: 1.35rem;
  margin: 0 0 0.35rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.auth-sub {
  color: var(--text-dim);
  margin: 0;
  font-size: 0.92rem;
}
.auth-form { margin-top: 0.5rem; }
.auth-hint {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.82rem;
  margin: 1.5rem 0 0;
}
.admin-disclosure {
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}
.admin-disclosure > summary {
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.82rem;
  text-align: center;
  list-style: none;
  padding: 0.25rem;
  transition: color 0.15s;
}
.admin-disclosure > summary:hover { color: var(--text-dim); }
.admin-disclosure > summary::-webkit-details-marker { display: none; }
.admin-disclosure[open] > summary { color: var(--text-dim); margin-bottom: 0.75rem; }
.admin-disclosure .auth-form { margin-top: 0; }
.auth-footer {
  margin-top: 2rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-align: center;
}
.auth-footer a { color: var(--text-dim); }
.auth-footer a:hover { color: var(--accent); }

/* ---------- Top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 0.9rem 2rem;
  background: rgba(14, 17, 42, 0.75);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text);
}
.brand-logo {
  height: 38px;
  width: 38px;
  background: #fff;
  padding: 5px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.08);
  box-sizing: content-box;
}
.brand-text-wrap {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.brand-text {
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.005em;
}
.brand-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 1px;
}
.topnav {
  display: flex;
  gap: 0.25rem;
  margin-left: auto;
}
.nav-link {
  padding: 0.55rem 1.1rem;
  color: var(--text-dim);
  text-decoration: none;
  border-radius: var(--radius-pill);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.15s;
}
.nav-link:hover {
  color: var(--text);
  background: var(--surface-2);
}

.user-panel {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.user-info {
  text-align: right;
  line-height: 1.2;
}
.user-name {
  display: block;
  font-weight: 600;
  font-size: 0.92rem;
}
.user-role {
  display: block;
  font-size: 0.7rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 2px;
  font-weight: 600;
}
.logout-form { margin: 0; }

/* ---------- Layout ---------- */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem;
}

.page-head { margin-bottom: 1.5rem; }
.page-head h1 {
  font-size: 1.6rem;
  margin: 0 0 0.35rem;
  font-weight: 700;
  letter-spacing: -0.015em;
}
.page-sub {
  color: var(--text-dim);
  margin: 0;
  font-size: 0.95rem;
}

/* ---------- Breadcrumbs ---------- */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9rem;
  flex-wrap: wrap;
}
.crumb {
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-pill);
  color: var(--text-dim);
  text-decoration: none;
  transition: all 0.15s;
  font-weight: 500;
}
.crumb:hover {
  background: var(--surface-2);
  color: var(--text);
}
.crumb-current {
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
}
.crumb-sep {
  color: var(--text-muted);
  font-weight: 400;
}

/* ---------- File list ---------- */
.file-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.file-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: linear-gradient(180deg, rgba(28, 33, 72, 0.6) 0%, rgba(20, 24, 56, 0.6) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text);
  transition: transform 0.15s, border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.file-row:hover {
  border-color: var(--primary-light);
  background: linear-gradient(180deg, rgba(40, 46, 98, 0.7) 0%, rgba(28, 33, 72, 0.7) 100%);
  transform: translateX(3px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  color: var(--text);
}
.file-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(107, 116, 217, 0.1);
  border-radius: var(--radius-md);
  flex-shrink: 0;
  color: var(--primary-light);
  border: 1px solid rgba(107, 116, 217, 0.15);
}
.file-icon svg { width: 22px; height: 22px; }
.folder-icon {
  background: rgba(240, 116, 42, 0.08);
  color: var(--accent);
  border-color: rgba(240, 116, 42, 0.18);
}

/* ---------- File-type icon colours ---------- */
.file-icon.icon-pdf     { background: rgba(239, 68, 68, 0.14);   color: #ff6b6b; border-color: rgba(239, 68, 68, 0.28); }
.file-icon.icon-word    { background: rgba(43, 92, 224, 0.16);   color: #7c93ea; border-color: rgba(43, 92, 224, 0.30); }
.file-icon.icon-excel   { background: rgba(34, 197, 94, 0.14);   color: #4ade80; border-color: rgba(34, 197, 94, 0.28); }
.file-icon.icon-ppt     { background: rgba(240, 116, 42, 0.14);  color: #ffa574; border-color: rgba(240, 116, 42, 0.28); }
.file-icon.icon-image   { background: rgba(168, 85, 247, 0.14);  color: #c084fc; border-color: rgba(168, 85, 247, 0.28); }
.file-icon.icon-video   { background: rgba(236, 72, 153, 0.14);  color: #f472b6; border-color: rgba(236, 72, 153, 0.28); }
.file-icon.icon-audio   { background: rgba(20, 184, 166, 0.14);  color: #2dd4bf; border-color: rgba(20, 184, 166, 0.28); }
.file-icon.icon-archive { background: rgba(234, 179, 8, 0.14);   color: #facc15; border-color: rgba(234, 179, 8, 0.28); }
.file-icon.icon-code    { background: rgba(6, 182, 212, 0.14);   color: #22d3ee; border-color: rgba(6, 182, 212, 0.28); }
.file-icon.icon-text    { background: rgba(148, 163, 184, 0.14); color: #cbd5e1; border-color: rgba(148, 163, 184, 0.28); }

.file-meta {
  flex: 1;
  min-width: 0;
}
.file-name {
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-sub {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 3px;
}
.file-action { flex-shrink: 0; }
.download-btn {
  display: inline-block;
  padding: 0.45rem 1rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--text-dim);
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.15s;
}
.file-row:hover .download-btn {
  background: linear-gradient(180deg, var(--primary-hover) 0%, var(--primary) 100%);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 2px 10px var(--primary-glow);
}
.chev {
  color: var(--text-muted);
  font-size: 1.75rem;
  transition: transform 0.15s, color 0.15s;
  line-height: 1;
}
.file-row:hover .chev {
  transform: translateX(4px);
  color: var(--accent);
}

/* ---------- Empty state ---------- */
.empty-state {
  text-align: center;
  padding: 4.5rem 2rem;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  color: var(--text-dim);
}
.empty-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1.25rem;
  color: var(--text-muted);
  opacity: 0.6;
}
.empty-icon svg { width: 100%; height: 100%; }
.empty-text {
  font-size: 1rem;
  margin: 0 0 0.5rem;
  color: var(--text);
}
.empty-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}

/* ---------- Alerts ---------- */
.alert {
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
  border: 1px solid transparent;
}
.alert-error {
  background: rgba(224, 75, 75, 0.1);
  border-color: rgba(224, 75, 75, 0.3);
  color: #ffb8b8;
}
.alert-info {
  background: rgba(107, 116, 217, 0.1);
  border-color: rgba(107, 116, 217, 0.3);
  color: #cfd4f5;
}

/* ---------- Notice / cards ---------- */
.notice {
  padding: 1rem 1.25rem;
  background: rgba(240, 116, 42, 0.08);
  border: 1px solid rgba(240, 116, 42, 0.25);
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
}
.notice strong { color: var(--accent); display: block; margin-bottom: 0.25rem; }
.notice p { margin: 0; color: var(--text-dim); font-size: 0.9rem; line-height: 1.6; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}
.card-head h2 {
  margin: 0 0 1.25rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.admin-form .btn { margin-top: 0.25rem; }

/* ---------- Tables ---------- */
.users-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.users-table th {
  text-align: left;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-dim);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
}
.users-table td {
  padding: 0.9rem 0.85rem;
  border-bottom: 1px solid var(--border);
}
.users-table tr:last-child td { border-bottom: 0; }
.status-pill {
  display: inline-block;
  padding: 0.2rem 0.7rem;
  border-radius: var(--radius-pill);
  background: rgba(107, 116, 217, 0.15);
  color: var(--primary-light);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.empty-line {
  color: var(--text-muted);
  margin: 0;
  padding: 0.5rem 0;
  font-size: 0.9rem;
}

/* ---------- Admin file manager ---------- */
.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 2rem;
  align-items: flex-end;
}
.action-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin: 0;
}
.action-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-right: 0.2rem;
  width: 100%;
}
.action-inline input[type="text"] {
  padding: 0.55rem 0.9rem;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  min-width: 220px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.action-inline input[type="text"]:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(107, 116, 217, 0.18);
}
.action-inline input[type="file"] {
  color: var(--text-dim);
  font-size: 0.85rem;
  max-width: 320px;
}
.action-inline input[type="file"]::file-selector-button {
  padding: 0.45rem 0.9rem;
  margin-right: 0.6rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--text-dim);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.action-inline input[type="file"]::file-selector-button:hover {
  border-color: var(--primary-light);
  color: var(--text);
}
.action-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.file-row-admin {
  padding: 0;
  display: flex;
  align-items: stretch;
}
.file-row-admin .file-row-main {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  flex: 1;
  min-width: 0;
  text-decoration: none;
  color: var(--text);
}
.file-row-admin .file-row-main:hover {
  color: var(--text);
}
.row-delete-form {
  display: flex;
  align-items: center;
  padding-right: 0.75rem;
  margin: 0;
}
.btn-delete {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}
.btn-delete:hover {
  background: rgba(224, 75, 75, 0.12);
  border-color: rgba(224, 75, 75, 0.35);
  color: #ff8888;
}
.btn-delete:focus-visible {
  outline: 2px solid var(--primary-light);
  outline-offset: 2px;
}

/* ---------- Activity log ---------- */
.activity-filters {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.filter-pill {
  padding: 0.45rem 1rem;
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  border: 1px solid var(--border);
  transition: all 0.15s;
}
.filter-pill:hover { color: var(--text); border-color: var(--primary-light); background: var(--surface-2); }
.filter-pill-active {
  background: linear-gradient(180deg, var(--primary-hover), var(--primary));
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 4px 12px var(--primary-glow);
}
.filter-pill-active:hover { color: #fff; }

.activity-card { padding: 0; overflow: hidden; }
.activity-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.activity-table th {
  text-align: left;
  padding: 0.8rem 1rem;
  background: rgba(0, 0, 0, 0.25);
  border-bottom: 1px solid var(--border);
  color: var(--text-dim);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.7rem;
}
.activity-table td {
  padding: 0.7rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}
.activity-table tbody tr:last-child td { border-bottom: 0; }
.activity-table tbody tr:hover { background: rgba(255, 255, 255, 0.02); }
.activity-when {
  color: var(--text-dim);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  font-size: 0.82rem;
}
.activity-actor { font-weight: 600; }
.activity-details {
  color: var(--text-dim);
  display: flex;
  gap: 0.6rem;
  align-items: center;
  flex-wrap: wrap;
}
.activity-path {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.82rem;
  color: var(--text);
  word-break: break-all;
}
.activity-size, .activity-role, .activity-ip {
  font-size: 0.75rem;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text-muted);
  white-space: nowrap;
}
.activity-role { color: var(--primary-light); border-color: rgba(107, 116, 217, 0.3); background: rgba(107, 116, 217, 0.08); }

.event-pill {
  display: inline-block;
  padding: 0.2rem 0.7rem;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
  border: 1px solid transparent;
}
.pill-green { background: rgba(34, 197, 94, 0.12);   color: #4ade80; border-color: rgba(34, 197, 94, 0.28); }
.pill-red   { background: rgba(239, 68, 68, 0.12);   color: #ff8888; border-color: rgba(239, 68, 68, 0.28); }
.pill-blue  { background: rgba(107, 116, 217, 0.14); color: var(--primary-light); border-color: rgba(107, 116, 217, 0.3); }
.pill-amber { background: rgba(234, 179, 8, 0.12);   color: #facc15; border-color: rgba(234, 179, 8, 0.28); }
.pill-grey  { background: rgba(148, 163, 184, 0.12); color: #cbd5e1; border-color: rgba(148, 163, 184, 0.28); }

/* ---------- Blacklist panel ---------- */
.blacklist-head { display: flex; align-items: center; justify-content: space-between; }
.blacklist-head h2 { margin: 0 0 1.25rem; }
.inline-form { margin: 0 0 1.25rem; }
.blacklist-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.blacklist-table th {
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-dim);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.7rem;
}
.blacklist-table td {
  padding: 0.7rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}
.blacklist-table tr:last-child td { border-bottom: 0; }
.atrisk-head {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 1.25rem 0 0.5rem;
}

.users-live-table .user-username {
  color: var(--text-muted);
  font-size: 0.78rem;
  margin-top: 2px;
}
.activity-ip-cell {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.82rem;
  color: var(--text-dim);
  white-space: nowrap;
}
.session-you {
  display: inline-block;
  padding: 0.2rem 0.7rem;
  border-radius: var(--radius-pill);
  background: rgba(107, 116, 217, 0.15);
  color: var(--primary-light);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 1px solid rgba(107, 116, 217, 0.3);
}

/* ---------- Pagination ---------- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.25rem;
  padding: 0.25rem 0.25rem 2rem;
}
.pagination-info {
  font-size: 0.85rem;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}
.pagination-standalone {
  text-align: center;
  padding: 1.5rem 0;
}
.btn.btn-disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

/* ---------- Error page ---------- */
.error-title {
  font-size: 1.3rem;
  margin: 0 0 0.5rem;
  font-weight: 700;
}
.error-msg {
  color: var(--text-dim);
  margin: 0 0 1.5rem;
}
.error-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 3rem 2rem;
  text-align: center;
  max-width: 520px;
  margin: 2rem auto;
}

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .topbar {
    padding: 0.75rem 1rem;
    gap: 1rem;
    flex-wrap: wrap;
  }
  .brand-sub { display: none; }
  .topnav { margin-left: 0; order: 3; width: 100%; }
  .container { padding: 1.25rem 1rem; }
  .field-row { grid-template-columns: 1fr; }
  .auth-card { padding: 2rem 1.5rem; }
  .user-info { display: none; }
  .file-row { padding: 0.85rem 1rem; }
  .file-name { font-size: 0.9rem; }
}
