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

:root {
  --navy:   #1B2A4A;
  --navy-2: #253660;
  --blue:   #2563EB;
  --green:  #16a34a;
  --red:    #dc2626;
  --amber:  #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,.10), 0 1px 2px rgba(0,0,0,.06);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  color: var(--gray-800);
  background: var(--gray-50);
  line-height: 1.5;
}

/* ── Nav ──────────────────────────────────────────────────────── */
nav {
  background: var(--navy);
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  height: 52px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}

.nav-brand {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: .03em;
  color: white;
}

.nav-links { display: flex; gap: 4px; align-items: center; }

.nav-links a {
  color: rgba(255,255,255,.75);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13.5px;
  transition: background .15s, color .15s;
}
.nav-links a:hover, .nav-links a.active {
  background: rgba(255,255,255,.12);
  color: white;
}
.nav-logout { margin-left: 8px; }

/* ── Layout ───────────────────────────────────────────────────── */
main {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 20px 60px;
}

.page-header { margin-bottom: 24px; }
.page-header h1 { font-size: 22px; font-weight: 700; color: var(--navy); }
.page-header-row { display: flex; align-items: center; justify-content: space-between; }
.page-subtitle { color: var(--gray-600); margin-top: 4px; }

.month-nav { display: flex; gap: 6px; }

/* ── Cards ────────────────────────────────────────────────────── */
.card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.card-muted { opacity: .7; }
.card-empty { text-align: center; color: var(--gray-400); padding: 40px; }
.card-title { font-size: 15px; font-weight: 600; color: var(--navy); margin-bottom: 16px; }

.divider { border-top: 1px solid var(--gray-200); margin: 20px 0; }
h3 { font-size: 13.5px; font-weight: 600; color: var(--gray-600); margin-bottom: 12px; text-transform: uppercase; letter-spacing: .04em; }

/* ── Alerts ───────────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-size: 13.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #15803d; }
.alert-error   { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; }
.alert-warn    { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.alert-link    { color: inherit; font-weight: 600; margin-left: auto; }

/* ── Tables ───────────────────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; }
thead { background: var(--gray-50); }
th {
  text-align: left;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: .05em;
  border-bottom: 1px solid var(--gray-200);
}
td {
  padding: 11px 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); }
.row-paid td { color: var(--gray-400); }

/* ── Forms ────────────────────────────────────────────────────── */
.inline-form { /* nothing special — let field-row handle layout */ }

.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 12.5px; font-weight: 500; color: var(--gray-600); }
.field-wide { flex: 1; }
.field-action { justify-content: flex-end; }

.field-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.field-row.tight { flex-wrap: nowrap; margin-bottom: 0; }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select {
  padding: 8px 10px;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  font-size: 14px;
  color: var(--gray-800);
  background: white;
  width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

/* ── Buttons ──────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background .15s, border-color .15s, opacity .15s;
  white-space: nowrap;
}
.btn-sm { padding: 5px 10px; font-size: 12.5px; }
.btn-full { width: 100%; justify-content: center; }

.btn-primary {
  background: var(--navy);
  color: white;
}
.btn-primary:hover { background: var(--navy-2); }

.btn-success {
  background: #dcfce7;
  color: var(--green);
  border-color: #bbf7d0;
}
.btn-success:hover { background: #bbf7d0; }

.btn-danger {
  background: #fee2e2;
  color: var(--red);
  border-color: #fecaca;
}
.btn-danger:hover { background: #fecaca; }

.btn-ghost {
  background: white;
  color: var(--gray-600);
  border-color: var(--gray-200);
}
.btn-ghost:hover { background: var(--gray-100); }

.btn-row { display: flex; gap: 10px; margin-top: 12px; }

/* ── Badges ───────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11.5px;
  font-weight: 600;
}
.badge-pending  { background: #fef3c7; color: #92400e; }
.badge-approved { background: #dcfce7; color: #15803d; }
.badge-rejected { background: #fee2e2; color: #b91c1c; }

/* ── Misc ─────────────────────────────────────────────────────── */
.tag {
  display: inline-block;
  font-size: 10.5px;
  background: var(--gray-100);
  color: var(--gray-600);
  border-radius: 4px;
  padding: 1px 5px;
  margin-left: 4px;
  font-weight: 500;
}
.muted { color: var(--gray-400); }
.hint  { color: var(--gray-600); font-size: 12.5px; }

.submission-status {
  margin-top: 14px;
  padding: 10px 14px;
  background: var(--gray-50);
  border-radius: 6px;
  font-size: 13.5px;
  border: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ── Login ────────────────────────────────────────────────────── */
body.login-body {
  background: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.login-card {
  background: white;
  border-radius: 12px;
  padding: 40px 36px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}

.login-logo {
  text-align: center;
}
.login-logo-img {
  height: 48px;
  width: auto;
}
.nav-logo {
  height: 28px;
  width: auto;
  display: block;
}
.login-subtitle {
  color: var(--gray-400);
  font-size: 13px;
  margin-bottom: 28px;
  margin-top: 2px;
}

.login-card .field { margin-bottom: 16px; }
.login-card .btn-primary { margin-top: 8px; padding: 10px 16px; }
