/* ═══════════════════════════════════════════════════════════
   FlowGate — Kenshin Samurai X Defence Zone
   Brand: #1e3a5f · #1e293b · #b91c1c · #64748b
   Font:  Segoe UI Variable (Microsoft)
   ═══════════════════════════════════════════════════════════ */

/* ─── GOOGLE FONT IMPORT ─────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+JP:wght@400;600&display=swap');

/* ─── RESET & ROOT ───────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --fg-primary:      #1e3a5f;
  --fg-primary-dark: #1e293b;
  --fg-accent:       #b91c1c;
  --fg-slate:        #64748b;
  --fg-bg:           #0f172a;
  --fg-surface:      #ffffff;

  /* Derived */
  --fg-accent-glow:  rgba(185, 28, 28, 0.35);
  --fg-primary-glow: rgba(30, 58, 95, 0.35);
  --transition-fast: 0.18s ease;
  --transition-med:  0.28s ease;
}

body {
  font-family:
    'Segoe UI Variable Text', 'Segoe UI Variable', 'Segoe UI',
    system-ui, Tahoma, Geneva, Verdana, sans-serif;
  background: var(--fg-bg);
  color: #334155;
  -webkit-font-smoothing: antialiased;
}

/* ─── KEYFRAME ANIMATIONS ────────────────────────────────── */
@keyframes scrollIn {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}

@keyframes pulseAccent {
  0%, 100% { box-shadow: 0 0 0 0 var(--fg-accent-glow),
                          0 25px 60px rgba(0,0,0,0.42); }
  50%       { box-shadow: 0 0 0 8px transparent,
                          0 25px 60px rgba(0,0,0,0.42); }
}

@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position:  200% center; }
}

@keyframes swordGlow {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.65; }
}

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateX(-12px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes tabUnderline {
  from { width: 0; }
  to   { width: 100%; }
}

/* ─── MS-STYLE BUTTON BASE ───────────────────────────────── */
.btn-ms {
  font-family: 'Segoe UI Variable Text', 'Segoe UI Variable', 'Segoe UI', system-ui, sans-serif !important;
  font-weight: 600;
  letter-spacing: 0.012em;
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow: hidden;
}

/* Ripple layer on click */
.btn-ms::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background var(--transition-fast);
  border-radius: inherit;
}
.btn-ms:active::after { background: rgba(255,255,255,0.14); }

/* ════════════════════════════════════════════════════════
   LOGIN SCREEN — FlowGate Unified Defence Zone
   (from flow_gate_unified_screens_react.jsx)
   ════════════════════════════════════════════════════════ */
.fg-login-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #0E1A2B;
  position: relative;
  font-family: 'Segoe UI Variable', 'Segoe UI', Inter, system-ui, sans-serif;
}

/* Background layers (same as landing) */
.fg-login-container .fg-bg-layers {
  position: fixed;
  inset: 0;
  z-index: 0;
}

.fg-login-container .fg-bg-base {
  position: absolute;
  inset: 0;
  background: #0E1A2B url("images/bg2.png") center center / cover no-repeat;
  filter: saturate(0.95) contrast(1.08);
}

.fg-login-container .fg-bg-veil {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(1200px 900px at 52% 35%, rgba(22,38,63,0.08), rgba(14,26,43,0.92) 66%),
    linear-gradient(180deg, rgba(14,26,43,0.55), rgba(14,26,43,0.90));
}

.fg-login-container .fg-bg-mist {
  position: absolute;
  inset: 0;
  opacity: 0.45;
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0) 35%, rgba(255,255,255,0.04) 70%, rgba(255,255,255,0));
  animation: fg-mist-drift 18s ease-in-out infinite;
}

@keyframes fg-mist-drift {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(12px); }
}

.fg-login-container .fg-bg-grain {
  position: absolute;
  inset: 0;
  opacity: 0.10;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.35'/%3E%3C/svg%3E");
}

.fg-login-container .fg-bg-embers {
  position: absolute;
  inset: 0;
  opacity: 0.85;
  background:
    radial-gradient(2px 2px at 14% 44%, rgba(177,18,38,0.55), rgba(177,18,38,0) 60%),
    radial-gradient(1.5px 1.5px at 82% 58%, rgba(177,18,38,0.45), rgba(177,18,38,0) 60%),
    radial-gradient(2px 2px at 66% 22%, rgba(177,18,38,0.35), rgba(177,18,38,0) 60%);
}

.fg-login-content {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px 32px;
}

.fg-login-grid {
  width: 100%;
  max-width: 980px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
}

@media (min-width: 1024px) {
  .fg-login-grid {
    grid-template-columns: 1fr 1fr;
    gap: 56px;
  }
}

/* Hero (left) */
.fg-login-container .fg-hero {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.fg-login-container .fg-kicker {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.fg-login-container .fg-dot {
  width: 10px;
  height: 10px;
  background: #B11226;
  box-shadow: 0 0 18px rgba(177,18,38,0.55);
}

.fg-login-container .fg-kicker span:last-child {
  font-size: 12px;
  letter-spacing: 0.22em;
  color: rgba(255,255,255,0.55);
}

.fg-login-container .fg-title {
  margin-top: 20px;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #fff;
}

.fg-login-container .fg-desc,
.fg-login-container .fg-notice {
  margin-top: 16px;
  max-width: 460px;
  font-size: 15px;
  line-height: 1.75;
  color: rgba(255,255,255,0.7);
}

.fg-login-container .fg-desc-line {
  display: block;
}

.fg-login-container .fg-divider {
  margin-top: 32px;
  max-width: 460px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.fg-login-container .fg-divider span:first-child,
.fg-login-container .fg-divider span:last-child {
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.1);
}

.fg-login-container .fg-divider-label {
  font-size: 12px;
  letter-spacing: 0.22em;
  color: rgba(255,255,255,0.4);
}

.fg-login-container .fg-notice {
  margin-top: 32px;
  font-size: 13px;
  color: rgba(255,255,255,0.55);
}

.fg-login-container .fg-notice-label {
  letter-spacing: 0.12em;
}

/* Glass panel (right) */
.fg-login-container .fg-panel-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (min-width: 1024px) {
  .fg-login-container .fg-panel-wrap {
    justify-content: flex-end;
  }
}

.fg-login-container .fg-glass-panel {
  position: relative;
  width: 100%;
  max-width: 460px;
  border: 1px solid rgba(199,203,214,0.18);
  background: linear-gradient(180deg, rgba(255,255,255,0.07), rgba(255,255,255,0.03));
  box-shadow: 0 30px 90px rgba(0,0,0,0.55), inset 0 1px 0 rgba(255,255,255,0.07);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.fg-login-container .fg-panel-glow {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, rgba(177,18,38,0), rgba(177,18,38,0.9), rgba(177,18,38,0));
  opacity: 0.8;
}

.fg-login-container .fg-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 36px 32px 0;
}

.fg-login-container .fg-panel-kicker {
  font-size: 12px;
  letter-spacing: 0.22em;
  color: rgba(255,255,255,0.55);
}

.fg-login-container .fg-panel-title {
  margin-top: 8px;
  font-size: 24px;
  font-weight: 600;
  color: #fff;
}

.fg-login-container .fg-panel-right {
  text-align: right;
}

.fg-login-container .fg-panel-right .fg-panel-kicker {
  color: rgba(255,255,255,0.4);
}

.fg-login-container .fg-panel-sub {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: rgba(255,255,255,0.45);
}

.fg-login-container .fg-panel-body {
  padding: 28px 32px;
}

/* Field (floating label) */
.fg-field-wrap {
  position: relative;
  margin-bottom: 16px;
}

.fg-field-input {
  width: 100%;
  padding: 24px 16px 12px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.9);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.fg-field-input:focus {
  border-color: rgba(255,255,255,0.25);
  box-shadow: 0 0 0 4px rgba(90,140,255,0.18);
}

.fg-field-label {
  position: absolute;
  left: 16px;
  top: 12px;
  font-size: 12px;
  letter-spacing: 0.05em;
  color: rgba(255,255,255,0.45);
  pointer-events: none;
  transition: color 0.2s;
}

.fg-field-wrap.has-value .fg-field-label,
.fg-field-input:focus ~ .fg-field-label,
.fg-field-input:not(:placeholder-shown) ~ .fg-field-label {
  color: rgba(255,255,255,0.65);
}

.fg-field-line {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(177,18,38,0), rgba(177,18,38,0.55), rgba(177,18,38,0));
  opacity: 0.35;
  pointer-events: none;
}

/* Katana button */
.fg-katana-btn {
  position: relative;
  width: 100%;
  padding: 12px 16px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.9);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.18em;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.2s, background 0.2s;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.fg-katana-btn:hover:not(:disabled) {
  border-color: rgba(255,255,255,0.3);
}

.fg-katana-btn:disabled {
  cursor: not-allowed;
  border-color: rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.35);
}

.fg-katana-text {
  position: relative;
  z-index: 2;
}

.fg-katana-slash {
  position: absolute;
  left: 0;
  top: 0;
  width: 140%;
  height: 100%;
  background: linear-gradient(90deg, rgba(177,18,38,0), rgba(177,18,38,0.75), rgba(177,18,38,0));
  filter: drop-shadow(0 0 14px rgba(177,18,38,0.45));
  transform: skewX(-18deg);
  pointer-events: none;
  z-index: 1;
}

.fg-katana-btn.slash .fg-katana-slash {
  animation: fg-katana-slash 0.45s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes fg-katana-slash {
  0% {
    transform: skewX(-18deg) translateX(-100%);
    opacity: 0;
  }
  100% {
    transform: skewX(-18deg) translateX(100%);
    opacity: 1;
  }
}

.fg-katana-edge {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, rgba(177,18,38,0), rgba(177,18,38,0.9), rgba(177,18,38,0));
  opacity: 0.65;
  pointer-events: none;
}

.fg-katana-btn:disabled .fg-katana-edge {
  opacity: 0.2;
}

.fg-login-actions {
  margin-top: 8px;
  margin-bottom: 16px;
}

.fg-login-msg {
  margin-top: 16px;
  padding: 12px 16px;
  font-size: 13px;
  border: 1px solid;
  border-radius: 0;
}

.fg-msg-error {
  border-color: rgba(177,18,38,0.35);
  background: rgba(177,18,38,0.08);
  color: rgba(255,220,224,0.9);
}

.fg-msg-success {
  border-color: rgba(90,140,255,0.35);
  background: rgba(90,140,255,0.08);
  color: rgba(220,235,255,0.9);
}

.fg-login-msg:empty {
  display: none;
}

.fg-login-container .fg-panel-notice {
  margin-top: 16px;
  padding-top: 16px;
  font-size: 12px;
  line-height: 1.6;
  color: rgba(255,255,255,0.45);
}

.fg-login-container .fg-panel-footer {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 16px 32px;
  font-size: 12px;
  color: rgba(255,255,255,0.45);
}

.fg-login-container .fg-footer-hint {
  color: rgba(255,255,255,0.35);
}

@media (max-width: 900px) {
  .fg-login-grid {
    gap: 40px;
  }
  .fg-login-container .fg-panel-body {
    padding: 24px 24px;
  }
}

/* Legacy login (keep for fallback if needed) */
.login-container {
  display: flex;
  width: 100%;
  min-height: 100vh;
  position: relative;
}

/* ── LEFT: form section ─── */
.form-section {
  width: 50%;
  min-width: 320px;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px;
  position: relative;
  overflow: hidden;
}

.form-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.pixel-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* Atmospheric overlay on left panel */
.bamboo-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(30, 58, 95, 0.72) 0%,
    rgba(30, 41, 59, 0.82) 50%,
    rgba(15, 23, 42, 0.90) 100%
  );
  pointer-events: none;
}

/* ── GATE PASS (login card — scroll / parchment aesthetic) ── */
.gate-pass {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 428px;
  background: linear-gradient(
    170deg,
    rgba(255,255,255,0.985) 0%,
    rgba(248,250,252,0.975) 100%
  );
  padding: 44px 40px 38px;
  border-radius: 14px;

  /* Layered shadows — depth + glow */
  box-shadow:
    0 28px 70px rgba(0,0,0,0.45),
    0 0 0 1px rgba(255,255,255,0.08),
    inset 0 1px 0 rgba(255,255,255,0.85);

  border-top: 4px solid var(--fg-accent);

  /* Entrance animation */
  animation:
    scrollIn      0.55s cubic-bezier(0.22, 1, 0.36, 1) both,
    pulseAccent   3.5s  ease-in-out 0.6s infinite;
}

/* Subtle top-edge red shimmer line */
.gate-pass::before {
  content: '';
  position: absolute;
  top: -1px; left: 10%; right: 10%;
  height: 4px;
  background: linear-gradient(
    90deg,
    transparent 0%, var(--fg-accent) 40%, #dc2626 60%, transparent 100%
  );
  background-size: 200% auto;
  animation: shimmer 3.5s linear infinite;
  border-radius: 0 0 2px 2px;
  opacity: 0.85;
}

.gate-pass-header {
  text-align: center;
  margin-bottom: 28px;
}

/* Sword icon ── animated glow */
.gate-symbol {
  display: block;
  font-size: 34px;
  margin-bottom: 10px;
  filter: drop-shadow(0 2px 6px rgba(185,28,28,0.4));
  animation: swordGlow 2.4s ease-in-out infinite;
}

.login-brand {
  font-family: 'Segoe UI Variable Display', 'Segoe UI Variable', 'Segoe UI', system-ui, sans-serif;
  font-size: 29px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--fg-primary);
  margin-bottom: 8px;
}

.login-tagline {
  color: var(--fg-slate);
  font-size: 12.5px;
  line-height: 1.55;
}

/* Divider line between header and form */
.gate-pass-header::after {
  content: '';
  display: block;
  width: 48px;
  height: 2px;
  background: linear-gradient(90deg, var(--fg-accent), transparent);
  margin: 16px auto 0;
  border-radius: 2px;
}

.login-title {
  font-family: 'Segoe UI Variable Text', 'Segoe UI Variable', 'Segoe UI', system-ui, sans-serif;
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 26px;
  color: var(--fg-primary-dark);
  letter-spacing: -0.01em;
}

/* Input groups */
.form-section .input-group { margin-bottom: 20px; }

.form-section .input-group label {
  display: block;
  margin-bottom: 7px;
  color: #2d3748;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.form-section .input-group input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  font-size: 15px;
  font-family: inherit;
  background: #fafbfc;
  color: #1e293b;
}

.form-section .input-group input:focus {
  border-color: var(--fg-primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(30,58,95,0.18);
}

/* Login button — MS-style with accent hover */
.form-section .btn-primary {
  width: 100%;
  padding: 13px 16px;
  background: var(--fg-primary);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition:
    background var(--transition-fast),
    box-shadow  var(--transition-fast),
    transform   0.1s ease;
  letter-spacing: 0.018em;
}

.form-section .btn-primary:hover {
  background: #16304f;
  box-shadow: 0 5px 18px rgba(30,58,95,0.42);
}

.form-section .btn-primary:active { transform: scale(0.985); }

/* Error message */
.form-section .error-message {
  margin-top: 14px;
  font-size: 13.5px;
  color: #dc2626;
  padding: 10px 12px;
  background: #fef2f2;
  border-radius: 7px;
  border-left: 3px solid var(--fg-accent);
}

/* ── RIGHT: Kenshin scene canvas ── */
.image-section {
  width: 50%;
  min-height: 100vh;
  position: relative;
  background: linear-gradient(180deg, #030810 0%, #070f1e 50%, #1e3a5f 100%);
  overflow: hidden;
}

.katana-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* Red energy vignette at left edge of right panel */
.image-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(185,28,28,0.08) 0%, transparent 18%);
  pointer-events: none;
  z-index: 1;
}

/* ─── RESPONSIVE LOGIN ───────────────────────────────────── */
@media (max-width: 900px) {
  .login-container { flex-direction: column; min-height: auto; }
  .form-section    { width: 100%; min-height: 55vh; padding: 32px 20px; }
  .image-section   { width: 100%; min-height: 45vh; }
}

/* ════════════════════════════════════════════════════════
   DASHBOARD — Feudal command centre
   ════════════════════════════════════════════════════════ */
.dashboard {
  min-height: 100vh;
  background: #eef2f8;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(30,58,95,0.06) 1px, transparent 0);
  background-size: 28px 28px;
}

/* ── SUBSCRIPTION BANNER ── */
.subscription-banner {
  padding: 12px 24px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.subscription-banner.sub-ok {
  background: linear-gradient(90deg, rgba(22, 163, 74, 0.15), rgba(22, 163, 74, 0.08));
  color: #15803d;
  border-bottom: 2px solid rgba(22, 163, 74, 0.4);
}

.subscription-banner.sub-warning {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.2), rgba(245, 158, 11, 0.1));
  color: #b45309;
  border-bottom: 2px solid rgba(245, 158, 11, 0.5);
}

.subscription-banner.sub-expiring {
  background: linear-gradient(90deg, rgba(185, 28, 28, 0.15), rgba(185, 28, 28, 0.08));
  color: #b91c1c;
  border-bottom: 2px solid rgba(185, 28, 28, 0.5);
}

/* ── HEADER (dojo banner) ── */
.dojo-header {
  background: linear-gradient(93deg, var(--fg-primary) 0%, var(--fg-primary-dark) 100%);
  padding: 15px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 4px 24px rgba(0,0,0,0.28);
  border-bottom: 3px solid var(--fg-accent);
  position: relative;
  overflow: hidden;
}

/* Subtle shimmer stripe across header */
.dojo-header::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  animation: fadeSlideIn 0.4s ease both;
}

.header-symbol {
  font-size: 22px;
  filter: drop-shadow(0 1px 4px rgba(185,28,28,0.5));
}

.dojo-header h1 {
  font-family: 'Segoe UI Variable Display', 'Segoe UI Variable', 'Segoe UI', system-ui, sans-serif;
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.header-actions {
  display: flex;
  gap: 18px;
  align-items: center;
}

.refresh-status {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255,255,255,0.88);
  font-size: 13px;
}

/* Refresh icon button */
.btn-icon {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.28);
  font-size: 16px;
  cursor: pointer;
  padding: 7px 9px;
  border-radius: 8px;
  transition: background var(--transition-fast), border-color var(--transition-fast);
  line-height: 1;
}
.btn-icon:hover {
  background: rgba(255,255,255,0.22);
  border-color: rgba(255,255,255,0.48);
}

/* ── TABS — scroll/banner style ── */
.tabs {
  display: flex;
  background: #fff;
  border-bottom: 2px solid #dde4ef;
  padding: 0 32px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.07);
  position: sticky;
  top: 0;
  z-index: 10;
}

.tab {
  padding: 14px 24px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14.5px;
  font-family: 'Segoe UI Variable Text', 'Segoe UI Variable', 'Segoe UI', system-ui, sans-serif;
  font-weight: 500;
  color: var(--fg-slate);
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: color var(--transition-fast), border-color var(--transition-fast);
  letter-spacing: 0.005em;
}

.tab:hover { color: var(--fg-primary); }

.tab.active {
  color: var(--fg-primary);
  font-weight: 600;
  border-bottom-color: var(--fg-accent);
}

/* ── TAB CONTENT ── */
.tab-content { padding: 30px 32px; }

.tab-panel { display: none; }
.tab-panel.active {
  display: block;
  animation: fadeSlideIn 0.25s ease both;
}

.tab-panel h2 {
  font-family: 'Segoe UI Variable Display', 'Segoe UI Variable', 'Segoe UI', system-ui, sans-serif;
  font-size: 21px;
  font-weight: 600;
  color: var(--fg-primary-dark);
  margin-bottom: 22px;
  letter-spacing: -0.01em;
}

/* ── FORMS ── */
.redirect-form {
  background: #fff;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 2px 14px rgba(0,0,0,0.08);
  max-width: 820px;
  border-top: 3px solid var(--fg-accent);
}

.form-group { margin-bottom: 20px; }

.form-group label {
  display: block;
  margin-bottom: 7px;
  color: #1e293b;
  font-weight: 600;
  font-size: 13.5px;
  letter-spacing: 0.01em;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: #fafbfc;
  color: #1e293b;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--fg-primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(30,58,95,0.14);
}

.form-group small {
  display: block;
  margin-top: 5px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.5;
}

.form-group textarea { resize: vertical; }

/* ── SETTINGS ── */
.settings-section {
  margin-bottom: 36px;
  padding-bottom: 28px;
  border-bottom: 1px solid #e2e8f0;
}
.settings-section:last-child { border-bottom: none; }
.settings-section h3 {
  font-size: 16px;
  color: var(--fg-primary);
  margin-bottom: 12px;
}
.settings-hint {
  color: #64748b;
  font-size: 13px;
  margin-bottom: 16px;
  line-height: 1.5;
}
.settings-hint a { color: var(--fg-primary); text-decoration: none; }
.settings-hint a:hover { text-decoration: underline; }
.password-step { margin-top: 8px; }

/* ── BUTTONS ── */
.btn {
  padding: 11px 22px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-family: 'Segoe UI Variable Text', 'Segoe UI Variable', 'Segoe UI', system-ui, sans-serif;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition-fast), box-shadow var(--transition-fast), transform 0.1s ease;
  letter-spacing: 0.015em;
}

.btn-primary {
  background: var(--fg-primary);
  color: #fff;
}
.btn-primary:hover {
  background: #16304f;
  box-shadow: 0 4px 16px rgba(30,58,95,0.38);
}
.btn-primary:active { transform: scale(0.978); }

.btn-secondary { background: #64748b; color: #fff; }
.btn-secondary:hover { background: #475569; }

/* Logout on dark header */
.header .btn-secondary {
  background: transparent;
  color: rgba(255,255,255,0.92);
  border: 1px solid rgba(255,255,255,0.40);
  padding: 8px 18px;
}
.header .btn-secondary:hover {
  background: rgba(255,255,255,0.11);
  border-color: rgba(255,255,255,0.62);
}

.btn-danger  { background: #dc2626; color: #fff; padding: 8px 15px; font-size: 13px; }
.btn-danger:hover  { background: #b91c1c; }

.btn-success { background: #16a34a; color: #fff; padding: 8px 15px; font-size: 13px; }
.btn-success:hover { background: #15803d; }

.btn-warning {
  background: #f59e0b;
  color: #1e293b;
  padding: 8px 15px;
  font-size: 13px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  transition: background var(--transition-fast);
}
.btn-warning:hover { background: #d97706; color: #fff; }

.btn-sm { padding: 6px 12px; font-size: 12.5px; }

/* ── REDIRECTS LIST ── */
.redirects-list {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 14px rgba(0,0,0,0.08);
  overflow: hidden;
  border-top: 3px solid var(--fg-accent);
}

.redirect-item {
  padding: 20px 24px;
  border-bottom: 1px solid #e8edf4;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background var(--transition-fast);
}
.redirect-item:hover { background: #f8fafc; }
.redirect-item:last-child { border-bottom: none; }

.redirect-info h3 { margin-bottom: 6px; color: #1e293b; font-size: 14.5px; }
.redirect-info p  { color: #64748b; font-size: 13px; margin: 3px 0; }

.redirect-actions { display: flex; gap: 10px; }

/* ── STAT CARDS ── */
.stats-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}

.stat-card {
  background: #fff;
  padding: 22px;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  text-align: center;
  border-top: 3px solid var(--fg-primary);
  transition: box-shadow var(--transition-fast), transform var(--transition-fast);
}
.stat-card:hover {
  box-shadow: 0 6px 22px rgba(30,58,95,0.14);
  transform: translateY(-2px);
}

.stat-label {
  color: var(--fg-slate);
  font-size: 12.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--fg-primary);
  font-family: 'Segoe UI Variable Display', 'Segoe UI Variable', 'Segoe UI', system-ui, sans-serif;
}

/* ── STATS CONTROLS ── */
.stats-controls {
  background: #fff;
  padding: 14px 22px;
  border-radius: 10px;
  margin-bottom: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  flex-wrap: wrap;
}

.stats-controls label {
  font-size: 13.5px;
  font-weight: 500;
  color: #334155;
  display: flex;
  align-items: center;
  gap: 8px;
}

.stats-controls select {
  padding: 5px 10px;
  border: 1.5px solid #cbd5e1;
  border-radius: 6px;
  font-family: inherit;
  font-size: 13px;
  color: #1e293b;
  cursor: pointer;
  transition: border-color var(--transition-fast);
}
.stats-controls select:focus { outline: none; border-color: var(--fg-primary); }

/* ── VISITS TABLE ── */
.visits-table-container {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 14px rgba(0,0,0,0.08);
  overflow-x: auto;
}

.visits-table { width: 100%; border-collapse: collapse; }

.visits-table thead {
  background: linear-gradient(180deg, #f5f8fc 0%, #eef2f8 100%);
  position: sticky;
  top: 0;
}

.visits-table th {
  padding: 13px 15px;
  text-align: left;
  font-weight: 600;
  font-size: 12.5px;
  color: var(--fg-primary-dark);
  border-bottom: 2px solid #dde4ef;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.visits-table td {
  padding: 11px 15px;
  border-bottom: 1px solid #eef2f8;
  font-size: 13.5px;
  color: #334155;
}

.visits-table tr:hover td { background: #f5f8fc; }
.visits-table tbody tr:last-child td { border-bottom: none; }

.bot-row td { background: rgba(251, 243, 199, 0.5) !important; }

.blocked-yes { color: #dc2626; font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; }
.blocked-no  { color: #16a34a; font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; }

.user-agent { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── PAGINATION ── */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  padding: 18px;
  flex-wrap: wrap;
}

.pagination button {
  padding: 9px 13px;
  border: 1.5px solid #cbd5e1;
  background: #fff;
  cursor: pointer;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  color: #334155;
  transition: all var(--transition-fast);
  min-width: 36px;
}
.pagination button:hover:not(:disabled) {
  background: #f1f5f9;
  border-color: var(--fg-primary);
  color: var(--fg-primary);
}
.pagination button:disabled { opacity: 0.38; cursor: not-allowed; }
.pagination .page-num.active {
  background: var(--fg-primary);
  color: #fff;
  border-color: var(--fg-primary);
  box-shadow: 0 2px 8px rgba(30,58,95,0.3);
}

/* ── MODAL ── */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(10, 18, 38, 0.72);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  backdrop-filter: blur(3px);
}

.modal-content {
  background: #fff;
  padding: 32px;
  border-radius: 14px;
  max-width: 620px;
  width: 92%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 28px 70px rgba(0,0,0,0.35);
  border-top: 4px solid var(--fg-accent);
  animation: scrollIn 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.modal-content h2 {
  font-family: 'Segoe UI Variable Display', 'Segoe UI Variable', 'Segoe UI', system-ui, sans-serif;
  font-size: 20px;
  font-weight: 600;
  color: var(--fg-primary-dark);
  margin-bottom: 22px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}

/* ── STATUS MESSAGES ── */
.error-message {
  color: #dc2626;
  margin-top: 12px;
  padding: 11px 14px;
  background: #fef2f2;
  border-radius: 8px;
  border-left: 3px solid var(--fg-accent);
  font-size: 13.5px;
  line-height: 1.5;
}

.success-message {
  color: #15803d;
  margin-top: 12px;
  padding: 11px 14px;
  background: #f0fdf4;
  border-radius: 8px;
  border-left: 3px solid #16a34a;
  font-size: 13.5px;
  line-height: 1.5;
}

/* Hide empty messages */
.error-message:empty,
.success-message:empty { display: none; }

.loading {
  text-align: center;
  padding: 28px;
  color: var(--fg-slate);
  font-size: 14px;
}

/* ─── SCROLLBAR (webkit) ─────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #eef2f8; }
::-webkit-scrollbar-thumb { background: #94a3b8; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--fg-primary); }

/* ─── RESPONSIVE DASHBOARD ───────────────────────────────── */
@media (max-width: 768px) {
  .dojo-header { flex-direction: column; gap: 14px; }
  .header-actions { width: 100%; justify-content: space-between; }
  .tabs { flex-wrap: wrap; padding: 0 16px; }
  .tab  { padding: 12px 14px; font-size: 13px; }
  .tab-content { padding: 20px 16px; }
  .stats-summary { grid-template-columns: 1fr 1fr; }
  .stat-value { font-size: 22px; }
  .visits-table { font-size: 12px; }
  .visits-table th,
  .visits-table td { padding: 9px 10px; }
  .modal-content { padding: 24px 18px; }
}

@media (max-width: 480px) {
  .stats-summary { grid-template-columns: 1fr; }
  .form-section { padding: 28px 16px; }
  .gate-pass { padding: 32px 22px 28px; }
}
