/* ============================================================
   Redwood Privacy — Dashboard Page Styles
   ============================================================ */

/* ── Shell ───────────────────────────────────────────────────── */
.dash-body {
  background-color: #c3d1e4;
  background-image:
    radial-gradient(ellipse 85% 55% at 55% -8%, rgba(255, 255, 255, 0.68) 0%, transparent 62%),
    radial-gradient(ellipse 65% 50% at 92% 18%, rgba(37, 99, 235, 0.18) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 18% 82%, rgba(59, 130, 246, 0.15) 0%, transparent 62%),
    radial-gradient(ellipse 50% 40% at 50% 50%, rgba(255, 255, 255, 0.28) 0%, transparent 70%),
    linear-gradient(145deg, #cfdeef 0%, #c1d0e5 48%, #b3c5dd 100%);
  background-attachment: fixed;
  min-height: 100dvh;
}

/* ── Sidebar Nav ─────────────────────────────────────────────── */
.dash-layout {
  display: block;
  min-height: 100dvh;
}

.dash-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 240px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-right: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: 4px 0 24px rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
  z-index: var(--z-nav);
  overflow-y: auto;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-5) var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
  text-decoration: none;
}

.sidebar-logo-img {
  height: 30px;
  width: auto;
  display: block;
  object-fit: contain;
  flex-shrink: 0;
}

.sidebar-logo-text {
  font-weight: 800;
  font-size: var(--text-base);
  color: var(--text-primary);
  letter-spacing: -0.01em;
  line-height: 1.1;
  white-space: nowrap;
}

.sidebar-logo-text span {
  display: inline;
  font-size: inherit;
  font-weight: 800;
  color: var(--green-600, #16a34a);
  letter-spacing: inherit;
}

.sidebar-nav {
  flex: 1;
  padding: var(--space-4) var(--space-3);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: var(--space-3) var(--space-3) var(--space-2);
  margin-top: var(--space-2);
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 9px var(--space-3);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.sidebar-link:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.sidebar-link.active {
  background: var(--blue-50);
  color: var(--blue-700);
  font-weight: 600;
}

.sidebar-link-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.7;
}

.sidebar-link.active .sidebar-link-icon { opacity: 1; }

.sidebar-footer {
  padding: var(--space-4) var(--space-3);
  border-top: 1px solid var(--border-subtle);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-2);
  border-radius: var(--radius-lg);
}

.sidebar-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--blue-500), var(--blue-700));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: 700;
  flex-shrink: 0;
}

.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name  { font-size: var(--text-xs); font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-plan  { font-size: 10px; color: var(--text-muted); }

.sidebar-logout-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-md);
  transition: background var(--transition-fast), color var(--transition-fast);
}
.sidebar-logout-btn:hover { background: var(--bg-elevated); color: var(--status-danger); }

/* ── Main Content ────────────────────────────────────────────── */
.dash-content {
  margin-left: 240px;
  padding: var(--space-8) var(--space-8) var(--space-16);
  min-height: 100vh;
  box-sizing: border-box;
}

/* ── Page Header ─────────────────────────────────────────────── */
.dash-page-header {
  margin-bottom: var(--space-6);
}

.dash-greeting {
  font-size: clamp(1.5rem, 1.2rem + 1.2vw, var(--text-3xl));
  font-weight: 800;
  letter-spacing: -0.025em;
  color: #0b172a;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
  margin-bottom: var(--space-1);
}

.dash-greeting span { color: var(--blue-700); }

.dash-date {
  font-size: var(--text-sm);
  font-weight: 500;
  color: #3b506b;
}

/* ── Score + Overview Row ────────────────────────────────────── */
.dash-hero-row {
  display: grid;
  grid-template-columns: 260px 1fr 1.35fr;
  gap: var(--space-5);
  margin-bottom: var(--space-6);
  align-items: stretch;
}

/* Privacy Meter Card */
.score-card {
  background: linear-gradient(145deg, var(--blue-700), #0f2557);
  border: 1px solid rgba(147, 197, 253, 0.28);
  box-shadow: 0 12px 32px -4px rgba(15, 30, 60, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  border-radius: var(--radius-2xl);
  padding: var(--space-6) var(--space-6);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  min-width: 240px;
  position: relative;
  overflow: hidden;
}

.score-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 30% 0%, rgba(255,255,255,0.16) 0%, transparent 62%);
  pointer-events: none;
}

.score-card-label {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.75);
}

.score-card-gauge { position: relative; width: 148px; height: 148px; display: block; }

.score-card-gauge svg { transform: rotate(-90deg); display: block; }

.score-gauge-track { fill: none; stroke: rgba(255,255,255,0.14); stroke-width: 10; }
.score-gauge-fill  { fill: none; stroke-width: 10; stroke-linecap: round; transition: stroke-dashoffset 1.2s cubic-bezier(0.4,0,0.2,1); }

.score-gauge-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.score-value  { font-size: 2.1rem; font-weight: 900; color: #fff; line-height: 1; letter-spacing: -0.04em; }
.score-denom  { font-size: 11px; color: rgba(255,255,255,0.55); font-weight: 500; margin-top: 3px; }

/* Phase 2 UX: Shield Protection Tier Box inside Privacy Meter */
.score-tier-box {
  width: 100%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-lg);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  z-index: 1;
}

.score-tier-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.score-tier-name {
  font-size: 11.5px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.score-tier-level {
  font-size: 10px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.16);
  padding: 1px 7px;
  border-radius: var(--radius-full);
}

.score-tier-bar-track {
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.score-tier-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #38bdf8, #4ade80);
  border-radius: var(--radius-full);
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.score-tier-prompt {
  font-size: 10.5px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.35;
}

/* Stat cards — high-contrast white cards that pop against glossy canvas */
.stat-card {
  background: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--space-4);
  box-shadow: 0 10px 28px -4px rgba(15, 23, 42, 0.12), 0 4px 10px -2px rgba(15, 23, 42, 0.06), inset 0 1px 0 #ffffff;
  transition: box-shadow var(--transition-base), transform var(--transition-base);
}

.stat-card:hover {
  box-shadow: 0 16px 36px -4px rgba(15, 23, 42, 0.16), 0 6px 14px -2px rgba(15, 23, 42, 0.08);
  transform: translateY(-2px);
}

.stat-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stat-card-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin: auto 0;
}

.stat-card-label {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
}

.stat-card-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-icon-blue   { background: var(--blue-50);          color: var(--blue-600); }
.stat-icon-green  { background: rgba(34,197,94,0.10);    color: #16a34a; }
.stat-icon-orange { background: rgba(249,115,22,0.10);   color: #ea580c; }

.stat-card-value {
  font-size: 2.75rem;
  font-weight: 900;
  color: var(--text-primary);
  letter-spacing: -0.04em;
  line-height: 1;
}

.stat-card-sub {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-weight: 500;
}

.stat-card-link {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--blue-600);
  text-decoration: none;
  padding-top: var(--space-3);
  border-top: 1px solid var(--border-subtle);
  display: inline-flex;
  align-items: center;
  transition: color var(--transition-fast);
}

.stat-card-link:hover {
  color: var(--blue-700);
}

/* ── Two-Column Section ──────────────────────────────────────── */
.dash-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-5);
  margin-bottom: var(--space-6);
}

/* ── Panel Cards ─────────────────────────────────────────────── */
.panel {
  background: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: var(--radius-xl);
  box-shadow: 0 10px 28px -4px rgba(15, 23, 42, 0.12), 0 4px 10px -2px rgba(15, 23, 42, 0.06), inset 0 1px 0 #ffffff;
  overflow: hidden;
  transition: box-shadow var(--transition-base);
}

.panel:hover {
  box-shadow: 0 14px 34px -4px rgba(15, 23, 42, 0.15), 0 6px 12px -2px rgba(15, 23, 42, 0.07);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border-subtle);
}

.panel-title {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-primary);
}

.panel-action {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--blue-600);
  text-decoration: none;
}

.panel-action:hover { color: var(--blue-700); }

.panel-body { padding: var(--space-4) var(--space-5); }

/* ── Company list ────────────────────────────────────────────── */
.company-watch-list { display: flex; flex-direction: column; gap: 2px; }

.company-watch-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-2);
  border-radius: var(--radius-md);
  transition: background var(--transition-fast);
}

.company-watch-item:hover { background: var(--bg-elevated); }

.company-watch-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}

.company-watch-name {
  flex: 1;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
}

.company-watch-score {
  font-size: var(--text-xs);
  font-weight: 800;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

/* ── Alerts list & Phase 2 Next Best Action Spotlight ────────── */
.next-best-action-card {
  background: linear-gradient(135deg, #eff6ff 0%, #f8fafc 100%);
  border: 1px solid rgba(37, 99, 235, 0.24);
  border-left: 4px solid var(--blue-600);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nba-all-done-card {
  background: rgba(34, 197, 94, 0.06);
  border: 1px solid rgba(34, 197, 94, 0.25);
  border-left: 4px solid #16a34a;
  border-radius: var(--radius-lg);
  padding: 14px 16px;
}

.nba-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.nba-eyebrow {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--blue-700, #1d4ed8);
}

.nba-badges {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nba-time-pill {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: #ffffff;
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
}

.nba-pts-pill {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: rgba(34, 197, 94, 0.14);
  color: #15803d;
}

.nba-company-line {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-primary);
}

.nba-action-text {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  line-height: 1.5;
}

.nba-cta-btn {
  align-self: flex-start;
  margin-top: 4px;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  background: var(--blue-600);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: background var(--transition-fast), transform var(--transition-fast);
}

.nba-cta-btn:hover {
  background: var(--blue-700);
  transform: translateY(-1px);
}

.alerts-list { display: flex; flex-direction: column; gap: var(--space-2); }

.alert-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 10px 12px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
}

.alert-item-btn {
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  transition: background var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
}

.alert-item-btn:hover {
  background: #ffffff;
  border-color: var(--blue-400);
  transform: translateY(-1px);
}

.alert-jump-arrow {
  font-size: 11px;
  font-weight: 700;
  color: var(--blue-600);
  flex-shrink: 0;
}

.alert-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
  margin-top: 4px;
}

.alert-dot-red    { background: var(--status-danger); }
.alert-dot-yellow { background: var(--status-warn); }
.alert-dot-blue   { background: var(--blue-400); }

.alert-body { flex: 1; min-width: 0; }

.alert-title {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
  margin-bottom: 2px;
}

.alert-meta {
  font-size: 10px;
  color: var(--text-muted);
}

/* ── Quick Actions ───────────────────────────────────────────── */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-5);
  margin-bottom: var(--space-6);
}

.quick-action-card {
  background: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  box-shadow: 0 10px 28px -4px rgba(15, 23, 42, 0.12), 0 4px 10px -2px rgba(15, 23, 42, 0.06), inset 0 1px 0 #ffffff;
  transition: box-shadow var(--transition-base), transform var(--transition-base), border-color var(--transition-fast);
}

.quick-action-card:hover {
  box-shadow: 0 16px 36px -4px rgba(15, 23, 42, 0.16), 0 6px 14px -2px rgba(15, 23, 42, 0.08);
  transform: translateY(-3px);
  border-color: var(--blue-border-strong);
}

.quick-action-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.quick-action-title {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-primary);
}

.quick-action-desc {
  font-size: var(--text-xs);
  color: var(--text-muted);
  line-height: 1.5;
}

/* ── Empty state ─────────────────────────────────────────────── */
.panel-empty {
  padding: var(--space-8) var(--space-5);
  text-align: center;
  color: var(--text-muted);
}

.panel-empty-icon { font-size: 2rem; margin-bottom: var(--space-3); }
.panel-empty-text { font-size: var(--text-sm); line-height: 1.6; }
.panel-empty-link { color: var(--blue-600); font-weight: 600; font-size: var(--text-sm); text-decoration: none; display: inline-block; margin-top: var(--space-3); }

/* ── Loading overlay ─────────────────────────────────────────── */
#dash-loading {
  position: fixed; inset: 0;
  background: linear-gradient(145deg, #cfdeef 0%, #c1d0e5 48%, #b3c5dd 100%);
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: var(--space-4);
  z-index: 999;
  transition: opacity 0.3s;
}

.dash-spinner {
  width: 40px; height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.5);
  border-top-color: var(--blue-600);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Account Overview Card ───────────────────────────────────── */
.account-overview-card {
  justify-content: flex-start;
  gap: var(--space-4);
}

.account-panel-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: auto;
  margin-bottom: auto;
}

.account-meta-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.account-meta-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  flex-shrink: 0;
}

.account-meta-value {
  font-size: var(--text-xs);
  color: var(--text-primary);
  font-weight: 600;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-plan-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  background: var(--blue-50);
  color: var(--blue-700);
  border: 1px solid var(--blue-200);
  font-size: 11px;
  font-weight: 700;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .dash-hero-row   { grid-template-columns: 1fr 1fr; }
  .score-card      { grid-column: 1 / -1; flex-direction: row; justify-content: center; gap: var(--space-8); }
  .quick-actions   { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .dash-layout  { display: block; }
  .dash-sidebar { display: none; }
  .dash-content { margin-left: 0; padding: var(--space-5); }
  .dash-hero-row { grid-template-columns: 1fr; }
  .score-card    { flex-direction: column; align-items: center; }
  .dash-grid-2  { grid-template-columns: 1fr; }
  .quick-actions { grid-template-columns: 1fr 1fr; }

  .dash-greeting { font-size: var(--text-xl); }
  .section-title { font-size: var(--text-lg); }
}

@media (max-width: 480px) {
  .quick-actions { grid-template-columns: 1fr; }
}
