/* ============================================================
   DASHBOARD — Glassmorphism / Apple Vision Pro inspired
   ============================================================ */

body.dashboard-page {
  background: #0a1419;
  position: relative;
  min-height: 100vh;
  color: rgba(255, 255, 255, 0.92);
  overflow-x: hidden;
}

body.dashboard-page::before {
  content: '';
  position: fixed; inset: 0; z-index: -2;
  background:
    radial-gradient(ellipse 80% 60% at 20% 0%, rgba(122, 158, 135, 0.28) 0%, transparent 60%),
    radial-gradient(ellipse 70% 50% at 80% 30%, rgba(26, 58, 74, 0.55) 0%, transparent 55%),
    radial-gradient(ellipse 60% 80% at 50% 100%, rgba(122, 158, 135, 0.18) 0%, transparent 60%),
    linear-gradient(180deg, #0e242e 0%, #0a1419 100%);
}

body.dashboard-page::after {
  content: '';
  position: fixed; inset: 0; z-index: -1;
  pointer-events: none; opacity: 0.08; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Floating ambient orbs */
.orb {
  position: fixed; border-radius: 50%; filter: blur(80px);
  opacity: 0.5; pointer-events: none; z-index: -1;
  animation: orb-float 20s ease-in-out infinite;
}
.orb-1 { width: 600px; height: 600px; top: -150px; left: -100px;
  background: radial-gradient(circle, rgba(122, 158, 135, 0.45), transparent 70%); }
.orb-2 { width: 500px; height: 500px; top: 30%; right: -100px;
  background: radial-gradient(circle, rgba(48, 90, 110, 0.6), transparent 70%);
  animation-delay: -10s; animation-duration: 25s; }
.orb-3 { width: 400px; height: 400px; bottom: 0; left: 30%;
  background: radial-gradient(circle, rgba(122, 158, 135, 0.3), transparent 70%);
  animation-delay: -5s; animation-duration: 30s; }

@keyframes orb-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(40px, -30px) scale(1.05); }
  66%      { transform: translate(-30px, 30px) scale(0.95); }
}

/* Top nav — frosted pill */
.db-page-nav {
  position: sticky; top: 16px; z-index: 50;
  margin: 16px clamp(16px, 3vw, 32px) 0;
  padding: 14px 24px;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  background: rgba(15, 30, 38, 0.55);
  backdrop-filter: blur(32px) saturate(1.8);
  -webkit-backdrop-filter: blur(32px) saturate(1.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 100px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

.db-page-brand {
  font-family: var(--f-display); font-size: 16px; font-weight: 400;
  letter-spacing: -0.01em; color: rgba(255, 255, 255, 0.95);
  display: flex; align-items: center; gap: 10px;
}
.db-page-brand em { font-style: italic; color: #a8c2b0; }
.db-page-brand .dot {
  width: 6px; height: 6px; border-radius: 50%; background: #7a9e87;
  display: inline-block; box-shadow: 0 0 12px rgba(122, 158, 135, 0.8);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50%      { opacity: 1; transform: scale(1.15); }
}

.db-page-meta {
  font-family: var(--f-mono); font-size: 11px;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

.topbar-actions { display: flex; align-items: center; gap: 20px; }
.topbar-actions a, .logout {
  font-family: var(--f-mono); font-size: 10px;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
  transition: color 0.3s, text-shadow 0.3s;
}
.topbar-actions a:hover {
  color: #a8c2b0; text-shadow: 0 0 12px rgba(168, 194, 176, 0.5);
}

@media (max-width: 700px) {
  .db-page-meta { display: none; }
  .db-page-nav { padding: 12px 18px; border-radius: 24px; }
}

/* Loading state */
.db-loading {
  padding: 120px clamp(24px, 4vw, 40px); text-align: center;
  font-family: var(--f-mono); font-size: 11px;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}
.db-loading::after {
  content: ''; display: block;
  width: 40px; height: 40px; margin: 24px auto 0;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-top-color: #7a9e87;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Page header */
.db-page-header {
  padding: 64px clamp(20px, 3vw, 40px) 32px;
  max-width: 1600px; margin: 0 auto;
}

.db-page-label {
  font-family: var(--f-mono); font-size: 10px;
  letter-spacing: 0.24em; text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5); margin-bottom: 20px;
  display: inline-flex; gap: 12px; align-items: center;
}
.db-page-label::before {
  content: ''; width: 32px; height: 1px;
  background: linear-gradient(90deg, transparent, #7a9e87);
}

.db-page-header h1 {
  font-family: var(--f-display); font-weight: 200;
  font-size: clamp(40px, 6vw, 72px); line-height: 0.96;
  letter-spacing: -0.03em;
  color: rgba(255, 255, 255, 0.96); margin-bottom: 20px;
}
.db-page-header h1 em {
  font-style: italic; font-weight: 200;
  background: linear-gradient(135deg, #a8c2b0, #7a9e87);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: #7a9e87;
}

.db-page-sub {
  font-size: 16px; line-height: 1.6; max-width: 580px;
  color: rgba(255, 255, 255, 0.65); font-weight: 300;
}

/* Time toggle */
.db-page-tabs {
  margin-top: 36px;
  display: inline-flex; gap: 0; padding: 4px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 100px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.db-page-tabs .db-tab {
  padding: 10px 22px;
  font-family: var(--f-mono); font-size: 10px;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  background: transparent; border: none; border-radius: 100px;
  cursor: pointer; font-weight: 500;
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.db-page-tabs .db-tab.active {
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.95);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.15),
    0 2px 8px rgba(0, 0, 0, 0.15);
}
.db-page-tabs .db-tab:hover:not(.active) { color: rgba(255, 255, 255, 0.85); }

/* Body */
.db-page-body {
  max-width: 1600px; margin: 0 auto;
  padding: 0 clamp(20px, 3vw, 40px) 80px;
}

/* Headline cards */
.db-headline {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 16px; margin-bottom: 24px;
}
@media (max-width: 1100px) { .db-headline { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px)  { .db-headline { grid-template-columns: 1fr; } }

.headline-card {
  position: relative;
  padding: 28px 28px 24px;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  display: flex; flex-direction: column; gap: 10px;
  overflow: hidden;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1),
              border-color 0.5s, box-shadow 0.5s;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 4px 20px rgba(0, 0, 0, 0.15);
}
.headline-card:hover {
  transform: translateY(-3px);
  border-color: rgba(168, 194, 176, 0.25);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 12px 40px rgba(0, 0, 0, 0.25),
    0 0 60px rgba(122, 158, 135, 0.15);
}
.headline-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(122, 158, 135, 0.6), transparent);
  opacity: 0; transition: opacity 0.6s 0.1s;
}
.headline-card.active::before { opacity: 1; }
.headline-card::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  background: radial-gradient(circle at 50% 0%, rgba(122,158,135,0.08), transparent 70%);
  opacity: 0; transition: opacity 0.5s; pointer-events: none;
}
.headline-card:hover::after { opacity: 1; }
.headline-card > * { position: relative; z-index: 1; }

.headline-card .lbl {
  font-family: var(--f-mono); font-size: 9px;
  letter-spacing: 0.24em; text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5); margin-bottom: 4px;
}
.headline-card .val {
  font-family: var(--f-display);
  font-size: clamp(38px, 4vw, 52px); line-height: 1;
  color: rgba(255, 255, 255, 0.96);
  font-weight: 300; letter-spacing: -0.03em; margin-top: 2px;
}
.headline-card .delta {
  font-family: var(--f-mono); font-size: 11px;
  font-weight: 600; letter-spacing: 0.04em; margin-top: 2px;
}
.headline-card .delta.up    { color: #a8c2b0; text-shadow: 0 0 12px rgba(168, 194, 176, 0.3); }
.headline-card .delta.down  { color: #d88a76; text-shadow: 0 0 12px rgba(216, 138, 118, 0.3); }
.headline-card .delta.flat  { color: rgba(255, 255, 255, 0.5); }
.headline-card .spark { margin-top: 14px; height: 40px; position: relative; }
.headline-card .footnote {
  font-family: var(--f-mono); font-size: 9px;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: rgba(255, 255, 255, 0.35);
  padding-top: 14px; margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* Section panels */
.db-section {
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  margin-bottom: 16px; overflow: hidden;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 4px 20px rgba(0, 0, 0, 0.15);
}
.db-section-head {
  padding: 24px 32px;
  display: flex; justify-content: space-between; align-items: baseline;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-wrap: wrap; gap: 12px;
}
.db-section-head h3 {
  font-family: var(--f-display); font-size: 22px; font-weight: 400;
  color: rgba(255, 255, 255, 0.95); letter-spacing: -0.015em;
}
.db-section-head .legend {
  display: flex; gap: 20px;
  font-family: var(--f-mono); font-size: 10px;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}
.db-section-head .legend-item { display: inline-flex; align-items: center; gap: 8px; }
.db-section-head .legend-item::before {
  content: ''; width: 12px; height: 2px; border-radius: 1px;
}
.db-section-head .legend-navy::before {
  background: #ffffff; box-shadow: 0 0 8px rgba(255,255,255,0.4);
}
.db-section-head .legend-sage::before {
  background: #7a9e87; box-shadow: 0 0 8px rgba(122,158,135,0.5);
}
.db-chart-body { padding: 32px 32px 40px; }

/* Two-column row */
.db-cols {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 16px; margin-bottom: 16px;
}
@media (max-width: 900px) { .db-cols { grid-template-columns: 1fr; } }

.db-col-section {
  padding: 28px 32px;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 4px 20px rgba(0, 0, 0, 0.15);
}
.db-col-section h3 {
  font-family: var(--f-display); font-size: 20px; font-weight: 400;
  color: rgba(255, 255, 255, 0.95); letter-spacing: -0.015em;
  margin-bottom: 4px;
}
.db-col-section .sub {
  font-family: var(--f-mono); font-size: 9px;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45); margin-bottom: 20px;
}

/* Row lists */
.row-list { display: flex; flex-direction: column; }
.row-list .row {
  display: grid; grid-template-columns: 1fr auto;
  align-items: center;
  padding: 16px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 14px; gap: 16px;
}
.row-list .row:last-child  { border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
.row-list .row:first-child { border-top: none; }
.row-list .name { color: rgba(255, 255, 255, 0.85); font-weight: 400; }
.row-list .val {
  font-family: var(--f-mono); font-size: 13px;
  color: #a8c2b0; font-weight: 600;
  text-align: right; letter-spacing: 0.02em;
}

/* Activity log */
.activity-log { display: flex; flex-direction: column; }
.activity-log .row {
  padding: 16px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: grid; grid-template-columns: 90px 1fr;
  gap: 20px; font-size: 13.5px;
}
.activity-log .row:first-child { border-top: none; }
.activity-log .when {
  font-family: var(--f-mono); font-size: 10px;
  letter-spacing: 0.12em; color: rgba(255, 255, 255, 0.45);
  padding-top: 2px;
}
.activity-log .what { color: rgba(255, 255, 255, 0.82); line-height: 1.55; }
.activity-log .what .label {
  font-family: var(--f-mono); font-size: 9px;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: #a8c2b0;
  background: rgba(122, 158, 135, 0.12);
  padding: 3px 10px; border-radius: 100px;
  margin-right: 10px; font-weight: 600;
  display: inline-block; vertical-align: 1px;
  border: 1px solid rgba(122, 158, 135, 0.2);
}

/* Analyst note */
.month-note {
  margin-top: 16px;
  padding: 36px 36px 32px;
  background: linear-gradient(135deg, rgba(122, 158, 135, 0.08), rgba(255, 255, 255, 0.04));
  backdrop-filter: blur(32px) saturate(1.5);
  -webkit-backdrop-filter: blur(32px) saturate(1.5);
  border: 1px solid rgba(168, 194, 176, 0.15);
  border-radius: 20px;
  position: relative; overflow: hidden;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 8px 32px rgba(0, 0, 0, 0.2),
    0 0 60px rgba(122, 158, 135, 0.08);
}
.month-note::before {
  content: ''; position: absolute;
  top: -50%; right: -20%; width: 60%; height: 200%;
  background: radial-gradient(ellipse, rgba(122, 158, 135, 0.18), transparent 60%);
  pointer-events: none;
}
.month-note > * { position: relative; }
.month-note .lbl {
  font-family: var(--f-mono); font-size: 9px;
  letter-spacing: 0.24em; text-transform: uppercase;
  color: #a8c2b0; margin-bottom: 18px;
}
.month-note h4 {
  font-family: var(--f-display); font-weight: 200;
  font-size: clamp(22px, 2.6vw, 32px); line-height: 1.25;
  letter-spacing: -0.02em;
  color: rgba(255, 255, 255, 0.95); margin-bottom: 18px;
  max-width: 800px;
}
.month-note p {
  font-size: 15px; line-height: 1.7;
  color: rgba(255, 255, 255, 0.7);
  max-width: 720px; font-weight: 300;
}
.month-note .signature {
  font-family: var(--f-display); font-style: italic;
  color: #a8c2b0; margin-top: 18px; font-size: 14px; font-weight: 300;
}

/* Admin client picker cards */
.client-list {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px; margin-top: 24px;
}
.client-card {
  display: block; padding: 28px;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
              border-color 0.4s, box-shadow 0.4s;
  color: inherit;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 4px 20px rgba(0, 0, 0, 0.15);
}
.client-card:hover {
  transform: translateY(-3px);
  border-color: rgba(168, 194, 176, 0.3);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 12px 40px rgba(0, 0, 0, 0.25),
    0 0 60px rgba(122, 158, 135, 0.15);
}
.client-card-name {
  font-family: var(--f-display); font-size: 22px; font-weight: 400;
  letter-spacing: -0.01em;
  color: rgba(255, 255, 255, 0.95); margin-bottom: 6px;
}
.client-card-meta {
  font-family: var(--f-mono); font-size: 10px;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

/* Error */
.error {
  padding: 16px 20px;
  background: rgba(216, 138, 118, 0.08);
  border: 1px solid rgba(216, 138, 118, 0.2);
  border-radius: 12px;
  color: #d88a76; font-size: 14px;
}

/* ============================================================
   ADMIN PAGE — glass connection cards
   ============================================================ */

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}

.admin-card {
  position: relative;
  padding: 28px;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
              border-color 0.4s, box-shadow 0.4s;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 4px 20px rgba(0, 0, 0, 0.15);
}
.admin-card:hover {
  transform: translateY(-2px);
  border-color: rgba(168, 194, 176, 0.25);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 12px 40px rgba(0, 0, 0, 0.25),
    0 0 60px rgba(122, 158, 135, 0.15);
}

.admin-card-head {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.admin-card-name {
  font-family: var(--f-display);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: rgba(255, 255, 255, 0.95);
}
.admin-card-meta {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

.admin-card-status {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
}
.admin-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.admin-status-dot.ok {
  background: #a8c2b0;
  box-shadow: 0 0 12px rgba(168, 194, 176, 0.6);
}
.admin-status-dot.warn {
  background: #e8c089;
  box-shadow: 0 0 12px rgba(232, 192, 137, 0.5);
}
.admin-status-text-ok { color: #a8c2b0; font-weight: 600; letter-spacing: 0.12em; }
.admin-status-text-warn { color: #e8c089; font-weight: 600; letter-spacing: 0.12em; }
.admin-status-meta {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.45);
  margin-left: auto;
}

.admin-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
}

.admin-btn {
  padding: 10px 18px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 100px;
  font-family: var(--f-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s;
}
.admin-btn:hover:not(:disabled) {
  background: rgba(168, 194, 176, 0.15);
  border-color: rgba(168, 194, 176, 0.3);
  transform: translateY(-1px);
}
.admin-btn.primary {
  background: linear-gradient(135deg, rgba(122, 158, 135, 0.25), rgba(122, 158, 135, 0.15));
  border-color: rgba(168, 194, 176, 0.35);
  color: rgba(255, 255, 255, 0.98);
}
.admin-btn.primary:hover:not(:disabled) {
  background: linear-gradient(135deg, rgba(122, 158, 135, 0.4), rgba(122, 158, 135, 0.25));
  box-shadow: 0 0 20px rgba(122, 158, 135, 0.25);
}
.admin-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.admin-view-link {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  transition: color 0.2s, transform 0.2s;
}
.admin-view-link:hover {
  color: #a8c2b0;
  transform: translateX(2px);
}