:root {
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --green: #16a34a;
  --red: #dc2626;
  --yellow: #d97706;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-400: #9ca3af;
  --gray-600: #4b5563;
  --gray-800: #1f2937;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  color: var(--gray-800);
  background: var(--gray-50);
  min-height: 100vh;
}

/* ── NAV ── */
nav {
  background: var(--blue);
  color: white;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 100;
}
nav .brand { font-weight: 700; font-size: 1.1rem; }
nav .nav-links { display: flex; gap: 4px; }
nav a {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  padding: 8px 10px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  min-height: 44px;
  display: flex;
  align-items: center;
}
nav a:hover, nav a.active { background: rgba(255,255,255,0.2); color: white; }
nav .logout-btn {
  background: rgba(255,255,255,0.15);
  border: none;
  color: white;
  padding: 8px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.9rem;
  min-height: 44px;
}
nav .logout-btn:hover { background: rgba(255,255,255,0.25); }

/* ── MAIN LAYOUT ── */
main { padding: 16px; max-width: 1100px; margin: 0 auto; }
h1 { font-size: 1.4rem; margin-bottom: 16px; }
h2 { font-size: 1.15rem; margin-bottom: 12px; color: var(--gray-800); }

/* ── CARDS / SECTIONS ── */
.card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 16px;
}

/* ── WEEK NAVIGATOR ── */
.week-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.week-nav .week-label {
  font-weight: 600;
  font-size: 1rem;
  flex: 1;
  min-width: 0;
}
.week-nav input[type="date"] { min-height: 44px; padding: 6px 10px; border: 1px solid var(--gray-200); border-radius: var(--radius); font-size: 16px; }

/* ── FORMS ── */
.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.form-group { display: flex; flex-direction: column; gap: 4px; }
label { font-size: 0.85rem; font-weight: 600; color: var(--gray-600); }
input, select, textarea {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 16px;
  min-height: 44px;
  width: 100%;
  background: white;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--blue);
  outline-offset: -1px;
  border-color: var(--blue);
}
textarea { min-height: 80px; resize: vertical; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: var(--radius);
  border: none;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
  white-space: nowrap;
}
.btn-primary { background: var(--blue); color: white; }
.btn-primary:hover { background: var(--blue-dark); }
.btn-success { background: var(--green); color: white; }
.btn-danger { background: var(--red); color: white; }
.btn-ghost { background: transparent; border: 1px solid var(--gray-200); color: var(--gray-600); }
.btn-ghost:hover { background: var(--gray-100); }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: 0.85rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── TABLES ── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th {
  text-align: left;
  padding: 10px 12px;
  background: var(--gray-50);
  border-bottom: 2px solid var(--gray-200);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-600);
  white-space: nowrap;
}
td { padding: 10px 12px; border-bottom: 1px solid var(--gray-100); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--gray-50); }
.total-row td { font-weight: 700; background: var(--gray-50); border-top: 2px solid var(--gray-200); }

/* ── BADGES ── */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.badge-planned { background: #e0f2fe; color: #0369a1; }
.badge-confirmed { background: #dcfce7; color: #15803d; }
.badge-actual { background: #f3e8ff; color: #7c3aed; }
.badge-draft { background: var(--gray-100); color: var(--gray-600); }
.badge-sent { background: #fef3c7; color: #92400e; }
.badge-approved { background: #dcfce7; color: #15803d; }

/* ── ALERTS ── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 12px;
  font-size: 0.9rem;
}
.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.alert-success { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.alert-info { background: #e0f2fe; color: #075985; border: 1px solid #7dd3fc; }

/* ── LOGIN PAGE ── */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-box {
  background: white;
  border-radius: var(--radius);
  box-shadow: 0 4px 24px rgba(0,0,0,0.1);
  padding: 32px 24px;
  width: 100%;
  max-width: 400px;
}
.login-box h1 { text-align: center; margin-bottom: 8px; }
.login-box .subtitle { text-align: center; color: var(--gray-600); font-size: 0.9rem; margin-bottom: 24px; }

/* ── SHIFT FORM INDICATORS ── */
.hours-preview {
  font-size: 0.85rem;
  color: var(--gray-600);
  padding: 6px 12px;
  background: var(--gray-100);
  border-radius: var(--radius);
  min-height: 36px;
  display: flex;
  align-items: center;
}
.future-week-notice {
  background: #e0f2fe;
  color: #075985;
  padding: 8px 12px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  margin-bottom: 12px;
}

/* ── VICKY STIPEND ROW ── */
.stipend-detail {
  font-size: 0.8rem;
  color: var(--gray-600);
  padding-top: 4px;
}
.stipend-detail span { margin-right: 12px; }

/* ── SECTION HEADER ── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 8px;
  flex-wrap: wrap;
}

/* ── EMPTY STATE ── */
.empty-state {
  text-align: center;
  padding: 32px 16px;
  color: var(--gray-400);
  font-size: 0.9rem;
}

/* ── LOADING ── */
.loading { text-align: center; padding: 24px; color: var(--gray-400); }

/* ── APPROVE PAGE ── */
.approve-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.approve-box {
  background: white;
  border-radius: var(--radius);
  box-shadow: 0 4px 24px rgba(0,0,0,0.1);
  padding: 32px 24px;
  width: 100%;
  max-width: 500px;
  text-align: center;
}
.approve-box .checkmark { font-size: 3rem; margin-bottom: 16px; }

/* ── DESKTOP OVERRIDES ── */
@media (min-width: 768px) {
  main { padding: 24px; }
  h1 { font-size: 1.6rem; }
  .form-grid { grid-template-columns: repeat(2, 1fr); }
  .form-grid .full-width { grid-column: 1 / -1; }
  nav a { padding: 8px 14px; }
  .card { padding: 24px; }
  .week-nav { flex-wrap: nowrap; }
}
