/* SwiftSupport - Professional Admin Dashboard */
/* Design System: Clean, minimal, enterprise-grade */

:root {
  --primary: #1e3a5f;
  --primary-light: #2c5282;
  --primary-dark: #152a45;
  --accent: #c53030;
  --accent-light: #e53e3e;
  --surface: #ffffff;
  --background: #f7f8fc;
  --sidebar-bg: #0f1923;
  --sidebar-hover: #1a2d3d;
  --sidebar-active: rgba(197, 48, 48, 0.15);
  --text-primary: #1a202c;
  --text-secondary: #4a5568;
  --text-muted: #a0aec0;
  --border: #e2e8f0;
  --border-light: #edf2f7;
  --success: #38a169;
  --success-bg: #f0fff4;
  --warning: #d69e2e;
  --warning-bg: #fffff0;
  --danger: #e53e3e;
  --danger-bg: #fff5f5;
  --info: #3182ce;
  --info-bg: #ebf8ff;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.04), 0 2px 4px rgba(0,0,0,0.03);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.04), 0 4px 6px rgba(0,0,0,0.02);
  --radius: 6px;
  --radius-lg: 10px;
  --transition: all 0.15s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--background);
  color: var(--text-primary);
  line-height: 1.5;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

/* ===== PAGES ===== */
.page { display: none; }
.page.active { display: block; }

/* ===== LOGIN ===== */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--sidebar-bg);
  position: relative;
  overflow: hidden;
}

.login-container::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(197,48,48,0.08) 0%, transparent 70%);
}

.login-container::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(30,58,95,0.15) 0%, transparent 70%);
}

.login-box {
  background: var(--surface);
  padding: 40px;
  border-radius: 12px;
  width: 380px;
  max-width: 90%;
  box-shadow: 0 25px 50px rgba(0,0,0,0.25);
  position: relative;
  z-index: 1;
}

.logo {
  text-align: center;
  margin-bottom: 4px;
}

.logo-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--primary) 100%);
  border-radius: 10px;
  font-size: 20px;
  margin-bottom: 12px;
}

.logo h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.login-subtitle {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 28px;
  font-size: 13px;
}

/* ===== FORMS ===== */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text-primary);
  background: var(--surface);
  transition: var(--transition);
  font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.08);
}

.form-group input::placeholder { color: var(--text-muted); }
.form-group textarea { min-height: 72px; resize: vertical; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border: none;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  font-family: inherit;
  white-space: nowrap;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 1px 3px rgba(30,58,95,0.3);
}
.btn-primary:hover { background: var(--primary-light); }

.btn-accent {
  background: var(--accent);
  color: white;
  box-shadow: 0 1px 3px rgba(197,48,48,0.3);
}
.btn-accent:hover { background: var(--accent-light); }

.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-warning { background: var(--warning); color: white; }

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}
.btn-outline:hover { background: var(--background); border-color: var(--text-muted); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 6px 10px;
}
.btn-ghost:hover { background: var(--background); color: var(--text-primary); }

.btn-full { width: 100%; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 14px; }

.error-text { color: var(--danger); font-size: 12px; margin-top: 12px; text-align: center; }

/* ===== DASHBOARD LAYOUT ===== */
#dashboard-page {
  display: none;
  min-height: 100vh;
}
#dashboard-page.active { display: flex; }

/* ===== SIDEBAR ===== */
.sidebar {
  width: 220px;
  background: var(--sidebar-bg);
  color: white;
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
}

.sidebar-header {
  padding: 20px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.sidebar-header .logo-icon {
  width: 32px;
  height: 32px;
  font-size: 14px;
  margin-bottom: 0;
}

.sidebar-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.3px;
}

.nav-menu {
  list-style: none;
  padding: 12px 8px;
  flex: 1;
}

.nav-item {
  padding: 9px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: rgba(255,255,255,0.55);
  transition: var(--transition);
  border-radius: var(--radius);
  margin-bottom: 2px;
}

.nav-item:hover {
  background: var(--sidebar-hover);
  color: rgba(255,255,255,0.9);
}

.nav-item.active {
  background: var(--sidebar-active);
  color: white;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  width: 3px;
  height: 24px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}

.nav-item span:first-child {
  font-size: 15px;
  width: 20px;
  text-align: center;
}

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.sidebar-footer .btn-outline {
  color: rgba(255,255,255,0.5);
  border-color: rgba(255,255,255,0.1);
  font-size: 12px;
}
.sidebar-footer .btn-outline:hover {
  color: white;
  background: rgba(255,255,255,0.05);
}

/* ===== MAIN CONTENT ===== */
.main-content {
  flex: 1;
  margin-left: 220px;
  padding: 28px 32px;
  min-height: 100vh;
}

.section { display: none; }
.section.active { display: block; }

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

h2 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 20px;
  letter-spacing: -0.3px;
}

/* ===== STATS ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  padding: 16px 18px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
}

.stat-card .stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.5px;
}

.stat-card .stat-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}

/* ===== CARDS ===== */
.card {
  background: var(--surface);
  padding: 20px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  margin-bottom: 12px;
}

.card h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ===== TABLES ===== */
.table-container {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
}

th {
  background: var(--background);
  font-weight: 500;
  color: var(--text-secondary);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: #fafbfd; }

/* ===== BADGES ===== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2px;
}

.badge-online, .badge-active, .badge-confirmed {
  background: var(--success-bg);
  color: var(--success);
}
.badge-offline, .badge-suspended {
  background: var(--danger-bg);
  color: var(--danger);
}
.badge-pending {
  background: var(--warning-bg);
  color: var(--warning);
}

/* ===== MODAL ===== */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 25, 35, 0.6);
  backdrop-filter: blur(2px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.active { display: flex; }

.modal-content {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 440px;
  max-width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-light);
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--text-muted);
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
}
.modal-close:hover { background: var(--background); color: var(--text-primary); }

/* ===== SUCCESS BOX ===== */
.success-box {
  background: var(--success-bg);
  border: 1px solid #c6f6d5;
  border-radius: var(--radius);
  padding: 14px;
  margin-top: 14px;
  font-size: 12px;
  line-height: 1.6;
}

/* ===== SEARCH ===== */
.search-bar input {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  width: 240px;
  background: var(--surface);
}
.search-bar input:focus {
  outline: none;
  border-color: var(--primary);
}

/* ===== PLANS ===== */
.plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.plan-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  text-align: center;
  position: relative;
}

.plan-card h3 {
  font-size: 15px;
  margin-bottom: 4px;
  text-transform: none;
  letter-spacing: 0;
}

.plan-card .price {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
  margin: 8px 0;
}
.plan-card .price span {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 400;
}

.plan-card .features {
  list-style: none;
  margin: 14px 0;
  text-align: left;
}
.plan-card .features li {
  padding: 4px 0;
  font-size: 12px;
  color: var(--text-secondary);
}
.plan-card .features li::before {
  content: "✓";
  color: var(--success);
  font-weight: 700;
  margin-right: 6px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .sidebar { width: 56px; }
  .sidebar-title { display: none; }
  .nav-item span:last-child { display: none; }
  .main-content { margin-left: 56px; padding: 20px 16px; }
  .grid-2 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .section-header { flex-direction: column; gap: 12px; align-items: flex-start; }
}

/* ===== UTILITY ===== */
code {
  background: var(--background);
  padding: 2px 5px;
  border-radius: 3px;
  font-size: 12px;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  color: var(--primary);
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}
.empty-state p { font-size: 13px; margin-top: 8px; }
