/* ============================================================
   AutoReporter Dashboard — Blue light theme
   Modern, light, blue-centric design system.
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* Blue family */
  --brand-1: #2563eb;   /* blue-600 (primary) */
  --brand-2: #1d4ed8;   /* blue-700 (deep) */
  --brand-3: #0ea5e9;   /* sky-500 */
  --accent:  #06b6d4;   /* cyan-500 */
  --accent-2: #6366f1;  /* indigo-500 (subtle pop) */
  --soft:    #dbeafe;   /* blue-100 (tint) */
  --softer:  #eff6ff;   /* blue-50  */

  --success: #16a34a;
  --warning: #f59e0b;
  --danger:  #ef4444;
  --info:    #3b82f6;

  --gradient-brand:   linear-gradient(135deg, #2563eb 0%, #0ea5e9 100%);
  --gradient-deep:    linear-gradient(135deg, #1d4ed8 0%, #2563eb 50%, #06b6d4 100%);
  --gradient-accent:  linear-gradient(135deg, #06b6d4 0%, #2563eb 100%);
  --gradient-success: linear-gradient(135deg, #16a34a 0%, #14b8a6 100%);
  --gradient-warning: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
  --gradient-danger:  linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  --gradient-hero:
    radial-gradient(circle at 0% 0%,   rgba(37, 99, 235, 0.10) 0%, transparent 45%),
    radial-gradient(circle at 100% 0%, rgba(14, 165, 233, 0.08) 0%, transparent 45%),
    radial-gradient(circle at 50% 100%, rgba(6, 182, 212, 0.08) 0%, transparent 50%);

  /* Light theme tokens */
  --bg:           #f5f8ff;
  --bg-elev:      #ffffff;
  --panel:        rgba(255, 255, 255, 0.85);
  --panel-solid:  #ffffff;
  --panel-2:      rgba(239, 246, 255, 0.7);
  --panel-hover:  rgba(219, 234, 254, 0.55);
  --border:       rgba(37, 99, 235, 0.12);
  --border-strong: rgba(37, 99, 235, 0.28);
  --text:         #0f172a;
  --text-strong:  #050a1c;
  --text-muted:   #64748b;
  --text-dim:     #94a3b8;

  --shadow-sm:    0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md:    0 6px 18px rgba(37, 99, 235, 0.08);
  --shadow-lg:    0 20px 50px rgba(37, 99, 235, 0.18);
  --shadow-glow:  0 0 28px rgba(37, 99, 235, 0.22);

  --radius-sm: 8px;
  --radius:    12px;
  --radius-lg: 16px;
  --radius-xl: 22px;

  --easing: cubic-bezier(0.22, 1, 0.36, 1);
  --easing-out: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }
*::selection { background: var(--brand-1); color: white; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: rgba(37, 99, 235, 0.22); border-radius: 999px; }
*::-webkit-scrollbar-thumb:hover { background: rgba(37, 99, 235, 0.45); }

html, body {
  margin: 0; padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  height: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body::before {
  content: '';
  position: fixed; inset: 0;
  background: var(--gradient-hero);
  pointer-events: none; z-index: 0;
  animation: float-bg 30s ease-in-out infinite alternate;
}
@keyframes float-bg {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(2%, -2%) scale(1.05); }
  100% { transform: translate(-2%, 2%) scale(1); }
}

body { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }

a { color: var(--brand-1); text-decoration: none; transition: color 0.18s var(--easing); }
a:hover { color: var(--brand-2); }
h1, h2, h3, h4, h5 { margin: 0 0 12px; font-weight: 700; color: var(--text-strong); letter-spacing: -0.01em; }
h1 { font-size: 28px; }
h2 { font-size: 22px; letter-spacing: -0.02em; }
h3 { font-size: 17px; }
h4 { font-size: 14px; }
p  { margin: 0 0 12px; }
code {
  font-family: 'JetBrains Mono', Consolas, Monaco, monospace; font-size: 12px;
  background: var(--softer); padding: 2px 6px; border-radius: 4px;
  color: var(--brand-2); border: 1px solid var(--soft);
}

.muted { color: var(--text-muted); font-size: 13px; }
.dim { color: var(--text-dim); font-size: 12px; }

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  background: var(--panel-solid);
  border-right: 1px solid var(--border);
  padding: 24px 16px;
  display: flex; flex-direction: column;
  position: relative; z-index: 10;
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-sm);
}
.sidebar .brand {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 32px; padding: 4px;
}
.brand-name {
  font-weight: 800; font-size: 17px;
  background: var(--gradient-deep);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.02em;
}
.brand-sub { font-size: 11px; color: var(--text-muted); font-weight: 500; letter-spacing: 0.05em; text-transform: uppercase; }
.logo-circle {
  width: 42px; height: 42px;
  background: var(--gradient-deep);
  color: white; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 15px;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  position: relative; overflow: hidden;
}
.logo-circle::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, transparent 50%, rgba(255, 255, 255, 0.2) 100%);
}

.sidebar nav { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.nav-section { font-size: 11px; color: var(--text-dim); padding: 14px 12px 6px; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 600; }
.nav-link {
  color: var(--text-muted); padding: 10px 12px; border-radius: 10px;
  font-size: 13px; font-weight: 500;
  display: flex; align-items: center; gap: 12px;
  position: relative; transition: all 0.2s var(--easing);
}
.nav-link svg { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.85; transition: all 0.2s var(--easing); }
.nav-link:hover { background: var(--panel-hover); color: var(--brand-2); transform: translateX(2px); }
.nav-link:hover svg { transform: scale(1.1); }
.nav-link.active {
  background: var(--gradient-brand); color: white;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.3);
}
.nav-link.active svg { opacity: 1; }
.nav-link .badge-count {
  margin-left: auto;
  background: rgba(255, 255, 255, 0.22);
  color: inherit;
  padding: 1px 7px; border-radius: 99px;
  font-size: 10px; font-weight: 700;
}
.nav-link:not(.active) .badge-count { background: var(--soft); color: var(--brand-2); }

.sidebar-footer { border-top: 1px solid var(--border); padding-top: 14px; margin-top: 8px; }
.user-info {
  display: flex; align-items: center; gap: 10px;
  padding: 8px; border-radius: 10px;
  transition: background 0.2s var(--easing);
}
.user-info:hover { background: var(--panel-hover); }
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--gradient-accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: white;
}
.user-meta { flex: 1; min-width: 0; }
.user-name { font-size: 13px; color: var(--text-strong); font-weight: 600; }
.user-role { font-size: 11px; color: var(--text-muted); }

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.content { padding: 28px 36px; position: relative; z-index: 1; overflow-x: hidden; }
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 28px; gap: 16px;
}
.topbar h2 { margin: 0; font-size: 24px; }
.topbar-left { display: flex; align-items: center; gap: 16px; flex: 1; min-width: 0; }
.topbar-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.search-box { position: relative; flex: 1; max-width: 340px; }
.search-box input {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 12px 9px 38px;
  width: 100%;
  font-size: 13px; color: var(--text);
  transition: all 0.2s var(--easing);
}
.search-box input:focus { border-color: var(--brand-1); box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.14); outline: none; }
.search-box svg {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--text-muted);
}
.kbd-hint {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  font-size: 10px; color: var(--text-dim);
  background: var(--softer); border-radius: 4px; padding: 2px 6px;
  font-family: 'JetBrains Mono', monospace; border: 1px solid var(--soft);
}

.icon-btn {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  cursor: pointer; transition: all 0.2s var(--easing);
  position: relative;
}
.icon-btn:hover { color: var(--brand-1); border-color: var(--brand-1); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.icon-btn svg { width: 18px; height: 18px; }

.status-pill {
  padding: 6px 12px; border-radius: 99px;
  font-size: 12px; font-weight: 600;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--text-muted);
  display: inline-flex; align-items: center; gap: 6px;
  transition: all 0.25s var(--easing);
}
.status-pill::before {
  content: ''; width: 6px; height: 6px;
  background: var(--text-muted); border-radius: 50%;
}
.status-pill.idle::before { background: var(--text-dim); }
.status-pill.running { background: rgba(245, 158, 11, 0.12); color: var(--warning); border-color: rgba(245, 158, 11, 0.3); }
.status-pill.running::before { background: var(--warning); animation: pulse 1.2s ease infinite; }
.status-pill.completed { background: rgba(22, 163, 74, 0.12); color: var(--success); border-color: rgba(22, 163, 74, 0.3); }
.status-pill.completed::before { background: var(--success); }
.status-pill.failed { background: rgba(239, 68, 68, 0.12); color: var(--danger); border-color: rgba(239, 68, 68, 0.3); }
.status-pill.failed::before { background: var(--danger); }
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.5; transform: scale(1.4); }
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-md);
  margin-bottom: 18px;
  backdrop-filter: blur(20px);
  transition: all 0.25s var(--easing);
  position: relative;
  overflow: hidden;
}
.card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-lg); }
.card-title {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px;
}
.card-title h3, .card-title h4 { margin: 0; }

.grid { display: grid; gap: 18px; margin-bottom: 18px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 900px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  body { grid-template-columns: 1fr; }
  .sidebar { flex-direction: row; padding: 12px; align-items: center; }
  .sidebar nav { flex-direction: row; flex-wrap: wrap; overflow-x: auto; }
  .sidebar-footer, .nav-section { display: none; }
}

/* ============================================================
   STAT TILES
   ============================================================ */
.stat { position: relative; padding: 22px; overflow: hidden; }
.stat:hover { transform: translateY(-2px); }
.stat .stat-icon {
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--gradient-brand); color: white;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.25);
  margin-bottom: 14px;
}
.stat:nth-child(2) .stat-icon { background: var(--gradient-accent); box-shadow: 0 8px 24px rgba(6, 182, 212, 0.25); }
.stat:nth-child(3) .stat-icon { background: linear-gradient(135deg, #6366f1, #2563eb); box-shadow: 0 8px 24px rgba(99, 102, 241, 0.25); }
.stat:nth-child(4) .stat-icon { background: var(--gradient-success); box-shadow: 0 8px 24px rgba(22, 163, 74, 0.25); }
.stat .stat-icon svg { width: 22px; height: 22px; }
.stat-label { color: var(--text-muted); font-size: 13px; font-weight: 500; }
.stat-value { font-size: 32px; font-weight: 800; color: var(--text-strong); margin-top: 4px; letter-spacing: -0.025em; }
.stat-trend { font-size: 12px; margin-top: 6px; display: inline-flex; gap: 4px; align-items: center; }
.stat-trend.up { color: var(--success); }
.stat-trend.down { color: var(--danger); }

.view-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; gap: 12px; flex-wrap: wrap; }
.view-header > div { display: flex; gap: 8px; flex-wrap: wrap; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 16px;
  border-radius: 10px;
  font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all 0.2s var(--easing);
  font-family: inherit;
  display: inline-flex; align-items: center; gap: 8px;
  position: relative; overflow: hidden;
}
.btn:hover { background: var(--softer); border-color: var(--brand-1); color: var(--brand-1); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn svg { width: 15px; height: 15px; }

.btn.primary {
  background: var(--gradient-brand); border-color: transparent; color: white;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.35);
}
.btn.primary:hover { box-shadow: 0 12px 32px rgba(37, 99, 235, 0.5); transform: translateY(-2px); color: white; }
.btn.primary::before {
  content: ''; position: absolute;
  top: 0; left: -100%; width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  transition: left 0.6s ease;
}
.btn.primary:hover::before { left: 100%; }

.btn.ghost { background: transparent; border-color: transparent; color: var(--text-muted); }
.btn.ghost:hover { background: var(--softer); color: var(--brand-1); border-color: transparent; }

.btn.success { background: var(--gradient-success); border-color: transparent; color: white; box-shadow: 0 8px 24px rgba(22, 163, 74, 0.3); }
.btn.success:hover { color: white; }
.btn.danger { background: var(--gradient-danger); border-color: transparent; color: white; box-shadow: 0 8px 24px rgba(239, 68, 68, 0.3); }
.btn.danger:hover { color: white; }
.btn.warning { background: var(--gradient-warning); border-color: transparent; color: white; box-shadow: 0 8px 24px rgba(245, 158, 11, 0.3); }
.btn.warning:hover { color: white; }

.btn.small { padding: 6px 10px; font-size: 12px; border-radius: 8px; }
.btn.small svg { width: 13px; height: 13px; }
.btn.large { padding: 12px 22px; font-size: 14px; border-radius: 12px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.actions-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }

/* ============================================================
   FORMS
   ============================================================ */
form label {
  display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px;
  font-size: 13px; font-weight: 500;
}
form label > span { color: var(--text-muted); font-size: 12px; font-weight: 600; letter-spacing: 0.01em; }
input[type="text"], input[type="password"], input[type="email"], input[type="number"],
input[type="date"], input[type="time"], input[type="datetime-local"], input[type="file"],
select, textarea {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  font-family: inherit;
  width: 100%;
  background: var(--bg-elev);
  color: var(--text);
  transition: all 0.2s var(--easing);
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand-1);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.14);
}
input::placeholder, textarea::placeholder { color: var(--text-dim); }
textarea { min-height: 90px; resize: vertical; font-family: inherit; }
select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2364748b' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px;
}
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.form-grid label.full, .form-grid .full { grid-column: 1 / -1; }
.form-actions {
  grid-column: 1 / -1;
  display: flex; gap: 10px; justify-content: flex-end; padding-top: 6px;
}
label.checkbox { flex-direction: row; align-items: center; gap: 8px; }
label.checkbox input { width: auto; }

/* combo-box: input next to "use existing" button */
.combo-input { display: flex; gap: 6px; }
.combo-input select { flex: 1; }

/* Radio tiles (used by output format selector) */
.radio-tile {
  display: flex !important; align-items: center; gap: 8px;
  padding: 12px 14px;
  background: var(--bg-elev);
  border: 2px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s var(--easing);
  margin: 0;
}
.radio-tile:hover { border-color: var(--brand-1); transform: translateY(-1px); }
.radio-tile input[type="radio"] { width: auto; margin: 0; accent-color: var(--brand-1); }
.radio-tile input[type="radio"]:checked + span { color: var(--brand-2); }
.radio-tile:has(input:checked) { border-color: var(--brand-1); background: var(--softer); box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08); }
.radio-tile small { color: var(--text-muted); font-weight: 400; }

/* Options card (for explanation blocks) */
.options-card {
  background: var(--softer);
  border-radius: 12px; padding: 16px;
  border: 1px solid var(--soft);
}
.options-card h4 {
  display: flex; align-items: center; gap: 8px; margin: 0 0 10px;
  color: var(--brand-2);
}
.options-card h4 svg { width: 18px; height: 18px; }
.option-row { padding: 8px 0; }
.option-row .desc { color: var(--text-muted); font-size: 12px; margin-top: 2px; margin-left: 26px; }

/* ============================================================
   LISTS & TABLES
   ============================================================ */
.list { list-style: none; padding: 0; margin: 0; }
.list li {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
}
.list li:last-child { border-bottom: none; }

.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th, .data-table td {
  padding: 12px 14px; text-align: left;
  border-bottom: 1px solid var(--border);
}
.data-table th {
  font-weight: 600; color: var(--text-muted);
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
}
.data-table tr { transition: background 0.18s var(--easing); }
.data-table tbody tr:hover td { background: var(--softer); }

/* Filter chips */
.filter-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.chip {
  padding: 6px 12px; border-radius: 99px;
  background: var(--bg-elev); border: 1px solid var(--border);
  font-size: 12px; font-weight: 600; color: var(--text-muted);
  cursor: pointer; transition: all 0.2s var(--easing);
}
.chip:hover { border-color: var(--brand-1); color: var(--brand-1); }
.chip.active {
  background: var(--gradient-brand); color: white; border-color: transparent;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

/* ============================================================
   CAMPAIGN CARDS
   ============================================================ */
.campaign-card {
  display: flex; gap: 16px; align-items: flex-start;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  background: var(--panel);
  backdrop-filter: blur(20px);
  transition: all 0.25s var(--easing);
  position: relative;
  overflow: hidden;
}
.campaign-card::after {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; background: var(--gradient-brand);
  transform: scaleY(0); transform-origin: top;
  transition: transform 0.3s var(--easing);
}
.campaign-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--border-strong); }
.campaign-card:hover::after { transform: scaleY(1); }
.campaign-card .thumb {
  width: 80px; height: 80px; flex-shrink: 0;
  background: var(--panel-2); border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  border: 1px solid var(--border);
}
.campaign-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.campaign-card .meta { flex: 1; min-width: 0; }
.campaign-card .meta h4 { font-size: 15px; margin-bottom: 6px; }
.campaign-card .meta .sub { font-size: 12px; color: var(--text-muted); }
.campaign-card .products { margin-top: 10px; font-size: 12px; color: var(--text-muted); }
.campaign-card .badges { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 6px;
  font-size: 11px; font-weight: 600;
  background: var(--softer);
  color: var(--brand-2);
  border: 1px solid var(--soft);
}
.badge.success { background: rgba(22, 163, 74, 0.12); color: var(--success); border-color: rgba(22, 163, 74, 0.22); }
.badge.warning { background: rgba(245, 158, 11, 0.12); color: var(--warning); border-color: rgba(245, 158, 11, 0.22); }
.badge.accent  { background: rgba(6, 182, 212, 0.12); color: var(--accent); border-color: rgba(6, 182, 212, 0.22); }
.badge.indigo  { background: rgba(99, 102, 241, 0.12); color: var(--accent-2); border-color: rgba(99, 102, 241, 0.22); }
.campaign-card .row-actions { display: flex; flex-direction: column; gap: 6px; }

/* ============================================================
   BRAND EMAIL BLOCKS
   ============================================================ */
.brand-block {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px; margin-bottom: 14px;
  background: var(--bg-elev);
  transition: all 0.2s var(--easing);
}
.brand-block:hover { border-color: var(--border-strong); }
.brand-block .head {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px;
}
.brand-block h5 { margin: 0; font-size: 15px; color: var(--text-strong); display: flex; align-items: center; gap: 8px; }
.brand-block .preview { color: var(--text-muted); font-size: 12px; line-height: 1.7; }
.brand-block .preview b { color: var(--text); }
.preview-row { display: grid; grid-template-columns: 60px 1fr; gap: 8px; padding: 3px 0; }

/* ============================================================
   SCHEDULES
   ============================================================ */
.schedule-row {
  display: grid; grid-template-columns: 1fr auto auto auto auto auto;
  gap: 12px; align-items: center;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  padding: 16px 18px;
  border-radius: var(--radius-lg);
  margin-bottom: 10px;
  transition: all 0.2s var(--easing);
}
.schedule-row:hover { border-color: var(--border-strong); transform: translateX(2px); box-shadow: var(--shadow-sm); }
.schedule-row .col-1 { min-width: 0; }
.schedule-row h4 { margin: 0; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.schedule-row .sub { color: var(--text-muted); font-size: 12px; margin-top: 4px; }

.toggle { position: relative; display: inline-block; width: 42px; height: 22px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; cursor: pointer; inset: 0;
  background: #e2e8f0; transition: 0.25s var(--easing);
  border-radius: 99px;
}
.slider:before {
  content: ''; position: absolute; height: 16px; width: 16px;
  left: 3px; top: 3px;
  background: white; transition: 0.25s var(--easing);
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.12);
}
.toggle input:checked + .slider { background: var(--gradient-brand); }
.toggle input:checked + .slider:before { transform: translateX(20px); }

/* ============================================================
   LOGIN
   ============================================================ */
.login-body {
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
  min-height: 100vh;
  grid-template-columns: none !important;
  position: relative; overflow: hidden;
}
.login-body::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(37, 99, 235, 0.25) 0%, transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(14, 165, 233, 0.22) 0%, transparent 40%),
    radial-gradient(circle at 50% 100%, rgba(6, 182, 212, 0.18) 0%, transparent 50%);
  animation: float-bg 20s ease-in-out infinite alternate;
}
.login-body::after {
  content: ''; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(37, 99, 235, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 99, 235, 0.04) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
}
.login-card {
  background: var(--panel-solid);
  backdrop-filter: blur(40px);
  border: 1px solid var(--border-strong);
  border-radius: 22px;
  box-shadow: var(--shadow-lg), 0 0 60px rgba(37, 99, 235, 0.2);
  padding: 40px; width: 100%; max-width: 420px;
  position: relative; z-index: 1;
  animation: card-in 0.6s var(--easing-out);
}
@keyframes card-in {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo .logo-circle { margin: 0 auto 14px; width: 60px; height: 60px; font-size: 20px; border-radius: 16px; }
.login-logo h1 { margin: 0 0 4px; font-size: 26px; }
.login-logo p { font-size: 13px; color: var(--text-muted); margin: 0; }
.error {
  margin-top: 14px; padding: 12px 14px;
  background: rgba(239, 68, 68, 0.08);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 10px; font-size: 13px;
  animation: shake 0.4s ease;
}
@keyframes shake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-4px); }
  40%, 60% { transform: translateX(4px); }
}

/* ============================================================
   LOG VIEWER
   ============================================================ */
.log-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px; gap: 10px;
}
.log-tools { display: flex; gap: 6px; align-items: center; }
.log-view {
  background: #0a1530;
  color: #cbd5e1;
  border-radius: 12px;
  padding: 14px 16px;
  font-family: 'JetBrains Mono', Consolas, Monaco, monospace;
  font-size: 12px; line-height: 1.65;
  max-height: 520px; min-height: 280px;
  overflow-y: auto; white-space: pre-wrap; word-wrap: break-word;
  margin: 0;
  border: 1px solid var(--border);
  box-shadow: inset 0 0 60px rgba(37, 99, 235, 0.06);
}
.log-line { padding: 1px 0; }
.log-line.stderr { color: #fca5a5; }
.log-line.stdout { color: #cbd5e1; }
.log-line:hover { background: rgba(255, 255, 255, 0.03); }
.log-time { color: #64748b; margin-right: 4px; }

/* ============================================================
   MODAL
   ============================================================ */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(5, 10, 28, 0.55);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 20px;
  animation: fade-in 0.2s var(--easing);
}
.modal-backdrop[hidden] { display: none; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--panel-solid);
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  width: 100%; max-width: 780px;
  max-height: 90vh;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg), 0 0 60px rgba(37, 99, 235, 0.2);
  animation: modal-in 0.3s var(--easing-out);
}
@keyframes modal-in {
  from { opacity: 0; transform: scale(0.95) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-header { padding: 20px 24px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.modal-header h3 { margin: 0; }
.modal-body { padding: 22px 24px; overflow-y: auto; flex: 1; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* ============================================================
   TOASTS
   ============================================================ */
.toast-stack { position: fixed; top: 20px; right: 20px; z-index: 2000; display: flex; flex-direction: column; gap: 10px; max-width: 380px; }
.toast {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px; padding: 14px 16px;
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  animation: slide-in 0.3s var(--easing-out);
  display: flex; align-items: flex-start; gap: 12px;
  position: relative; overflow: hidden;
}
.toast::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; }
.toast.success::before { background: var(--gradient-success); }
.toast.error::before { background: var(--gradient-danger); }
.toast.info::before { background: var(--gradient-accent); }
.toast .toast-icon { color: var(--brand-1); flex-shrink: 0; }
.toast.success .toast-icon { color: var(--success); }
.toast.error .toast-icon { color: var(--danger); }
.toast .toast-msg { flex: 1; color: var(--text); }
@keyframes slide-in {
  from { transform: translateX(20px); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}
@keyframes slide-out { to { transform: translateX(40px); opacity: 0; } }

/* ============================================================
   IMAGE PICKER
   ============================================================ */
.image-picker {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px; max-height: 380px; overflow-y: auto;
  padding: 10px; border: 1px dashed var(--border-strong); border-radius: 12px;
  background: var(--softer);
}
.image-tile {
  cursor: pointer; border: 2px solid transparent; border-radius: 10px;
  padding: 6px; background: var(--bg-elev);
  text-align: center; font-size: 11px; word-break: break-all;
  transition: all 0.2s var(--easing);
}
.image-tile:hover { transform: translateY(-2px); border-color: var(--brand-1); }
.image-tile.selected { border-color: var(--brand-1); background: var(--softer); }
.image-tile img { max-width: 100%; max-height: 80px; object-fit: contain; }

/* ============================================================
   EMPTY STATES
   ============================================================ */
.empty {
  text-align: center; padding: 60px 20px;
  color: var(--text-muted);
}
.empty .empty-icon {
  width: 64px; height: 64px;
  background: var(--softer);
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
  color: var(--brand-1);
}
.empty .empty-icon svg { width: 30px; height: 30px; }
.empty h4 { color: var(--text); margin-bottom: 4px; font-size: 16px; }

/* ============================================================
   CHARTS
   ============================================================ */
.chart-box { height: 130px; position: relative; margin-top: 8px; }
.chart-bars { display: flex; gap: 4px; align-items: flex-end; height: 100%; padding-top: 18px; }
.chart-bar {
  flex: 1; background: var(--gradient-brand); border-radius: 4px 4px 0 0;
  min-height: 4px; position: relative;
  transition: all 0.3s var(--easing);
  cursor: pointer;
}
.chart-bar:hover { opacity: 0.85; transform: scaleY(1.05); }
.chart-bar .label { position: absolute; bottom: -20px; left: 50%; transform: translateX(-50%); font-size: 10px; color: var(--text-muted); }

/* ============================================================
   VIEW TRANSITIONS
   ============================================================ */
.view { animation: view-in 0.35s var(--easing-out); }
@keyframes view-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Skeleton loaders */
.skeleton {
  background: linear-gradient(90deg, var(--softer) 25%, var(--soft) 50%, var(--softer) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite linear;
  border-radius: 6px;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

[hidden] { display: none !important; }
.fade-out { animation: slide-out 0.3s var(--easing-out) forwards; }

/* Tooltip helper */
[data-tip] { position: relative; }
[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: var(--text-strong); color: white;
  padding: 4px 8px; border-radius: 6px; font-size: 11px;
  white-space: nowrap; pointer-events: none; z-index: 100;
}
