/* ===== VARIABLES ===== */
:root {
  --alfred-dark: #0f0f23;
  --alfred-navy: #1a1a3e;
  --alfred-blue: #3a7bd5;
  --alfred-blue-light: #6c9bdb;
  --alfred-sidebar-bg: #f8f9fc;
  --alfred-sidebar-width: 220px;
  --alfred-card-border: #e8ecf4;
  --alfred-text-muted: #6c757d;
  --alfred-google: #4285F4;
  --alfred-meta: #0866FF;
  --alfred-sklik: #E24E2C;
}

/* ===== NAVBAR ===== */
.alfred-navbar {
  background: var(--alfred-dark);
  border-bottom: 1px solid #1e1e40;
  padding: 0 0;
  min-height: 56px;
}

.alfred-navbar .navbar-brand { padding: 12px 0; }
.brand-alfred {
  font-size: 1.2rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.5px;
}
.brand-sub {
  font-size: 0.7rem;
  color: #4a6fa5;
  margin-left: 8px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.alfred-navbar .nav-link {
  color: #8899bb !important;
  font-size: 0.875rem;
  padding: 18px 16px !important;
  transition: color 0.15s;
}
.alfred-navbar .nav-link:hover,
.alfred-navbar .nav-link.active { color: #fff !important; }

.alfred-navbar .dropdown-menu {
  background: var(--alfred-navy);
  border: 1px solid #2a2a5e;
}
.alfred-navbar .dropdown-item { color: #aac; }
.alfred-navbar .dropdown-item:hover { background: #2a2a5e; color: #fff; }
.alfred-navbar .dropdown-divider { border-color: #2a2a5e; }

/* ===== SIDEBAR ===== */
.alfred-sidebar {
  background: var(--alfred-sidebar-bg);
  border-right: 1px solid var(--alfred-card-border);
  min-height: calc(100vh - 56px);
  padding-top: 24px !important;
}

.sidebar-section {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #aaa;
  padding: 0 16px;
  margin-bottom: 6px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  color: #495057;
  text-decoration: none;
  font-size: 0.875rem;
  border-radius: 6px;
  margin: 1px 8px;
  transition: background 0.12s, color 0.12s;
}
.sidebar-link:hover { background: #e9ecef; color: #212529; }
.sidebar-link.active { background: #e7eef8; color: var(--alfred-blue); font-weight: 600; }
.sidebar-link.sidebar-highlight {
  background: var(--alfred-blue);
  color: #fff !important;
  font-weight: 600;
}
.sidebar-link.sidebar-highlight:hover { background: #2d68c4; }

/* ===== PAGE HEADER ===== */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--alfred-card-border);
}
.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--alfred-dark);
  margin: 0;
}

/* ===== CONTENT CARD ===== */
.content-card {
  background: #fff;
  border: 1px solid var(--alfred-card-border);
  border-radius: 10px;
  overflow: hidden;
}

.content-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--alfred-card-border);
  background: #fafbfd;
}

.content-card .table { margin-bottom: 0; }
.content-card .table thead th {
  background: #f8f9fc;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #666;
  font-weight: 600;
  border-bottom: 2px solid var(--alfred-card-border);
}

/* ===== KPI CARDS (dashboard) ===== */
.kpi-card {
  background: #fff;
  border: 1px solid var(--alfred-card-border);
  border-radius: 10px;
  padding: 20px;
  position: relative;
}
.kpi-card-danger { border-color: #f5c2c7; background: #fff5f5; }
.kpi-icon { font-size: 1.4rem; color: var(--alfred-blue); margin-bottom: 8px; }
.kpi-value { font-size: 2rem; font-weight: 800; color: var(--alfred-dark); line-height: 1; }
.kpi-label { font-size: 0.78rem; color: var(--alfred-text-muted); margin-top: 4px; }

/* ===== METRIC CARDS (report preview) ===== */
.metric-card {
  background: #fff;
  border: 1px solid var(--alfred-card-border);
  border-radius: 8px;
  padding: 14px 16px;
}
.metric-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #888;
  margin-bottom: 4px;
}
.metric-value {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--alfred-dark);
  line-height: 1.1;
}
.metric-change {
  font-size: 0.72rem;
  font-weight: 600;
  margin-top: 3px;
}
.metric-change.positive { color: #1a9c3e; }
.metric-change.negative { color: #c0392b; }
.metric-change.neutral  { color: #888; }

/* ===== CHANNEL SECTIONS (report preview) ===== */
.channel-section {
  background: #fff;
  border: 1px solid var(--alfred-card-border);
  border-radius: 10px;
  overflow: hidden;
}
.channel-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  font-size: 1.05rem;
  font-weight: 700;
  background: #f8f9fc;
  border-bottom: 1px solid var(--alfred-card-border);
}
.channel-section .row,
.channel-section .table-responsive,
.channel-section .comment-block { padding: 16px 20px; }
.channel-section .row { padding-bottom: 0; }

.channel-period {
  margin-left: auto;
  font-size: 0.78rem;
  color: var(--alfred-text-muted);
  font-weight: 400;
}

.channel-google .channel-header { border-left: 4px solid var(--alfred-google); }
.channel-meta .channel-header   { border-left: 4px solid var(--alfred-meta); }
.channel-sklik .channel-header  { border-left: 4px solid var(--alfred-sklik); }
.channel-summary .channel-header { border-left: 4px solid #2c3e50; }

/* ===== CAMPAIGN TABLE ===== */
.campaign-table {
  font-size: 0.83rem;
}
.campaign-table thead th {
  background: var(--alfred-dark);
  color: #fff;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: none;
}
.campaign-table tbody tr:hover { background: #f0f4fa; }

/* ===== COMMENT BLOCK ===== */
.comment-block textarea {
  border: 1px solid var(--alfred-card-border);
  border-radius: 6px;
  resize: vertical;
}

/* ===== API HEALTH ===== */
.api-health-item {
  padding: 12px 20px;
  border-bottom: 1px solid var(--alfred-card-border);
}
.api-health-item:last-child { border-bottom: none; }
.api-health-name { font-size: 0.875rem; font-weight: 600; margin-bottom: 6px; }
.api-health-channels { display: flex; flex-wrap: wrap; gap: 4px; }

/* ===== API TEST BLOCK (client list) ===== */
.api-test-block {
  background: #f8f9fc;
  border: 1px solid var(--alfred-card-border);
  border-radius: 8px;
  padding: 14px;
}
.test-result small { font-size: 0.8rem; }

/* ===== CHANNEL SELECTOR (report form) ===== */
.channel-selector {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.channel-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 16px 24px;
  border: 2px solid var(--alfred-card-border);
  border-radius: 10px;
  background: #fff;
  transition: border-color 0.15s, background 0.15s;
  user-select: none;
  min-width: 100px;
}
.channel-option input[type="checkbox"] { display: none; }
.channel-option.selected {
  border-color: var(--alfred-blue);
  background: #e7eef8;
}
.channel-icon { font-size: 1.5rem; }
.channel-name { font-size: 0.82rem; font-weight: 600; color: #495057; }
.google-icon { color: var(--alfred-google); }
.meta-icon   { color: var(--alfred-meta); }
.sklik-icon  { color: var(--alfred-sklik); }

.compare-preview { min-height: 18px; }

/* ===== EMPTY STATE ===== */
.empty-state {
  padding: 48px 24px;
  text-align: center;
  color: #aaa;
}
.empty-state i { font-size: 2.5rem; display: block; margin-bottom: 12px; }
.empty-state p { font-size: 0.9rem; }

/* ===== LOGIN PAGE ===== */
.login-page {
  background: var(--alfred-dark);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-wrapper { width: 100%; max-width: 420px; padding: 16px; }
.login-card {
  background: #fff;
  border-radius: 16px;
  padding: 40px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
.login-header { text-align: center; margin-bottom: 32px; }
.login-logo {
  width: 64px; height: 64px;
  background: var(--alfred-dark);
  color: #fff;
  font-size: 1.8rem;
  font-weight: 800;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}
.login-title { font-size: 1.8rem; font-weight: 800; color: var(--alfred-dark); margin-bottom: 4px; }
.login-subtitle { color: var(--alfred-text-muted); font-size: 0.875rem; }

/* ===== UTILITIES ===== */
.btn-primary {
  background: var(--alfred-blue);
  border-color: var(--alfred-blue);
}
.btn-primary:hover { background: #2d68c4; border-color: #2d68c4; }

.table th { white-space: nowrap; }
