/* ─────────────────────────────────────────
   DIFFERSON — Partner Dashboard Stylesheet
───────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;900&display=swap');

:root {
  --black:   #0a0a0a;
  --white:   #ffffff;
  --gray-50: #fafafa;
  --gray-100:#f5f5f5;
  --gray-200:#e8e8e8;
  --gray-400:#9e9e9e;
  --gray-600:#555555;
  --border:  1px solid #e0e0e0;
  --font:    'Inter', sans-serif;
  --sidebar: 240px;
  --transition: 0.2s ease;
  --green:   #1a9e5f;
  --green-light: #e8f7f0;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }
body { font-family: var(--font); background: var(--gray-50); color: var(--black); font-size: 14px; line-height: 1.6; -webkit-font-smoothing: antialiased; height: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* ── Login Screen ── */
#login-screen {
  position: fixed;
  inset: 0;
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.login-box {
  width: 100%;
  max-width: 420px;
  padding: 0 24px;
}

.login-logo {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.login-title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.login-sub {
  font-size: 14px;
  color: var(--gray-600);
  margin-bottom: 40px;
}

.login-field { margin-bottom: 16px; }
.login-field label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gray-600);
  margin-bottom: 8px;
}
.login-field input {
  width: 100%;
  padding: 13px 16px;
  font-family: var(--font);
  font-size: 14px;
  background: var(--gray-100);
  border: 1px solid transparent;
  border-radius: 3px;
  outline: none;
  transition: border-color var(--transition);
}
.login-field input:focus { border-color: var(--black); background: var(--white); }

.login-btn {
  width: 100%;
  margin-top: 8px;
  padding: 14px;
  background: var(--black);
  color: var(--white);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  transition: background var(--transition);
}
.login-btn:hover { background: #333; }

.login-demo-note {
  margin-top: 20px;
  font-size: 12px;
  color: var(--gray-400);
  text-align: center;
  line-height: 1.6;
}

.login-error {
  display: none;
  font-size: 12px;
  color: #c0392b;
  margin-top: 10px;
  padding: 10px 14px;
  background: #fdf0ef;
  border-radius: 3px;
}

/* ── App Shell ── */
#app {
  display: none;
  height: 100vh;
  flex-direction: row;
}

#app.visible { display: flex; }

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar);
  min-width: var(--sidebar);
  background: var(--black);
  color: var(--white);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
  overflow-y: auto;
}

.sidebar-header {
  padding: 28px 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-brand {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--white);
  margin-bottom: 4px;
}

.sidebar-sub {
  font-size: 11px;
  color: rgba(255,255,255,0.35);
  letter-spacing: 0.04em;
}

.sidebar-nav { padding: 16px 0; flex: 1; }

.sidebar-section-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.25);
  padding: 12px 24px 6px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 24px;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.55);
  transition: all var(--transition);
  cursor: pointer;
  border-left: 2px solid transparent;
}

.sidebar-link:hover {
  color: var(--white);
  background: rgba(255,255,255,0.04);
}

.sidebar-link.active {
  color: var(--white);
  border-left-color: var(--white);
  background: rgba(255,255,255,0.06);
}

.sidebar-icon { font-size: 15px; width: 20px; text-align: center; }

.sidebar-footer {
  padding: 20px 24px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.sidebar-user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--white);
}

.sidebar-user-tier {
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  margin-top: 2px;
}

.logout-btn {
  margin-top: 16px;
  width: 100%;
  padding: 9px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.5);
  font-family: var(--font);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 2px;
  cursor: pointer;
  transition: all var(--transition);
}
.logout-btn:hover { border-color: rgba(255,255,255,0.4); color: var(--white); }

/* ── Main Content ── */
.main {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* ── Top Bar ── */
.topbar {
  background: var(--white);
  border-bottom: var(--border);
  padding: 0 36px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.topbar-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 5px 12px;
  background: var(--green-light);
  color: var(--green);
  border-radius: 20px;
  letter-spacing: 0.04em;
}

.live-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  margin-right: 6px;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ── Content Area ── */
.content { padding: 36px; flex: 1; }

/* ── View panels ── */
.view { display: none; }
.view.active { display: block; }

/* ── Stats Grid ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--white);
  border: var(--border);
  padding: 24px;
  border-radius: 4px;
}

.stat-card-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gray-400);
  margin-bottom: 10px;
}

.stat-card-value {
  font-size: 30px;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--black);
  line-height: 1;
  margin-bottom: 8px;
}

.stat-card-sub {
  font-size: 12px;
  color: var(--gray-400);
}

.stat-card-green .stat-card-value { color: var(--green); }

/* ── Commission Progress ── */
.commission-banner {
  background: var(--black);
  color: var(--white);
  padding: 28px 32px;
  border-radius: 4px;
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}

.commission-banner-left h3 {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}

.commission-banner-left p {
  font-size: 13px;
  color: rgba(255,255,255,0.5);
}

.commission-tier {
  text-align: right;
}

.commission-tier-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  margin-bottom: 6px;
}

.commission-tier-value {
  font-size: 38px;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--white);
}

/* Progress bar */
.progress-wrap {
  flex: 1;
  min-width: 200px;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  margin-bottom: 8px;
}

.progress-bar-bg {
  background: rgba(255,255,255,0.12);
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--white);
  border-radius: 3px;
  transition: width 1s ease;
}

/* ── Table ── */
.table-card {
  background: var(--white);
  border: var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 28px;
}

.table-header {
  padding: 20px 24px;
  border-bottom: var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.table-header h3 {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.table-header span {
  font-size: 12px;
  color: var(--gray-400);
}

table { width: 100%; border-collapse: collapse; }

thead th {
  padding: 12px 24px;
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gray-400);
  background: var(--gray-50);
  border-bottom: var(--border);
}

tbody td {
  padding: 14px 24px;
  font-size: 13px;
  border-bottom: var(--border);
  color: var(--black);
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--gray-50); }

.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.status-paid { background: var(--green-light); color: var(--green); }
.status-pending { background: #fef9e7; color: #b7950b; }
.status-processing { background: #eaf4ff; color: #1a6fa8; }

/* ── Two col ── */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ── Chart placeholder ── */
.chart-card {
  background: var(--white);
  border: var(--border);
  border-radius: 4px;
  padding: 24px;
  margin-bottom: 28px;
}

.chart-card h3 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 20px;
}

.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 140px;
}

.chart-bar-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  height: 100%;
  justify-content: flex-end;
  gap: 6px;
}

.chart-bar {
  width: 100%;
  background: var(--black);
  border-radius: 2px 2px 0 0;
  transition: height 0.8s ease;
  min-height: 4px;
}

.chart-bar-label {
  font-size: 10px;
  color: var(--gray-400);
  white-space: nowrap;
}

/* ── Profile form ── */
.profile-card {
  background: var(--white);
  border: var(--border);
  border-radius: 4px;
  padding: 32px;
  margin-bottom: 24px;
}

.profile-card h3 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: var(--border);
}

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-field { margin-bottom: 16px; }
.form-field label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gray-600);
  margin-bottom: 6px;
}
.form-field input, .form-field select, .form-field textarea {
  width: 100%;
  padding: 10px 14px;
  font-family: var(--font);
  font-size: 13px;
  background: var(--gray-100);
  border: 1px solid transparent;
  border-radius: 3px;
  outline: none;
  color: var(--black);
  transition: border-color var(--transition);
}
.form-field input:focus, .form-field select:focus { border-color: var(--black); background: var(--white); }

.save-btn {
  padding: 11px 28px;
  background: var(--black);
  color: var(--white);
  border: none;
  font-family: var(--font);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: 2px;
  cursor: pointer;
  transition: background var(--transition);
}
.save-btn:hover { background: #333; }

/* ── Commission info card ── */
.info-card {
  background: var(--gray-100);
  border: var(--border);
  border-radius: 4px;
  padding: 24px;
  margin-bottom: 16px;
}
.info-card h4 {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
}
.info-card p { font-size: 13px; color: var(--gray-600); line-height: 1.7; }

/* ── Mobile tweaks ── */
@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .sidebar { display: none; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .two-col { grid-template-columns: 1fr; }
  .topbar { padding: 0 20px; }
  .content { padding: 20px; }
  .form-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .commission-banner { flex-direction: column; align-items: flex-start; }
  .commission-tier { text-align: left; }
}
