/* ============================================================
   KONBIT MEDIA — Dashboard Styles
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700;900&family=DM+Sans:wght@300;400;500;600&family=DM+Mono:wght@400;500&display=swap');

:root {
  --brand-primary:   #E8380D;
  --brand-secondary: #F5A623;
  --brand-accent:    #1A6B3C;
  --brand-dark:      #0F1923;
  --brand-light:     #FDF8F2;
  --sidebar-w:       260px;
  --sidebar-bg:      #0F1923;
  --topbar-h:        64px;
  --gray-50:  #FAFAF9;
  --gray-100: #F5F4F0;
  --gray-200: #E8E5DE;
  --gray-300: #D1CCC0;
  --gray-400: #9E9789;
  --gray-500: #716B5D;
  --gray-600: #4A4540;
  --gray-700: #312E28;
  --gray-800: #1E1B16;
  --success: #1A6B3C;
  --warning: #B87A00;
  --error:   #E8380D;
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'DM Sans', system-ui, sans-serif;
  --font-mono:    'DM Mono', monospace;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.10);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.12);
  --transition: 200ms cubic-bezier(0.4,0,0.2,1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: var(--font-body);
  background: var(--gray-50);
  color: var(--gray-800);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ── AUTH SCREENS ─────────────────────────────────────────── */
.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: stretch;
}
.auth-brand {
  display: none;
  width: 420px;
  flex-shrink: 0;
  background: var(--brand-dark);
  padding: 3rem;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
@media (min-width: 1024px) { .auth-brand { display: flex; } }
.auth-brand::before {
  content: '';
  position: absolute;
  top: -30%;
  right: -30%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(232,56,13,0.20) 0%, transparent 65%);
}
.auth-brand::after {
  content: '';
  position: absolute;
  bottom: -20%;
  left: -20%;
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, rgba(245,166,35,0.15) 0%, transparent 65%);
}
.auth-brand__inner { position: relative; z-index: 1; }
.auth-brand__logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 3rem;
}
.auth-brand__logo-icon {
  width: 44px;
  height: 44px;
  background: var(--brand-primary);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.25rem;
  color: #fff;
}
.auth-brand__logo-text {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.5rem;
  color: #fff;
  letter-spacing: -0.03em;
}
.auth-brand__title {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 900;
  color: #fff;
  line-height: 1.1;
  margin-bottom: 1.25rem;
  letter-spacing: -0.02em;
}
.auth-brand__title span { color: var(--brand-secondary); }
.auth-brand__desc { color: rgba(255,255,255,0.60); line-height: 1.7; margin-bottom: 2rem; }
.auth-brand__features { display: flex; flex-direction: column; gap: 1rem; }
.auth-brand__feature {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: rgba(255,255,255,0.75);
  font-size: 0.9rem;
}
.auth-brand__feature-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.auth-form-panel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: #fff;
}
.auth-form-wrap { width: 100%; max-width: 440px; }
.auth-form-wrap__logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.5rem;
  letter-spacing: -0.03em;
}
@media (min-width: 1024px) { .auth-form-wrap__logo { display: none; } }
.auth-tabs {
  display: flex;
  gap: 0;
  background: var(--gray-100);
  border-radius: var(--radius-lg);
  padding: 4px;
  margin-bottom: 2rem;
}
.auth-tab {
  flex: 1;
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-500);
  border-radius: calc(var(--radius-lg) - 4px);
  transition: all var(--transition);
  text-align: center;
  cursor: pointer;
}
.auth-tab.active {
  background: #fff;
  color: var(--brand-dark);
  box-shadow: var(--shadow-sm);
}
.auth-form { display: flex; flex-direction: column; gap: 1.25rem; }
.form-group { display: flex; flex-direction: column; gap: 0.5rem; }
.form-label { font-size: 0.875rem; font-weight: 600; color: var(--gray-700); }
.form-input {
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  color: var(--gray-800);
  background: #fff;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  width: 100%;
}
.form-input:focus { border-color: var(--brand-primary); box-shadow: 0 0 0 3px rgba(232,56,13,0.10); }
.form-input.error { border-color: var(--error); }
.form-hint { font-size: 0.8rem; color: var(--gray-400); }
.form-error { font-size: 0.8rem; color: var(--error); display: none; }
.form-error.show { display: block; }
.form-select {
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  color: var(--gray-800);
  background: #fff;
  outline: none;
  width: 100%;
  cursor: pointer;
}
.form-select:focus { border-color: var(--brand-primary); }
.auth-submit {
  padding: 0.875rem;
  background: var(--brand-primary);
  color: #fff;
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  font-weight: 700;
  font-family: var(--font-body);
  transition: all var(--transition);
  box-shadow: 0 4px 12px rgba(232,56,13,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.auth-submit:hover { background: #C42D08; box-shadow: 0 6px 18px rgba(232,56,13,0.35); }
.auth-submit:disabled { opacity: 0.6; cursor: not-allowed; }
.auth-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--gray-400);
  font-size: 0.8rem;
}
.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--gray-200);
}
.auth-alert {
  padding: 0.875rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  display: none;
  align-items: flex-start;
  gap: 0.75rem;
}
.auth-alert.show { display: flex; }
.auth-alert--error { background: rgba(232,56,13,0.08); color: #C42D08; border: 1px solid rgba(232,56,13,0.20); }
.auth-alert--success { background: rgba(26,107,60,0.08); color: #145A2F; border: 1px solid rgba(26,107,60,0.20); }
.auth-alert--pending {
  background: rgba(245,166,35,0.10);
  color: #8A5A00;
  border: 1px solid rgba(245,166,35,0.25);
  padding: 1rem;
  border-radius: var(--radius-lg);
  margin-top: 1.5rem;
}

/* ── DASHBOARD LAYOUT ────────────────────────────────────── */
.dash { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  transition: transform var(--transition);
}
@media (max-width: 1023px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
}
.sidebar__header {
  padding: 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.sidebar__logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.25rem;
  color: #fff;
  letter-spacing: -0.03em;
}
.sidebar__logo-icon {
  width: 36px;
  height: 36px;
  background: var(--brand-primary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  color: #fff;
  font-size: 1rem;
}
.sidebar__nav { flex: 1; padding: 1rem 0.75rem; display: flex; flex-direction: column; gap: 0.25rem; }
.sidebar__section-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.25);
  padding: 0.75rem 0.75rem 0.375rem;
  margin-top: 0.5rem;
}
.sidebar__link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.875rem;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(255,255,255,0.55);
  transition: all var(--transition);
  text-decoration: none;
}
.sidebar__link:hover { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.90); }
.sidebar__link.active { background: rgba(232,56,13,0.15); color: #fff; }
.sidebar__link.active .sidebar__link-icon { color: var(--brand-primary); }
.sidebar__link-icon { width: 18px; text-align: center; opacity: 0.7; }
.sidebar__link.active .sidebar__link-icon { opacity: 1; }
.sidebar__badge {
  margin-left: auto;
  background: var(--brand-primary);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.1rem 0.5rem;
  border-radius: 99px;
}
.sidebar__user {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.sidebar__user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--brand-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
  color: #fff;
  flex-shrink: 0;
}
.sidebar__user-info { flex: 1; min-width: 0; }
.sidebar__user-name { font-size: 0.875rem; font-weight: 600; color: rgba(255,255,255,0.90); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar__user-status { font-size: 0.75rem; color: rgba(255,255,255,0.40); }
.sidebar__user-status.approved { color: #4ADE80; }
.sidebar__logout { color: rgba(255,255,255,0.30); transition: color var(--transition); font-size: 0.875rem; }
.sidebar__logout:hover { color: rgba(255,255,255,0.70); }

/* Main Content */
.dash__main {
  flex: 1;
  margin-left: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
@media (min-width: 1024px) { .dash__main { margin-left: var(--sidebar-w); } }

/* Topbar */
.topbar {
  height: var(--topbar-h);
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 40;
}
.topbar__mobile-toggle { display: flex; align-items: center; color: var(--gray-600); }
@media (min-width: 1024px) { .topbar__mobile-toggle { display: none; } }
.topbar__title { font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; color: var(--brand-dark); }
.topbar__actions { display: flex; align-items: center; gap: 0.75rem; }
.topbar__notif {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-500);
  background: var(--gray-100);
  transition: background var(--transition);
  position: relative;
}
.topbar__notif:hover { background: var(--gray-200); }
.topbar__notif-dot {
  width: 8px;
  height: 8px;
  background: var(--brand-primary);
  border-radius: 50%;
  position: absolute;
  top: 6px;
  right: 6px;
  border: 2px solid #fff;
}

/* Page Content */
.page-content { padding: 2rem 1.5rem; flex: 1; }
@media (min-width: 768px) { .page-content { padding: 2rem; } }

/* ── STATS GRID ──────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}
@media (min-width: 768px) { .stats-grid { grid-template-columns: repeat(4, 1fr); } }
.stat-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  border: 1px solid var(--gray-200);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.stat-card__header { display: flex; align-items: center; justify-content: space-between; }
.stat-card__label { font-size: 0.8125rem; font-weight: 600; color: var(--gray-500); }
.stat-card__icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}
.stat-card__icon--primary { background: rgba(232,56,13,0.10); color: var(--brand-primary); }
.stat-card__icon--secondary { background: rgba(245,166,35,0.12); color: #B87A00; }
.stat-card__icon--accent { background: rgba(26,107,60,0.10); color: var(--brand-accent); }
.stat-card__icon--dark { background: rgba(15,25,35,0.08); color: var(--brand-dark); }
.stat-card__value {
  font-family: var(--font-display);
  font-size: 1.875rem;
  font-weight: 900;
  color: var(--brand-dark);
  line-height: 1;
  letter-spacing: -0.02em;
}
.stat-card__change { font-size: 0.8rem; color: var(--gray-500); }
.stat-card__change.up { color: var(--success); }
.stat-card__change.down { color: var(--error); }

/* ── SECTION CARD ────────────────────────────────────────── */
.section-card {
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  overflow: hidden;
  margin-bottom: 1.5rem;
}
.section-card__header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.section-card__title { font-size: 1rem; font-weight: 700; color: var(--brand-dark); }
.section-card__body { padding: 1.5rem; }

/* ── LINK GENERATOR ──────────────────────────────────────── */
.link-gen {
  background: linear-gradient(135deg, var(--brand-dark) 0%, #1A2A3A 100%);
  border-radius: var(--radius-xl);
  padding: 2rem;
  color: #fff;
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
}
.link-gen::before {
  content: '';
  position: absolute;
  top: -40%;
  right: -10%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(232,56,13,0.20) 0%, transparent 65%);
  pointer-events: none;
}
.link-gen__title { font-family: var(--font-display); font-size: 1.375rem; font-weight: 900; margin-bottom: 0.5rem; }
.link-gen__desc { color: rgba(255,255,255,0.60); font-size: 0.875rem; margin-bottom: 1.5rem; }
.link-gen__controls {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}
.link-gen__select {
  flex: 1;
  min-width: 200px;
  padding: 0.75rem 1rem;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-md);
  color: #fff;
  font-size: 0.875rem;
  font-family: var(--font-body);
  outline: none;
  cursor: pointer;
}
.link-gen__select option { background: var(--brand-dark); }
.link-gen__select:focus { border-color: rgba(255,255,255,0.40); }
.link-gen__result {
  margin-top: 1.25rem;
  padding: 1rem;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-md);
  display: none;
  position: relative;
  z-index: 1;
}
.link-gen__result.show { display: block; }
.link-gen__result-label { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(255,255,255,0.40); margin-bottom: 0.5rem; }
.link-gen__result-row { display: flex; align-items: center; gap: 0.75rem; }
.link-gen__result-url {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: rgba(255,255,255,0.85);
  word-break: break-all;
  background: none;
  border: none;
  outline: none;
  cursor: text;
}
.link-gen__copy-btn {
  padding: 0.5rem 0.875rem;
  background: var(--brand-primary);
  color: #fff;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 600;
  transition: background var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
}
.link-gen__copy-btn:hover { background: #C42D08; }

/* ── ARTICLES TABLE ──────────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gray-500);
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--gray-200);
  background: var(--gray-50);
}
.data-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--gray-100);
  font-size: 0.875rem;
  color: var(--gray-700);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--gray-50); }
.data-table__title { font-weight: 600; color: var(--brand-dark); max-width: 260px; }
.data-table__views { font-family: var(--font-mono); color: var(--gray-600); }
.data-table__revenue { font-weight: 700; color: var(--brand-accent); font-family: var(--font-mono); }
.table-responsive { overflow-x: auto; }

/* Status Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.625rem;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.status-badge--pending { background: rgba(245,166,35,0.12); color: #8A5A00; }
.status-badge--approved { background: rgba(26,107,60,0.10); color: var(--brand-accent); }
.status-badge--paid { background: rgba(26,107,60,0.10); color: var(--brand-accent); }
.status-badge--unpaid { background: rgba(232,56,13,0.10); color: var(--brand-primary); }
.status-badge::before { content: '•'; font-size: 0.6rem; }

/* ── CHART PLACEHOLDER ───────────────────────────────────── */
.chart-wrap { width: 100%; height: 200px; display: flex; align-items: flex-end; gap: 8px; padding: 1rem 0; }
.chart-bar {
  flex: 1;
  background: linear-gradient(to top, var(--brand-primary), rgba(232,56,13,0.30));
  border-radius: 4px 4px 0 0;
  min-height: 4px;
  transition: all 0.5s ease;
  position: relative;
}
.chart-bar:hover { filter: brightness(1.1); }
.chart-labels { display: flex; gap: 8px; padding: 0.5rem 0 0; }
.chart-label { flex: 1; text-align: center; font-size: 0.7rem; color: var(--gray-400); font-family: var(--font-mono); }

/* ── PAYOUT HISTORY ──────────────────────────────────────── */
.payout-empty {
  text-align: center;
  padding: 3rem;
  color: var(--gray-400);
}
.payout-empty__icon { font-size: 3rem; margin-bottom: 1rem; opacity: 0.4; }
.payout-empty__title { font-size: 1rem; font-weight: 600; color: var(--gray-500); margin-bottom: 0.5rem; }

/* ── PROFILE ─────────────────────────────────────────────── */
.profile-header {
  background: linear-gradient(135deg, var(--brand-dark) 0%, #1A2A3A 100%);
  border-radius: var(--radius-xl);
  padding: 2rem;
  color: #fff;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--brand-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 900;
  color: #fff;
  flex-shrink: 0;
}
.profile-name { font-family: var(--font-display); font-size: 1.5rem; font-weight: 900; }
.profile-email { color: rgba(255,255,255,0.55); font-size: 0.875rem; margin-top: 0.25rem; }
.profile-status { margin-top: 0.625rem; }

/* ── TOAST ───────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
}
.toast {
  background: var(--brand-dark);
  color: #fff;
  padding: 0.875rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  pointer-events: all;
  min-width: 260px;
  max-width: 360px;
  animation: slideLeft 0.3s ease forwards;
}
.toast--success { background: var(--brand-accent); }
.toast--error { background: var(--brand-primary); }
.toast--warning { background: #B87A00; }
@keyframes slideLeft {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── OVERLAY ─────────────────────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.50);
  z-index: 49;
}
.sidebar-overlay.show { display: block; }

/* ── UTILS ───────────────────────────────────────────────── */
.loading-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.30);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.hidden { display: none !important; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.text-sm { font-size: 0.875rem; }
.text-muted { color: var(--gray-500); }
.fw-600 { font-weight: 600; }
.page { display: none; }
.page.active { display: block; }
