/* ============================================================
   GESTOR IPTV - Estilos Globais
   ============================================================ */

:root {
  --sidebar-width: 260px;
  --sidebar-bg: #0f1117;
  --sidebar-border: #1e2433;
  --accent: #00d4aa;
  --accent-dark: #00a884;
  --body-bg: #f4f6f9;
  --topbar-h: 60px;
}

/* ── RESET & BASE ─────────────────────────────────────────── */
* { box-sizing: border-box; }
body { background: var(--body-bg); font-family: 'Segoe UI', sans-serif; overflow-x: hidden; }

/* ── LOGIN PAGE ───────────────────────────────────────────── */
.login-body {
  background: linear-gradient(135deg, #0f1117 0%, #1a2332 50%, #0d2137 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-wrapper { width: 100%; max-width: 420px; padding: 20px; }
.login-card {
  background: #fff;
  border-radius: 16px;
  padding: 40px 36px;
  box-shadow: 0 20px 60px rgba(0,0,0,.4);
}
.login-brand { text-align: center; margin-bottom: 28px; }
.login-logo {
  width: 72px; height: 72px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 32px; color: #fff; margin-bottom: 12px;
}
.login-brand h4 { font-weight: 700; color: #1a1f2e; margin-bottom: 4px; }
.login-brand p  { color: #888; font-size: .85rem; margin: 0; }
.login-footer   { text-align: center; font-size: .78rem; color: #aaa; margin-top: 24px; margin-bottom: 0; }
.btn-primary    { background: var(--accent); border-color: var(--accent); font-weight: 600; }
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }

/* ── WRAPPER LAYOUT ───────────────────────────────────────── */
.wrapper { display: flex; }

/* ── SIDEBAR ──────────────────────────────────────────────── */
#sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--sidebar-bg);
  position: fixed; left: 0; top: 0;
  z-index: 999;
  display: flex; flex-direction: column;
  transition: all .3s ease;
  border-right: 1px solid var(--sidebar-border);
}
#sidebar.collapsed { width: 0; overflow: hidden; }

.sidebar-brand {
  display: flex; align-items: center;
  padding: 20px 20px 16px;
  color: var(--accent);
  font-size: 1.1rem; font-weight: 700;
  border-bottom: 1px solid var(--sidebar-border);
  letter-spacing: .3px;
}
.sidebar-section {
  padding: 16px 20px 6px;
  font-size: .65rem; font-weight: 700;
  letter-spacing: 1.2px;
  color: #4a5568;
}
#sidebar .nav-link {
  padding: 10px 20px;
  color: #9ca3af;
  font-size: .875rem;
  border-left: 3px solid transparent;
  transition: all .2s;
  display: flex; align-items: center;
}
#sidebar .nav-link:hover {
  color: #fff;
  background: rgba(255,255,255,.05);
  border-left-color: var(--accent);
}
#sidebar .nav-link.active {
  color: var(--accent);
  background: rgba(0,212,170,.1);
  border-left-color: var(--accent);
  font-weight: 600;
}
#sidebar .nav-link.text-danger:hover { border-left-color: #dc3545; background: rgba(220,53,69,.08); }

.sidebar-user {
  margin-top: auto;
  padding: 16px 20px;
  border-top: 1px solid var(--sidebar-border);
  display: flex; align-items: center; gap: 12px;
}
.user-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent);
  color: #fff; font-weight: 700; font-size: .9rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.user-name  { color: #fff; font-size: .85rem; font-weight: 600; line-height: 1.2; }
.user-role  { color: #6b7280; font-size: .72rem; }

/* ── TOPBAR ───────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.topbar-right { display: flex; align-items: center; gap: 10px; }

/* ── MAIN CONTENT ─────────────────────────────────────────── */
#content {
  margin-left: var(--sidebar-width);
  flex: 1; min-width: 0;
  transition: margin .3s ease;
}
#content.expanded { margin-left: 0; }
.main-content { padding: 24px; }

/* ── PAGE HEADER ──────────────────────────────────────────── */
.page-header {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e5e7eb;
}
.page-header h4 { font-weight: 700; color: #1a1f2e; margin-bottom: 4px; }

/* ── STAT CARDS ───────────────────────────────────────────── */
.stat-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  display: flex; align-items: center; gap: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  border-left: 4px solid transparent;
  transition: transform .2s, box-shadow .2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,.1); }
.stat-icon {
  width: 52px; height: 52px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; flex-shrink: 0;
}
.stat-value { font-size: 1.6rem; font-weight: 800; line-height: 1; color: #1a1f2e; }
.stat-label { font-size: .8rem; color: #6b7280; margin-top: 4px; font-weight: 600; }
.stat-sub   { font-size: .72rem; color: #9ca3af; margin-top: 2px; }

.stat-green { border-left-color: #10b981; }
.stat-green .stat-icon { background: #d1fae5; color: #059669; }
.stat-yellow { border-left-color: #f59e0b; }
.stat-yellow .stat-icon { background: #fef3c7; color: #d97706; }
.stat-blue { border-left-color: #3b82f6; }
.stat-blue .stat-icon { background: #dbeafe; color: #2563eb; }
.stat-purple { border-left-color: #8b5cf6; }
.stat-purple .stat-icon { background: #ede9fe; color: #7c3aed; }

/* ── CARDS ────────────────────────────────────────────────── */
.card { border: none; border-radius: 12px; }
.card-header {
  background: #fff; border-bottom: 1px solid #f3f4f6;
  font-weight: 600; font-size: .875rem;
  border-radius: 12px 12px 0 0 !important;
  padding: 14px 16px;
}
.table th { font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.table td { vertical-align: middle; font-size: .875rem; }

/* ── FORMS ────────────────────────────────────────────────── */
.form-label { font-weight: 600; font-size: .85rem; color: #374151; }

/* ── RESPONSIVE ───────────────────────────────────────────── */
@media (max-width: 768px) {
  #sidebar { width: 0; overflow: hidden; }
  #sidebar.mobile-open { width: var(--sidebar-width); }
  #content { margin-left: 0; }
}
