:root {
  --bg-obsidian: #181516;
  --bg-card: #1f1b1d;
  --bg-input: #141112;
  --brand-maroon: #5c252d;
  --brand-maroon-hover: #732f39;
  --brand-gold: #8c6d3f;
  --brand-gold-light: #e3cfaf;
  --brand-gold-bright: #d4af37;
  --text-light: #f5f0e6;
  --text-muted: #a89f96;
  --green: #16a34a;
  --red: #dc2626;
  --font-display: 'Noto Serif', Georgia, serif;
  --font-body: 'Lora', Georgia, serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  background-color: var(--bg-obsidian);
  color: var(--text-light);
  min-height: 100vh;
}

.hidden { display: none !important; }

/* Login Gate */
.login-gate {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background-color: var(--bg-card);
  border: 1px solid var(--brand-gold);
  border-radius: 12px;
  padding: 28px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
}

.brand-lockup {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 6px;
}

.brand-seal { width: 56px; height: auto; }

.brand-title {
  display: flex;
  flex-direction: column;
  font-family: var(--font-display);
  color: var(--brand-gold-light);
  text-shadow: 2px 0 var(--brand-gold);
  line-height: 1.18;
}

.brand-top { font-weight: 700; font-size: 18px; letter-spacing: 0.149em; }
.brand-bottom { font-weight: 400; font-size: 18px; letter-spacing: 0.175em; }

.subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: 22px;
}

/* Forms & Buttons */
label {
  display: block;
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: var(--brand-gold-light);
  margin-bottom: 6px;
}

input, select {
  width: 100%;
  padding: 12px;
  margin-bottom: 16px;
  border-radius: 8px;
  border: 1px solid #4a3f42;
  background-color: var(--bg-input);
  color: #ffffff;
  font-family: var(--font-body);
  font-size: 1rem;
}

button, .btn-inline {
  width: 100%;
  padding: 13px 18px;
  border-radius: 8px;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  display: inline-block;
}

button:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background-color: var(--brand-maroon);
  color: var(--brand-gold-light);
  border: 1px solid var(--brand-gold);
}

.btn-primary:hover { background-color: var(--brand-maroon-hover); }
.btn-secondary { background-color: #3a3235; color: var(--text-light); border: 1px solid #52484b; }
.btn-in { background-color: var(--green); color: #ffffff; border: none; }
.btn-out { background-color: var(--red); color: #ffffff; border: none; }
.btn-inline { width: auto; margin-top: 14px; }
.btn-group { display: flex; gap: 12px; }

.confirm-box {
  background-color: var(--bg-input);
  border: 1px solid var(--brand-gold);
  border-radius: 8px;
  padding: 18px;
  text-align: center;
}

.confirm-name {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--brand-gold-bright);
  margin: 8px 0 16px;
}

/* Portal Shell & Left Sidebar */
.portal-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 250px;
  background-color: var(--bg-card);
  border-right: 1px solid var(--brand-gold);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex-shrink: 0;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 20px;
  border-bottom: 1px solid #352d30;
}

.sidebar-seal { width: 42px; height: auto; }
.sidebar-brand { display: flex; flex-direction: column; font-family: var(--font-display); color: var(--brand-gold-light); line-height: 1.15; }
.sidebar-brand .brand-top { font-size: 14px; }
.sidebar-brand .brand-bottom { font-size: 14px; }

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 24px;
  flex: 1;
}

.nav-item {
  background: none;
  border: 1px solid transparent;
  color: var(--text-muted);
  text-align: left;
  padding: 12px 14px;
  font-size: 0.95rem;
}

.nav-item:hover { color: var(--brand-gold-light); background-color: rgba(255, 255, 255, 0.03); }
.nav-item.is-active {
  background-color: var(--brand-maroon);
  color: var(--brand-gold-light);
  border-color: var(--brand-gold);
}

.sidebar-footer {
  border-top: 1px solid #352d30;
  padding-top: 16px;
}

.worker-badge { margin-bottom: 12px; font-size: 0.88rem; }
.worker-badge strong { display: block; color: var(--brand-gold-light); font-family: var(--font-display); }
.worker-badge span { color: var(--text-muted); font-size: 0.8rem; }
.btn-signout { background: none; border: 1px solid #4a3f42; color: var(--text-muted); padding: 8px; font-size: 0.82rem; }

/* Workspace & Panels */
.workspace {
  flex: 1;
  padding: 32px;
  max-width: 1120px;
}

.view-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
  padding-bottom: 16px;
  border-bottom: 1px solid #352d30;
}

.kicker {
  display: block;
  font-family: var(--font-display);
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  color: var(--brand-gold-bright);
  margin-bottom: 4px;
}

.view-header h1 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  color: var(--brand-gold-light);
}

.role-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.role-badge {
  padding: 5px 12px;
  border-radius: 20px;
  background-color: var(--brand-maroon);
  border: 1px solid var(--brand-gold);
  color: var(--brand-gold-light);
  font-family: var(--font-display);
  font-size: 0.78rem;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.panel {
  background-color: var(--bg-card);
  border: 1px solid #3c3336;
  border-radius: 12px;
  padding: 24px;
}

.panel-wide { grid-column: 1 / -1; }
.clock-panel { max-width: 480px; }

.panel h2 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--brand-gold-light);
  margin-bottom: 14px;
}

.panel-desc { color: var(--text-muted); font-size: 0.92rem; margin-bottom: 16px; }

/* Radial Earnings Chart (Green Net / Red Withholding) */
.radial-summary {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.radial-ring {
  width: 132px;
  height: 132px;
  border-radius: 50%;
  background: conic-gradient(var(--green) 0% var(--net-pct), var(--red) var(--net-pct) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.radial-center {
  width: 98px;
  height: 98px;
  border-radius: 50%;
  background-color: var(--bg-card);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.radial-center strong { font-family: var(--font-display); font-size: 1.05rem; color: var(--text-light); }
.radial-center span { font-size: 0.72rem; color: var(--text-muted); }

.radial-legend p { font-size: 0.9rem; margin-bottom: 6px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }
.dot-green { background-color: var(--green); }
.dot-red { background-color: var(--red); }
.small-note { font-size: 0.8rem; color: var(--text-muted); margin-top: 8px; }

/* Expandable (+) Event Cards & Completed Rows */
.event-acc-item {
  border: 1px solid #3c3336;
  border-radius: 8px;
  margin-bottom: 10px;
  background-color: var(--bg-input);
}

.event-acc-header {
  width: 100%;
  background: none;
  border: none;
  color: var(--text-light);
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-align: left;
  font-size: 0.92rem;
}

.event-acc-body {
  display: none;
  padding: 10px 14px 14px;
  border-top: 1px solid #2e282a;
  font-size: 0.86rem;
  color: var(--text-muted);
}

.event-acc-item.is-open .event-acc-body { display: block; }

.completed-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #2e282a;
  font-size: 0.94rem;
}

.hours-pill {
  background-color: rgba(22, 163, 74, 0.18);
  border: 1px solid var(--green);
  color: #86efac;
  padding: 4px 10px;
  border-radius: 6px;
  font-family: var(--font-display);
  font-size: 0.82rem;
}

/* Weekly Availability Rows */
.weekly-row {
  display: grid;
  grid-template-columns: 110px 1fr 1fr;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}

.weekly-row input { margin-bottom: 0; padding: 8px; font-size: 0.88rem; }

/* Status Banners */
.status-banner {
  margin-top: 14px;
  padding: 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  text-align: center;
}

.status-ok { background-color: rgba(22, 163, 74, 0.2); border: 1px solid var(--green); color: #86efac; }
.status-err { background-color: rgba(220, 38, 38, 0.2); border: 1px solid var(--red); color: #fca5a5; }

/* Mobile Responsive Sidebar -> Top Bar */
@media (max-width: 820px) {
  .portal-shell { flex-direction: column; }
  .sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--brand-gold); }
  .sidebar-nav { flex-direction: row; flex-wrap: wrap; }
  .nav-item { width: auto; flex: 1; text-align: center; padding: 10px; font-size: 0.85rem; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .workspace { padding: 20px; }
}
