/* ──────────────────────────────────────────────────────
   CTV Platform — White Theme Stylesheet
   Modern CRM-style layout with Sidebar & Topbar
────────────────────────────────────────────────────── */

:root {
  --app-bg:           #f8f9fc;
  --sidebar-bg:       #ffffff;
  --topbar-bg:        #ffffff;
  --card-bg:          #ffffff;
  
  --primary:          #4e73df;
  --primary-hover:    #2e59d9;
  --secondary:        #858796;
  --success:          #1cc88a;
  --info:             #36b9cc;
  --warning:          #f6c23e;
  --danger:           #e74a3b;
  
  --text-main:        #4a4a4a;
  --text-dark:        #2d2d2d;
  --text-muted:       #8a8a8a;
  
  --border-color:     #e3e6f0;
  --sidebar-width:    260px;
  --sidebar-collapsed: 70px;
  
  --shadow-sm:        0 .125rem .25rem 0 rgba(58,59,69,.05);
  --shadow:           0 .15rem 1.75rem 0 rgba(58,59,69,.15);
  --transition:       all 0.2s ease-in-out;
  --radius:           8px;
}

/* ── GLOBAL ── */
body {
  font-family: 'Inter', sans-serif;
  background-color: var(--app-bg);
  color: var(--text-main);
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 { color: var(--text-dark); font-weight: 700; }

/* ── LAYOUT ── */
#wrapper {
  display: flex;
  min-height: 100vh;
}

/* ── SIDEBAR ── */
#sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  z-index: 1000;
  transition: var(--transition);
}

.sidebar-brand {
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--primary);
  text-decoration: none !important;
}

.sidebar-heading {
  padding: 0.75rem 1.5rem;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.nav-item { list-style: none; }

.nav-link-item {
  display: flex;
  align-items: center;
  padding: 0.75rem 1.5rem;
  color: var(--text-main);
  text-decoration: none !important;
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition);
}

.nav-link-item i {
  width: 20px;
  margin-right: 12px;
  font-size: 1.1rem;
  color: var(--secondary);
  transition: var(--transition);
}

.nav-link-item:hover {
  background-color: #f8f9fc;
  color: var(--primary);
}

.nav-link-item:hover i { color: var(--primary); }

.nav-link-item.active {
  color: var(--primary);
  background-color: rgba(78, 115, 223, 0.08);
  border-right: 3px solid var(--primary);
}
.nav-link-item.active i { color: var(--primary); }

/* ── CONTENT AREA ── */
#content-wrapper {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ── TOPBAR ── */
.topbar {
  height: 70px;
  background: var(--topbar-bg);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  margin-bottom: 1.5rem;
}

.topbar-search { max-width: 400px; width: 100%; }

.user-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.user-img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 0.8rem;
}

/* ── COMPONENTS ── */
.ctv-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  margin-bottom: 1.5rem;
}

.ctv-card:hover { box-shadow: var(--shadow); }

.ctv-card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  background-color: #f8f9fc;
  font-weight: 700;
  color: var(--primary);
}

.ctv-card-body { padding: 1.25rem; }

.ctv-page-hero {
  background: white;
  padding: 2rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 2rem;
  margin-top: -1.5rem;
  margin-left: -1.5rem;
  margin-right: -1.5rem;
}

.btn-primary {
  background-color: var(--primary);
  border-color: var(--primary);
  border-radius: var(--radius);
  font-weight: 600;
  padding: 0.5rem 1.25rem;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  border-color: var(--primary-hover);
}

.table { color: var(--text-main); }
.table thead th {
  background-color: #f8f9fc;
  border-bottom: 2px solid var(--border-color);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.badge {
  padding: .35em .65em;
  font-weight: 700;
  border-radius: .35rem;
}

.form-control, .form-select {
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 0.6rem 0.75rem;
}

.form-control:focus {
  border-color: #bac8f3;
  box-shadow: 0 0 0 0.25rem rgba(78,115,223,0.25);
}

/* ── DASHBOARD CARDS ── */
.report-card {
  border-left: .25rem solid var(--primary) !important;
}
.report-card.border-success { border-left: .25rem solid var(--success) !important; }
.report-card.border-info { border-left: .25rem solid var(--info) !important; }
.report-card.border-warning { border-left: .25rem solid var(--warning) !important; }

/* ── AUTH ── */
.ctv-auth-page {
  background-color: var(--primary);
  background-image: linear-gradient(180deg,#4e73df 10%,#224abe 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ctv-auth-card {
  background: white;
  border-radius: var(--radius);
  padding: 3rem;
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 500px;
}

/* ── UTILITIES ── */
.text-xs { font-size: .7rem; }
.text-gray-800 { color: #5a5c69; }
.text-gray-300 { color: #dddfeb; }

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