/* ============================================
   Concursos Publicos — Premium UI
   Ethereal Glass (dark) + Asymmetrical layout
   ============================================ */

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

:root {
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  --bg: #f1f5f9;
  --surface: #ffffff;
  --surface-elevated: #ffffff;
  --border: rgba(0,0,0,0.06);
  --border-light: rgba(0,0,0,0.03);
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --accent: #0b7d72;
  --accent-hover: #0f766e;
  --accent-subtle: rgba(11,125,114,0.08);
  --danger: #e63946;
  --danger-hover: #c1121f;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.08);
  --shadow-xl: 0 20px 60px rgba(0,0,0,0.1);

  --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --transition: 0.4s cubic-bezier(0.32, 0.72, 0, 1);
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Noise overlay */
.noise-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.015;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

/* ============ BUTTONS ============ */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn:hover { background: #f1f5f9; transform: translateY(-1px); }
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 14px rgba(11,125,114,0.25);
}
.btn-primary:hover { background: var(--accent-hover); box-shadow: 0 6px 20px rgba(11,125,114,0.35); }

.btn-secondary {
  background: var(--accent-subtle);
  color: var(--accent);
  border: 1px solid rgba(11,125,114,0.15);
}
.btn-secondary:hover { background: rgba(11,125,114,0.15); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: rgba(0,0,0,0.04); color: var(--text-primary); }

.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover { background: var(--danger-hover); }

.btn-icon-only {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}
.btn-icon-only:hover { background: rgba(0,0,0,0.05); color: var(--text-primary); }

.btn-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.2);
  transition: all var(--transition);
}
.btn-primary:hover .btn-icon-wrap { transform: translateX(2px) scale(1.05); }

.btn-add {
  padding: 8px 16px;
  font-size: 0.8125rem;
}

/* ============ HEADER ============ */
header {
  background: rgba(15,23,42,0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.header-left { display: flex; align-items: center; gap: 10px; }
.header-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.logo-icon { color: #14b8a6; font-size: 1.2rem; }
.version-tag {
  font-size: 0.65rem;
  font-weight: 500;
  color: rgba(255,255,255,0.35);
  background: rgba(255,255,255,0.06);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}
.header-nav { display: flex; align-items: center; gap: 4px; }
.nav-link {
  padding: 8px 16px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  text-decoration: none;
}
.nav-link:hover { color: #fff; background: rgba(255,255,255,0.06); }
.nav-link.active { color: #fff; background: rgba(255,255,255,0.08); }

/* ============ LOGO ANIMATION ============ */
.logo-svg {
  animation: logoPulse 4s var(--transition) infinite;
  filter: drop-shadow(0 0 8px rgba(20,184,166,0.15));
}
@keyframes logoPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.04); opacity: 0.85; }
}

/* ============ PAGE TRANSITIONS ============ */
.page, .page-login {
  animation: pageFadeIn 0.5s var(--transition);
}
@keyframes pageFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============ RESULT CARD ENTRANCE ============ */
.result-card {
  animation: cardSlideUp 0.5s var(--transition) both;
}
.result-card:nth-child(1) { animation-delay: 0.02s; }
.result-card:nth-child(2) { animation-delay: 0.06s; }
.result-card:nth-child(3) { animation-delay: 0.10s; }
.result-card:nth-child(4) { animation-delay: 0.14s; }
.result-card:nth-child(5) { animation-delay: 0.18s; }
.result-card:nth-child(6) { animation-delay: 0.22s; }
.result-card:nth-child(7) { animation-delay: 0.26s; }
.result-card:nth-child(8) { animation-delay: 0.30s; }
.result-card:nth-child(9) { animation-delay: 0.34s; }
.result-card:nth-child(10) { animation-delay: 0.38s; }
.result-card:nth-child(n+11) { animation-delay: 0.42s; }

@keyframes cardSlideUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============ LOGIN ============ */
.page-login {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
  overflow: hidden;
}
.login-bg-shapes {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.15;
}
.shape-1 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, #14b8a6, transparent);
  top: -200px; right: -200px;
  animation: shapeFloat1 20s ease-in-out infinite;
}
.shape-2 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, #0ea5e9, transparent);
  bottom: -150px; left: -150px;
  animation: shapeFloat2 25s ease-in-out infinite;
}
.shape-3 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, #8b5cf6, transparent);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  animation: shapeFloat3 30s ease-in-out infinite;
}
@keyframes shapeFloat1 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-40px, 40px); }
}
@keyframes shapeFloat2 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(40px, -40px); }
}
@keyframes shapeFloat3 {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.2); }
}

.login-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: rgba(255,255,255,0.04);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-radius: var(--radius-xl);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 24px 80px rgba(0,0,0,0.4);
  overflow: hidden;
  animation: loginCardEntrance 0.8s var(--transition);
}
@keyframes loginCardEntrance {
  from { opacity: 0; transform: translateY(30px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.login-card-inner {
  padding: 40px 40px 24px;
  text-align: center;
}
.login-emblem {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(11,125,114,0.2), rgba(11,125,114,0.05));
  border: 1px solid rgba(255,255,255,0.08);
  margin: 0 auto 24px;
}
.emblem-icon { color: #14b8a6; font-size: 1.8rem; }
.login-title {
  color: #fff;
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 8px;
}
.login-subtitle {
  color: rgba(255,255,255,0.45);
  font-size: 0.8125rem;
  font-weight: 400;
  margin-bottom: 24px;
  line-height: 1.5;
}
.login-fields { margin-bottom: 16px; }
.input-group {
  position: relative;
  margin-bottom: 14px;
}
.login-input {
  width: 100%;
  padding: 14px 16px 10px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-sm);
  color: #fff;
  font-family: var(--font);
  font-size: 0.875rem;
  outline: none;
  transition: all var(--transition);
}
.login-input:focus { border-color: rgba(11,125,114,0.5); background: rgba(255,255,255,0.08); box-shadow: 0 0 0 3px rgba(11,125,114,0.1); }
.login-input::placeholder { color: transparent; }
.login-input:not(:placeholder-shown) + .input-label,
.login-input:focus + .input-label {
  transform: translateY(-20px) scale(0.85);
  color: rgba(255,255,255,0.4);
}
.input-label {
  position: absolute;
  left: 16px;
  top: 14px;
  color: rgba(255,255,255,0.3);
  font-size: 0.875rem;
  pointer-events: none;
  transition: all var(--transition);
}
.login-btn {
  width: 100%;
  padding: 14px 24px;
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
}
.login-btn .btn-icon-wrap { background: rgba(255,255,255,0.15); }
.login-error {
  margin-top: 12px;
  font-size: 0.8125rem;
  color: #fb7185;
  min-height: 1.2em;
}
.login-card-footer {
  padding: 16px 40px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.login-card-footer p {
  color: rgba(255,255,255,0.2);
  font-size: 0.75rem;
  text-align: center;
}

/* ============ DASHBOARD ============ */
.dashboard-header {
  max-width: 1400px;
  margin: 0 auto;
  padding: 16px 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.status-text { font-size: 0.8125rem; color: var(--text-secondary); font-weight: 500; }
.result-count {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-subtle);
  padding: 4px 12px;
  border-radius: var(--radius-full);
}

.toolbar {
  max-width: 1400px;
  margin: 0 auto;
  padding: 12px 24px;
}
.toolbar-row { margin-bottom: 8px; }
.toolbar-row:last-child { margin-bottom: 0; }
.toolbar-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.toolbar-filters select, .toolbar-filters input {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-family: var(--font);
  font-size: 0.8125rem;
  color: var(--text-primary);
  outline: none;
  transition: all var(--transition);
}
.toolbar-filters select:focus, .toolbar-filters input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-subtle); }
.toolbar-filters input { flex: 1; min-width: 150px; }

.deadline-filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.dl-label { font-size: 0.8125rem; font-weight: 600; color: var(--text-secondary); }
.dl-input {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-family: var(--font);
  font-size: 0.8125rem;
  color: var(--text-primary);
  outline: none;
  transition: all var(--transition);
}
.dl-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-subtle); }
.dl-sep { font-size: 0.8125rem; color: var(--text-muted); }

/* ============ RESULTS ============ */
.results {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px 32px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.result-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}
.result-card:hover {
  border-color: rgba(11,125,114,0.2);
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
  transform: translateY(-2px);
}
.result-card:active { transform: scale(0.995); }

.deadline-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.deadline-bar .bar-track {
  flex: 1;
  height: 6px;
  background: #e2e8f0;
  border-radius: var(--radius-full);
  overflow: hidden;
}
.deadline-bar .bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.5s var(--transition);
}
.deadline-text { font-weight: 700; font-size: 0.8125rem; letter-spacing: -0.01em; }
.deadline-urgent .deadline-text { color: var(--danger); }
.deadline-warning .deadline-text { color: #d97706; }
.deadline-ok .deadline-text { color: #0d9488; }
.deadline-date { font-size: 0.75rem; color: var(--text-muted); font-weight: 500; }

.result-card .title {
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: 6px;
  line-height: 1.4;
}
.result-card .title a { color: var(--text-primary); text-decoration: none; }
.result-card .title a:hover { color: var(--accent); }
.result-card .meta {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}
.result-card .meta span { display: inline-flex; align-items: center; gap: 4px; }
.keyword-tag {
  display: inline-block;
  background: var(--accent-subtle);
  color: var(--accent);
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: 0.6875rem;
  font-weight: 600;
}

/* ============ CONFIG ============ */
.config-container {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}
.config-header { margin-bottom: 24px; }
.config-header h2 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.config-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 16px;
  transition: all var(--transition);
}
.config-section:hover { border-color: rgba(0,0,0,0.08); transform: translateY(-1px); box-shadow: 0 4px 20px rgba(0,0,0,0.04); }
.config-section-header { margin-bottom: 16px; }
.config-section h3 { font-size: 1rem; font-weight: 700; margin-bottom: 2px; }
.config-desc { font-size: 0.8125rem; color: var(--text-muted); line-height: 1.5; }
.section-label { font-size: 0.8125rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 8px; }

.search-row, .inline-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  align-items: center;
}
.search-row input[type="text"] { flex: 1; }
.search-row input[type="number"] { width: 80px; }
.search-row input, .inline-row input {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.8125rem;
  outline: none;
  transition: all var(--transition);
}
.search-row input:focus, .inline-row input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-subtle); }

.input-full { width:100%; padding:10px 14px; border:1px solid var(--border); border-radius:var(--radius-sm); font-family:var(--font); font-size:0.8125rem; box-sizing:border-box; outline:none; transition: all var(--transition); }
.input-full:focus { border-color:var(--accent); box-shadow: 0 0 0 3px var(--accent-subtle); }
.grid-2 { display:grid; grid-template-columns:1fr 1fr; gap:10px; }

/* Toggle Switch */
.toggle-row {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  padding: 4px 0;
}
.toggle-row input[type="checkbox"] { display: none; }
.toggle-track {
  position: relative;
  width: 44px;
  height: 24px;
  border-radius: var(--radius-full);
  background: #cbd5e1;
  transition: all 0.3s var(--transition);
  flex-shrink: 0;
}
.toggle-row input:checked + .toggle-track { background: var(--accent); }
.toggle-thumb {
  position: absolute;
  top: 2px; left: 2px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
  transition: all 0.3s var(--transition);
}
.toggle-row input:checked + .toggle-track .toggle-thumb { left: 22px; }
.toggle-row:active .toggle-thumb { transform: scale(0.92); }
.toggle-label { font-size: 0.875rem; font-weight: 500; color: var(--text-primary); }

.interval-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}
.interval-row input {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.8125rem;
  outline: none;
}
.interval-row span { font-size: 0.8125rem; color: var(--text-secondary); }

.config-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 24px;
}

.inline-msg { font-size: 0.8125rem; color: var(--text-muted); margin-left: 8px; }

/* ============ SUGGEST CLOUD ============ */
.suggest-cloud {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 24px;
}
.chip {
  background: var(--accent-subtle);
  color: var(--accent);
  border: 1px solid rgba(11,125,114,0.15);
  border-radius: var(--radius-full);
  padding: 5px 14px;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}
.chip:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.suggest-loading, .suggest-error { font-size: 0.8125rem; color: var(--text-muted); }

/* ============ USER ROWS ============ */
.user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  font-size: 0.875rem;
}
.user-row small { color: var(--text-muted); }
.btn-sm { padding: 6px 12px; font-size: 0.75rem; }

/* ============ MODALS ============ */
.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.modal-content {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 80px rgba(0,0,0,0.2);
  animation: modalIn 0.3s var(--transition);
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-header {
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}
.modal-header-left { display: flex; align-items: center; gap: 10px; }
.modal-header-left h2 { font-size: 1.1rem; font-weight: 700; }
.modal-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
}
.modal-icon-error { background: rgba(230,57,70,0.1); color: var(--danger); }
.modal-footer {
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid var(--border);
}
.modal-body { padding: 20px 24px; overflow-y: auto; flex: 1; }
.modal-body hr { margin: 16px 0; border: none; border-top: 1px solid var(--border); }
.modal-body label { font-size: 0.875rem; color: var(--text-secondary); }

.modal-detail { max-width: 720px; }

/* Error items */
.error-item {
  background: rgba(230,57,70,0.04);
  border: 1px solid rgba(230,57,70,0.15);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 8px;
  font-size: 0.8125rem;
}
.error-item strong { color: var(--danger); }
.error-detail { color: var(--text-secondary); word-break: break-all; font-family: 'JetBrains Mono', monospace; font-size: 0.75rem; }

/* Detail table */
.detail-table { width: 100%; border-collapse: collapse; font-size: 0.8125rem; }
.detail-table tr { border-bottom: 1px solid var(--border); }
.detail-table tr:last-child { border-bottom: none; }
.detail-table td { padding: 10px 4px; vertical-align: top; }
.detail-label { width: 140px; font-weight: 600; color: var(--text-secondary); white-space: nowrap; }
.detail-value { color: var(--text-primary); word-break: break-word; }
.detail-value a { color: var(--accent); text-decoration: none; font-weight: 600; }
.detail-value a:hover { text-decoration: underline; }

/* ============ LOADING ============ */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 999;
}
.loading-spinner { margin-bottom: 20px; }
.spinner-ring {
  width: 44px;
  height: 44px;
  border: 3px solid #e2e8f0;
  border-top-color: var(--accent);
  border-bottom-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
.loading-text { font-size: 0.9375rem; font-weight: 600; color: var(--text-secondary); animation: loadingFade 0.6s var(--transition) 0.2s both; }
@keyframes loadingFade {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============ EMPTY STATE ============ */
.empty-state {
  text-align: center;
  padding: 64px 24px;
  color: var(--text-muted);
}
.empty-state p { font-size: 1rem; margin-bottom: 4px; }

/* ============ FOCUS ============ */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
  .header-inner { height: auto; padding: 12px 16px; flex-wrap: wrap; }
  .header-nav { order: 3; width: 100%; justify-content: center; }

  .login-card-inner { padding: 40px 24px 24px; }
  .login-title { font-size: 1.5rem; }

  .dashboard-header { padding: 12px 16px 0; flex-direction: column; gap: 8px; align-items: flex-start; }
  .toolbar { padding: 8px 16px; }
  .toolbar-filters { flex-direction: column; }
  .toolbar-filters input { min-width: auto; }
  .deadline-filter-row { flex-wrap: wrap; }

  .results { padding: 0 16px 24px; }

  .config-container { padding: 24px 16px 40px; }
  .config-section { padding: 20px; }
  .grid-2 { grid-template-columns: 1fr; }
  .config-actions { flex-direction: column; }
  .config-actions .btn { width: 100%; }
  .inline-row { flex-wrap: wrap; }
  .inline-row .btn { width: 100%; }

  .detail-table, .detail-table tbody, .detail-table tr, .detail-table td { display: block; }
  .detail-table tr { padding: 10px 0; }
  .detail-label { width: auto; white-space: normal; }

  .modal-content { width: 95%; max-height: 90vh; }
}

/* Page switching */
.page { display: none; }
.page-login { display: flex; }
