/* ============================================================
   OCEAN BLUE — SHAREHOLDER DASHBOARD
   Sidebar layout, uses root variables from style.css
   ============================================================ */

body.dash-body {
  background: var(--bg-secondary);
  min-height: 100vh;
}

.dash-shell {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ── */
.dash-sidebar {
  width: 260px;
  flex-shrink: 0;
  background: var(--grad-dark);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 200;
}
.dash-sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 26px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.dash-sidebar-logo img { height: 34px; }
.dash-sidebar-logo span { font-size: 13px; font-weight: 700; color: rgba(255,255,255,0.85); }

.dash-nav {
  flex: 1;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.dash-nav-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: rgba(255,255,255,0.35);
  padding: 16px 12px 8px;
}
.dash-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 10px;
  color: rgba(255,255,255,0.75);
  font-size: 13.5px;
  font-weight: 600;
  transition: all 0.2s var(--ease-out);
}
.dash-nav a i { width: 18px; text-align: center; font-size: 14px; }
.dash-nav a:hover { background: rgba(255,255,255,0.08); color: #fff; }
.dash-nav a.active { background: var(--grad-primary); color: #fff; }

.dash-sidebar-footer {
  padding: 16px 14px 22px;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.dash-sidebar-footer a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  color: rgba(255,255,255,0.7);
  font-size: 13px;
  font-weight: 600;
}
.dash-sidebar-footer a:hover { background: rgba(255,255,255,0.08); color: #fff; }
.dash-sidebar-footer a.logout { color: #ff8080; }

/* ── Mobile sidebar toggle ── */
.dash-mobile-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 16px;
  cursor: pointer;
}
.dash-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 190;
}

/* ── Main content area ── */
.dash-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.dash-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.dash-topbar-title h1 {
  font-size: 1.2rem;
  color: var(--text-primary);
  font-family: var(--font-head);
}
.dash-topbar-title p { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }

.dash-user-chip {
  display: flex;
  align-items: center;
  gap: 12px;
}
.dash-user-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--grad-primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 14px;
}
.dash-user-info { display: flex; flex-direction: column; }
.dash-user-info .name { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.dash-user-info .role { font-size: 11px; color: var(--text-muted); }

.dash-content {
  padding: 32px;
  flex: 1;
}

/* ── Stat cards ── */
.dash-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 30px;
}
.dash-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px;
  box-shadow: var(--shadow);
}
.dash-stat-card .dsc-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.dash-stat-card .dsc-icon {
  width: 42px; height: 42px;
  border-radius: 11px;
  background: var(--grad-primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
}
.dash-stat-card .dsc-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  font-family: var(--font-head);
  margin-bottom: 4px;
}
.dash-stat-card .dsc-label { font-size: 12.5px; color: var(--text-muted); }

/* ── Panels ── */
.dash-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 26px 26px 10px;
  margin-bottom: 26px;
  box-shadow: var(--shadow);
}
.dash-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.dash-panel-head h2 { font-size: 1.05rem; color: var(--text-primary); }
.dash-panel-head .dp-sub { font-size: 12.5px; color: var(--text-muted); }

.dash-table { width: 100%; border-collapse: collapse; }
.dash-table th, .dash-table td { padding: 13px 14px; text-align: left; font-size: 13px; }
.dash-table th {
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 10.5px;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
}
.dash-table td { color: var(--text-secondary); border-bottom: 1px solid var(--border); }
.dash-table tr:last-child td { border-bottom: none; }

.dash-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 10.5px;
  font-weight: 700;
}
.dash-badge.paid { background: rgba(16,185,129,0.12); color: #10b981; }
.dash-badge.pending { background: rgba(245,158,11,0.12); color: #f59e0b; }
.dash-badge.active { background: rgba(0,180,216,0.12); color: var(--ocean-cyan); }

.dash-notice {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.7;
  margin: 16px 0 20px;
  display: flex;
  gap: 10px;
}
.dash-notice i { color: var(--ocean-cyan); margin-top: 2px; flex-shrink: 0; }

/* ── Document cards ── */
.dash-doc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.dash-doc-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow);
}
.dash-doc-card .dd-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--grad-primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
}
.dash-doc-card h4 { font-size: 13.5px; color: var(--text-primary); }
.dash-doc-card p { font-size: 11.5px; color: var(--text-muted); }
.dash-doc-card .dd-btn {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ocean-cyan);
}

/* ── Referral ── */
.dash-ref-link-box {
  display: flex;
  gap: 10px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.dash-ref-link-box code {
  flex: 1;
  font-size: 13px;
  color: var(--text-primary);
  font-family: monospace;
  min-width: 200px;
}

/* ── Unilevel note box ── */
.dash-explain-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 1100px) {
  .dash-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-doc-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-explain-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .dash-sidebar {
    position: fixed;
    left: -280px;
    transition: left 0.3s var(--ease-out);
  }
  .dash-sidebar.mobile-open { left: 0; }
  .dash-sidebar-overlay.active { display: block; }
  .dash-mobile-toggle { display: flex; }
  .dash-content { padding: 20px; }
  .dash-topbar { padding: 14px 18px; }
}

@media (max-width: 640px) {
  .dash-stats-grid { grid-template-columns: 1fr; }
  .dash-doc-grid { grid-template-columns: 1fr; }
  .dash-user-info { display: none; }
  .dash-table { font-size: 11.5px; }
  .dash-table th:nth-child(4), .dash-table td:nth-child(4) { display: none; }
}
