:root {
  --bg: #6b7080;
  --surface: rgba(255,255,255,0.04);
  --surface-hover: rgba(255,255,255,0.07);
  --border: rgba(255,255,255,0.08);
  --border-hover: rgba(255,255,255,0.15);
  --text: #e2e8f0;
  --text-muted: #64748b;
  --text-dim: #475569;
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --accent-glow: rgba(99,102,241,0.15);
  --green: #22c55e;
  --green-bg: rgba(34,197,94,0.1);
  --red: #ef4444;
  --red-bg: rgba(239,68,68,0.1);
  --yellow: #eab308;
  --radius: 12px;
  --radius-sm: 8px;
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  min-height: 100vh;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* ================================ */
/*        PORTAL (login WiFi)       */
/* ================================ */

.portal-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  padding-bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px));
  background: radial-gradient(ellipse at 50% 0%, rgba(255,229,0,0.03) 0%, transparent 50%), #0d0d0d;
}

.portal {
  width: 100%;
  max-width: 380px;
}

.portal .card {
  background: #161616;
  border: 1px solid #252525;
  border-radius: 16px;
  padding: 2.5rem 2rem 2rem;
  position: relative;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

/* Card transitions */
.card-animated {
  display: none;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.card-animated.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
  animation: cardEnter 0.4s ease forwards;
}

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

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-4px); }
  40%, 80% { transform: translateX(4px); }
}
.shake { animation: shake 0.4s ease; }

/* Button spinner */
.btn-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(13,13,13,0.3);
  border-top-color: #0d0d0d;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Success animation */
.success-check {
  width: 72px;
  height: 72px;
  margin: 1rem auto 1.25rem;
}
.success-svg { width: 72px; height: 72px; }
.success-circle {
  stroke-dasharray: 150;
  stroke-dashoffset: 150;
  animation: drawCircle 0.5s ease forwards;
}
.success-tick {
  stroke-dasharray: 40;
  stroke-dashoffset: 40;
  animation: drawTick 0.3s ease 0.4s forwards;
}
@keyframes drawCircle { to { stroke-dashoffset: 0; } }
@keyframes drawTick { to { stroke-dashoffset: 0; } }

/* Progress bar */
.progress-bar {
  width: 100%;
  height: 3px;
  background: #252525;
  border-radius: 3px;
  overflow: hidden;
  margin-top: 0.5rem;
}
.progress-fill {
  height: 100%;
  background: #ffe500;
  border-radius: 3px;
  width: 0%;
  transition: width 1.6s ease;
}

/* Welcome page ring countdown */
.welcome-enter { animation: cardEnter 0.5s ease forwards; }

.welcome-check-ring {
  width: 72px;
  height: 72px;
  margin: 0 auto 1.25rem;
  position: relative;
}
.welcome-ring-svg {
  width: 72px;
  height: 72px;
}
.ring-progress {
  transition: stroke-dashoffset 1s linear;
}
.welcome-check-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 52px;
  height: 52px;
}
.welcome-btn {
  display: block;
  text-align: center;
  text-decoration: none;
  margin-top: 0.75rem;
  width: 100%;
}
.welcome-fallback {
  color: #666;
  font-size: 0.82rem;
  margin-top: 0.75rem;
  animation: fadeIn 0.3s ease;
}

.btn-subtle {
  background: none;
  border: none;
  color: #666;
  font-size: 0.73rem;
  cursor: pointer;
  transition: color 0.2s;
  padding: 0;
}

.btn-subtle:hover {
  color: #888;
}

.portal .card h2 {
  color: #ffffff;
  text-align: center;
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 1.25rem;
}

.card-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.card-logo img {
  width: 100px;
  height: auto;
}

.portal .input-field {
  background: #0d0d0d;
  border: 1px solid #2a2a2a;
  color: #ffffff;
  border-radius: 10px;
  padding: 0.8rem 1rem;
}

.portal .input-field::placeholder {
  color: #555;
}

.portal .input-field {
  font-size: 1rem;
}
.portal .input-field:focus {
  border-color: #ffe500;
  box-shadow: 0 0 0 3px rgba(255,229,0,0.2);
  outline: none;
}

.portal .input-group label {
  color: #888;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.portal .lgpd-notice {
  color: #666;
}

.portal .checkbox-label {
  color: #777;
}

.portal .btn-primary {
  background: #ffe500;
  color: #0d0d0d;
  border-radius: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-top: 0.75rem;
}

.portal .btn-primary:hover { background: #fff033; }
.portal .btn-primary:active { transform: scale(0.97); }

.portal .btn-primary:disabled {
  background: #3a3a00;
  color: #666;
}

.portal .link-btn { color: #ffe500; font-size: 0.82rem; }
.portal .link-btn:hover { color: #fff566; }
.portal .checkbox-label a { color: #ffe500; }
.portal .checkbox-label a:hover { color: #fff566; }

/* Float label input */
.input-float {
  position: relative;
  margin-bottom: 0.75rem;
}

.input-float-field {
  width: 100%;
  padding: 1.1rem 1rem 0.5rem;
  background: #0d0d0d;
  border: 1px solid #2a2a2a;
  border-radius: 10px;
  color: #fff;
  font-size: 1.05rem;
  outline: none;
  transition: border-color 0.2s;
}

.input-float label {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #555;
  font-size: 0.95rem;
  pointer-events: none;
  transition: all 0.2s ease;
}

.input-float-field:focus,
.input-float-field:not(:placeholder-shown) {
  border-color: #ffe500;
  box-shadow: 0 0 0 3px rgba(255,229,0,0.2);
}

.input-float-field:focus + label,
.input-float-field:not(:placeholder-shown) + label {
  top: 0.45rem;
  transform: none;
  font-size: 0.65rem;
  color: #ffe500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

/* Bottom row (Cadastre-se · Usuário e senha) */
.card-bottom-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  margin-top: 1.25rem;
}

.card-bottom-row .link-btn {
  margin: 0;
  width: auto;
  font-size: 0.8rem;
}

.card-bottom-dot {
  width: 3px;
  height: 3px;
  background: #444;
  border-radius: 50%;
  flex-shrink: 0;
}

.portal-brand {
  text-align: center;
  margin-bottom: 2rem;
}

.portal-brand .wifi-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 1rem;
  background: var(--accent-glow);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-hover);
}

.portal-logo {
  width: 200px;
  max-width: 200px;
  height: auto;
  display: block;
  margin: 0 auto 0.75rem;
}

.portal-brand h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.portal-brand p {
  color: #475569;
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  backdrop-filter: blur(12px);
}

.card h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  letter-spacing: -0.01em;
}

.input-group {
  margin-bottom: 0.75rem;
}

.input-group label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
  font-weight: 500;
}

.input-field {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(0,0,0,0.25);
  color: var(--text);
  font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.input-field:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.input-field::placeholder { color: var(--text-dim); }

select.input-field {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
}

select.input-field option {
  background: #1e293b;
  color: var(--text);
}

.btn-primary {
  width: 100%;
  padding: 0.75rem;
  margin-top: 0.5rem;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.link-btn {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  margin-top: 1rem;
  font-size: 0.85rem;
  width: 100%;
  text-align: center;
  display: block;
  text-decoration: none;
}

.link-btn:hover { text-decoration: underline; }

.link-btn-dim {
  color: #444;
  font-size: 0.72rem;
  margin-top: 0.5rem;
  border: 1px solid #2a2a2a;
  border-radius: 6px;
  padding: 0.35rem 0.75rem;
  background: transparent;
  transition: all 0.2s;
}

.link-btn-dim:hover {
  color: #777;
  border-color: #444;
  background: rgba(255,255,255,0.03);
  text-decoration: none;
}

/* Modal de Termos */
.termos-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 1rem;
  animation: fadeIn 0.15s ease;
}

.termos-modal {
  background: #141825;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 600px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  animation: modalIn 0.2s ease;
}

.termos-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.termos-header h3 {
  font-size: 1.05rem;
  font-weight: 600;
}

.termos-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0 0.25rem;
  line-height: 1;
}

.termos-close:hover { color: var(--text); }

.termos-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
  font-size: 0.88rem;
  line-height: 1.7;
  color: var(--text-muted);
}

.termos-body h4 {
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 600;
  margin: 1.5rem 0 0.75rem;
}

.termos-body h4:first-child { margin-top: 0; }

.termos-body p { margin-bottom: 0.75rem; }

.termos-body strong { color: var(--text); }

.termos-body ul {
  margin: 0.5rem 0 0.75rem 1.25rem;
  padding: 0;
}

.termos-body li {
  margin-bottom: 0.35rem;
}

.termos-body a { color: var(--accent-hover); }

.termos-update {
  margin-top: 1.5rem;
  font-size: 0.8rem;
  color: var(--text-dim);
  font-style: italic;
}

.termos-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  flex-shrink: 0;
}

.checkbox-label a {
  color: var(--accent-hover);
  text-decoration: none;
}

.checkbox-label a:hover { text-decoration: underline; }

/* Welcome page */
.welcome-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 1.5rem;
  text-align: center;
  backdrop-filter: blur(12px);
}

.welcome-logo {
  width: 100px;
  height: auto;
  margin: 0 auto 1.25rem;
  display: block;
}

.welcome-check {
  width: 48px;
  height: 48px;
  margin: 0 auto 1rem;
  background: var(--green-bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--green);
}

.welcome-card h1 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.welcome-sub {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.welcome-divider {
  width: 40px;
  height: 2px;
  background: var(--border);
  margin: 1.25rem auto;
}

.welcome-redirect {
  color: var(--text-dim);
  font-size: 0.88rem;
}

.welcome-redirect span {
  color: var(--accent-hover);
  font-weight: 600;
}

.lgpd-notice {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  line-height: 1.5;
}

.lgpd-notice a { color: var(--accent-hover); }

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0.75rem 0;
  cursor: pointer;
  line-height: 1.4;
}

.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin-top: 1px;
  accent-color: var(--accent);
  flex-shrink: 0;
}

.portal-footer {
  text-align: center;
  margin-top: 3rem;
  font-size: 0.72rem;
  color: #444;
}

.portal-footer a {
  display: inline-block;
  margin-top: 0.5rem;
  color: #555;
  text-decoration: none;
  font-size: 0.75rem;
}

.portal-footer a:hover { color: #ffe500; }

.alert {
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.alert-error {
  background: var(--red-bg);
  border: 1px solid rgba(239,68,68,0.2);
  color: #fca5a5;
}

.alert-info {
  background: var(--accent-glow);
  border: 1px solid rgba(99,102,241,0.2);
  color: var(--accent-hover);
}

.alert-success {
  background: var(--green-bg);
  border: 1px solid rgba(34,197,94,0.2);
  color: #86efac;
}

/* ================================ */
/*      ADMIN LOGIN GATE            */
/* ================================ */

.admin-gate {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background:
    radial-gradient(ellipse at 50% 50%, rgba(99,102,241,0.06) 0%, transparent 60%),
    var(--bg);
}

.admin-gate-card {
  width: 100%;
  max-width: 380px;
  text-align: center;
}

.admin-gate-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.admin-gate-card h1 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.admin-gate-card > p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0.35rem 0 1.5rem;
}

.admin-gate-card form {
  text-align: left;
}

.admin-gate-card input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.admin-gate-card input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.admin-gate-card input::placeholder { color: var(--text-dim); }

.admin-gate-card button {
  width: 100%;
  padding: 0.75rem;
  margin-top: 0.75rem;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.admin-gate-card button:hover { background: var(--accent-hover); }
.admin-gate-card button:disabled { opacity: 0.5; }

.admin-error {
  background: var(--red-bg);
  border: 1px solid rgba(239,68,68,0.2);
  color: #fca5a5;
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
}

.admin-back {
  display: inline-block;
  margin-top: 1.5rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
}

.admin-back:hover { color: var(--accent-hover); }

/* ================================ */
/*     PAINEL DE GERENCIAMENTO      */
/* ================================ */

.admin-page {
  min-height: 100vh;
  padding: 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
}

.admin-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.admin-topbar h1 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.admin-topbar p {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 0.15rem;
}

.topbar-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1.5rem;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 0.25rem;
  border: 1px solid var(--border);
  width: fit-content;
}

.tab {
  padding: 0.55rem 1.15rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.tab:hover { color: var(--text); }

.tab.active {
  background: var(--accent);
  color: white;
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* Section header */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.section-header h2 {
  font-size: 1rem;
  font-weight: 600;
}

.badge {
  background: var(--accent-glow);
  color: var(--accent-hover);
  padding: 0.1rem 0.55rem;
  border-radius: 100px;
  font-size: 0.78rem;
  font-weight: 600;
  margin-left: 0.5rem;
}

/* Table */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th {
  padding: 0.7rem 1rem;
  text-align: left;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.table td {
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.table tbody tr:last-child td { border-bottom: none; }

.table tbody tr {
  transition: background 0.15s;
}

.table tbody tr:hover { background: var(--surface-hover); }

.mono {
  font-family: 'SF Mono', 'Cascadia Code', monospace;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.status-on {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--green);
  font-size: 0.85rem;
  font-weight: 500;
}

.status-on::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--green);
}

.status-off {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--red);
  font-size: 0.85rem;
  font-weight: 500;
}

.status-off::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--red);
  border-radius: 50%;
}

.actions-cell {
  white-space: nowrap;
  display: flex;
  gap: 0.35rem;
}

/* Buttons */
.btn {
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.15s;
  white-space: nowrap;
}

.btn-sm {
  padding: 0.3rem 0.65rem;
  font-size: 0.8rem;
}

.btn-accent {
  background: var(--accent);
  color: white;
}
.btn-accent:hover { background: var(--accent-hover); }

.btn-ghost {
  background: var(--surface);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  background: var(--surface-hover);
  color: var(--text);
  border-color: var(--border-hover);
}

.btn-danger-outline {
  background: transparent;
  color: var(--red);
  border: 1px solid rgba(239,68,68,0.25);
}
.btn-danger-outline:hover {
  background: var(--red-bg);
}

.btn-green-outline {
  background: transparent;
  color: var(--green);
  border: 1px solid rgba(34,197,94,0.25);
}
.btn-green-outline:hover {
  background: var(--green-bg);
}

.btn-logout {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 0.82rem;
  cursor: pointer;
  text-decoration: none;
  padding: 0.4rem;
}
.btn-logout:hover { color: var(--red); }

.loading {
  color: var(--text-dim);
  padding: 2rem 1rem;
  text-align: center;
  font-size: 0.9rem;
}

.empty {
  color: var(--text-dim);
  font-size: 0.9rem;
  padding: 2rem 1rem;
  text-align: center;
}

/* Toast */
.toast {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  padding: 0.7rem 1.15rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 500;
  z-index: 1000;
  animation: toastIn 0.3s ease;
}

.toast-ok {
  background: rgba(34,197,94,0.9);
  color: white;
  box-shadow: 0 4px 20px rgba(34,197,94,0.3);
}

.toast-error {
  background: rgba(239,68,68,0.9);
  color: white;
  box-shadow: 0 4px 20px rgba(239,68,68,0.3);
}

@keyframes toastIn {
  from { transform: translateY(-10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  animation: fadeIn 0.15s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  background: #141825;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  width: 100%;
  max-width: 420px;
  margin: 1rem;
  animation: modalIn 0.2s ease;
}

@keyframes modalIn {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal h3 {
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
  font-weight: 600;
}

.modal .input-group { margin-bottom: 1rem; }

.modal .input-group label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
  font-weight: 500;
}

.modal .input-field {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(0,0,0,0.3);
  color: var(--text);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.modal .input-field:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.modal .input-field::placeholder { color: var(--text-dim); }

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1.75rem;
}

/* Responsive */
@media (max-width: 640px) {
  .admin-topbar { flex-direction: column; align-items: flex-start; }
  .tabs { width: 100%; }
  .tab { flex: 1; text-align: center; font-size: 0.82rem; padding: 0.5rem 0.5rem; }
  .table { font-size: 0.82rem; }
  .table th, .table td { padding: 0.55rem 0.65rem; }
  .actions-cell { flex-wrap: wrap; }
}
