/* ============================================================
   Oncall Roster — custom styles
   Theme matched to Leave Management app
   ============================================================ */

:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --text: #1f2a37;
  --muted: #637084;
  --primary: #0d47a1;
  --primary-600: #0b3a82;
  --primary-contrast: #ffffff;
  --border: #e7eef7;
  --shadow: 0 12px 40px rgba(0,0,0,0.06);
  --navbar-bg: #0b1f3b;
}

/* ── Layout ─────────────────────────────────────────────── */
body {
  background: var(--bg);
  font-family: 'Segoe UI', 'Roboto', 'Arial', sans-serif;
  color: var(--text);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.page-header { margin-bottom: 1.5rem; }
.page-header h1 { font-weight: 600; font-size: 1.6rem; color: #0b1f3b; margin-top: 0; }
.page-header p { color: var(--muted); margin-bottom: 0; }

/* ── Navbar ─────────────────────────────────────────────── */
.navbar {
  background: var(--navbar-bg) !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.navbar-brand {
  font-weight: 700;
  font-size: 1.15em;
  letter-spacing: .5px;
  color: white !important;
}
.nav-link {
  color: white !important;
  font-size: 1.08em;
  padding: 0.2em 0.7em !important;
  border-radius: 3px;
  transition: background 0.2s;
}
.nav-link:hover, .nav-link.active {
  background: #13325c !important;
  text-decoration: none !important;
}
.btn-light {
  background: #244a7b !important;
  border-color: #244a7b !important;
  color: white !important;
}
.btn-light:hover {
  background: #13325c !important;
  border-color: #13325c !important;
}

/* ── Cards ──────────────────────────────────────────────── */
.card {
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  background: var(--surface);
}
.card-header {
  border-radius: 12px 12px 0 0 !important;
  font-weight: 600;
  background: #eef3f9 !important;
  color: #0b1f3b;
  border-bottom: 1px solid var(--border);
}

/* ── Dashboard stat cards ────────────────────────────────── */
.stat-card { border-radius: 12px; color: #fff; }
.stat-num  { font-size: 2.4rem; font-weight: 800; line-height: 1.1; }
.stat-lbl  { font-size: .8rem; opacity: .85; text-transform: uppercase; letter-spacing: .6px; }

/* ── Badges ─────────────────────────────────────────────── */
.badge-full { background: var(--primary); }
.badge-half { background: #6f42c1; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn-primary {
  background: linear-gradient(180deg, var(--primary), var(--primary-600)) !important;
  border-color: var(--primary) !important;
  color: var(--primary-contrast) !important;
  border-radius: 8px;
  transition: filter 0.15s ease, transform 0.05s ease;
}
.btn-primary:hover {
  filter: brightness(1.05);
  border-color: var(--primary-600) !important;
}
.btn-primary:active {
  transform: translateY(1px);
}
.btn-success {
  background: linear-gradient(180deg, #198754, #146c43) !important;
  border-radius: 8px;
}
.btn-success:hover {
  filter: brightness(1.05);
}

/* ── Team setup table ────────────────────────────────────── */
.person-row:hover { background: #f8f9fa; }

/* ── Wishlist grid ───────────────────────────────────────── */
.person-card {
  display: block;
  text-decoration: none;
  color: inherit;
  border-radius: 12px;
  transition: transform .15s, box-shadow .15s;
  border: 1px solid var(--border);
  background: var(--surface);
}
.person-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(0,0,0,.15);
  color: inherit;
}
.person-card .card-body { padding: 1.2rem; }
.wish-dot {
  width: 10px; height: 10px; border-radius: 50%;
  display: inline-block; margin-right: 4px;
}
.wish-dot-done    { background: #198754; }
.wish-dot-pending { background: #dee2e6; }

/* ── Calendar ───────────────────────────────────────────── */
.cal-table { table-layout: fixed; width: 100%; border-collapse: separate; border-spacing: 3px; }
.cal-table th {
  text-align: center; font-size: .68rem; font-weight: 700;
  padding: 5px 2px; color: #6c757d; text-transform: uppercase;
  letter-spacing: .4px;
}
.cal-table td { padding: 2px; }

.cal-day {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; margin: auto;
  border-radius: 8px; font-size: .88rem; font-weight: 500;
  cursor: pointer; transition: transform .12s, box-shadow .12s;
  user-select: none;
}
.cal-day:hover { transform: scale(1.15); box-shadow: 0 2px 6px rgba(0,0,0,.18); }
.cal-day.available { background: #fff; color: #333; border: 1px solid #e0e0e0; }
.cal-day.available:hover { background: #e3eeff; border-color: var(--primary); }
.cal-day.available.is-wknd { background: #f5f5ff; }
.cal-day.is-holiday {
  box-shadow: inset 0 0 0 2px #0dcaf0;
}
.cal-day .ph-dot {
  position: absolute;
  right: 1px;
  top: 1px;
  font-size: .52rem;
  font-weight: 700;
  line-height: 1;
  color: #055160;
  background: #b8eff9;
  border-radius: 8px;
  padding: 1px 3px;
}
.cal-day.unavailable { background: #dc3545; color: #fff; border-color: #b02a37; }
.cal-day.prefer_not_first { background: #ffc107; color: #333; border-color: #d39e00; }
.cal-day.outside {
  background: transparent; color: #ccc; border: 1px dashed #e8e8e8;
  cursor: default; font-size: .78rem;
}
.cal-day.outside:hover { transform: none; box-shadow: none; }

/* Calendar legend */
.cal-legend-swatch {
  display: inline-block; width: 18px; height: 18px;
  border-radius: 5px; vertical-align: middle; margin-right: 5px;
}
.swatch-avail { background: #fff; border: 1px solid #dee2e6; }
.swatch-unavail { background: #dc3545; }
.swatch-prefer { background: #ffc107; }
.swatch-holiday { background: #0dcaf0; }

/* ── Roster table ────────────────────────────────────────── */
.roster-table th {
  font-size: .78rem; text-transform: uppercase;
  letter-spacing: .4px; white-space: nowrap;
}
.roster-table td { vertical-align: middle; font-size: .88rem; padding: .45rem .6rem; }
.roster-table .month-sep td {
  background: #e9ecef; font-weight: 700; font-size: .8rem;
  text-transform: uppercase; letter-spacing: 1px; color: #495057;
  padding: 6px 12px;
}
.roster-wknd { background-color: #fffbf0 !important; }
.roster-weekend-grey td { background-color: #eceff3 !important; }
.roster-sun td { border-bottom: 3px solid #b8bec7 !important; }
.roster-holiday td { background-color: #dff5df !important; }

/* Call position pills */
.call-pill {
  display: inline-block; padding: 2px 10px; border-radius: 20px;
  font-size: .78rem; font-weight: 600; color: #fff; white-space: nowrap;
}
.c1 { background: var(--primary); }
.c2 { background: #198754; }
.c3 { background: #fd7e14; }

/* Person-only highlight in roster cells */
.call-name {
  display: inline-block;
  padding: 1px 2px;
  border-radius: 6px;
}
.hl-pill {
  background: #ffd6dc !important;
  color: #6a0f1f !important;
  border: 1px solid #f0a7b5;
  box-shadow: 0 0 0 1px rgba(240, 167, 181, .35) inset;
  padding: 2px 8px;
  border-radius: 999px;
}

/* Stats table */
.stats-table th { font-size: .78rem; }
.stats-table td { font-size: .85rem; }
.on-target { color: #198754; font-weight: 600; }
.off-target { color: #dc3545; }

/* ── Warnings box ────────────────────────────────────────── */
.warn-list { max-height: 200px; overflow-y: auto; }
.warn-list li { font-size: .83rem; }

/* ── Forms & Inputs ─────────────────────────────────────── */
.form-control, .form-select {
  border: 1px solid #c9d3df;
  border-radius: 8px;
  background: #fbfdff;
}
.form-control:focus, .form-select:focus {
  border-color: #759bd1;
  box-shadow: 0 0 0 3px rgba(117,155,209,0.15);
}
.form-label {
  font-weight: 600;
  color: #31445e;
}

/* ── Tables ─────────────────────────────────────────────── */
.table {
  background: var(--surface);
  box-shadow: 0 1px 6px rgba(0,0,0,0.04);
}
.table thead th {
  background: #eef3f9;
  color: #0b1f3b;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}
.table td {
  border-bottom: 1px solid #e3eaf2;
}

/* ── Alerts ─────────────────────────────────────────────── */
.alert {
  border-radius: 8px;
  border: 1px solid var(--border);
}

/* ── Main content container ─────────────────────────────── */
.container-lg > .card,
.container-lg > .alert:first-child {
  margin-bottom: 1.5rem;
}

/* ── Modal styling ──────────────────────────────────────── */
.modal-header {
  background: #eef3f9;
  border-bottom: 1px solid var(--border);
}
.modal-title {
  color: #0b1f3b;
  font-weight: 600;
}
.modal-body h6 {
  color: #0b1f3b;
  font-weight: 600;
  margin-top: 1rem;
}
.modal-body {
  color: var(--text);
}
.modal-footer {
  border-top: 1px solid var(--border);
}
.modal-content {
  border-radius: 12px;
  border: 1px solid var(--border);
}

/* ── Footer ─────────────────────────────────────────────── */
footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  color: var(--muted);
  margin-top: 2rem;
}

/* ── Misc ────────────────────────────────────────────────── */
.url-pill {
  background: var(--bg);
  border-radius: 6px;
  padding: 4px 10px;
  font-family: monospace;
  font-size: .82rem;
  word-break: break-all;
}

/* ── Utility classes to avoid inline styles ────────────── */
.min-h-screen { min-height: 100vh; }
.tracking-wide { letter-spacing: .05em; }
.icon-xl { font-size: 3rem; }
.icon-lg { font-size: 1.5rem; }
.icon-md { font-size: 1.3rem; }
.text-xs { font-size: .75rem; }
.text-sm-fixed { font-size: .85rem; }

.nav-info-btn {
  width: 1.7rem;
  height: 1.7rem;
  line-height: 1;
}

.login-page {
  background: #f0f4f8;
}

.login-card {
  border: none;
  border-radius: 1rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, .1);
}

.login-icon {
  font-size: 3.5rem;
  line-height: 1;
}

.login-header-public {
  background: #e8f4f8;
  border-radius: 1rem 1rem 0 0;
}

.login-header-admin {
  background: #fff3cd;
  border-radius: 1rem 1rem 0 0;
}

.badge-full {
  background: #0d6efd;
}

.badge-half {
  background: #6f42c1;
}

.badge-mini {
  font-size: .7rem;
}

.badge-wkd {
  background: #d0a800;
  font-size: .65rem;
  vertical-align: middle;
}

.badge-ph {
  background: #0dcaf0;
  color: #05313a;
  font-size: .65rem;
  vertical-align: middle;
}

.inline-form {
  display: inline;
}

.emoji-empty {
  font-size: 3rem;
}

.chart-container {
  height: 380px;
}

.scroll-400 {
  max-height: 400px;
  overflow-y: auto;
}

.sticky-bottom-offset {
  bottom: 1rem;
}

.toast-z {
  z-index: 1200;
}

.prev-table { font-size: .85rem; }
.col-day { width: 15%; }
.col-date { width: 22%; }
.col-call { width: 21%; }

.stat-bg-blue { background: linear-gradient(135deg, #0d6efd, #0a58ca); }
.stat-bg-green { background: linear-gradient(135deg, #198754, #146c43); }
.stat-bg-gray { background: linear-gradient(135deg, #6c757d, #495057); }
.stat-bg-orange { background: linear-gradient(135deg, #fd7e14, #dc6502); }
.stat-bg-purple { background: linear-gradient(135deg, #6f42c1, #59359a); }

.stat-meta {
  font-size: .78rem;
  opacity: .85;
}

.stat-num-compact {
  font-size: 1rem;
  padding-top: .5rem;
}

.stat-num-mid {
  font-size: 1.4rem;
  padding-top: .3rem;
}

/* ── Scrollbar styling ──────────────────────────────────── */
::-webkit-scrollbar {
  width: 10px;
  background: #e3eaf2;
}
::-webkit-scrollbar-thumb {
  background: #b0c4de;
  border-radius: 5px;
}
