/* ================================================================
   IPTV Manager — Custom Styles
   ================================================================ */

:root {
  --primary:        #673DE6;
  --primary-dark:   #5530c4;
  --sidebar-bg:     #1a1a2e;
  --sidebar-width:  240px;
  --topbar-height:  60px;
  --body-bg:        #f0f2f8;
  --card-shadow:    0 2px 12px rgba(0,0,0,.08);
}

/* ── Body & Layout ────────────────────────────────────────── */
body {
  font-family: 'Inter', 'Segoe UI', sans-serif;
  background: var(--body-bg);
  color: #2d2d3f;
  min-height: 100vh;
}

/* ── Sidebar ──────────────────────────────────────────────── */
#sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--sidebar-bg);
  z-index: 1040;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  transition: transform .25s ease;
}

#sidebar .sidebar-brand {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,.07);
  display: flex;
  align-items: center;
  gap: .75rem;
  text-decoration: none;
}
#sidebar .sidebar-brand .brand-icon {
  width: 36px; height: 36px;
  background: var(--primary);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  color: #fff;
  flex-shrink: 0;
}
#sidebar .sidebar-brand .brand-text {
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: .3px;
}

#sidebar .nav-section {
  padding: .5rem 1rem .25rem;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(255,255,255,.3);
  margin-top: .5rem;
}

#sidebar .nav-link {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .6rem 1.5rem;
  color: rgba(255,255,255,.65);
  font-size: .875rem;
  font-weight: 500;
  border-radius: 0;
  transition: color .15s, background .15s;
  text-decoration: none;
}
#sidebar .nav-link i {
  font-size: 1rem;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}
#sidebar .nav-link:hover {
  color: #fff;
  background: rgba(255,255,255,.07);
}
#sidebar .nav-link.active {
  color: #fff;
  background: var(--primary);
}

/* ── Main Wrapper ─────────────────────────────────────────── */
#main-wrapper {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Top Bar ──────────────────────────────────────────────── */
#topbar {
  height: var(--topbar-height);
  background: #fff;
  border-bottom: 1px solid #e8eaf0;
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 1030;
  gap: 1rem;
}
#topbar .page-title {
  font-size: 1rem;
  font-weight: 600;
  color: #2d2d3f;
  margin: 0;
}

/* ── Content ──────────────────────────────────────────────── */
#content {
  flex: 1;
  padding: 1.5rem;
}

/* ── Cards ────────────────────────────────────────────────── */
.card {
  border: none;
  border-radius: 12px;
  box-shadow: var(--card-shadow);
}
.card-header {
  background: transparent;
  border-bottom: 1px solid #eef0f6;
  padding: 1rem 1.25rem;
  font-weight: 600;
  font-size: .9rem;
}

/* ── Stat Cards ───────────────────────────────────────────── */
.stat-card {
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  color: #fff;
  box-shadow: var(--card-shadow);
}
.stat-card .stat-icon {
  width: 50px; height: 50px;
  border-radius: 12px;
  background: rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.stat-card .stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1;
}
.stat-card .stat-label {
  font-size: .8rem;
  opacity: .85;
  margin-top: .2rem;
}

.bg-primary-gradient { background: linear-gradient(135deg, #673DE6, #8b5cf6); }
.bg-success-gradient { background: linear-gradient(135deg, #10b981, #34d399); }
.bg-warning-gradient { background: linear-gradient(135deg, #f59e0b, #fbbf24); }
.bg-danger-gradient  { background: linear-gradient(135deg, #ef4444, #f87171); }
.bg-info-gradient    { background: linear-gradient(135deg, #3b82f6, #60a5fa); }
.bg-dark-gradient    { background: linear-gradient(135deg, #374151, #6b7280); }

/* ── Tables ───────────────────────────────────────────────── */
.table thead th {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: #6b7280;
  border-bottom: 2px solid #eef0f6;
  background: #fafbfe;
}
.table td { vertical-align: middle; font-size: .875rem; }
.table-hover tbody tr:hover { background: #f8f9ff; }

/* ── Buttons ──────────────────────────────────────────────── */
.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
}
.btn-primary:hover, .btn-primary:focus {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}
.btn-outline-primary {
  color: var(--primary);
  border-color: var(--primary);
}
.btn-outline-primary:hover {
  background: var(--primary);
  border-color: var(--primary);
}

/* ── Badges ───────────────────────────────────────────────── */
.badge { font-weight: 600; font-size: .72rem; padding: .35em .65em; }

/* ── Login Page ───────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-card {
  width: 100%;
  max-width: 420px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,.4);
}
.login-card .login-header {
  background: var(--primary);
  padding: 2rem;
  text-align: center;
  color: #fff;
}
.login-card .login-header .brand-icon-lg {
  width: 60px; height: 60px;
  background: rgba(255,255,255,.2);
  border-radius: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.75rem;
  margin-bottom: .75rem;
}
.login-card .login-body {
  background: #fff;
  padding: 2rem;
}

/* ── Install Page ─────────────────────────────────────────── */
.install-page {
  min-height: 100vh;
  background: var(--body-bg);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem 1rem;
}

/* ── Forms ────────────────────────────────────────────────── */
.form-label { font-weight: 600; font-size: .85rem; color: #374151; }
.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 .2rem rgba(103,61,230,.15);
}

/* ── Alerts ───────────────────────────────────────────────── */
.alert { border: none; border-radius: 10px; }
.alert--success { background: #d1fae5; color: #065f46; }
.alert--danger  { background: #fee2e2; color: #7f1d1d; }
.alert--warning { background: #fef3c7; color: #78350f; }
.alert--info    { background: #dbeafe; color: #1e3a8a; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 991.98px) {
  #sidebar { transform: translateX(calc(-1 * var(--sidebar-width))); }
  #sidebar.show { transform: translateX(0); }
  #main-wrapper { margin-left: 0; }
}
