/* ============================================================
   Pluto — dark, futuristic theme
   Palette pulled from the logo: deep navy/black base, gold/amber
   accent, cool blue secondary accent, soft glass surfaces.
   ============================================================ */
:root {
  --bg-0: #05070d;
  --bg-1: #0a0f1e;
  --bg-2: #10182c;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-strong: rgba(255, 255, 255, 0.07);
  --surface-border: rgba(255, 255, 255, 0.09);
  --surface-border-strong: rgba(200, 162, 74, 0.35);

  --navy: #283962;
  --navy-deep: #121b33;
  --gold: #c8a24a;
  --gold-bright: #f0d999;
  --gold-dim: #a17f34;
  --blue-accent: #5b7fe0;

  --text: #eef1f8;
  --text-dim: #c3c9dc;
  --muted: #8b93ac;

  --green: #3ddc84;
  --red: #ff6b6b;
  --green-bg: rgba(61, 220, 132, 0.12);
  --red-bg: rgba(255, 107, 107, 0.12);

  --border: var(--surface-border);
  --radius: 14px;
  --radius-sm: 9px;
  --shadow-lift: 0 12px 32px -12px rgba(0, 0, 0, 0.55);
  --shadow-gold-glow: 0 0 0 1px rgba(200, 162, 74, 0.25), 0 8px 24px -8px rgba(200, 162, 74, 0.25);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  color: var(--text);
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 8%, rgba(91, 127, 224, 0.16), transparent 42%),
    radial-gradient(circle at 88% 0%, rgba(200, 162, 74, 0.14), transparent 40%),
    radial-gradient(circle at 50% 100%, rgba(40, 57, 98, 0.35), transparent 55%),
    linear-gradient(180deg, var(--bg-0) 0%, var(--bg-1) 45%, var(--bg-0) 100%);
  background-attachment: fixed;
  background-repeat: no-repeat;
}

h1, h2, h3, .brand, .stat, .btn {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  letter-spacing: 0.01em;
}

::selection { background: rgba(200, 162, 74, 0.35); color: #fff; }

/* scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(200, 162, 74, 0.4); }

/* ---------------- Nav ---------------- */
nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(5, 7, 13, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--surface-border);
  box-shadow: 0 1px 0 rgba(200, 162, 74, 0.12);
}
.nav-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
nav .brand {
  font-weight: 700;
  font-size: 17px;
  color: var(--text);
  display: flex;
  align-items: center;
  filter: drop-shadow(0 0 6px rgba(200, 162, 74, 0.35));
}
.nav-links { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; }
nav a {
  color: var(--text-dim);
  text-decoration: none;
  margin-right: 6px;
  font-size: 13.5px;
  font-weight: 500;
  padding: 7px 10px;
  border-radius: 8px;
  transition: color 0.15s ease, background 0.15s ease;
}
nav a:hover { color: var(--gold-bright); background: var(--surface); }

/* ---------------- Nav dropdowns (Payroll / Team / Data groups) ---------------- */
.nav-dropdown { position: relative; }
.nav-dropdown-toggle {
  color: var(--text-dim);
  background: none;
  border: none;
  margin-right: 6px;
  font-size: 13.5px;
  font-weight: 500;
  padding: 7px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  transition: color 0.15s ease, background 0.15s ease;
}
.nav-dropdown-toggle:hover { color: var(--gold-bright); background: var(--surface); }
.nav-dropdown.open .nav-dropdown-toggle { color: var(--gold-bright); background: var(--surface); }
.nav-caret { font-size: 10px; }
.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 170px;
  flex-direction: column;
  background: linear-gradient(180deg, var(--surface-strong), var(--bg-1));
  border: 1px solid var(--surface-border-strong);
  border-radius: var(--radius-sm);
  padding: 6px;
  box-shadow: var(--shadow-lift), var(--shadow-gold-glow);
  z-index: 40;
}
.nav-dropdown.open .nav-dropdown-menu { display: flex; }
.nav-dropdown-menu a { margin-right: 0; }

/* ---------------- Layout ---------------- */
.container { max-width: 1120px; margin: 40px auto; padding: 0 20px; }

.card {
  background: linear-gradient(180deg, var(--surface-strong), var(--surface));
  border: 1px solid var(--surface-border);
  border-radius: var(--radius);
  padding: 26px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-lift);
  backdrop-filter: blur(6px);
}

h1 {
  font-size: 24px;
  margin-top: 0;
  color: var(--text);
  font-weight: 700;
}
h2 {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  margin-top: 0;
}

/* ---------------- Tables ---------------- */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--surface-border); color: var(--text-dim); }
th {
  color: var(--muted);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
tbody tr:hover { background: rgba(255, 255, 255, 0.025); }
td strong, td a { color: var(--text); }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-block;
  background: linear-gradient(135deg, var(--gold-dim), var(--gold));
  color: #1a1204;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: none;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
  box-shadow: 0 6px 18px -6px rgba(200, 162, 74, 0.55);
}
.btn:hover { filter: brightness(1.08); transform: translateY(-1px); box-shadow: 0 10px 22px -6px rgba(200, 162, 74, 0.65); }
.btn:active { transform: translateY(0); }
.btn-secondary {
  background: var(--surface-strong);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--surface-border);
}
.btn-secondary:hover { background: rgba(255,255,255,0.12); box-shadow: inset 0 0 0 1px rgba(200,162,74,0.4); }
.btn-danger { background: linear-gradient(135deg, #b23a3a, #ff6b6b); color: #2a0a0a; box-shadow: 0 6px 18px -6px rgba(255, 107, 107, 0.45); }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }

/* ---------------- Forms ----------------
   Note: these are intentionally NOT scoped to "form X" — some inputs (e.g. the
   Bonus Types table) are linked to a <form> via the form="id" attribute rather
   than being nested inside it, so a descendant selector would miss them. */
input:not([type="checkbox"]):not([type="radio"]), select, textarea {
  width: 100%;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  font-size: 14px;
  color: var(--text);
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
input::placeholder, textarea::placeholder { color: var(--muted); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: rgba(200, 162, 74, 0.55);
  box-shadow: 0 0 0 3px rgba(200, 162, 74, 0.16);
  background: rgba(255, 255, 255, 0.06);
}
select option { background: #10182c; color: var(--text); }

input[type="checkbox"], input[type="radio"] {
  width: 16px;
  height: 16px;
  min-width: 16px;
  accent-color: var(--gold);
  cursor: pointer;
  margin: 0;
  vertical-align: middle;
}

label { font-size: 12.5px; font-weight: 600; color: var(--muted); display: block; margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.04em; }
.row { display: flex; gap: 12px; }
.row > div { flex: 1; }

/* ---------------- Stats & badges ---------------- */
.stat {
  font-size: 30px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat-label { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; letter-spacing: 0.02em; }
.badge-green { background: var(--green-bg); color: var(--green); }
.badge-red { background: var(--red-bg); color: var(--red); }
.badge-amber { background: rgba(200, 162, 74, 0.16); color: var(--gold-bright); }
.badge-blue { background: rgba(91, 127, 224, 0.16); color: var(--blue-accent); }

.positive { color: var(--green); font-weight: 600; }
.negative { color: var(--red); font-weight: 600; }

.flash {
  background: var(--green-bg);
  color: var(--green);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
  font-size: 14px;
  border: 1px solid rgba(61, 220, 132, 0.25);
}
.error {
  background: var(--red-bg);
  color: var(--red);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
  font-size: 14px;
  border: 1px solid rgba(255, 107, 107, 0.3);
}

.credential-box {
  background: linear-gradient(180deg, rgba(200, 162, 74, 0.14), rgba(200, 162, 74, 0.05));
  border: 1px dashed rgba(200, 162, 74, 0.5);
  border-radius: var(--radius-sm);
  padding: 18px;
  margin-bottom: 18px;
  font-size: 14px;
  color: var(--text);
}

.muted { color: var(--muted); font-size: 13px; }

/* ---------------- Login ---------------- */
.login-wrap { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-card {
  width: 360px;
  box-shadow: var(--shadow-lift), var(--shadow-gold-glow);
}
a.plain { color: var(--gold-bright); text-decoration: none; }
a.plain:hover { text-decoration: underline; }

/* ---------------- Bonus / deduction rows ---------------- */
.bonus-row, .deduction-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  padding: 10px;
  margin-bottom: 8px;
}
.bonus-row input, .deduction-row input, .bonus-row select { margin-bottom: 0; }

@media (max-width: 640px) {
  .row { flex-direction: column; }
  .nav-inner { flex-direction: column; align-items: flex-start; }
}


/* ---------------- Date range picker (always inline, never a popup) ---------------- */
.date-range-picker { margin-bottom: 12px; }
.drp-summary {
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  margin-bottom: 8px;
}
.drp-summary.drp-error { border-color: var(--red); color: var(--red); }
.drp-calendar {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  background: linear-gradient(180deg, var(--surface-strong), var(--bg-1));
  border: 1px solid var(--surface-border-strong);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-lift);
}
.drp-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.drp-month { font-size: 18px; font-weight: 600; color: var(--text); text-transform: none; letter-spacing: 0; }
.drp-nav {
  background: var(--surface-strong);
  border: 1px solid var(--surface-border);
  color: var(--text);
  width: 36px;
  height: 36px;
  border-radius: 9px;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}
.drp-nav:hover { border-color: rgba(200, 162, 74, 0.5); color: var(--gold-bright); }
.drp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.drp-dow span { text-align: center; font-size: 12.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; padding-bottom: 8px; display: block; }
.drp-days { margin-bottom: 8px; }
.drp-empty { visibility: hidden; }
.drp-day {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-dim);
  font-size: 15px;
  padding: 12px 0;
  border-radius: 9px;
  cursor: pointer;
  text-align: center;
  font-family: inherit;
}
.drp-day:hover { background: rgba(255, 255, 255, 0.08); color: var(--text); }
.drp-day.drp-inrange { background: rgba(200, 162, 74, 0.16); color: var(--text); border-radius: 0; }
.drp-day.drp-edge {
  background: linear-gradient(135deg, var(--gold-dim), var(--gold));
  color: #1a1204;
  font-weight: 700;
}
.drp-footer { display: flex; justify-content: center; margin-top: 14px; }

/* ---------------- Reason picker (time off notes) ---------------- */
.reason-picker { margin-bottom: 12px; }
.reason-select {
  width: 100%;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
}
.reason-other-input { width: 100%; }

/* ---------------- Manage roles ---------------- */
.role-row { padding: 14px 0; border-top: 1px solid var(--surface-border); }
.role-row:first-child { border-top: none; padding-top: 0; }
.perm-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  cursor: pointer;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  font-size: 13.5px;
  color: var(--text-dim);
}
.perm-check input[type="checkbox"] { margin-top: 3px; flex-shrink: 0; }


/* ---------------- Announcement banner ---------------- */
.announcement-banner {
  background: linear-gradient(90deg, rgba(200, 162, 74, 0.16), rgba(200, 162, 74, 0.06));
  border-bottom: 1px solid rgba(200, 162, 74, 0.3);
}
.announcement-banner-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 10px 24px;
  font-size: 13.5px;
  color: var(--gold-bright);
  font-weight: 500;
}

/* ---------------- Leaderboard / scorecard tables ---------------- */
.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--surface-strong);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.rank-badge.rank-1 { background: linear-gradient(135deg, var(--gold-dim), var(--gold)); color: #1a1204; }
.rank-badge.rank-2 { background: rgba(200, 162, 74, 0.35); color: #1a1204; }
.rank-badge.rank-3 { background: rgba(200, 162, 74, 0.2); color: var(--gold-bright); }
