/* NOVA Vault — Premium dark-first UI */
:root {
  --bg: #0a0b0d;
  --bg-elevated: #12141a;
  --bg-glass: rgba(18, 20, 26, 0.72);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #e8eaef;
  --text-muted: #8b90a0;
  --accent: #5b8def;
  --accent-hover: #7aa3f5;
  --success: #3dd68c;
  --warning: #f5a524;
  --danger: #f31260;
  --radius: 12px;
  --radius-sm: 8px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --transition: 0.18s ease;
}

@media (prefers-color-scheme: light) {
  :root.auto {
    --bg: #f4f5f7;
    --bg-elevated: #ffffff;
    --bg-glass: rgba(255, 255, 255, 0.8);
    --border: rgba(0, 0, 0, 0.08);
    --border-strong: rgba(0, 0, 0, 0.14);
    --text: #1a1d26;
    --text-muted: #5c6370;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  }
}

[data-theme="light"] {
  --bg: #f4f5f7;
  --bg-elevated: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.8);
  --border: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.14);
  --text: #1a1d26;
  --text-muted: #5c6370;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* Layout */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px;
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}
.sidebar-brand {
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  padding: 0 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.sidebar-brand .logo-mark {
  width: 28px; height: 28px;
  background: linear-gradient(135deg, #5b8def, #3dd68c);
  border-radius: 8px;
  display: grid; place-items: center;
  font-size: 0.75rem; font-weight: 800; color: #0a0b0d;
}
.nav-link {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: background var(--transition), color var(--transition);
  margin-bottom: 0.15rem;
}
.nav-link:hover, .nav-link.active {
  background: rgba(91, 141, 239, 0.12);
  color: var(--text);
}
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  position: sticky; top: 0; z-index: 10;
}
.content { padding: 1.5rem; flex: 1; }

/* Cards & surfaces */
.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.card-glass {
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-weight: 560;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), transform 0.1s;
  background: var(--accent);
  color: #fff;
}
.btn:hover { background: var(--accent-hover); }
.btn:active { transform: scale(0.98); }
.btn-ghost {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text);
}
.btn-ghost:hover { background: rgba(255,255,255,0.05); }
.btn-danger { background: var(--danger); }
.btn-sm { padding: 0.4rem 0.75rem; font-size: 0.875rem; }
.btn-block { width: 100%; }

/* Forms */
.form-group { margin-bottom: 1.1rem; }
.form-label { display: block; margin-bottom: 0.4rem; font-size: 0.875rem; color: var(--text-muted); }
.form-input {
  width: 100%;
  padding: 0.7rem 0.9rem;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  transition: border-color var(--transition);
}
.form-input:focus { border-color: var(--accent); outline: none; }
.form-error { color: var(--danger); font-size: 0.875rem; margin-top: 0.35rem; }

/* Auth pages */
.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(91, 141, 239, 0.12), transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(61, 214, 140, 0.08), transparent 50%),
    var(--bg);
}
.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: var(--shadow);
}
.auth-card h1 { margin: 0 0 0.25rem; font-size: 1.5rem; letter-spacing: -0.02em; }
.auth-card .subtitle { color: var(--text-muted); margin-bottom: 1.5rem; font-size: 0.9rem; }
.domain-badge {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.75rem;
  color: var(--success);
  background: rgba(61, 214, 140, 0.1);
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  margin-bottom: 1rem;
}

/* File grid */
.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.75rem;
}
.file-item, .folder-item {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  text-align: center;
}
.file-item:hover, .folder-item:hover {
  border-color: var(--accent);
  background: rgba(91, 141, 239, 0.06);
}
.file-icon, .folder-icon {
  width: 40px; height: 40px;
  margin: 0 auto 0.5rem;
  opacity: 0.85;
}
.file-name {
  font-size: 0.85rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-meta { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.25rem; }

/* Drop zone */
.dropzone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 2.5rem;
  text-align: center;
  color: var(--text-muted);
  transition: border-color var(--transition), background var(--transition);
  margin-bottom: 1.5rem;
}
.dropzone.dragover {
  border-color: var(--accent);
  background: rgba(91, 141, 239, 0.08);
}
.dropzone strong { color: var(--text); }

/* Security status */
.security-status {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.status-item {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
}
.status-item .label { font-size: 0.8rem; color: var(--text-muted); }
.status-item .value { font-size: 1.25rem; font-weight: 600; margin-top: 0.25rem; }
.check { color: var(--success); }

/* Tables */
.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.table th, .table td {
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
}
.table th { color: var(--text-muted); font-weight: 500; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; }

/* Official domain banner */
.official-banner {
  background: rgba(61, 214, 140, 0.08);
  border: 1px solid rgba(61, 214, 140, 0.25);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.official-banner .check-icon { color: var(--success); font-size: 1.25rem; }

/* Mobile */
.mobile-nav-toggle {
  display: none;
  background: none; border: none; color: var(--text); font-size: 1.5rem; cursor: pointer;
}
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: -260px;
    top: 0; bottom: 0;
    z-index: 100;
    transition: left 0.25s ease;
  }
  .sidebar.open { left: 0; }
  .mobile-nav-toggle { display: block; }
  .file-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .content { padding: 1rem; }
}

/* Utility */
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.875rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-2 { margin-bottom: 1rem; }
.flex { display: flex; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); border: 0;
}
