/* ========================================================
   Tool Genzy KH - Admin Console & Control Center
   Design System: Apple Light Canvas (Clean White Aesthetic)
   Enterprise Standard • 0 Emojis • 100% Fully Responsive
======================================================== */

:root {
  /* Clean Apple Light Color Palette */
  --admin-bg-base: #f8fafc;
  --admin-bg-surface: #ffffff;
  --admin-bg-card: #ffffff;
  --admin-bg-hover: #f1f5f9;
  
  --admin-border: #e2e8f0;
  --admin-border-subtle: #edf2f7;
  --admin-border-focus: #d97706;
  
  /* Contrast High-Precision Typography */
  --text-main: #0f172a;
  --text-body: #334155;
  --text-muted: #64748b;
  --text-sub: #94a3b8;
  
  /* Apple Executive Accents */
  --gold: #d97706;
  --gold-hover: #b45309;
  --gold-surface: #fef3c7;
  --gold-border: #fcd34d;
  
  --green: #15803d;
  --green-surface: #dcfce7;
  --green-border: #86efac;
  
  --red: #b91c1c;
  --red-surface: #fee2e2;
  --red-border: #fca5a5;
  
  --blue: #1d4ed8;
  --blue-surface: #dbeafe;
  --blue-border: #93c5fd;

  --cyan: #0e7490;
  --cyan-surface: #cffafe;
  --cyan-border: #67e8f9;

  --purple: #7e22ce;
  --purple-surface: #f3e8ff;
  --purple-border: #d8b4fe;
  
  /* Apple Geometric Radius & Elevation */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.05), 0 1px 3px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 12px 30px rgba(15, 23, 42, 0.08), 0 4px 8px rgba(15, 23, 42, 0.04);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Outfit', 'Kantumruy Pro', sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--admin-bg-base);
  color: var(--text-main);
  min-height: 100vh;
  padding-bottom: 60px;
  line-height: 1.5;
}

/* ========================================================
   Top Navigation Bar (Pristine Light / Sticky)
======================================================== */
.admin-navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--admin-border);
  box-shadow: var(--shadow-xs);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

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

.brand-icon-box {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--gold-surface);
  border: 1px solid var(--gold-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  flex-shrink: 0;
}

.brand-text h1 {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.3px;
  color: var(--text-main);
  line-height: 1.2;
}

.brand-text span {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

.admin-nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--gold-surface);
  border: 1px solid var(--gold-border);
  font-size: 12px;
  font-weight: 700;
  color: var(--gold);
}

.admin-pill span {
  color: var(--text-muted);
  font-weight: 500;
}

.btn-open-app {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: var(--admin-bg-surface);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-sm);
  color: var(--text-body);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: var(--shadow-xs);
  transition: all 0.2s ease;
}

.btn-open-app:hover {
  background: var(--admin-bg-hover);
  color: var(--text-main);
  border-color: #cbd5e1;
}

/* ========================================================
   Tab Navigation Menu (Apple Segmented Style)
======================================================== */
.admin-tabs-bar {
  max-width: 1320px;
  margin: 18px auto 0;
  padding: 0 20px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.admin-tabs-bar::-webkit-scrollbar {
  display: none;
}

.admin-tab-btn {
  background: var(--admin-bg-surface);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  box-shadow: var(--shadow-xs);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.admin-tab-btn:hover {
  color: var(--text-main);
  background: var(--admin-bg-hover);
  border-color: #cbd5e1;
}

.admin-tab-btn.active {
  background: var(--admin-bg-surface);
  border-color: var(--gold);
  color: var(--gold);
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.15);
  font-weight: 700;
}

.admin-tab-icon {
  width: 16px;
  height: 16px;
  stroke-width: 2.2;
}

/* ========================================================
   Main Container & View Panels
======================================================== */
.admin-container {
  max-width: 1320px;
  margin: 20px auto 0;
  padding: 0 20px;
}

.tab-content-panel {
  display: none;
  animation: fadeIn 0.22s ease-out;
}

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

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

/* ========================================================
   KPI Metrics Grid (Pure White Cards with Soft Tints)
======================================================== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--admin-bg-surface);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.kpi-card:hover {
  transform: translateY(-2px);
  border-color: #cbd5e1;
  box-shadow: var(--shadow-md);
}

.kpi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.kpi-title {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
}

.kpi-icon-box {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kpi-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.5px;
  line-height: 1.15;
}

.kpi-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
  font-weight: 500;
}

/* ========================================================
   Quick Actions Bar
======================================================== */
.quick-actions-bar {
  background: var(--admin-bg-surface);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.action-btns-wrap {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-admin {
  background: var(--admin-bg-surface);
  border: 1px solid var(--admin-border);
  color: var(--text-main);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: var(--shadow-xs);
  transition: all 0.2s ease;
}

.btn-admin:hover {
  background: var(--admin-bg-hover);
  border-color: #cbd5e1;
}

.btn-admin.gold {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border-color: #d97706;
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.25);
}

.btn-admin.gold:hover {
  background: linear-gradient(135deg, #d97706, #b45309);
  box-shadow: 0 4px 14px rgba(217, 119, 6, 0.35);
}

/* ========================================================
   Data Tables & Section Panels (Pure White Surfaces)
======================================================== */
.section-panel {
  background: var(--admin-bg-surface);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.section-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.section-panel-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--admin-border-subtle);
  -webkit-overflow-scrolling: touch;
}

.table-card {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--admin-border-subtle);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: var(--admin-bg-surface);
}

.admin-table th {
  background: #f8fafc;
  color: var(--text-muted);
  text-align: left;
  padding: 12px 14px;
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border-bottom: 1px solid var(--admin-border);
  white-space: nowrap;
}

.admin-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--admin-border-subtle);
  color: var(--text-body);
  white-space: nowrap;
}

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

.admin-table tr:hover td {
  background: #f8fafc;
}

/* ========================================================
   Status Badges (Clean Soft Apple Pills)
======================================================== */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
}

.badge-status.vip {
  background: var(--gold-surface);
  border: 1px solid var(--gold-border);
  color: var(--gold);
}

.badge-status.free {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: var(--text-muted);
}

.badge-status.paid {
  background: var(--green-surface);
  border: 1px solid var(--green-border);
  color: var(--green);
}

.badge-status.pending {
  background: var(--gold-surface);
  border: 1px solid var(--gold-border);
  color: var(--gold);
}

/* ========================================================
   Search & Filter Controls
======================================================== */
.filter-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--admin-bg-surface);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  box-shadow: var(--shadow-xs);
}

.filter-search-box input {
  background: none;
  border: none;
  color: var(--text-main);
  font-size: 13px;
  outline: none;
  width: 200px;
}

.filter-search-box svg {
  color: var(--text-muted);
  flex-shrink: 0;
}

/* ========================================================
   Form Inputs & Modals (White Surface Elevation)
======================================================== */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-body);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 9px 13px;
  background: var(--admin-bg-surface);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 13.5px;
  outline: none;
  box-shadow: var(--shadow-xs);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.15);
}

.modal-admin-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-admin-card {
  background: var(--admin-bg-surface);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  padding: 26px;
  box-shadow: var(--shadow-lg);
  animation: popIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-admin-card h3 {
  color: var(--text-main) !important;
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.hidden {
  display: none !important;
}

/* ========================================================
   Master Admin Security Gate (Clean Enterprise Vault)
======================================================== */
.admin-vault-gate {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.admin-vault-gate.hidden {
  display: none !important;
}

.admin-vault-card {
  width: 100%;
  max-width: 440px;
  background: #ffffff;
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-xl);
  padding: 36px 30px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.28s ease-out;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.vault-shield-icon {
  margin-bottom: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 999px;
  background: var(--gold-surface);
  border: 1px solid var(--gold-border);
}

.admin-vault-card h2 {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.vault-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 20px;
}

/* ========================================================
   Mobile & Tablet Responsive Adaptations (100% Fluid)
======================================================== */
@media (max-width: 768px) {
  .admin-navbar {
    padding: 10px 16px;
  }
  
  .brand-text h1 {
    font-size: 14px;
  }
  
  .brand-text span {
    display: none;
  }
  
  .admin-container {
    padding: 0 14px;
    margin-top: 14px;
  }
  
  .admin-tabs-bar {
    padding: 0 14px;
    margin-top: 12px;
  }
  
  .kpi-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .quick-actions-bar {
    padding: 12px 14px;
    flex-direction: column;
    align-items: stretch;
  }
  
  .action-btns-wrap {
    flex-direction: column;
  }
  
  .action-btns-wrap .btn-admin {
    width: 100%;
    justify-content: center;
  }
  
  .section-panel {
    padding: 14px;
  }
  
  .section-panel-header {
    flex-direction: column;
    align-items: stretch;
  }
  
  .filter-search-box {
    width: 100%;
  }
  
  .filter-search-box input {
    width: 100%;
  }
}
