/* ============================================================
   GWRE Executive Equity Holdings Dashboard
   css/styles.css
   Prepared by Semler Brossy Consulting Group
   ============================================================ */

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
  --navy:        #002452;
  --teal:        #005687;
  --cyan:        #00B3C7;
  --light-cyan:  #2EC3E7;
  --accent-blue: #4179BD;
  --green:       #82C341;
  --orange:      #F68633;
  --purple:      #5C62AC;
  --pink:        #EB7AB0;
  --gray-light:  #F5F6F8;
  --gray-mid:    #63666A;
  --white:       #FFFFFF;

  /* Light mode */
  --bg-page:     #F5F6F8;
  --bg-card:     #FFFFFF;
  --bg-header:   #002452;
  --text-primary:#002452;
  --text-muted:  #63666A;
  --border:      #E2E5EA;
  --shadow:      0 2px 12px rgba(0,36,82,0.08);
  --shadow-lg:   0 4px 24px rgba(0,36,82,0.14);
}

body.dark {
  --bg-page:     #0D1B2A;
  --bg-card:     #152232;
  --bg-header:   #0A1520;
  --text-primary:#E8EDF2;
  --text-muted:  #8FA0B2;
  --border:      #1E3145;
  --shadow:      0 2px 12px rgba(0,0,0,0.4);
  --shadow-lg:   0 4px 24px rgba(0,0,0,0.5);
}

/* ── Reset / Base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 14px; scroll-behavior: smooth; }

body {
  font-family: 'Calibri', 'Trebuchet MS', sans-serif;
  background: var(--bg-page);
  color: var(--text-primary);
  min-width: 1200px;
  transition: background 0.25s, color 0.25s;
}

a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Typography ────────────────────────────────────────────── */
h1 { font-size: 1.5rem; font-weight: 700; }
h2 { font-size: 1.15rem; font-weight: 600; }
h3 { font-size: 1rem; font-weight: 600; }
p, td, th, label { font-size: 0.9rem; }

/* ── Header ────────────────────────────────────────────────── */
.site-header {
  background: var(--bg-header);
  padding: 0 32px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.sb-wordmark {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--white);
}

.sb-wordmark .sb-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 6px;
  object-fit: cover;
  display: block;
}

.sb-wordmark .sb-name {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--white);
}

.header-divider {
  width: 1px;
  height: 32px;
  background: rgba(255,255,255,0.25);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.gwre-wordmark {
  color: rgba(255,255,255,0.85);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  /* Replace this text with <img src="/assets/gwre_logo.png" alt="Guidewire" height="28"> */
}

/* ── Control Bar ───────────────────────────────────────────── */
.control-bar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 10px 32px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  position: sticky;
  top: 60px;
  z-index: 999;
  box-shadow: var(--shadow);
}

.control-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.control-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

/* Executive selector */
.exec-select {
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 12px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s;
}
.exec-select:focus { border-color: var(--cyan); }

/* Price mode toggle */
.price-mode-group {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.price-mode-btn {
  padding: 6px 14px;
  border: none;
  background: var(--bg-page);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  border-right: 1px solid var(--border);
}
.price-mode-btn:last-child { border-right: none; }
.price-mode-btn.active {
  background: var(--cyan);
  color: var(--white);
}
.price-mode-btn:hover:not(.active) {
  background: var(--gray-light);
  color: var(--text-primary);
}
body.dark .price-mode-btn:hover:not(.active) {
  background: #1E3145;
}

/* Manual price input */
.manual-price-wrap,
.scenario-wrap {
  display: none;
  align-items: center;
  gap: 6px;
}
.manual-price-wrap.show,
.scenario-wrap.show {
  display: flex;
}

.manual-price-input {
  width: 100px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-page);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  outline: none;
}
.manual-price-input:focus { border-color: var(--orange); }

/* Scenario slider */
.scenario-wrap input[type="range"] {
  width: 140px;
  accent-color: var(--orange);
}
#scenario-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--orange);
  min-width: 140px;
}

/* Active price pill */
.price-pill {
  font-size: 1.1rem;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: 20px;
  letter-spacing: 0.02em;
  transition: background 0.2s;
}
.price-live   { background: var(--cyan);   color: var(--white); }
.price-manual { background: var(--orange); color: var(--white); }

/* Price dot (pulsing) */
.price-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  animation: pulse 2s infinite;
}
.dot-green { background: #22C55E; }
.dot-amber { background: var(--orange); animation: none; }

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(34,197,94,0.5); }
  70%  { box-shadow: 0 0 0 8px rgba(34,197,94,0); }
  100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}

/* Live price display */
#live-price-display {
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.price-up   { color: #22C55E; font-weight: 600; }
.price-down { color: #EF4444; font-weight: 600; }

/* Gate toggle */
.gate-toggle-group {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1.5px solid var(--teal);
  background: rgba(0,86,135,0.07);
  cursor: pointer;
}
.gate-toggle-group label { cursor: pointer; font-weight: 600; color: var(--teal); }
body.dark .gate-toggle-group { border-color: var(--cyan); background: rgba(0,179,199,0.07); }
body.dark .gate-toggle-group label { color: var(--cyan); }

/* ── Live fetch banner ────────────────────────────────────── */
.fetch-banner {
  display: none;
  background: rgba(246,134,51,0.12);
  border: 1px solid var(--orange);
  border-radius: 8px;
  padding: 10px 16px;
  margin: 12px 32px 0;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  color: var(--text-primary);
}
.fetch-banner.show { display: flex; }
.fetch-banner strong { color: var(--orange); }

.retry-btn {
  padding: 4px 12px;
  border: 1px solid var(--orange);
  border-radius: 5px;
  background: transparent;
  color: var(--orange);
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s;
}
.retry-btn:hover { background: var(--orange); color: var(--white); }

/* ── Gate Warning Banner ──────────────────────────────────── */
.gate-warning {
  display: none;
  background: rgba(235,122,176,0.12);
  border: 1.5px solid var(--pink);
  border-radius: 8px;
  padding: 10px 16px;
  margin: 0 0 16px;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--pink);
}
.gate-warning.show,
.gate-warning[style*="flex"] { display: flex !important; }

/* ── Main Content ─────────────────────────────────────────── */
.main-content {
  padding: 24px 32px;
  max-width: 1600px;
  margin: 0 auto;
}

/* ── Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: box-shadow 0.2s;
}
.card:hover { box-shadow: var(--shadow); }  /* remove elevated hover shadow for cleaner look */

.card-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.section-title {
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-primary);
  padding-left: 12px;
  border-left: 2px solid var(--teal);
}

.card-body { padding: 20px; }

/* ── KPI Cards Row ─────────────────────────────────────────── */
.kpi-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

@media (max-width: 900px) {
  .kpi-row { grid-template-columns: 1fr; }
}

.kpi-main-value {
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.1;
}
body.dark .kpi-main-value { color: var(--cyan); }

.kpi-multiple {
  font-size: 1rem;
  font-weight: 700;
  color: var(--green);
  margin-left: 8px;
}

.kpi-breakdown {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.kpi-row-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.85rem;
}

.kpi-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot-rsu    { background: #4179BD; }   /* accent blue — clear, distinct */
.dot-psu    { background: #5C62AC; }   /* purple — distinct from blue */
.dot-kicker { background: #F68633; }   /* orange — clearly different */

.kpi-item-label { color: var(--text-muted); flex: 1; }
.kpi-item-value { font-weight: 600; }
.kpi-item-shares { color: var(--text-muted); font-size: 0.8rem; }

.kpi-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 10px 0;
}

/* Window toggle */
.window-toggle-group {
  display: flex;
  gap: 4px;
}
.window-btn {
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.window-btn.active {
  background: var(--teal);
  color: var(--white);
  border-color: var(--teal);
}
.window-btn:hover:not(.active) { border-color: var(--teal); color: var(--teal); }

/* ── Section Layout ────────────────────────────────────────── */
.section { margin-bottom: 20px; }

.chart-wrap {
  position: relative;
  height: 320px;
  width: 100%;
}

.chart-wrap-tall {
  position: relative;
  height: 400px;
  width: 100%;
}

/* ── Waterfall callout ─────────────────────────────────────── */
.waterfall-callout {
  margin-top: 12px;
  padding: 10px 14px;
  background: rgba(0,0,0,0.02);
  border-left: 2px solid var(--border);
  border-radius: 0 6px 6px 0;
  font-size: 0.88rem;
  color: var(--text-muted);
  font-style: italic;
}
body.dark .waterfall-callout { background: rgba(255,255,255,0.02); }

/* ── Kicker Tracker ────────────────────────────────────────── */
.kicker-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.kicker-card {
  background: var(--bg-page);
  border-radius: 8px;
  padding: 16px;
  border: 1px solid var(--border);
}

.kicker-card-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.hurdle-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.hurdle-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.82rem;
  font-weight: 600;
  width: 100%;
}

.hurdle-met   { background: rgba(130,195,65,0.15);  color: #3a7d0f; border: 1px solid #82C341; }
.hurdle-unmet { background: rgba(99,102,106,0.1);   color: var(--text-muted); border: 1px solid var(--border); }
body.dark .hurdle-met { color: #82C341; }

.kicker-attainment-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
  padding: 3px 0;
}
.kicker-att-label { color: var(--text-muted); }
.kicker-att-value { font-weight: 700; color: var(--cyan); }

/* Kicker summary table */
.kicker-summary-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  margin-top: 8px;
}
.kicker-summary-table th,
.kicker-summary-table td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.kicker-summary-table th {
  background: var(--gray-light);
  color: var(--text-primary);
  border-bottom: 2px solid var(--navy);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
body.dark .kicker-summary-table th {
  background: rgba(255,255,255,0.05);
  color: var(--text-primary);
}
.kicker-summary-table tr:hover td { background: rgba(0,179,199,0.04); }

/* ── Grant Table ───────────────────────────────────────────── */
.grant-table-wrap {
  overflow-x: auto;
  margin-top: 8px;
}

.grant-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.87rem;
}

.grant-table th {
  background: var(--gray-light);
  color: var(--text-primary);
  border-bottom: 2px solid var(--navy);
  padding: 9px 12px;
  text-align: left;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
body.dark .grant-table th {
  background: rgba(255,255,255,0.05);
  color: var(--text-primary);
  border-bottom: 2px solid var(--cyan);
}

.grant-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.grant-table tr:nth-child(even) td { background: rgba(0,0,0,0.02); }
body.dark .grant-table tr:nth-child(even) td { background: rgba(255,255,255,0.02); }

.grant-table tr:hover td { background: rgba(0,179,199,0.06); }

.kicker-row td {
  border-left: none;
  background: rgba(46,195,231,0.06) !important;
}
.kicker-row td:first-child {
  border-left: 3px solid var(--cyan);
  padding-left: 9px;
}

.totals-row td {
  background: var(--bg-page) !important;
  font-weight: 700;
  border-top: 2px solid var(--border);
}
body.dark .totals-row td { background: rgba(255,255,255,0.04) !important; }

/* Table section heading */
.table-section-heading {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--teal);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 14px 0 8px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 4px;
}

/* ── Dark Mode Button ──────────────────────────────────────── */
.dark-mode-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.3);
  background: transparent;
  color: var(--white);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s;
}
.dark-mode-btn:hover {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.6);
}

/* ── Footer ────────────────────────────────────────────────── */
.site-footer {
  background: var(--navy);
  color: rgba(255,255,255,0.7);
  padding: 14px 32px;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 32px;
}
.site-footer strong { color: var(--white); }

/* ── Login Page ────────────────────────────────────────────── */
.login-body {
  min-height: 100vh;
  background: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Calibri', 'Trebuchet MS', sans-serif;
}

.login-card {
  background: var(--white);
  border-radius: 12px;
  padding: 48px 44px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.4);
  text-align: center;
}

.login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 24px;
}

.login-logo .sb-name {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--navy);
}

.login-card h1 {
  font-size: 1.3rem;
  color: var(--navy);
  margin-bottom: 6px;
}

.login-card .login-sub {
  font-size: 0.9rem;
  color: var(--gray-mid);
  margin-bottom: 32px;
}

.login-input-wrap {
  display: flex;
  border: 1.5px solid #D0D5DD;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 14px;
  transition: border-color 0.2s;
}
.login-input-wrap:focus-within { border-color: var(--cyan); }

.login-input {
  flex: 1;
  padding: 12px 16px;
  border: none;
  font-family: 'Calibri', 'Trebuchet MS', sans-serif;
  font-size: 1rem;
  color: var(--navy);
  outline: none;
  background: transparent;
}

.login-btn {
  padding: 12px 20px;
  background: var(--cyan);
  border: none;
  color: var(--white);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}
.login-btn:hover { background: var(--teal); }

.login-error {
  display: none;
  color: #DC2626;
  font-size: 0.88rem;
  margin-top: 8px;
  font-weight: 600;
}
.login-error.show { display: block; }

.login-footer {
  margin-top: 28px;
  font-size: 0.8rem;
  color: var(--gray-mid);
}

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

.flex-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.spacer { flex: 1; }

.text-muted { color: var(--text-muted); }
.text-green { color: var(--green); }
.text-orange { color: var(--orange); }
.text-cyan { color: var(--cyan); }

.mb-16 { margin-bottom: 16px; }
.mb-8  { margin-bottom: 8px; }
.mt-12 { margin-top: 12px; }

/* Tag pill */
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 600;
}
.tag-rsu    { background: rgba(65,121,189,0.12);  color: #3361A0; }
.tag-psu    { background: rgba(92,98,172,0.12);   color: #4B50A0; }
.tag-kicker { background: rgba(246,134,51,0.15);  color: #C06020; }
body.dark .tag-psu    { background: rgba(92,98,172,0.2);  color: #9CA0D8; }
body.dark .tag-rsu    { background: rgba(65,121,189,0.2); color: #7AAAD4; }
body.dark .tag-kicker { background: rgba(246,134,51,0.2); color: #F6A870; }

/* Gate info icon */
.gate-info-icon {
  font-size: 0.85rem;
  opacity: 0.6;
  cursor: help;
  margin-left: 2px;
}

/* Chart footnote */
.chart-footnote {
  margin-top: 8px;
  font-size: 0.77rem;
  color: var(--text-muted);
  line-height: 1.5;
  padding: 0 4px;
  font-style: italic;
}
