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

  :root {
    --bg: #0a0d14;
    --surface: #111622;
    --surface2: #161d2e;
    --border: #1e2a42;
    --accent: #3b82f6;
    --accent2: #60a5fa;
    --accent-glow: rgba(59,130,246,0.25);
    --green: #22c55e;
    --green-glow: rgba(34,197,94,0.2);
    --text: #e8edf5;
    --text-muted: #8896b0;
    --text-dim: #4a5568;
    --gold: #f59e0b;
  }

  /* ===== LIGHT MODE VARIABLES ===== */
  html.light {
    --bg: #f0f4f8;
    --surface: #ffffff;
    --surface2: #e8edf5;
    --border: #c8d4e8;
    --accent: #2563eb;
    --accent2: #1d4ed8;
    --accent-glow: rgba(37,99,235,0.18);
    --green: #16a34a;
    --green-glow: rgba(22,163,74,0.15);
    --text: #0f172a;
    --text-muted: #475569;
    --text-dim: #94a3b8;
    --gold: #d97706;
  }

  /* ===== THEME TOGGLE BUTTON ===== */
  #themeToggleBtn {
    display: flex; align-items: center; gap: 7px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 6px 13px;
    font-size: 13px; font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.22s;
    font-family: 'Heebo', sans-serif;
    flex-shrink: 0;
    white-space: nowrap;
    user-select: none;
  }
  #themeToggleBtn:hover {
    border-color: var(--accent);
    color: var(--accent2);
    background: var(--surface);
  }
  #themeToggleBtn .theme-icon {
    font-size: 15px;
    transition: transform 0.4s ease;
  }
  #themeToggleBtn:hover .theme-icon {
    transform: rotate(20deg);
  }

  /* Light mode body/background overrides */
  html.light body {
    background: var(--bg);
  }
  html.light body::before {
    background:
      radial-gradient(ellipse 60% 40% at 20% 10%, rgba(37,99,235,0.05) 0%, transparent 70%),
      radial-gradient(ellipse 40% 60% at 80% 90%, rgba(22,163,74,0.04) 0%, transparent 70%);
  }
  html.light body::after {
    background-image:
      linear-gradient(rgba(37,99,235,0.04) 1px, transparent 1px),
      linear-gradient(90deg, rgba(37,99,235,0.04) 1px, transparent 1px);
  }
  html.light header {
    background: rgba(240,244,248,0.88);
  }
  html.light .contact-bar {
    background: rgba(240,244,248,0.95);
  }
  html.light #preloader {
    background: #f0f4f8;
  }
  html.light .welcome-modal {
    background: #ffffff;
    border-color: #c8d4e8;
    box-shadow: 0 0 0 1px rgba(37,99,235,0.1), 0 24px 60px rgba(0,0,0,0.12), 0 0 80px rgba(37,99,235,0.06);
  }
  html.light .welcome-modal-divider {
    background: linear-gradient(90deg, transparent, #c8d4e8, transparent);
  }
  html.light .welcome-modal h4,
  html.light .welcome-modal-name {
    background: linear-gradient(135deg, #0f172a 60%, #2563eb);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  }
  html.light .welcome-modal p { color: #475569; }
  html.light .welcome-modal p strong { color: #0f172a; }
  html.light .welcome-modal-tagline { color: #475569; }
  html.light #welcomeOverlay {
    background: rgba(240,244,248,0.82);
  }
  html.light .logo-text {
    background: linear-gradient(135deg, #0f172a, #2563eb);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  }
  html.light .result-title {
    background: linear-gradient(135deg, #0f172a, #16a34a);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  }
  html.light .card:hover {
    box-shadow: 0 8px 30px rgba(37,99,235,0.12);
  }
  html.light .secondary-btn {
    background: var(--surface);
  }
  html.light h2 {
    background: linear-gradient(135deg, #0f172a 60%, #2563eb);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  }
  html.light .screen-desc {
    color: #334155;
  }
  html.light .step-label {
    color: var(--accent);
  }

  html, body {
    width: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: 'Heebo', sans-serif;
    overflow-x: hidden;
  }

  /* Animated background */
  body::before {
    content: '';
    position: fixed; inset: 0;
    background: 
      radial-gradient(ellipse 60% 40% at 20% 10%, rgba(59,130,246,0.06) 0%, transparent 70%),
      radial-gradient(ellipse 40% 60% at 80% 90%, rgba(34,197,94,0.04) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
  }

  /* Grid lines */
  body::after {
    content: '';
    position: fixed; inset: 0;
    background-image: 
      linear-gradient(rgba(59,130,246,0.03) 1px, transparent 1px),
      linear-gradient(90deg, rgba(59,130,246,0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
    z-index: 0;
  }

  #app {
    position: relative; z-index: 1;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex; flex-direction: column;
  }

  /* Header */
  header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 24px;
    border-bottom: 1px solid var(--border);
    background: rgba(10,13,20,0.8);
    backdrop-filter: blur(10px);
    flex-shrink: 0;
    position: sticky; top: 0; z-index: 100;
    gap: 12px;
  }

  .logo {
    display: flex; align-items: center; gap: 12px;
  }

  .logo-icon {
    width: 38px; height: 38px;
    background: linear-gradient(135deg, var(--accent), #1d4ed8);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
    box-shadow: 0 0 20px var(--accent-glow);
  }

  .logo-text {
    font-size: 20px; font-weight: 800;
    background: linear-gradient(135deg, #fff, var(--accent2));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
  }

  .logo-sub {
    font-size: 11px; color: var(--text-muted); font-weight: 400;
    margin-top: -3px;
  }

  /* Steps bar */
  .steps-bar {
    display: flex; align-items: center; gap: 0;
  }

  .step-item {
    display: flex; align-items: center; gap: 8px;
    font-size: 12px; font-weight: 500; color: var(--text-dim);
    transition: color 0.3s;
    white-space: nowrap;
  }

  .step-item.active { color: var(--accent2); }
  .step-item.done { color: var(--green); }

  .step-num {
    width: 24px; height: 24px; border-radius: 50%;
    border: 2px solid var(--text-dim);
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 700;
    transition: all 0.3s;
    flex-shrink: 0;
  }

  .step-item.active .step-num {
    border-color: var(--accent);
    background: var(--accent-glow);
    color: var(--accent2);
    box-shadow: 0 0 10px var(--accent-glow);
  }

  .step-item.done .step-num {
    border-color: var(--green);
    background: var(--green-glow);
    color: var(--green);
  }

  .step-connector {
    width: 28px; height: 2px;
    background: var(--border);
    margin: 0 4px;
    transition: background 0.3s;
  }

  .step-connector.done { background: var(--green); }

  /* Main content */
  main {
    flex: 1;
    display: flex; align-items: flex-start; justify-content: center;
    padding: 20px 24px 24px;
  }

  .screen {
    display: none;
    width: 100%; max-width: 820px;
    animation: fadeIn 0.4s ease;
    align-self: flex-start;
  }

  .screen.active { display: block; }

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

  .step-label {
    font-size: 11px; font-weight: 700; letter-spacing: 2px;
    color: var(--accent); text-transform: uppercase;
    margin-bottom: 8px;
    display: flex; align-items: center; gap: 8px;
  }

  .step-label::before {
    content: '';
    width: 20px; height: 2px;
    background: var(--accent);
  }

  h2 {
    font-size: clamp(22px, 3vw, 34px);
    font-weight: 800; line-height: 1.25;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #fff 60%, var(--accent2));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  }

  .screen-desc {
    font-size: 15px; color: var(--text-muted);
    margin-bottom: 28px; line-height: 1.6;
  }

  /* Cards grid */
  .cards-grid {
    display: grid;
    gap: 12px;
  }

  .cards-grid.cols-2 { grid-template-columns: 1fr 1fr; }
  .cards-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
  .cards-grid.cols-auto { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

  .card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px 20px;
    cursor: pointer;
    transition: all 0.25s;
    display: flex; align-items: center; gap: 14px;
    position: relative; overflow: hidden;
  }

  .card::before {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(135deg, var(--accent-glow), transparent);
    opacity: 0; transition: opacity 0.25s;
  }

  .card:hover::before { opacity: 1; }
  .card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(59,130,246,0.15);
  }

  .card.selected {
    border-color: var(--accent);
    background: var(--surface2);
    box-shadow: 0 0 20px var(--accent-glow);
  }

  .card-icon {
    font-size: 26px; flex-shrink: 0; line-height: 1;
  }

  .card-content { flex: 1; min-width: 0; }

  .card-title {
    font-size: 14px; font-weight: 700;
    color: var(--text); line-height: 1.3;
  }

  .card-sub {
    font-size: 12px; color: var(--text-muted); margin-top: 3px;
  }

  .card-arrow {
    font-size: 16px; color: var(--text-dim);
    transition: color 0.2s, transform 0.2s;
    flex-shrink: 0;
  }

  .card:hover .card-arrow { color: var(--accent2); transform: translateX(-4px); }

  /* Problem sub-cards - compact */
  .prob-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 18px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex; align-items: center; gap: 12px;
  }

  .prob-card:hover {
    border-color: var(--accent);
    background: var(--surface2);
    transform: translateY(-1px);
  }

  .prob-card.selected {
    border-color: var(--accent);
    box-shadow: 0 0 15px var(--accent-glow);
  }

  .prob-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--accent); flex-shrink: 0;
    box-shadow: 0 0 6px var(--accent);
  }

  /* Result screen */
  .result-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 30px 36px;
    position: relative; overflow: hidden;
  }

  .result-box::before {
    content: '';
    position: absolute; top: 0; right: 0;
    width: 200px; height: 200px;
    background: radial-gradient(circle, var(--accent-glow), transparent 70%);
    pointer-events: none;
  }

  .result-header {
    display: flex; align-items: center; gap: 14px;
    margin-bottom: 20px;
  }

  .result-check {
    width: 50px; height: 50px; border-radius: 50%;
    background: var(--green-glow);
    border: 2px solid var(--green);
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
    box-shadow: 0 0 20px var(--green-glow);
    flex-shrink: 0;
  }

  .result-title {
    font-size: 22px; font-weight: 800;
    background: linear-gradient(135deg, #fff, var(--green));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  }

  .result-summary {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 20px;
    font-size: 13px; color: var(--text-muted);
    line-height: 1.8;
  }

  .result-summary span { color: var(--text); font-weight: 600; }

  .result-desc {
    font-size: 15px; color: var(--text-muted);
    line-height: 1.7; margin-bottom: 24px;
  }

  .guides-section h4 {
    font-size: 13px; font-weight: 700; letter-spacing: 1.5px;
    color: var(--accent); text-transform: uppercase; margin-bottom: 12px;
  }

  .guide-links {
    display: flex; flex-direction: column; gap: 8px;
  }

  .guide-link {
    display: flex; align-items: center; gap: 10px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--text);
    transition: all 0.2s;
    font-size: 14px; font-weight: 500;
  }

  .guide-link:hover {
    border-color: var(--accent);
    background: rgba(59,130,246,0.08);
    transform: translateX(-3px);
    color: var(--accent2);
  }

  .guide-link-icon { font-size: 16px; flex-shrink: 0; }
  .guide-link-text { flex: 1; }
  .guide-link-arrow { color: var(--text-dim); font-size: 14px; }

  .primary-btn {
    display: inline-flex; align-items: center; gap: 8px;
    background: linear-gradient(135deg, var(--accent), #1d4ed8);
    color: #fff; border: none; border-radius: 10px;
    padding: 13px 28px;
    font-size: 15px; font-weight: 700;
    cursor: pointer; transition: all 0.2s;
    font-family: 'Heebo', sans-serif;
    text-decoration: none;
    box-shadow: 0 4px 20px var(--accent-glow);
  }

  .primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(59,130,246,0.4);
  }

  .secondary-btn {
    display: inline-flex; align-items: center; gap: 8px;
    background: transparent;
    color: var(--text-muted); border: 1px solid var(--border);
    border-radius: 10px;
    padding: 13px 28px;
    font-size: 15px; font-weight: 600;
    cursor: pointer; transition: all 0.2s;
    font-family: 'Heebo', sans-serif;
  }

  .secondary-btn:hover {
    border-color: var(--accent);
    color: var(--accent2);
  }

  .btn-row {
    display: flex; gap: 10px; margin-top: 28px;
    justify-content: flex-end; align-items: center;
    flex-wrap: wrap;
  }

  .btn-row a.secondary-btn {
    text-decoration: none;
    display: inline-flex; align-items: center; justify-content: center;
  }

  /* Progress bar */
  .progress-wrap {
    padding: 0 24px;
    flex-shrink: 0;
  }

  .progress-bar {
    height: 2px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
    margin: 10px 0 0;
  }

  .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--green));
    transition: width 0.5s ease;
    border-radius: 2px;
  }

  /* Scrollable content area */
  .scroll-content {
    width: 100%;
    padding-bottom: 16px;
  }

  /* Footer */
  .contact-bar {
    padding: 12px 24px;
    border-top: 1px solid var(--border);
    background: rgba(10,13,20,0.9);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    font-size: 11px; color: var(--text-dim);
    text-align: center; letter-spacing: 0.5px;
    font-weight: 500;
    direction: ltr;
    unicode-bidi: isolate;
  }

  .contact-bar a {
    color: var(--text-muted); text-decoration: none;
    transition: color 0.2s; font-weight: 600;
  }

  .contact-bar a:hover { color: var(--accent2); }

  @media (max-width: 600px) {
    header { padding: 12px 16px; }
    .logo-text { font-size: 17px; }
    .logo-sub { display: none; }
    .logo-icon { width: 32px; height: 32px; font-size: 17px; }
    main { padding: 14px 16px 20px; }
    .progress-wrap { padding: 0 16px; }
    .cards-grid.cols-3, .cards-grid.cols-2 { grid-template-columns: 1fr; }
    .cards-grid.cols-auto { grid-template-columns: 1fr; }
    .steps-bar { display: none; }
    .contact-bar { padding: 10px 16px; }
    .contact-links { gap: 10px; }
    .result-box { padding: 16px; }
    .result-title { font-size: 18px; }
    .result-check { width: 40px; height: 40px; font-size: 18px; }
    h2 { font-size: 20px; }
    .screen-desc { font-size: 13px; margin-bottom: 16px; }
    .card { padding: 14px 16px; }
    .card-icon { font-size: 22px; }
    .card-title { font-size: 13px; }
    .primary-btn { padding: 12px 20px; font-size: 14px; }
    .secondary-btn { padding: 12px 16px; font-size: 13px; }
    .btn-row { margin-top: 18px; justify-content: flex-start; }
    .result-summary { font-size: 12px; padding: 12px 14px; }
    .result-desc { font-size: 13px; margin-bottom: 16px; }
    .guide-link { padding: 11px 14px; font-size: 13px; }
    #themeToggleBtn #themeLabel { display: none; }
    #themeToggleBtn { padding: 6px 10px; }
  }

  /* Support contact section */
  .support-contact {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
  }

  .support-contact-title {
    font-size: 13px; font-weight: 700;
    color: var(--text-muted); margin-bottom: 14px;
    letter-spacing: 0.3px;
  }

  .support-contact-buttons {
    display: flex; gap: 10px; flex-wrap: wrap;
  }

  .support-btn {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 16px;
    border-radius: 12px;
    text-decoration: none;
    border: 1px solid var(--border);
    background: var(--surface2);
    transition: all 0.2s;
    flex: 1; min-width: 140px;
  }

  .support-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
  }

  .support-btn-phone { border-color: rgba(99,179,237,0.3); }
  .support-btn-phone:hover { border-color: #63b3ed; background: rgba(99,179,237,0.08); }

  .support-btn-wa { border-color: rgba(72,187,120,0.3); }
  .support-btn-wa:hover { border-color: #48bb78; background: rgba(72,187,120,0.08); }

  .support-btn-web { border-color: rgba(159,122,234,0.3); }
  .support-btn-web:hover { border-color: #9f7aea; background: rgba(159,122,234,0.08); }

  .support-btn-icon { font-size: 20px; flex-shrink: 0; }

  .support-btn-text {
    display: flex; flex-direction: column;
    color: var(--text); font-size: 14px;
  }

  .support-btn-sub {
    font-size: 11px; color: var(--text-muted);
    font-weight: 400; margin-top: 1px;
  }

  .support-hours {
    margin-top: 12px;
    font-size: 11px; color: var(--text-dim);
    text-align: center;
  }

  @media (max-width: 600px) {
    .support-contact-buttons { gap: 8px; }
    .support-btn { min-width: calc(50% - 4px); flex: none; padding: 10px 12px; }
    .support-btn-text font-size: 13px;
  }
/* ===== PRELOADER ===== */
#preloader {
  position: fixed; inset: 0; z-index: 9999;
  background: #0a0d14;
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

#preloader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.preloader-inner {
  display: flex; flex-direction: column; align-items: center; gap: 20px;
  text-align: center;
}

.preloader-logo {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  animation: preloaderFadeIn 0.6s ease forwards;
}

.preloader-icon {
  font-size: 52px;
  filter: drop-shadow(0 0 20px rgba(59,130,246,0.6));
  animation: preloaderPulse 1.8s ease-in-out infinite;
}

.preloader-brand {
  font-size: 22px; font-weight: 800; letter-spacing: -0.5px;
  background: linear-gradient(135deg, #fff, #60a5fa);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

.preloader-spinner {
  position: relative; width: 56px; height: 56px;
  margin: 4px 0;
}

.spinner-ring {
  position: absolute; inset: 0;
  border-radius: 50%;
  border: 2.5px solid transparent;
  border-top-color: #3b82f6;
  animation: spinRing 1s linear infinite;
}

.spinner-ring-2 {
  inset: 8px;
  border-top-color: #22c55e;
  animation-duration: 0.75s;
  animation-direction: reverse;
}

.preloader-text {
  font-size: 13px; color: #8896b0; font-weight: 500;
  letter-spacing: 0.5px;
  animation: preloaderFadeIn 0.8s ease 0.3s forwards;
  opacity: 0;
}

.preloader-bar-wrap {
  width: 180px; height: 2px;
  background: #1e2a42; border-radius: 2px; overflow: hidden;
  animation: preloaderFadeIn 0.8s ease 0.4s forwards;
  opacity: 0;
}

.preloader-bar {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #3b82f6, #22c55e);
  border-radius: 2px;
  transition: width 0.3s ease;
}

@keyframes spinRing {
  to { transform: rotate(360deg); }
}

@keyframes preloaderPulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 20px rgba(59,130,246,0.5)); }
  50% { transform: scale(1.08); filter: drop-shadow(0 0 30px rgba(59,130,246,0.9)); }
}

@keyframes preloaderFadeIn {
  to { opacity: 1; }
}

/* ===== AI RESULT STATES ===== */
.ai-thinking {
  display: inline-flex; align-items: center; gap: 5px;
  vertical-align: middle;
}

.ai-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  animation: aiDotBounce 1.2s ease-in-out infinite;
  display: inline-block;
}

.ai-dot:nth-child(2) { animation-delay: 0.2s; background: var(--accent2); }
.ai-dot:nth-child(3) { animation-delay: 0.4s; background: var(--green); }

@keyframes aiDotBounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1.2); opacity: 1; }
}

.ai-loading-text {
  color: var(--text-muted);
  font-style: italic;
  font-size: 14px;
  animation: aiPulse 1.5s ease-in-out infinite;
}

@keyframes aiPulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

.ai-badge {
  display: inline-flex; align-items: center;
  background: linear-gradient(135deg, rgba(59,130,246,0.2), rgba(34,197,94,0.15));
  border: 1px solid rgba(59,130,246,0.4);
  border-radius: 6px;
  padding: 1px 7px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.5px;
  color: var(--accent2);
  vertical-align: middle;
  margin-left: 6px;
}

/* ===== AI DESC UPDATED HIGHLIGHT ===== */
.ai-updated-highlight {
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.5);
  border-radius: 10px;
  padding: 10px 14px;
  box-shadow: 0 0 18px rgba(34, 197, 94, 0.2);
  animation: aiHighlightFadeOut 5s ease forwards;
}

@keyframes aiHighlightFadeOut {
  0%   { background: rgba(34,197,94,0.18); border-color: rgba(34,197,94,0.6); box-shadow: 0 0 22px rgba(34,197,94,0.3); }
  60%  { background: rgba(34,197,94,0.10); border-color: rgba(34,197,94,0.3); box-shadow: 0 0 10px rgba(34,197,94,0.1); }
  100% { background: transparent; border-color: transparent; box-shadow: none; padding: 0; }
}

/* ===== WELCOME MODAL ===== */
#welcomeOverlay {
  position: fixed; inset: 0; z-index: 9998;
  background: rgba(10, 13, 20, 0.85);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  animation: overlayFadeIn 0.4s ease forwards;
}
#welcomeOverlay.hiding {
  animation: overlayFadeOut 0.35s ease forwards;
}
@keyframes overlayFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes overlayFadeOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}
.welcome-modal {
  background: #111622;
  border: 1px solid #1e2a42;
  border-radius: 20px;
  padding: 40px 44px;
  max-width: 480px;
  width: 100%;
  position: relative;
  box-shadow:
    0 0 0 1px rgba(59,130,246,0.15),
    0 24px 60px rgba(0,0,0,0.6),
    0 0 80px rgba(59,130,246,0.08);
  animation: modalSlideIn 0.45s cubic-bezier(0.22,1,0.36,1) forwards;
  overflow: hidden;
}
.welcome-modal::before {
  content: '';
  position: absolute; top: 0; right: 0;
  width: 180px; height: 180px;
  background: radial-gradient(circle, rgba(59,130,246,0.12), transparent 70%);
  pointer-events: none;
}
.welcome-modal::after {
  content: '';
  position: absolute; bottom: 0; left: 0;
  width: 120px; height: 120px;
  background: radial-gradient(circle, rgba(34,197,94,0.07), transparent 70%);
  pointer-events: none;
}
@keyframes modalSlideIn {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)   scale(1);    }
}
.welcome-modal-logo {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 26px;
}
.welcome-modal-icon {
  width: 48px; height: 48px;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  box-shadow: 0 0 24px rgba(59,130,246,0.35);
  flex-shrink: 0;
}
.welcome-modal-brand {
  display: flex; flex-direction: column;
}
.welcome-modal-name {
  font-size: 19px; font-weight: 800; letter-spacing: -0.4px;
  background: linear-gradient(135deg, #fff, #60a5fa);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.welcome-modal-tagline {
  font-size: 12px; color: #8896b0; font-weight: 400; margin-top: 2px;
}
.welcome-modal-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, #1e2a42, transparent);
  margin-bottom: 26px;
}
.welcome-modal h4 {
  font-size: 22px; font-weight: 800; line-height: 1.25;
  background: linear-gradient(135deg, #fff 60%, #60a5fa);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  margin-bottom: 14px;
}
.welcome-modal p {
  font-size: 14px; color: #8896b0; line-height: 1.75;
  margin-bottom: 0;
}
.welcome-modal p strong {
  color: #e8edf5; font-weight: 600;
}
.welcome-modal-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #fff; border: none; border-radius: 12px;
  padding: 14px 28px;
  font-size: 16px; font-weight: 700;
  cursor: pointer; transition: all 0.2s;
  font-family: 'Heebo', sans-serif;
  margin-top: 28px;
  box-shadow: 0 4px 20px rgba(59,130,246,0.35);
  position: relative; z-index: 1;
  letter-spacing: 0.2px;
}
.welcome-modal-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(59,130,246,0.5);
}
.welcome-modal-btn:active { transform: translateY(0); }
.welcome-modal-btn-arrow {
  font-size: 18px;
  transition: transform 0.2s;
}
.welcome-modal-btn:hover .welcome-modal-btn-arrow {
  transform: translateX(-4px);
}
@media (max-width: 600px) {
  .welcome-modal { padding: 28px 22px; border-radius: 16px; }
  .welcome-modal h4 { font-size: 19px; }
  .welcome-modal p  { font-size: 13px; }
  .welcome-modal-btn { font-size: 15px; padding: 13px 20px; }
}


/* ========================================
   ADMIN PANEL STYLES
   ======================================== */

/* ===== ADMIN GEAR BUTTON ===== */
#adminGearBtn {
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 44px;
  height: 44px;
  background: rgba(17,22,34,0.9);
  border: 1px solid #1e2a42;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 8888;
  transition: all 0.25s;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}
#adminGearBtn:hover {
  border-color: #3b82f6;
  box-shadow: 0 0 16px rgba(59,130,246,0.3);
  transform: rotate(30deg);
}
#adminGearBtn svg {
  width: 20px; height: 20px;
  fill: #4a5568;
  transition: fill 0.2s;
}
#adminGearBtn:hover svg { fill: #60a5fa; }

/* ===== LOGIN OVERLAY ===== */
#adminLoginOverlay {
  display: none;
  position: fixed; inset: 0; z-index: 9500;
  background: rgba(10,13,20,0.92);
  backdrop-filter: blur(8px);
  align-items: center; justify-content: center;
}
#adminLoginOverlay.open { display: flex; animation: adminFadeIn 0.3s ease; }

.admin-login-box {
  background: #111622;
  border: 1px solid #1e2a42;
  border-radius: 20px;
  padding: 44px 48px;
  width: 100%; max-width: 420px;
  box-shadow: 0 0 0 1px rgba(59,130,246,0.1), 0 30px 80px rgba(0,0,0,0.7);
  animation: adminSlideIn 0.4s cubic-bezier(0.22,1,0.36,1);
  text-align: center;
}
.admin-login-icon {
  font-size: 40px; margin-bottom: 16px;
  animation: adminGearSpin 4s linear infinite;
  display: inline-block;
}
@keyframes adminGearSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.admin-login-title {
  font-size: 22px; font-weight: 800;
  background: linear-gradient(135deg, #fff, #60a5fa);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  margin-bottom: 6px;
}
.admin-login-sub {
  font-size: 13px; color: #8896b0; margin-bottom: 28px;
}
.admin-login-input {
  width: 100%;
  background: #161d2e;
  border: 1px solid #1e2a42;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 15px; font-weight: 500;
  color: #e8edf5;
  font-family: 'Heebo', sans-serif;
  margin-bottom: 14px;
  text-align: center;
  letter-spacing: 2px;
  transition: border-color 0.2s;
}
.admin-login-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}
.admin-login-input.error { border-color: #ef4444; animation: adminShake 0.4s ease; }
@keyframes adminShake {
  0%,100%{transform:translateX(0)} 25%{transform:translateX(-6px)} 75%{transform:translateX(6px)}
}
.admin-login-btn {
  width: 100%;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #fff; border: none; border-radius: 10px;
  padding: 13px; font-size: 15px; font-weight: 700;
  cursor: pointer; transition: all 0.2s;
  font-family: 'Heebo', sans-serif;
  box-shadow: 0 4px 20px rgba(59,130,246,0.3);
  margin-bottom: 12px;
}
.admin-login-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(59,130,246,0.45); }
.admin-login-cancel {
  font-size: 13px; color: #4a5568; cursor: pointer;
  background: none; border: none; font-family: 'Heebo', sans-serif;
  transition: color 0.2s;
}
.admin-login-cancel:hover { color: #8896b0; }
.admin-login-error {
  font-size: 13px; color: #ef4444; margin-bottom: 10px;
  display: none;
}
.admin-login-error.show { display: block; }

/* ===== CHANGE PASSWORD MODAL ===== */
#adminChangePwOverlay {
  display: none;
  position: fixed; inset: 0; z-index: 9600;
  background: rgba(10,13,20,0.88);
  backdrop-filter: blur(8px);
  align-items: center; justify-content: center;
}
#adminChangePwOverlay.open { display: flex; animation: adminFadeIn 0.25s ease; }
.changepw-box {
  background: #111622;
  border: 1px solid #1e2a42;
  border-radius: 20px;
  padding: 36px 40px;
  width: 100%; max-width: 400px;
  box-shadow: 0 0 0 1px rgba(59,130,246,0.1), 0 30px 80px rgba(0,0,0,0.7);
  animation: adminSlideIn 0.35s cubic-bezier(0.22,1,0.36,1);
  text-align: center;
}
.changepw-title {
  font-size: 20px; font-weight: 800;
  background: linear-gradient(135deg, #fff, #60a5fa);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  margin-bottom: 6px;
}
.changepw-sub { font-size: 13px; color: #8896b0; margin-bottom: 24px; }
.changepw-label {
  display: block; text-align: right;
  font-size: 12px; font-weight: 600; color: #8896b0;
  margin-bottom: 6px; margin-top: 14px;
  font-family: 'Heebo', sans-serif;
}
.changepw-input {
  width: 100%;
  background: #161d2e; border: 1px solid #1e2a42; border-radius: 10px;
  padding: 11px 14px; font-size: 14px; font-weight: 500; color: #e8edf5;
  font-family: 'Heebo', sans-serif; text-align: right; direction: ltr;
  transition: border-color 0.2s;
}
.changepw-input:focus { outline: none; border-color: #3b82f6; }
.changepw-input.error { border-color: #ef4444; animation: adminShake 0.4s ease; }
.changepw-error { font-size: 12px; color: #ef4444; margin-top: 8px; min-height: 18px; text-align: right; }
.changepw-actions { display: flex; gap: 10px; margin-top: 24px; }
.changepw-save-btn {
  flex: 1; background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #fff; border: none; border-radius: 10px;
  padding: 12px; font-size: 15px; font-weight: 700;
  cursor: pointer; transition: all 0.2s; font-family: 'Heebo', sans-serif;
}
.changepw-save-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 24px rgba(59,130,246,0.4); }
.changepw-cancel-btn {
  padding: 12px 18px; background: transparent; color: #8896b0;
  border: 1px solid #1e2a42; border-radius: 10px;
  font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.2s;
  font-family: 'Heebo', sans-serif;
}
.changepw-cancel-btn:hover { border-color: #4a5568; color: #e8edf5; }
.admin-changepw-btn {
  width: 100%; margin-top: 8px; background: transparent;
  border: 1px solid #1e2a42; border-radius: 10px; padding: 9px 14px;
  font-size: 12px; font-weight: 600; color: #4a5568;
  cursor: pointer; transition: all 0.2s; font-family: 'Heebo', sans-serif;
  display: flex; align-items: center; gap: 7px; justify-content: center;
}
.admin-changepw-btn:hover { border-color: #3b82f6; color: #60a5fa; background: rgba(59,130,246,0.06); }

/* ===== BACKUP UI ===== */
.backup-card { background: #111622; border: 1px solid #1e2a42; border-radius: 14px; padding: 20px 22px; }
.backup-card + .backup-card { margin-top: 16px; }
.backup-card-header { display: flex; align-items: center; gap: 14px; }
.backup-card-icon { font-size: 24px; width: 44px; height: 44px; background: rgba(59,130,246,0.08); border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.backup-card-title { font-size: 15px; font-weight: 700; color: #e8edf5; }
.backup-card-sub { font-size: 12px; color: #8896b0; margin-top: 2px; }
.backup-limit-btn { padding: 8px 20px; background: #161d2e; border: 1px solid #1e2a42; border-radius: 8px; color: #8896b0; font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.18s; font-family: 'Heebo', sans-serif; }
.backup-limit-btn:hover { border-color: #3b82f6; color: #60a5fa; }
.backup-limit-btn.active { background: rgba(59,130,246,0.15); border-color: #3b82f6; color: #60a5fa; }
.backup-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; background: #0d1117; border: 1px solid #1a2238; border-radius: 10px; margin-bottom: 8px; gap: 10px; transition: border-color 0.18s; }
.backup-row:last-child { margin-bottom: 0; }
.backup-row:hover { border-color: #253352; }
.backup-row-info { flex: 1; min-width: 0; }
.backup-row-date { font-size: 13px; font-weight: 600; color: #e8edf5; }
.backup-row-size { font-size: 11px; color: #4a5568; margin-top: 2px; }
.backup-row-actions { display: flex; gap: 6px; flex-shrink: 0; }
.backup-action-btn { padding: 6px 12px; border-radius: 7px; font-size: 12px; font-weight: 600; cursor: pointer; transition: all 0.18s; font-family: 'Heebo', sans-serif; border: 1px solid transparent; white-space: nowrap; }
.backup-action-btn.restore { background: rgba(59,130,246,0.1); color: #60a5fa; border-color: rgba(59,130,246,0.3); }
.backup-action-btn.restore:hover { background: rgba(59,130,246,0.22); }
.backup-action-btn.export { background: rgba(52,211,153,0.08); color: #34d399; border-color: rgba(52,211,153,0.3); }
.backup-action-btn.export:hover { background: rgba(52,211,153,0.2); }
.backup-action-btn.delete { background: rgba(239,68,68,0.07); color: #f87171; border-color: rgba(239,68,68,0.25); }
.backup-action-btn.delete:hover { background: rgba(239,68,68,0.18); }

/* ===== ADMIN PANEL ===== */
#adminPanel {
  display: none;
  position: fixed; inset: 0; z-index: 9400;
  background: #0a0d14;
  flex-direction: row;
  overflow: hidden;
}
#adminPanel.open { display: flex; animation: adminFadeIn 0.3s ease; }

@keyframes adminFadeIn { from{opacity:0} to{opacity:1} }
@keyframes adminSlideIn {
  from { opacity:0; transform: translateY(24px) scale(0.97); }
  to { opacity:1; transform: translateY(0) scale(1); }
}

/* Sidebar */
.admin-sidebar {
  width: 240px; flex-shrink: 0;
  background: #0d1117;
  border-left: 1px solid #1e2a42;
  display: flex; flex-direction: column;
  overflow-y: auto;
}
.admin-sidebar-header {
  padding: 20px 18px 16px;
  border-bottom: 1px solid #1e2a42;
}
.admin-sidebar-logo {
  display: flex; align-items: center; gap: 10px;
}
.admin-sidebar-logo-icon {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.admin-sidebar-logo-text {
  font-size: 15px; font-weight: 800;
  background: linear-gradient(135deg, #fff, #60a5fa);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.admin-sidebar-logo-sub {
  font-size: 10px; color: #4a5568; font-weight: 400;
}
.admin-nav {
  padding: 12px 10px;
  flex: 1;
}
.admin-nav-label {
  font-size: 10px; font-weight: 700; letter-spacing: 1.5px;
  color: #2d3748; text-transform: uppercase;
  padding: 6px 8px 4px;
}
.admin-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px;
  border-radius: 9px;
  cursor: pointer;
  font-size: 13px; font-weight: 600; color: #8896b0;
  transition: all 0.18s;
  margin-bottom: 2px;
}
.admin-nav-item:hover { background: #161d2e; color: #e8edf5; }
.admin-nav-item.active { background: rgba(59,130,246,0.15); color: #60a5fa; }
.admin-nav-item .nav-icon { font-size: 16px; }
.admin-nav-badge {
  margin-right: auto;
  background: #1e2a42;
  border-radius: 10px;
  padding: 1px 7px;
  font-size: 10px;
  color: #8896b0;
}
.admin-sidebar-footer {
  padding: 14px 10px;
  border-top: 1px solid #1e2a42;
}
.admin-logout-btn {
  display: flex; align-items: center; gap: 8px;
  width: 100%;
  padding: 9px 10px;
  border-radius: 9px;
  border: none;
  background: transparent;
  color: #4a5568; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all 0.18s;
  font-family: 'Heebo', sans-serif;
}
.admin-logout-btn:hover { background: rgba(239,68,68,0.1); color: #ef4444; }

/* Main content area */
.admin-main {
  flex: 1;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.admin-topbar {
  padding: 16px 28px;
  border-bottom: 1px solid #1e2a42;
  background: #0d1117;
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}
.admin-topbar-title {
  font-size: 18px; font-weight: 800;
  color: #e8edf5;
}
.admin-topbar-sub { font-size: 12px; color: #4a5568; margin-top: 2px; }
.admin-actions { display: flex; gap: 10px; align-items: center; }
.admin-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  border-radius: 9px;
  border: 1px solid #1e2a42;
  background: #161d2e;
  color: #e8edf5; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all 0.18s;
  font-family: 'Heebo', sans-serif;
}
.admin-btn:hover { border-color: #3b82f6; color: #60a5fa; }
.admin-btn.primary {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  border-color: transparent; color: #fff;
  box-shadow: 0 3px 12px rgba(59,130,246,0.3);
}
.admin-btn.primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(59,130,246,0.4); }
.admin-btn.danger { color: #ef4444; }
.admin-btn.danger:hover { border-color: #ef4444; background: rgba(239,68,68,0.1); }
.admin-btn.success { color: #22c55e; }
.admin-btn.success:hover { border-color: #22c55e; background: rgba(34,197,94,0.1); }

.admin-content {
  flex: 1; overflow-y: auto;
  padding: 24px 28px;
}

/* ===== OVERVIEW SECTION ===== */
.admin-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.admin-stat-card {
  background: #111622;
  border: 1px solid #1e2a42;
  border-radius: 14px;
  padding: 20px 18px;
}
.admin-stat-icon { font-size: 24px; margin-bottom: 10px; }
.admin-stat-num { font-size: 28px; font-weight: 800; color: #e8edf5; line-height: 1; }
.admin-stat-label { font-size: 12px; color: #8896b0; margin-top: 4px; }

/* Tree view */
.admin-tree {
  background: #111622;
  border: 1px solid #1e2a42;
  border-radius: 14px;
  overflow: hidden;
}
.admin-tree-header {
  padding: 14px 18px;
  border-bottom: 1px solid #1e2a42;
  font-size: 13px; font-weight: 700; color: #8896b0;
  letter-spacing: 0.5px;
}
.admin-tree-root {
  padding: 8px 0;
}
.tree-node {
  user-select: none;
}
.tree-node-row {
  display: flex; align-items: center;
  padding: 6px 16px;
  cursor: pointer;
  transition: background 0.15s;
  font-size: 13px;
  gap: 6px;
}
.tree-node-row:hover { background: #161d2e; }
.tree-node-row.tree-selected { background: rgba(59,130,246,0.12); color: #60a5fa; }
.tree-toggle { width: 16px; font-size: 10px; color: #4a5568; flex-shrink: 0; }
.tree-icon { font-size: 14px; flex-shrink: 0; }
.tree-label { flex: 1; color: #e8edf5; font-weight: 500; }
.tree-node-row:hover .tree-label { color: #e8edf5; }
.tree-badge {
  font-size: 10px; background: #1e2a42; border-radius: 8px; padding: 1px 7px;
  color: #8896b0;
}
.tree-children {
  padding-right: 18px;
  border-right: 1px dashed #1e2a42;
  margin-right: 24px;
  display: none;
}
.tree-children.open { display: block; }

/* ===== LIST/EDIT SECTION ===== */
.admin-section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.admin-section-title {
  font-size: 16px; font-weight: 700; color: #e8edf5;
}
.admin-section-sub { font-size: 12px; color: #4a5568; }

.admin-list {
  display: flex; flex-direction: column; gap: 8px;
}
.admin-list-item {
  background: #111622;
  border: 1px solid #1e2a42;
  border-radius: 12px;
  padding: 14px 16px;
  display: flex; align-items: center; gap: 12px;
  transition: all 0.18s;
  cursor: grab;
}
.admin-list-item:hover { border-color: #2d3748; }
.admin-list-item.dragging { opacity: 0.4; cursor: grabbing; }
.admin-list-item.drag-over { border-color: #3b82f6; background: rgba(59,130,246,0.06); }
.drag-handle {
  color: #2d3748; font-size: 14px; cursor: grab; flex-shrink: 0;
  display: flex; flex-direction: column; gap: 3px;
}
.drag-handle span { width: 14px; height: 2px; background: currentColor; display: block; border-radius: 2px; }
.item-icon { font-size: 20px; flex-shrink: 0; min-width: 28px; text-align: center; }
.item-body { flex: 1; min-width: 0; }
.item-title { font-size: 14px; font-weight: 600; color: #e8edf5; }
.item-sub { font-size: 12px; color: #8896b0; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-actions { display: flex; gap: 6px; flex-shrink: 0; }
.item-btn {
  width: 30px; height: 30px; border-radius: 7px;
  border: 1px solid #1e2a42;
  background: transparent;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all 0.18s;
  font-size: 13px;
  color: #8896b0;
}
.item-btn:hover { border-color: #3b82f6; color: #60a5fa; background: rgba(59,130,246,0.1); }
.item-btn.del:hover { border-color: #ef4444; color: #ef4444; background: rgba(239,68,68,0.1); }
.item-tag {
  font-size: 10px; padding: 2px 8px; border-radius: 20px;
  background: #161d2e; border: 1px solid #1e2a42;
  color: #8896b0; flex-shrink: 0;
}
.item-tag.robot { border-color: rgba(59,130,246,0.3); color: #60a5fa; }
.item-tag.standing { border-color: rgba(34,197,94,0.3); color: #22c55e; }

/* ===== EDIT MODAL ===== */
#adminEditModal {
  display: none;
  position: fixed; inset: 0; z-index: 9600;
  background: rgba(10,13,20,0.88);
  backdrop-filter: blur(6px);
  align-items: center; justify-content: center;
  padding: 20px;
}
#adminEditModal.open { display: flex; animation: adminFadeIn 0.25s ease; }
.admin-modal-box {
  background: #111622;
  border: 1px solid #1e2a42;
  border-radius: 18px;
  padding: 28px 32px;
  width: 100%; max-width: 560px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: 0 30px 80px rgba(0,0,0,0.7);
  animation: adminSlideIn 0.35s cubic-bezier(0.22,1,0.36,1);
}
.admin-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 22px;
}
.admin-modal-title { font-size: 17px; font-weight: 800; color: #e8edf5; }
.admin-modal-close {
  width: 30px; height: 30px; border-radius: 7px;
  border: 1px solid #1e2a42; background: transparent;
  color: #8896b0; font-size: 15px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.18s;
}
.admin-modal-close:hover { border-color: #ef4444; color: #ef4444; }
.admin-field { margin-bottom: 16px; }
.admin-field label {
  display: block; font-size: 12px; font-weight: 700; color: #8896b0;
  margin-bottom: 6px; letter-spacing: 0.3px;
}
.admin-field input, .admin-field textarea, .admin-field select {
  width: 100%;
  background: #161d2e;
  border: 1px solid #1e2a42;
  border-radius: 9px;
  padding: 10px 13px;
  font-size: 14px; color: #e8edf5;
  font-family: 'Heebo', sans-serif;
  transition: border-color 0.18s;
  direction: rtl;
}
.admin-field input:focus, .admin-field textarea:focus, .admin-field select:focus {
  outline: none; border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
}
.admin-field textarea { resize: vertical; min-height: 80px; }
.admin-field select option { background: #161d2e; }
.admin-modal-footer {
  display: flex; gap: 10px; justify-content: flex-end;
  margin-top: 24px; padding-top: 20px;
  border-top: 1px solid #1e2a42;
}

/* Guide links editor */
.guides-editor { display: flex; flex-direction: column; gap: 8px; }
.guide-row {
  background: #161d2e;
  border: 1px solid #1e2a42;
  border-radius: 9px;
  padding: 10px 12px;
  display: flex; gap: 8px; align-items: flex-start;
}
.guide-row-fields { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.guide-row-fields input { font-size: 12px; padding: 6px 10px; }
.guide-row-del {
  width: 28px; height: 28px; border-radius: 6px;
  border: 1px solid #2d3748; background: transparent;
  color: #4a5568; cursor: pointer; transition: all 0.18s;
  font-size: 13px; flex-shrink: 0;
}
.guide-row-del:hover { border-color: #ef4444; color: #ef4444; background: rgba(239,68,68,0.1); }
.guide-row-eye {
  width: 28px; height: 28px; border-radius: 6px;
  border: 1px solid #2d3748; background: transparent;
  color: #4a5568; cursor: pointer; transition: all 0.18s;
  font-size: 13px; flex-shrink: 0;
}
.guide-row-eye:hover { border-color: #3b82f6; color: #60a5fa; background: rgba(59,130,246,0.1); }
.add-guide-btn {
  padding: 7px 14px;
  background: transparent; border: 1px dashed #2d3748;
  border-radius: 8px; color: #4a5568; font-size: 12px; font-weight: 600;
  cursor: pointer; transition: all 0.18s; font-family: 'Heebo', sans-serif;
  width: 100%; margin-top: 4px;
}
.add-guide-btn:hover { border-color: #3b82f6; color: #60a5fa; }

/* ===== TOAST ===== */
#adminToast {
  position: fixed;
  bottom: 80px; left: 50%; transform: translateX(-50%);
  background: #22c55e;
  color: #fff;
  padding: 10px 22px;
  border-radius: 30px;
  font-size: 13px; font-weight: 700;
  z-index: 9999;
  display: none;
  box-shadow: 0 6px 24px rgba(34,197,94,0.4);
  animation: adminToastIn 0.3s ease;
  white-space: nowrap;
}
#adminToast.show { display: block; }
#adminToast.error { background: #ef4444; box-shadow: 0 6px 24px rgba(239,68,68,0.4); }
@keyframes adminToastIn { from{opacity:0;transform:translateX(-50%) translateY(10px)} to{opacity:1;transform:translateX(-50%) translateY(0)} }

/* ===== CONFIRM DIALOG ===== */
#adminConfirm {
  display: none;
  position: fixed; inset: 0; z-index: 9700;
  background: rgba(10,13,20,0.88);
  align-items: center; justify-content: center;
}
#adminConfirm.open { display: flex; }
.admin-confirm-box {
  background: #111622;
  border: 1px solid #1e2a42;
  border-radius: 16px;
  padding: 28px 32px;
  max-width: 380px; width: 100%;
  text-align: center;
  box-shadow: 0 30px 80px rgba(0,0,0,0.7);
  animation: adminSlideIn 0.3s cubic-bezier(0.22,1,0.36,1);
}
.admin-confirm-icon { font-size: 36px; margin-bottom: 12px; }
.admin-confirm-title { font-size: 17px; font-weight: 800; color: #e8edf5; margin-bottom: 8px; }
.admin-confirm-sub { font-size: 13px; color: #8896b0; margin-bottom: 22px; }
.admin-confirm-btns { display: flex; gap: 10px; justify-content: center; }

/* ===== SEARCH BAR ===== */
.admin-search-wrap { position: relative; margin-bottom: 16px; }
.admin-search-input {
  width: 100%;
  background: #111622;
  border: 1px solid #1e2a42;
  border-radius: 10px;
  padding: 10px 14px 10px 36px;
  font-size: 13px; color: #e8edf5;
  font-family: 'Heebo', sans-serif;
  direction: rtl;
  transition: border-color 0.18s;
}
.admin-search-input:focus { outline: none; border-color: #3b82f6; }
.admin-search-icon {
  position: absolute;
  left: 12px; top: 50%; transform: translateY(-50%);
  color: #4a5568; font-size: 14px;
  pointer-events: none;
}

/* Scrollbar */
.admin-content::-webkit-scrollbar,
.admin-modal-box::-webkit-scrollbar,
.admin-sidebar::-webkit-scrollbar { width: 4px; }
.admin-content::-webkit-scrollbar-track,
.admin-modal-box::-webkit-scrollbar-track,
.admin-sidebar::-webkit-scrollbar-track { background: transparent; }
.admin-content::-webkit-scrollbar-thumb,
.admin-modal-box::-webkit-scrollbar-thumb,
.admin-sidebar::-webkit-scrollbar-thumb { background: #1e2a42; border-radius: 4px; }

/* Tabs */
.admin-tabs {
  display: flex; gap: 4px; margin-bottom: 18px;
  background: #0d1117;
  border: 1px solid #1e2a42;
  border-radius: 10px;
  padding: 4px;
}
.admin-tab {
  flex: 1; text-align: center;
  padding: 7px 10px;
  border-radius: 7px;
  font-size: 12px; font-weight: 600; color: #8896b0;
  cursor: pointer; transition: all 0.18s;
  border: none; background: none;
  font-family: 'Heebo', sans-serif;
}
.admin-tab.active { background: #1e2a42; color: #e8edf5; }
.admin-tab:hover:not(.active) { color: #e8edf5; }

/* Responsive */
@media (max-width: 700px) {
  .admin-sidebar { width: 200px; }
  .admin-content { padding: 16px; }
  .admin-topbar { padding: 12px 16px; }
  .admin-modal-box { padding: 20px; }
}
@media (max-width: 500px) {
  .admin-sidebar { display: none; }
}
