
:root {

  --bg: #dde3ea;

  --surface: #edf1f7;

  --text: #111827;

  --border: #c8d0db;

  --weekend: #e4e9f0;

}

.dark {

  --bg: #111827;

  --surface: #1f2937;

  --text: #f9fafb;

  --border: #374151;

  --weekend: #273244;

}

body {
  margin: 0;
  font-family: Arial;
  background: var(--bg);
  color: var(--text);
}

.layout {
  display: flex;
  height: 100vh;
}

.nav-strip {
  width: 64px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 0;
  flex-shrink: 0;
}

.nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 9px 6px;
  border-radius: 8px;
  border: none;
  background: none;
  color: var(--text);
  cursor: pointer;
  width: 54px;
  opacity: 0.6;
  transition: background 0.15s, opacity 0.15s;
}

.nav-btn:hover {
  background: rgba(99, 102, 241, 0.1);
  opacity: 1;
}

.nav-icon {
  font-size: 17px;
  line-height: 1;
}

.nav-label {
  font-size: 10px;
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
  color: var(--text);
}

.nav-btn.nav-logout {
  margin-top: auto;
  opacity: 0.45;
}

.nav-btn.nav-logout:hover {
  background: rgba(220, 38, 38, 0.1);
  opacity: 1;
}

.nav-btn.nav-logout .nav-label {
  color: #dc2626;
}

.nav-user {
  font-size: 10px;
  opacity: 0.55;
  text-align: center;
  padding: 10px 4px 8px;
  width: 58px;
  overflow: hidden;
  line-height: 1.4;
  color: var(--text);
  font-weight: 600;
  word-break: break-word;
}

.sidebar {
  width: 260px;
  background: var(--surface);
  border-right: 1px solid #ddd;
  overflow-y: auto;
  padding: 20px;
}

.sidebar h2 {
  margin-top: 0;
}

.main {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

input,
button {
  padding: 8px;
}

.calendar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.month {
  background: #e3eaf3;
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 10px;
}

.month h3 {
  text-align: center;
  margin-top: 0;
}

.weekdays {
  display: grid;
  grid-template-columns: repeat(5, 1fr) 0.65fr 0.65fr;
  margin-bottom: 5px;
}

.weekday {
  text-align: center;
  font-size: 11px;
  color: var(--text);
  opacity: 0.7;
}

.days {
  display: grid;
  grid-template-columns: repeat(5, 1fr) 0.65fr 0.65fr;
  gap: 2px;
}

.day {
  min-height: 64px;
  border: 1px solid var(--border);
  padding: 3px 2px 2px;
  background: #edf2f7;
  overflow: hidden;
}

.weekend {
  background: var(--weekend);
}

.holiday {
  background: rgba(253, 226, 179, 0.3);
  border-color: rgba(251, 191, 36, 0.4);
}

.day-number {
  font-size: 10px;
  color: var(--text);
  opacity: 0.7;
  margin-bottom: 2px;
  line-height: 1;
}

.holiday-name {
  font-size: 7.5px;
  color: #92400e;
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
  line-height: 1.2;
}

.entry {
  font-size: 9px;
  padding: 1px 3px 1px 4px;
  border-radius: 3px;
  margin-bottom: 1px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-weight: bold;
  border: none;
  border-left: 3px solid transparent;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

td {
  padding: 6px;
}
.modal {

  position: fixed;

  inset: 0;

  background: rgba(0,0,0,0.5);

  display: flex;

  align-items: center;

  justify-content: center;

  z-index: 1000;

}

.hidden {

  display: none;

}

.modal-content {

  background: var(--surface);

  color: var(--text);

  padding: 20px;

  border-radius: 12px;

  min-width: 300px;

}

.modal-buttons {

  display: flex;

  gap: 10px;

  margin-top: 20px;

}
/* LEAVE TYPE BADGE */

.leave-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.leave-tag--holiday {
  background: #dbeafe;
  color: #1d4ed8;
}

.leave-tag--tft {
  background: #ffedd5;
  color: #c2410c;
}

.leave-tag--parental {
  background: #fce7f3;
  color: #be185d;
}

body.dark .leave-tag--holiday {
  background: #1e3a5f;
  color: #93c5fd;
}

body.dark .leave-tag--tft {
  background: #431407;
  color: #fdba74;
}

body.dark .leave-tag--parental {
  background: #500724;
  color: #f9a8d4;
}

/* EMPLOYEE MANAGEMENT TABLE */

.employee-panel {

  padding: 20px;

  overflow-x: auto;

}

.employee-table {

  width: 100%;

  border-collapse: collapse;

  background: white;

  border-radius: 10px;

  overflow: hidden;

}

.employee-table thead {

  background: #f3f4f6;

}

.employee-table th {

  text-align: left;

  padding: 14px;

  font-size: 14px;

  border-bottom: 1px solid #ddd;

}

.employee-table td {

  padding: 12px;

  border-bottom: 1px solid #eee;

  vertical-align: middle;

}

.employee-table tr:hover {

  background: rgba(99, 102, 241, 0.07);

}

.small-input {

  width: 80px;

  padding: 6px;

}

.actions {

  display: flex;

  gap: 8px;

}

.employee-table button {

  padding: 6px 10px;

  cursor: pointer;

}

.danger {

  background: #d9534f;

  color: white;

  border: none;

}
/* TOOLBAR */

.toolbar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.toolbar-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.toolbar-left,
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* DARK MODE SWITCH */

.switch {

  position: relative;

  display: inline-block;

  width: 50px;

  height: 26px;

}

.switch input {

  opacity: 0;

  width: 0;

  height: 0;

}

.slider {

  position: absolute;

  cursor: pointer;

  top: 0;

  left: 0;

  right: 0;

  bottom: 0;

  background-color: #ccc;

  transition: .3s;

  border-radius: 34px;

}

.slider:before {

  position: absolute;

  content: "";

  height: 20px;

  width: 20px;

  left: 3px;

  bottom: 3px;

  background-color: white;

  transition: .3s;

  border-radius: 50%;

}

input:checked + .slider {

  background-color: #3b82f6;

}

input:checked + .slider:before {

  transform: translateX(24px);

}

.switch-label {
  font-size: 12px;
  color: var(--text);
  align-self: center;
  margin-right: 10px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  border: 1px solid rgba(0,0,0,0.1);
}

.legend-dot.whm {
  background: #ea580c;
}

.legend-dot.sv {
  background: #111827;
}

.legend-dot.ll {
  background: #16a34a;
}

.legend-dot.wss {
  background: #2563eb;
}

.legend-dot.we {
  background: #be185d;
}

/* FILTERS */

.filter-section {
  margin-bottom: 16px;
}

.filter-group {
  margin-bottom: 8px;
}

.filter-group label {
  display: block;
  font-size: 12px;
  opacity: 0.7;
  margin-bottom: 3px;
}

.filter-group select {
  width: 100%;
  padding: 5px;
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

tr.row-selected {
  background: rgba(59, 130, 246, 0.15);
}

/* SIDEBAR USERS */

.user-card {

  background: white;

  border-radius: 10px;

  padding: 12px;

  margin-bottom: 12px;

  border: 1px solid #ddd;

}

.user-top {

  display: flex;

  justify-content: space-between;

  align-items: center;

  margin-bottom: 8px;

}

.user-name {

  font-weight: bold;

}

.user-role {

  font-size: 12px;

  padding: 4px 8px;

  border-radius: 6px;

  background: #eee;

}

.user-stats {

  display: grid;

  grid-template-columns: 1fr 1fr;

  gap: 6px;

  font-size: 14px;

}

/* DARK MODE */

body.dark {

  background: #111827;

  color: white;

}

body.dark .month,
body.dark .user-card,
body.dark .modal-content,
body.dark .employee-table {

  background: #1f2937;

  color: white;

}

body.dark .day {

  background: #1a2332;

}

body.dark input,
body.dark select,
body.dark button {

  background: #374151;

  color: white;

  border: 1px solid #4b5563;

}

body.dark .day {

  border-color: #374151;

}

body.dark .weekday {

  color: #d1d5db;

}

body.dark .employee-table th {

  background: #111827;

}

body.dark .employee-table td {

  border-color: #374151;

}

/* Pending badge */
.pending-badge {
  background: #dc2626;
  color: white;
  font-size: 12px;
  font-weight: bold;
  padding: 4px 10px;
  border-radius: 12px;
  white-space: nowrap;
}

/* Coverage panel */
.coverage-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 300px;
  height: 100vh;
  background: var(--surface);
  border-left: 1px solid var(--border);
  z-index: 200;
  overflow-y: auto;
  box-shadow: -4px 0 16px rgba(0,0,0,0.15);
  font-size: 13px;
}

.coverage-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--surface);
}

.coverage-month-header {
  padding: 10px 16px 4px;
  font-size: 12px;
  font-weight: bold;
  opacity: 0.5;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.coverage-day {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 16px;
  border-bottom: 1px solid var(--border);
}

.coverage-day.coverage-yellow {
  background: rgba(234, 179, 8, 0.15);
  border-left: 3px solid #ca8a04;
}

.coverage-day.coverage-red {
  background: rgba(220, 38, 38, 0.12);
  border-left: 3px solid #dc2626;
}

.coverage-day.coverage-green {
  background: rgba(22, 163, 74, 0.12);
  border-left: 3px solid #16a34a;
}

.coverage-date {
  flex-shrink: 0;
  width: 90px;
}

.coverage-count {
  font-weight: bold;
  flex-shrink: 0;
  width: 20px;
  text-align: center;
}

.coverage-names {
  opacity: 0.65;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* WEEK VIEW */

.week-view {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 20px;
  overflow: hidden;
}

.week-nav {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  font-weight: bold;
  font-size: 14px;
}

.week-grid {
  display: grid;
  grid-template-columns: 160px repeat(5, 1fr);
}

.week-header {
  background: var(--bg);
  padding: 7px 10px;
  font-size: 12px;
  font-weight: bold;
  text-align: center;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
}

.week-header.week-name-col {
  text-align: left;
}

.week-header.today {
  background: rgba(59, 130, 246, 0.12);
  color: #2563eb;
}

.week-header.holiday {
  background: rgba(253, 226, 179, 0.4);
}

.week-holiday-name {
  font-size: 9px;
  font-weight: normal;
  color: #92400e;
  font-style: italic;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.week-name {
  padding: 6px 10px;
  font-size: 12px;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: var(--surface);
  display: flex;
  align-items: center;
  gap: 5px;
}

.week-role {
  opacity: 0.45;
  font-size: 10px;
}

.week-cell {
  padding: 3px;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  min-height: 32px;
}

.week-cell.today {
  background: rgba(59, 130, 246, 0.06);
  border-left: 2px solid #3b82f6;
}

.week-cell.holiday {
  background: rgba(253, 226, 179, 0.25);
}

.week-entry {
  height: 100%;
  min-height: 26px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  cursor: pointer;
  background: var(--surface);
  color: var(--text);
  border: none;
  border-left: 3px solid transparent;
}

.week-entry--pending {
  opacity: 0.65;
  border-left-style: dashed;
}

/* Pending popup */
.pending-popup {
  position: fixed;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  z-index: 500;
  min-width: 260px;
  max-height: 320px;
  overflow-y: auto;
  font-size: 13px;
}

.pending-popup.hidden {
  display: none;
}

.pending-popup-row {
  display: grid;
  grid-template-columns: 34px 1fr 54px auto;
  align-items: center;
  gap: 6px 10px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.pending-popup-row:last-child {
  border-bottom: none;
}

.pending-popup-row:hover {
  background: rgba(59,130,246,0.08);
}

.pending-popup-row span {
  opacity: 0.55;
  font-size: 12px;
  white-space: nowrap;
}

.pending-popup-row .leave-tag {
  opacity: 1;
  font-size: 11px;
}

.pending-popup-row strong {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.role-pill {
  font-size: 10px;
  font-weight: 700;
  width: 32px;
  text-align: center;
  border-radius: 4px;
  color: white;
  flex-shrink: 0;
  letter-spacing: 0.03em;
  padding: 2px 0;
  display: inline-block;
  line-height: 1.4;
}
.role-pill.role-whm { background: #ea580c; }
.role-pill.role-sv  { background: #374151; }
.role-pill.role-asv { background: #6b7280; }
.role-pill.role-ll  { background: #16a34a; }
.role-pill.role-we  { background: #be185d; }
.role-pill.role-wss { background: #2563eb; }

/* Calendar overflow chip */
.entry-more {
  background: #6b7280;
  color: white;
  opacity: 0.75;
  cursor: pointer;
  font-size: 8px;
  text-align: center;
}

.entry-more:hover {
  opacity: 1;
}

/* Toast notification */
.toast {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  background: #dc2626;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  padding: 5px 16px;
  border-radius: 8px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 10;
}

.toast.hidden {
  display: none;
}

.toast-fixed {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  font-size: 14px;
  padding: 12px 24px;
  z-index: 9999;
}

.toast-fixed.hidden {
  display: none;
}

/* SIDEBAR EMPLOYEE SUMMARY TABLE */
.user-summary-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.user-summary-table thead th {
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.45;
  border-bottom: 1px solid var(--border);
}

.user-summary-table thead th:first-child { text-align: left; }
.user-summary-table thead th:not(:first-child) { text-align: right; }

.ust-row { cursor: pointer; }

.ust-row:hover td { background: var(--surface); }

.ust-row.row-selected td { background: var(--surface); }

.user-summary-table td {
  padding: 5px 8px;
  border-bottom: 1px solid var(--border);
}

.ust-name {
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.ust-dot {
  width: 8px;
  min-width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.ust-num {
  text-align: right;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ust-h { color: #ea580c; }
.ust-t { color: #2563eb; }
.ust-p { color: #7c3aed; }

body.dark .ust-h { color: #fb923c; }
body.dark .ust-t { color: #60a5fa; }
body.dark .ust-p { color: #a78bfa; }

