:root {
  --navy: #1f2a44;
  --orange: #F94726;
  --orange-dark: #d63c1f;
  --bg: #e7ebf5;
  --card: #ffffff;
  --card-grad: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
  --border: #e2e6ee;
  --text: #1f2430;
  --muted: #6b7280;
  --danger: #b3261e;
  --danger-bg: #fdecea;
  --success: #1b7a3d;
  --success-bg: #e8f6ec;
  --shadow: 0 1px 2px rgba(31,42,68,0.06), 0 6px 16px rgba(31,42,68,0.10), 0 18px 40px rgba(31,42,68,0.08);
  --shadow-hover: 0 2px 4px rgba(31,42,68,0.08), 0 12px 28px rgba(31,42,68,0.14), 0 30px 60px rgba(31,42,68,0.12);
  --inset-top: inset 0 1px 0 rgba(255,255,255,0.9);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Montserrat', -apple-system, "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}
h1 { font-size: 22px; margin: 0 0 16px; font-weight: 700; }
h2 { font-size: 16px; margin: 0 0 12px; font-weight: 600; }

/* ---------- Generic floating card ---------- */
.card {
  background: var(--card-grad);
  border: none;
  border-radius: 16px;
  padding: 22px;
  margin-bottom: 20px;
  box-shadow: var(--shadow), var(--inset-top);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}
.card:hover {
  box-shadow: var(--shadow-hover), var(--inset-top);
  transform: translateY(-4px);
}
.auth-box {
  max-width: 380px;
  margin: 60px auto;
  background: var(--card-grad);
  border: none;
  border-radius: 18px;
  padding: 28px;
  box-shadow: var(--shadow-hover), var(--inset-top);
}
form label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 12px; font-weight: 500; }
form input, form select {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 9px 10px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: #f6f8fc;
  box-shadow: inset 0 2px 4px rgba(31,42,68,0.06), inset 0 0 0 1px rgba(226,230,238,0.9);
}
form input:focus, form select:focus {
  outline: none;
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--orange), 0 0 0 3px rgba(249,71,38,0.15);
}
.inline-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px; }
.inline-form label { margin-bottom: 0; min-width: 160px; }
button {
  background: var(--orange);
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(249,71,38,0.20), 0 6px 16px rgba(249,71,38,0.22), inset 0 1px 0 rgba(255,255,255,0.25);
  transition: box-shadow 0.15s ease, transform 0.15s ease, background 0.15s ease;
}
button:hover {
  background: var(--orange-dark);
  box-shadow: 0 3px 6px rgba(249,71,38,0.24), 0 10px 24px rgba(249,71,38,0.30), inset 0 1px 0 rgba(255,255,255,0.25);
  transform: translateY(-2px);
}
button:active { transform: translateY(0); box-shadow: inset 0 2px 5px rgba(0,0,0,0.20); }
button:disabled { background: #d9dce3; cursor: not-allowed; box-shadow: none; transform: none; }
.btn-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: var(--orange);
  border: 1px solid var(--orange);
  padding: 9px 17px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  line-height: 1.2;
  text-decoration: none !important;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(31,42,68,0.08);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.btn-clear:hover {
  background: var(--danger-bg);
  color: var(--orange-dark);
  border-color: var(--orange-dark);
  box-shadow: 0 6px 16px rgba(31,42,68,0.14);
  transform: translateY(-2px);
}
.alert { background: var(--danger-bg); color: var(--danger); padding: 10px 14px; border-radius: 10px; margin-bottom: 16px; font-size: 14px; box-shadow: 0 2px 8px rgba(179,38,30,0.10); }
.alert.success { background: var(--success-bg); color: var(--success); box-shadow: 0 2px 8px rgba(27,122,61,0.10); }
.muted { color: var(--muted); font-size: 14px; }
.small-note { font-size: 12px; margin-top: 10px; }

/* ---------- Data table: scrolls cleanly inside its own card, never spills past it ---------- */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th, .data-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.data-table th { color: var(--muted); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.2px; }
.data-table-wrap { overflow-x: auto; border-radius: 8px; }
.data-table-wrap::-webkit-scrollbar { height: 10px; }
.data-table-wrap::-webkit-scrollbar-thumb { background: var(--orange); border-radius: 6px; }
.data-table-wrap::-webkit-scrollbar-track { background: var(--bg); border-radius: 6px; }

/* ---------- Fixed-width data table variant: for tables with many columns.
   Instead of letting long content push columns wider than the card (forcing
   a horizontal scrollbar), this locks the table to the card's width and lets
   cell content wrap onto multiple lines instead. Add class="table-fit" (kept
   alongside "data-table") and a <colgroup> with per-column percentage widths
   on any table that needs this. Other .data-table tables are untouched. ---------- */
.data-table.table-fit {
  table-layout: fixed;
  width: 100%;
}
.data-table.table-fit th,
.data-table.table-fit td {
  white-space: normal;
  word-break: normal;
  overflow-wrap: break-word;
  max-width: none;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.icon-btn:hover { background: var(--danger-bg); color: var(--danger); }
.icon-btn svg { width: 16px; height: 16px; }

/* ---------- Stat cards (equal height, floating) ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  align-items: stretch;
  margin-bottom: 24px;
}
.stat-card {
  display: flex;
  flex-direction: column;
  background: var(--card-grad);
  border-top: 3px solid var(--orange);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow), var(--inset-top);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
  min-height: 190px;
}
.stat-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-4px) scale(1.01);
}
.stat-card-header { margin-bottom: 16px; }
.stat-label { display: block; font-size: 12px; color: var(--muted); text-transform: uppercase; margin-bottom: 6px; font-weight: 600; letter-spacing: 0.3px; }
.stat-value { font-size: 28px; font-weight: 700; color: var(--navy); }
.stat-value.small { font-size: 14px; }
.stat-card-body {
  flex: 1;
  display: flex;
  align-items: flex-end;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}
.stat-empty { font-size: 13px; color: var(--muted); }
.link-btn { color: var(--orange); text-decoration: none; font-size: 14px; font-weight: 600; }
.link-btn:hover { color: var(--orange-dark); }
code { background: #eef1f7; padding: 2px 6px; border-radius: 4px; font-size: 13px; }
.site-footer { text-align: center; padding: 18px; color: var(--muted); font-size: 13px; }

/* ---------- Guest topbar (login/setup pages) ---------- */
.topbar-guest {
  background: #fff;
  border-bottom: 3px solid var(--orange);
  padding: 14px 28px;
  box-shadow: 0 4px 16px rgba(31,42,68,0.08);
}

/* ---------- Sidebar layout (fixed width, not collapsible) ---------- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 230px;
  flex-shrink: 0;
  background: #fff;
  box-shadow: 4px 0 24px rgba(31,42,68,0.10);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 10;
}
.sidebar-top {
  padding: 20px;
  border-bottom: 3px solid var(--orange);
  display: flex;
  justify-content: center;
}
.sidebar-brand { display: flex; align-items: center; justify-content: center; }
.sidebar-logo { height: 20px; width: auto; display: block; }
.sidebar-nav { flex: 1; padding: 16px 12px; display: flex; flex-direction: column; gap: 6px; }
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 10px;
  color: var(--navy);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.sidebar-nav a .icon { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; }
.sidebar-nav a .icon svg { width: 18px; height: 18px; }
.sidebar-nav a:hover { background: var(--bg); transform: translateX(2px); }
.sidebar-nav a.active {
  background: var(--danger-bg);
  color: var(--orange-dark);
  box-shadow: 0 2px 6px rgba(249,71,38,0.18), 0 6px 14px rgba(249,71,38,0.12);
}
.sidebar-bottom { padding: 14px 12px 18px; position: relative; }
.sidebar-profile {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  background: none;
  color: var(--navy);
  border: none;
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
  box-shadow: none;
}
.sidebar-profile:hover { background: var(--bg); box-shadow: none; transform: none; }
.sidebar-profile .icon { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; }
.sidebar-profile .icon svg { width: 18px; height: 18px; }
.profile-menu {
  display: none;
  position: absolute;
  bottom: 60px;
  left: 12px;
  right: 12px;
  background: #fff;
  border: none;
  border-radius: 12px;
  box-shadow: var(--shadow-hover);
  overflow: hidden;
}
.profile-menu.open { display: block; }
.profile-menu a.logout {
  display: block;
  padding: 11px 14px;
  color: var(--danger);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}
.profile-menu a.logout:hover { background: var(--danger-bg); }
.main-area { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.container { max-width: 1440px; margin: 0 auto; padding: 32px; width: 100%; flex: 1; }

/* ---------- Reminders card (full width, recessed inner rows) ---------- */
.reminders-card { padding: 22px; }
.reminder-box {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px;
  background: #f6f8fc;
  border: none;
  border-radius: 12px;
  margin-bottom: 12px;
  box-shadow: inset 0 2px 4px rgba(31,42,68,0.06), inset 0 0 0 1px rgba(226,230,238,0.8);
}
.reminder-box:last-child { margin-bottom: 0; }
.reminder-icon { font-size: 20px; line-height: 1; }
.reminder-title { font-weight: 700; font-size: 14px; color: var(--navy); margin-bottom: 2px; }
.reminder-text { font-size: 13px; color: var(--text); }
.reminder-text.muted { color: var(--muted); }

/* ---------- Manage Employees: action cards ---------- */
.action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}
.action-card {
  display: flex;
  flex-direction: column;
  background: var(--card-grad);
  border-top: 3px solid var(--orange);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow), var(--inset-top);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
  text-decoration: none;
  color: inherit;
  min-height: 170px;
}
.action-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-4px) scale(1.01);
}
.action-icon { font-size: 26px; margin-bottom: 12px; display: inline-flex; color: var(--orange); }
.action-icon svg { width: 28px; height: 28px; }
.action-title { font-size: 16px; font-weight: 700; color: var(--navy); margin-bottom: 8px; }
.action-desc { font-size: 13px; color: var(--muted); flex: 1; line-height: 1.5; }
.action-flag {
  display: inline-block;
  margin-top: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--orange-dark);
  background: var(--danger-bg);
  padding: 3px 8px;
  border-radius: 6px;
}
.action-go { font-size: 13px; font-weight: 600; color: var(--orange); margin-top: 14px; }

/* ---------- Form pages (Add Employee, Credentials) ---------- */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

/* ---------- Standalone field label + input (for inputs outside a <form> tag) ---------- */
.field-label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 12px;
  font-weight: 500;
}
.field-input {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 9px 10px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: #f6f8fc;
  box-shadow: inset 0 2px 4px rgba(31,42,68,0.06), inset 0 0 0 1px rgba(226,230,238,0.9);
}
.field-input:focus {
  outline: none;
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--orange), 0 0 0 3px rgba(249,71,38,0.15);
}

/* ---------- Filter panel (recessed, sits directly under the search row, matches reminder-box) ---------- */
.filter-panel {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.filter-panel .inline-form {
  align-items: flex-end;
}
.filter-panel .inline-form label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.3px;
  margin-bottom: 0;
  min-width: 180px;
}
.filter-panel .field-input {
  margin-top: 6px;
}

/* ---------- Filter checklist (multi-select department / employment type) ---------- */
.filter-checklist-cols {
  display: flex;
  gap: 40px;
  flex-wrap: wrap;
}
.filter-col {
  min-width: 160px;
}
.filter-check-group {
  max-height: 122px; /* ~3 rows at current row height */
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  align-content: flex-start;
  column-gap: 24px;
}
.filter-col-title {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.3px;
  margin-bottom: 10px;
}
.filter-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text);
  font-weight: 400;
  margin-bottom: 10px;
  cursor: pointer;
}
.filter-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--orange);
  cursor: pointer;
}