:root {
  --bg: #0b0d13;
  --surface: #141720;
  --surface-hover: #1b1f2c;
  --border: #242a3a;
  --text: #e4e6eb;
  --text-muted: #6b7394;
  --accent: #2B3794;
  --accent-soft: rgba(43,55,148,0.25);
  --accent-light: #2CACE3;
  --green: #00b894;
  --green-soft: rgba(0,184,148,0.12);
  --orange: #fdcb6e;
  --orange-soft: rgba(253,203,110,0.12);
  --red: #e74c3c;
  --red-soft: rgba(231,76,60,0.12);
  --blue: #2CACE3;
  --blue-soft: rgba(44,172,227,0.15);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ── Header ────────────────────────────────────────────────────────── */

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.header-logo {
  width: 36px;
  height: 36px;
  border-radius: 8px;
}
.header h1 { font-size: 18px; font-weight: 700; }
.header h1 span { color: var(--accent-light); }
.header-right { display: flex; align-items: center; gap: 12px; }
.clock { color: var(--text-muted); font-size: 14px; font-variant-numeric: tabular-nums; }

/* ── Buttons ───────────────────────────────────────────────────────── */

.btn {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}
.btn:hover { background: var(--surface-hover); border-color: var(--accent-light); }

/* ── Launch Button (animated rocket) ──────────────────────────────── */

.btn-launch {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 10px;
  position: relative;
  overflow: hidden;
}
.btn-launch:hover {
  background: var(--accent-light);
  border-color: var(--accent-light);
  transform: scale(1.05);
}
.btn-launch:active { transform: scale(0.97); }

.rocket {
  font-size: 20px;
  display: inline-block;
  animation: rocketHover 2s ease-in-out infinite;
}

/* Hover: rocket launches! */
.btn-launch:hover .rocket {
  animation: rocketLaunch 0.6s ease-out forwards;
}

/* Engine fire trail */
.btn-launch::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: transparent;
  transform: translateX(-50%);
  transition: all 0.3s;
}
.btn-launch:hover::after {
  content: '🔥';
  font-size: 14px;
  bottom: -2px;
  animation: fireTrail 0.3s ease-in-out infinite alternate;
}

@keyframes rocketHover {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-3px) rotate(-2deg); }
  75% { transform: translateY(2px) rotate(2deg); }
}

@keyframes rocketLaunch {
  0% { transform: translateY(0) scale(1); }
  30% { transform: translateY(4px) scale(1.1); }
  60% { transform: translateY(-8px) scale(1.2) rotate(-10deg); }
  100% { transform: translateY(-20px) scale(0.8) rotate(-15deg); opacity: 0.6; }
}

@keyframes fireTrail {
  0% { transform: translateX(-50%) scale(1); opacity: 0.9; }
  100% { transform: translateX(-50%) scale(1.4); opacity: 0.5; }
}

/* Smoke particles on launch */
.btn-launch:hover .launch-text {
  animation: launchPulse 0.5s ease-out;
}

@keyframes launchPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); text-shadow: 0 0 10px var(--accent-light); }
  100% { transform: scale(1); }
}

/* ── Grid ──────────────────────────────────────────────────────────── */

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 16px 24px;
  max-width: 1600px;
  margin: 0 auto;
}
.card-wide { grid-column: 1 / -1; }

/* ── Cards ─────────────────────────────────────────────────────────── */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.card-header h2 { font-size: 15px; font-weight: 600; }
.card-body { padding: 12px 18px; flex: 1; }
.scrollable { max-height: 420px; overflow-y: auto; }

/* ── Badges ────────────────────────────────────────────────────────── */

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 22px;
  padding: 0 7px;
  border-radius: 11px;
  font-size: 12px;
  font-weight: 600;
  background: var(--blue-soft);
  color: var(--accent-light);
}
.badge-accent { background: var(--accent-soft); color: var(--accent-light); }

/* ── Calendar Items ────────────────────────────────────────────────── */

.cal-item {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  align-items: flex-start;
}
.cal-item:last-child { border-bottom: none; }
.cal-time {
  min-width: 70px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--accent-light);
  font-weight: 500;
  padding-top: 1px;
}
.cal-details { flex: 1; }
.cal-title { font-size: 14px; font-weight: 500; }
.cal-loc { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.cal-date-group {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  padding: 12px 0 6px;
}
.cal-date-group:first-child { padding-top: 0; }

/* ── Email Items ───────────────────────────────────────────────────── */

.email-item {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  align-items: flex-start;
}
.email-item:last-child { border-bottom: none; }
.email-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-light);
  margin-top: 6px;
  flex-shrink: 0;
}
.email-info { flex: 1; min-width: 0; }
.email-from { font-size: 13px; font-weight: 500; }
.email-subject {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.email-time { font-size: 11px; color: var(--text-muted); white-space: nowrap; }

/* ── Roles Table ───────────────────────────────────────────────────── */

.roles-table {
  width: 100%;
  border-collapse: collapse;
}
.roles-table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}
.roles-table td {
  padding: 10px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.roles-table tr:last-child td { border-bottom: none; }
.roles-table tr:hover td { background: var(--surface-hover); }
.role-client { font-weight: 600; color: var(--accent-light); }
.role-pay { color: var(--green); font-weight: 500; }
.role-loc { color: var(--text-muted); }

/* ── Expenses ──────────────────────────────────────────────────────── */

.expense-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.expense-stat {
  background: var(--bg);
  border-radius: 8px;
  padding: 16px;
  text-align: center;
}
.expense-label { font-size: 11px; text-transform: uppercase; color: var(--text-muted); letter-spacing: 0.5px; }
.expense-value { font-size: 24px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.expense-value.green { color: var(--green); }
.expense-value.orange { color: var(--orange); }
.expense-value.blue { color: var(--accent-light); }

/* ── Loading / Empty ───────────────────────────────────────────────── */

.loading { color: var(--text-muted); font-size: 14px; text-align: center; padding: 30px 0; }
.empty { color: var(--text-muted); font-size: 13px; text-align: center; padding: 20px 0; }

/* ── Scrollbar ─────────────────────────────────────────────────────── */

.scrollable::-webkit-scrollbar { width: 5px; }
.scrollable::-webkit-scrollbar-track { background: transparent; }
.scrollable::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ── Responsive ────────────────────────────────────────────────────── */

@media (max-width: 900px) {
  .grid { grid-template-columns: 1fr; }
  .card-wide { grid-column: 1; }
  .header { padding: 10px 16px; }
  .header-logo { width: 28px; height: 28px; }
  .header h1 { font-size: 16px; }
  .launch-text { display: none; }
}

/* ── Login ──────────────────────────────────────────────────────────── */

.login-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.login-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px;
  text-align: center;
  width: 360px;
}
.login-logo {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  margin-bottom: 16px;
}
.login-box h1 { font-size: 22px; margin-bottom: 8px; }
.login-box h1 span { color: var(--accent-light); }
.login-box p { color: var(--text-muted); font-size: 14px; margin-bottom: 24px; }
#login-form { display: flex; flex-direction: column; gap: 12px; }
#login-password {
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  outline: none;
}
#login-password:focus { border-color: var(--accent-light); }
.btn-login {
  padding: 12px;
  border-radius: 10px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-login:hover { background: var(--accent-light); transform: scale(1.02); }
.login-error { color: var(--red); font-size: 13px; min-height: 20px; }

/* ── Filter Bar ──────────────────────────────────────────────────────── */

.filter-bar {
  display: flex;
  gap: 6px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.filter-btn {
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}
.filter-btn:hover {
  border-color: var(--accent-light);
  color: var(--text);
}
.filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ── Search Bar ──────────────────────────────────────────────────────── */

.search-bar {
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
}
.search-bar input {
  width: 100%;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  outline: none;
}
.search-bar input:focus { border-color: var(--accent-light); }
.search-bar input::placeholder { color: var(--text-muted); }
