:root {
  --bg-main: #060b14;
  --bg-card: #0b1322;
  --bg-card-active: #0c1626;
  --bg-input: #040810;
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-active: #00d26a;
  
  --text-main: #ffffff;
  --text-muted: #7284a1;
  --text-dim: #4d5d77;
  
  --green-btn: #00c853;
  --green-btn-hover: #00b34a;
  --red-btn: #ef4444;
  --red-btn-hover: #dc2626;
  
  --radius-sm: 6px;
  --radius-md: 10px;
}

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

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

/* App Header */
.app-header {
  background: rgba(11, 19, 34, 0.95);
  border-bottom: 1px solid var(--border-subtle);
  padding: 12px 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
}
.header-inner {
  max-width: 1700px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.brand-group {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-logo-wrap {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: rgba(0, 212, 255, 0.1);
  border: 1px solid rgba(0, 212, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.brand-logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.logo-fallback {
  color: #00d4ff;
  font-size: 16px;
}
.title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.brand-title {
  font-size: 17px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.01em;
}
.brand-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.badge {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}
.badge-beta {
  background: rgba(139, 92, 246, 0.2);
  color: #c084fc;
  border: 1px solid rgba(139, 92, 246, 0.35);
}
.badge-accent {
  background: rgba(0, 212, 255, 0.15);
  color: #00d4ff;
  border: 1px solid rgba(0, 212, 255, 0.3);
}

/* Tab Navigation Buttons */
.tab-nav-group {
  display: flex;
  gap: 6px;
  background: rgba(0, 0, 0, 0.3);
  padding: 3px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}
.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}
.tab-btn:hover {
  color: #fff;
}
.tab-btn.active {
  background: #1e293b;
  color: #00e676;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
.tab-counter {
  font-size: 10px;
  background: rgba(0, 230, 118, 0.2);
  color: #00e676;
  padding: 1px 5px;
  border-radius: 10px;
  border: 1px solid rgba(0, 230, 118, 0.3);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.server-status-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
}
.status-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
}
.active-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  color: #a0aec0;
  border: 1px solid var(--border-subtle);
}

/* Main Container */
.main-container {
  max-width: 1700px;
  margin: 0 auto;
  padding: 16px 24px 40px;
}

/* Tab Panes */
.tab-pane {
  display: none;
}
.tab-pane.active {
  display: block;
  animation: fadeIn 0.2s ease-out;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Top Instruction Banner */
.instruction-banner {
  margin-bottom: 18px;
}
.instruction-text {
  font-size: 12px;
  color: #8b9bb4;
  font-weight: 500;
}

/* 10 Slots Grid (5 columns x 2 rows on large screens) */
.slots-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}

@media (max-width: 1400px) {
  .slots-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 992px) {
  .slots-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 600px) {
  .slots-grid {
    grid-template-columns: 1fr;
  }
}

/* Slot Card */
.slot-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
  position: relative;
}

.slot-card.is-active {
  border: 1.5px solid var(--border-active);
  background: var(--bg-card-active);
  box-shadow: 0 0 16px rgba(0, 210, 106, 0.14);
}

/* Card Header */
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.card-title-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}
.pin-icon {
  font-size: 14px;
  line-height: 1;
}
.card-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.slot-badge {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.slot-badge.active {
  background: rgba(0, 210, 106, 0.16);
  color: #00e676;
  border: 1px solid rgba(0, 210, 106, 0.4);
}
.slot-badge.empty {
  background: rgba(255, 255, 255, 0.05);
  color: #64748b;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.slot-badge.inactive {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

/* Subtitle / Meta */
.card-meta {
  font-size: 11px;
  color: var(--text-muted);
  min-height: 32px;
  margin-bottom: 10px;
  line-height: 1.35;
}
.card-meta strong {
  color: #cbd5e1;
}

/* File Picker Row */
.file-picker-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.file-picker-row .btn-choose {
  background: #1e293b;
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  white-space: nowrap;
}
.file-picker-row .btn-choose:hover {
  background: #334155;
  color: #fff;
}
.file-chosen-name {
  font-size: 11px;
  color: #94a3b8;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 140px;
}

/* JSON Textarea - Crisp, Dark, High-Contrast */
.json-box-wrap {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 10px;
}
.json-label {
  font-size: 11px;
  font-weight: 700;
  color: #cbd5e1;
  display: block;
}
.slot-textarea,
.json-textarea {
  width: 100% !important;
  height: 110px !important;
  min-height: 100px !important;
  background: #020617 !important;
  border: 1.5px solid rgba(255, 255, 255, 0.16) !important;
  border-radius: 8px !important;
  padding: 10px !important;
  color: #38bdf8 !important;
  font-family: 'JetBrains Mono', 'Consolas', monospace !important;
  font-size: 11.5px !important;
  line-height: 1.45 !important;
  resize: vertical !important;
  outline: none !important;
  box-sizing: border-box !important;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.6) !important;
  transition: all 0.2s ease !important;
  display: block !important;
}
.slot-textarea:focus,
.json-textarea:focus {
  border-color: #00e676 !important;
  background: #04091a !important;
  color: #f8fafc !important;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.7), 0 0 0 3px rgba(0, 230, 118, 0.2) !important;
}
.slot-textarea::placeholder,
.json-textarea::placeholder {
  color: #64748b !important;
  font-style: normal;
  opacity: 0.8;
}

/* Buttons */
.btn {
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  transition: all 0.15s ease;
}
.btn-sm {
  padding: 5px 12px;
  font-size: 11px;
}
.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

.card-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: auto;
}
.card-actions-sub {
  display: flex;
  gap: 6px;
  width: 100%;
}
.card-actions-sub .btn {
  flex: 1;
}

.btn-save,
.btn-primary {
  width: 100%;
  background: var(--green-btn);
  color: #032b14;
  font-weight: 800;
  padding: 8px 12px;
  border-radius: 6px;
}
.btn-save:hover,
.btn-primary:hover {
  background: var(--green-btn-hover);
  filter: brightness(1.05);
}

.btn-warning {
  background: #f59e0b;
  color: #000;
  font-weight: 700;
}
.btn-warning:hover {
  background: #d97706;
}
.btn-success {
  background: #10b981;
  color: #fff;
  font-weight: 700;
}
.btn-success:hover {
  background: #059669;
}
.btn-delete {
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  font-weight: 700;
}
.btn-delete:hover {
  background: #ef4444;
  color: #fff;
}

/* =========================================
   USER SECTION STYLING
   ========================================= */
.users-split-grid {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 20px;
}
@media (max-width: 900px) {
  .users-split-grid {
    grid-template-columns: 1fr;
  }
}

.user-card-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
}
.panel-header {
  margin-bottom: 16px;
}
.panel-header-split {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.panel-title {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}
.panel-desc {
  font-size: 11px;
  color: var(--text-muted);
}

.form-group {
  margin-bottom: 14px;
}
.form-group label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 5px;
}
.input {
  width: 100%;
  height: 38px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: #fff;
  padding: 0 12px;
  font-family: inherit;
  font-size: 12px;
  outline: none;
  transition: border-color 0.15s ease;
}
.input:focus {
  border-color: rgba(0, 210, 106, 0.6);
}

.demo-account-notice {
  margin-top: 18px;
  background: rgba(0, 212, 255, 0.06);
  border: 1px solid rgba(0, 212, 255, 0.2);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-size: 11px;
}
.demo-account-notice strong {
  color: #00d4ff;
  display: block;
  margin-bottom: 6px;
}
.demo-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}
.demo-account-notice code {
  font-family: 'JetBrains Mono', monospace;
  background: rgba(0,0,0,0.3);
  padding: 1px 6px;
  border-radius: 4px;
  color: #fff;
}
.demo-account-notice small {
  color: var(--text-dim);
  display: block;
  margin-top: 6px;
}

/* Users Table */
.users-table-wrap {
  overflow-x: auto;
}
.users-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.users-table th {
  text-align: left;
  padding: 10px 12px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
  font-weight: 600;
  font-size: 11px;
}
.users-table td {
  padding: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  vertical-align: middle;
}
.users-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}
.password-box {
  font-family: 'JetBrains Mono', monospace;
  color: #94a3b8;
  background: rgba(0,0,0,0.3);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
}

.hidden {
  display: none !important;
}

/* Toast System */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: #0f1c32;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  gap: 8px;
}
.toast.success { border-color: #00d26a; }
.toast.error { border-color: #ef4444; }

/* Maintenance Header Pill Button */
.maintenance-pill-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.05);
  color: #94a3b8;
  transition: all 0.2s ease;
}
.maintenance-pill-btn.on {
  background: rgba(245, 158, 11, 0.18);
  border-color: rgba(245, 158, 11, 0.4);
  color: #fbbf24;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.2);
}
.maint-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #64748b;
}
.maintenance-pill-btn.on .maint-dot {
  background: #f59e0b;
  box-shadow: 0 0 8px #f59e0b;
}

/* Maintenance Banner Card */
.maintenance-banner-card {
  background: #0b1322;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  transition: all 0.25s ease;
}
.maintenance-banner-card.on {
  background: linear-gradient(135deg, rgba(35, 22, 10, 0.95), rgba(18, 14, 28, 0.95));
  border: 1.5px solid rgba(245, 158, 11, 0.6);
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.15);
}
.maint-card-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.maint-icon {
  font-size: 24px;
}
.maint-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}
.maint-desc {
  font-size: 11px;
  color: var(--text-muted);
}
.maint-card-right {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}
.maint-input-wrap label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.maint-input {
  width: 380px;
  height: 36px;
  font-size: 11px;
}
@media (max-width: 768px) {
  .maint-input {
    width: 100%;
  }
}
.btn-maint-toggle {
  background: #e11d48;
  color: #fff;
  height: 36px;
  padding: 0 16px;
  font-size: 11px;
}
.btn-maint-toggle:hover {
  background: #be123c;
}
.btn-maint-toggle.is-active {
  background: #10b981;
}
.btn-maint-toggle.is-active:hover {
  background: #059669;
}

/* Admin Profile & Logout */
.admin-profile-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 200, 83, 0.1);
  border: 1px solid rgba(0, 200, 83, 0.3);
  color: #00e676;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 20px;
}
.admin-profile-pill .admin-avatar {
  font-size: 13px;
}
.btn-danger-soft {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #f87171;
  font-weight: 600;
  transition: all 0.2s ease;
}
.btn-danger-soft:hover {
  background: #ef4444;
  color: #ffffff;
  border-color: #ef4444;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.4);
}

/* ====================================================
   ADMIN LOGIN OVERLAY MODAL (Password Protected)
   ==================================================== */
.admin-login-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 7, 13, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.admin-login-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.admin-login-card {
  width: 100%;
  max-width: 440px;
  background: linear-gradient(145deg, #0e172a 0%, #080f1d 100%);
  border: 1px solid rgba(0, 210, 106, 0.3);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8), 0 0 40px rgba(0, 200, 83, 0.15);
  border-radius: 18px;
  padding: 34px 30px;
  position: relative;
  overflow: hidden;
  animation: modalScaleUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes modalScaleUp {
  0% { transform: scale(0.92); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
.admin-login-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #00c853, #10b981, #06b6d4, #00c853);
  background-size: 200% 100%;
  animation: rainbowBorder 4s linear infinite;
}
@keyframes rainbowBorder {
  0% { background-position: 0% 0%; }
  100% { background-position: 200% 0%; }
}

.admin-card-header {
  text-align: center;
  margin-bottom: 24px;
}
.admin-logo-badge {
  width: 60px;
  height: 60px;
  margin: 0 auto 14px;
  background: rgba(0, 200, 83, 0.08);
  border: 1px solid rgba(0, 200, 83, 0.3);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 25px rgba(0, 200, 83, 0.2);
}
.admin-modal-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
}
.admin-modal-fallback {
  font-size: 24px;
  font-weight: 900;
  color: #00e676;
}
.admin-modal-title {
  font-size: 20px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}
.admin-modal-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

.admin-login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.admin-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}
.admin-form-group label {
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.admin-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.admin-input-wrap .input-icon {
  position: absolute;
  left: 14px;
  font-size: 14px;
  pointer-events: none;
  opacity: 0.7;
}
.admin-input-wrap input {
  width: 100%;
  height: 44px;
  padding: 0 14px 0 40px;
  background: #040811;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: #ffffff;
  font-size: 13px;
  font-family: inherit;
  transition: all 0.2s ease;
}
.admin-input-wrap input:focus {
  outline: none;
  border-color: #00e676;
  box-shadow: 0 0 0 3px rgba(0, 230, 118, 0.15);
  background: #060c18;
}

.admin-login-alert {
  padding: 10px 14px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
  animation: shakeAlert 0.4s ease;
}
@keyframes shakeAlert {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.btn-admin-submit {
  width: 100%;
  height: 44px;
  margin-top: 6px;
  background: linear-gradient(135deg, #00c853 0%, #059669 100%);
  border: none;
  border-radius: 10px;
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 16px rgba(0, 200, 83, 0.35);
  transition: all 0.2s ease;
}
.btn-admin-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(0, 200, 83, 0.5);
  filter: brightness(1.08);
}
.btn-admin-submit:active {
  transform: translateY(1px);
}
.btn-admin-submit .btn-arrow {
  font-size: 14px;
  transition: transform 0.2s ease;
}
.btn-admin-submit:hover .btn-arrow {
  transform: translateX(3px);
}

.admin-card-footer {
  margin-top: 22px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 10px;
  color: #64748b;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 16px;
}
.footer-lock-icon {
  font-size: 11px;
}

