/* ==========================================
   OXO.GE Dashboard — Design Refinements
   dashboard-refined.css v1.0
   Override file — loaded after style.css
   ========================================== */

/* === TASK 1: SIDEBAR === */

.db2-sidebar {
  background: #0f172a;
  border-right: 1px solid rgba(255,255,255,0.06);
  position: relative;
}

/* Subtle top highlight — gives the sidebar a "light source" anchor */
.db2-sidebar::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(99,102,241,0.4), transparent);
  pointer-events: none;
}

/* Profile divider: nearly invisible */
.db2-profile {
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

/* Avatar: sharper gradient, no purple overflow */
.db2-avatar {
  background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
  box-shadow: 0 0 0 2px rgba(59,130,246,0.2);
}

/* Admin role: indigo = privilege, not red = danger */
.db2-role-admin {
  background: rgba(99,102,241,0.2);
  color: #a5b4fc;
}

/* Nav items: subtler hover */
.db2-nav-item:hover {
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.9);
}

/* Active state: left indicator pill, no right border */
.db2-nav-item.active {
  background: rgba(59,130,246,0.1);
  border-right: none;
  border-left: 3px solid var(--primary);
  margin-left: -1px;
  color: #fff;
  font-weight: 600;
}

/* Colored-accent active states keep their hue but use left border */
.db2-nav-ad.active {
  background: rgba(245,158,11,0.1);
  border-right: none;
  border-left: 3px solid #fbbf24;
  margin-left: -1px;
}
.db2-nav-pub.active,
.db2-nav-fin.active {
  background: rgba(16,185,129,0.1);
  border-right: none;
  border-left: 3px solid #34d399;
  margin-left: -1px;
}

/* Section labels: whisper, don't speak */
.db2-nav-section-label {
  color: rgba(255,255,255,0.3);
  letter-spacing: 0.1em;
}

/* Sidebar footer: same subtle divider */
.db2-side-footer {
  border-top: 1px solid rgba(255,255,255,0.07);
}

/* Nav badge: toned down */
.db2-nav-badge {
  background: rgba(99,102,241,0.25);
  color: rgba(199,210,254,0.8);
}


/* === TASK 2: STAT CARDS === */

/* Fix orphan: 6 cards = 2 rows of 3 — no lone card */
.db2-stats-grid {
  grid-template-columns: repeat(3, 1fr);
}

/* Physical elevation: the "1px shadow" technique */
.db2-stat-card {
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.db2-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
}

/* Icon backgrounds: more presence (0.12 → 0.16) */
.db2-stat-primary .db2-stat-icon { background: rgba(99,102,241,0.16); }
.db2-stat-blue    .db2-stat-icon { background: rgba(59,130,246,0.16); }
.db2-stat-emerald .db2-stat-icon { background: rgba(16,185,129,0.16); }
.db2-stat-amber   .db2-stat-icon { background: rgba(245,158,11,0.16); }
.db2-stat-purple  .db2-stat-icon { background: rgba(168,85,247,0.16); }
.db2-stat-rose    .db2-stat-icon { background: rgba(244,63,94,0.16); }

/* Value: less shouting */
.db2-stat-value {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Label: muted — data speaks for itself */
.db2-stat-label {
  font-size: 11px;
  color: var(--gray-400);
}

@media (max-width: 1024px) {
  .db2-stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .db2-stats-grid { grid-template-columns: 1fr; }
}


/* === TASK 3: CONTENT CARDS DEPTH === */

/* Cards must lift off the #f3f4f6 background */
.db2-card {
  border: 1px solid rgba(0,0,0,0.07);
  box-shadow: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.03);
  transition: box-shadow 0.2s ease;
}
.db2-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.07), 0 1px 3px rgba(0,0,0,0.04);
}

/* Card header: barely visible separator */
.db2-card-header {
  border-bottom: 1px solid rgba(0,0,0,0.05);
}
.db2-card-header h3 {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--gray-800);
}

/* "See all" links: muted — let content breathe */
.db2-card-link {
  font-size: 12px;
  color: var(--gray-400);
  font-weight: 500;
  transition: color 0.15s;
}
.db2-card-link:hover {
  color: var(--gray-800);
}

/* Mini rows: full-bleed hover (Linear / Notion style) */
.db2-mini-row {
  border-bottom: 1px solid rgba(0,0,0,0.04);
  border-radius: 6px;
  margin: 0 -8px;
  padding: 8px;
  transition: background 0.12s ease;
}
.db2-mini-row:hover {
  background: rgba(0,0,0,0.025);
}
.db2-mini-row:last-child { border: none; }

/* Stat values: readable, not primary-blue screaming */
.db2-mini-stat {
  color: var(--gray-700);
  font-weight: 600;
  font-size: 13px;
}


/* === TASK 4: PAGE HEADER === */

/* Consistent border — no browser-glitchy gradient border */
.db2-page-header {
  border-bottom: 1px solid var(--gray-200);
  border-image: none;
}

/* Heading: tool, not marketing page */
.db2-page-header h1 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--gray-900);
}

/* Icon stays gradient — that's fine */
.db2-page-header h1 i {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Header action group spacing */
.db2-page-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}


/* === TASK 5: SITE CARDS === */

/* Same elevation as .db2-card */
.db2-site-card {
  box-shadow: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.03);
  border: 1px solid rgba(0,0,0,0.07);
  transition: box-shadow 0.2s ease;
}
.db2-site-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}

/* Site name: less headline-heavy */
.db2-site-name {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* Stat items: transparent + border instead of nested gray */
.db2-site-stat-item {
  background: transparent;
  border: 1px solid var(--gray-100);
  border-radius: var(--radius);
}

/* Warning alert: subdued inline notification */
.db2-site-card .alert-warning,
.db2-site-card .db2-alert-warning,
.db2-site-card [class*="warning"] {
  border-radius: 8px;
  border: none;
  border-left: 3px solid var(--warning);
  background: rgba(245,158,11,0.06);
  color: var(--gray-700);
  font-size: 12px;
  padding: 10px 14px;
  font-weight: 500;
}

/* Delete button: ghost in rest state — destructive on hover only */
.db2-btn-danger,
.db2-site-card .db2-btn-danger {
  background: transparent;
  border: 1px solid var(--gray-200);
  color: var(--gray-400);
  box-shadow: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.db2-btn-danger:hover,
.db2-site-card .db2-btn-danger:hover {
  background: rgba(239,68,68,0.05);
  border-color: var(--danger);
  color: var(--danger);
}


/* === TASK 6: ADVERTISER TABLE === */

/* Row breathing room */
.db2-table tbody tr,
.db2-adv-table tbody tr {
  min-height: 64px;
}
.db2-table tbody td,
.db2-adv-table tbody td {
  padding: 14px 12px;
  vertical-align: middle;
}

/* Action icon group */
.db2-action-group {
  display: flex;
  gap: 4px;
  align-items: center;
}
.db2-action-group button,
.db2-action-group a,
.db2-icon-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--gray-200);
  background: transparent;
  color: var(--gray-400);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  text-decoration: none;
}
.db2-action-group button:hover,
.db2-action-group a:hover,
.db2-icon-btn:hover {
  background: var(--gray-50);
  color: var(--gray-700);
  border-color: var(--gray-300);
}

/* Status badge: pill, not plain text */
.db2-status-active,
td .status-active,
td [class*="active-badge"] {
  display: inline-flex;
  align-items: center;
  background: rgba(16,185,129,0.1);
  color: #059669;
  border: 1px solid rgba(16,185,129,0.2);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.db2-status-paused,
td .status-paused {
  background: rgba(245,158,11,0.1);
  color: #b45309;
  border: 1px solid rgba(245,158,11,0.2);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  white-space: nowrap;
}
.db2-status-pending,
td .status-pending {
  background: rgba(148,163,184,0.12);
  color: #475569;
  border: 1px solid rgba(148,163,184,0.2);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  white-space: nowrap;
}

/* Balance header card */
.db2-balance-header,
.db2-adv-balance {
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 20px;
}
.db2-balance-amount,
.db2-adv-balance .balance-num {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}


/* === TASK 7: SETTINGS FORM === */

/* 2-column grid max — not 4 */
.db2-form-grid,
.db2-settings-grid {
  grid-template-columns: 1fr 1fr !important;
  gap: 16px;
}

/* Input: consistent height, clean borders */
.db2-input,
.db2-form-control {
  height: 42px;
  padding: 10px 14px;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  font-size: 14px;
  background: var(--white);
  color: var(--gray-900);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  outline: none;
  width: 100%;
  box-sizing: border-box;
}
.db2-input:hover,
.db2-form-control:hover {
  border-color: var(--gray-300);
}
.db2-input:focus,
.db2-form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
  outline: none;
}

/* Textarea variant */
textarea.db2-input,
textarea.db2-form-control {
  height: auto;
  min-height: 96px;
  resize: vertical;
}

/* Form group labels */
.db2-form-group label,
.db2-form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: 6px;
  letter-spacing: 0;
}

/* Settings section headers */
.db2-settings-section h2,
.db2-settings-section h3,
.db2-section-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--gray-800);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--gray-100);
  margin-bottom: 20px;
  margin-top: 0;
  letter-spacing: -0.01em;
}

@media (max-width: 768px) {
  .db2-form-grid,
  .db2-settings-grid {
    grid-template-columns: 1fr !important;
  }
}


/* === TASK 8: GLOBAL DASHBOARD CONTEXT === */

/* Scope all overrides to dashboard body class */
.is-dashboard .h5-topbar {
  display: none !important;
}

.is-dashboard .h5-header {
  background: rgba(255,255,255,0.95) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--gray-100) !important;
  box-shadow: none !important;
}

/* Header is less prominent inside dashboard context */
.is-dashboard .h5-header .logo-text {
  font-size: 18px;
  letter-spacing: 3px;
}
.is-dashboard .h5-header .logo-badge {
  display: none;
}

/* Mobile: collapse sidebar */
@media (max-width: 768px) {
  .db2-sidebar {
    width: 100%;
    min-width: unset;
    max-height: 60px;
    overflow: hidden;
    flex-direction: row;
    align-items: center;
    padding: 0 16px;
  }
  .db2-sidebar.open {
    max-height: 100vh;
    flex-direction: column;
    align-items: stretch;
    padding: 16px 0;
  }
  .db2-content {
    padding: 16px;
  }
}
