:root {
  color-scheme: dark;
  --bg: #111413;
  --panel: #181c1b;
  --panel-soft: #202625;
  --line: #050606;
  --line-soft: #3a403d;
  --text: #f4f5f2;
  --muted: #b9c0bb;
  --accent: #d8ddd7;
  --danger: #ff6b5f;
  --danger-bg: #4d1712;
  --ok: #9ad6a0;
  --warn: #e8c36a;
  --shadow: rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

#app {
  min-height: 100vh;
}

.app-shell {
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 255, 255, 0.05), transparent 28rem),
    var(--bg);
  position: relative;
  overflow-x: hidden;
}

.watermark {
  position: fixed;
  width: min(520px, 78vw);
  left: 50%;
  top: 20vh;
  transform: translateX(-50%);
  opacity: 0.09;
  pointer-events: none;
  z-index: 0;
}

.splash {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
  background: var(--bg);
}

.splash-card {
  display: grid;
  justify-items: center;
  gap: 22px;
  width: min(420px, 100%);
}

.splash-logo {
  width: min(320px, 86vw);
  opacity: 0.96;
}

.splash-title {
  display: grid;
  gap: 8px;
  text-align: center;
  color: var(--muted);
}

.splash-title strong {
  color: var(--text);
  font-weight: 600;
  font-size: 1.2rem;
}

.primary-button,
.secondary-button,
.icon-button,
.tab-button,
.nav-button,
.tile,
.row-button {
  border: 1.5px solid var(--line);
  background: var(--panel);
  color: var(--text);
  border-radius: 8px;
}

.primary-button,
.secondary-button {
  min-height: 44px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.primary-button {
  border-color: var(--accent);
}

.secondary-button {
  color: var(--muted);
}

.layout {
  position: relative;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
}

.sidebar {
  border-right: 2px solid var(--line);
  background: rgba(17, 20, 19, 0.96);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-logo {
  width: 58px;
  height: 58px;
  object-fit: contain;
}

.brand-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.brand-text strong {
  font-weight: 600;
}

.brand-text span,
.muted {
  color: var(--muted);
}

.sensitive-row {
  gap: 8px;
}

.sensitive-field {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.sensitive-value {
  overflow-wrap: anywhere;
}

.identifier-toggle {
  min-height: 30px;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--text);
  padding: 0 10px;
  font: inherit;
}

.identifier-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.role-switcher {
  display: none;
  grid-template-columns: 1fr;
  gap: 6px;
  padding: 5px;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.test-mode .role-switcher {
  display: grid;
}

.test-mode-note {
  color: var(--warn);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0;
}

.tab-button {
  min-height: 44px;
  color: var(--muted);
}

.tab-button.active {
  background: var(--bg);
  color: var(--text);
  border-color: var(--accent);
}

.nav {
  display: grid;
  gap: 7px;
}

.nav-button {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 11px;
  text-align: left;
  color: var(--muted);
}

.nav-button.active {
  color: var(--text);
  border-color: var(--accent);
  background: var(--panel-soft);
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 8px;
}

.sync-status {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--muted);
  padding: 8px 10px;
  font-size: 0.78rem;
  text-align: center;
}

.sync-status.ok {
  color: var(--ok);
}

.sync-status.warn {
  color: var(--warn);
}

.sync-status.danger {
  color: var(--danger);
}

.content {
  min-width: 0;
  padding: 18px;
}

.topbar {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 2px solid var(--line);
  padding: 14px 16px;
  background: rgba(17, 20, 19, 0.96);
  position: sticky;
  top: 0;
  z-index: 4;
}

.topbar .brand {
  justify-content: center;
}

.topbar .brand-logo {
  width: 64px;
  height: 64px;
}

.icon-button {
  position: relative;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
}

.nav-badge {
  min-width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--danger);
  border-radius: 999px;
  background: var(--danger-bg);
  color: #ffe3df;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1;
  padding: 0 6px;
}

.nav-badge.ok {
  border-color: var(--ok);
  background: rgba(63, 103, 65, 0.72);
  color: #e8ffe8;
}

.nav-badge.warn {
  border-color: var(--warn);
  background: rgba(105, 78, 19, 0.72);
  color: #fff3cf;
}

.nav-badge.danger {
  border-color: #ffb2a8;
  background: var(--danger-bg);
  color: #ffe3df;
}

.notification-button .nav-badge {
  position: absolute;
  top: -6px;
  right: -6px;
}

.hamburger {
  width: 18px;
  display: grid;
  gap: 4px;
}

.hamburger span {
  height: 2px;
  background: currentColor;
  border-radius: 999px;
}

.page {
  display: grid;
  gap: 16px;
  max-width: 1180px;
  margin: 0 auto;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.page-heading {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.back-button {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  font-size: 1.65rem;
  line-height: 1;
  color: var(--text);
}

.page-title {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.page-title h1 {
  margin: 0;
  font-size: clamp(1.45rem, 2.3vw, 2.25rem);
  font-weight: 600;
  letter-spacing: 0;
}

.page-title p {
  margin: 0;
  color: var(--muted);
}

.grid {
  display: grid;
  gap: 12px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.leave-single-calendar {
  max-width: 920px;
  width: 100%;
  min-width: 0;
}

.summary-strip {
  border: 1.5px solid var(--line);
  background: rgba(24, 28, 27, 0.94);
  border-radius: 8px;
  box-shadow: 0 12px 28px var(--shadow);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
}

.summary-item {
  min-height: 72px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  padding: 10px 12px;
  display: grid;
  gap: 3px;
  text-align: left;
  align-content: center;
}

.summary-item:last-child {
  border-right: 0;
}

.summary-item strong {
  font-size: 1.35rem;
  font-weight: 600;
}

.summary-item span {
  color: var(--muted);
}

.week-summary-panel {
  display: grid;
  gap: 10px;
}

.week-summary-panel > .row-line {
  align-items: center;
}

.compact-stat-strip {
  border: 1.5px solid var(--line);
  background: rgba(24, 28, 27, 0.94);
  border-radius: 8px;
  box-shadow: 0 12px 28px var(--shadow);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
  overflow: hidden;
}

.compact-stat {
  min-width: 0;
  border-right: 1px solid var(--line);
  padding: 10px;
  display: grid;
  gap: 2px;
  align-content: center;
}

.compact-stat:last-child {
  border-right: 0;
}

.compact-stat strong {
  font-size: 1.35rem;
  font-weight: 600;
}

.compact-stat span,
.compact-stat small {
  color: var(--muted);
}

.compact-stat[data-employee-filter] {
  cursor: pointer;
}

.compact-stat[data-employee-filter]:hover,
.compact-stat.active {
  background: #242a28;
}

.panel,
.tile,
.row,
.calendar,
.profile-card,
.employee-row {
  border: 1.5px solid var(--line);
  background: rgba(24, 28, 27, 0.94);
  color: var(--text);
  border-radius: 8px;
  box-shadow: 0 12px 28px var(--shadow);
}

.panel {
  padding: 14px;
}

.tile {
  min-height: 112px;
  padding: 14px;
  display: grid;
  gap: 10px;
  text-align: left;
}

.tile strong {
  font-weight: 600;
}

.tile span {
  color: var(--muted);
}

.metric {
  display: grid;
  gap: 7px;
}

.metric strong {
  font-size: 2rem;
  font-weight: 600;
}

.metric span {
  color: var(--muted);
}

.tile[data-nav],
.tile[data-employee-filter],
.summary-item[data-nav],
.calendar[data-nav] {
  cursor: pointer;
}

.tile[data-nav]:hover,
.tile[data-employee-filter]:hover,
.tile.metric.active,
.summary-item[data-nav]:hover,
.nav-button:hover,
.row-button:hover {
  border-color: var(--accent);
  background: #242a28;
}

.filter-note {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 10px 12px;
}

.filter-note span {
  color: var(--muted);
}

.status {
  width: max-content;
  max-width: 100%;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid var(--line-soft);
  color: var(--muted);
  background: var(--panel-soft);
}

.status.danger {
  color: #ffe3df;
  border-color: #ffb2a8;
  background: var(--danger-bg);
}

.status.ok {
  color: #dff5df;
  border-color: var(--ok);
  background: rgba(63, 103, 65, 0.38);
}

.status.warn {
  color: #fff0c7;
  border-color: var(--warn);
  background: rgba(105, 78, 19, 0.42);
}

.list {
  display: grid;
  gap: 9px;
}

.leave-scroll {
  display: flex;
  gap: 9px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  padding-bottom: 6px;
}

.leave-scroll-item {
  flex: 0 0 min(340px, 84vw);
  display: grid;
  gap: 6px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(24, 28, 27, 0.58);
  padding: 10px;
  scroll-snap-align: start;
}

.compact-leave-history {
  display: grid;
  gap: 10px;
}

.leave-summary-row {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(24, 28, 27, 0.58);
  padding: 10px;
  display: grid;
  gap: 6px;
}

.approval-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.approval-grid.single {
  grid-template-columns: minmax(0, 1fr);
}

.approval-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.vehicle-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.service-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.vehicle-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.vehicle-card {
  display: grid;
  gap: 10px;
  border: 1.5px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 12px;
}

.vehicle-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 8px;
}

.vehicle-stats div {
  display: grid;
  gap: 3px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(24, 28, 27, 0.66);
  padding: 8px;
}

.vehicle-stats span {
  color: var(--muted);
  font-size: 0.82rem;
}

.chip-danger {
  border-color: #ffb2a8 !important;
  background: var(--danger-bg) !important;
  color: #ffe3df !important;
}

.filter-button {
  min-height: 34px;
  border: 1.5px solid var(--line-soft);
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--muted);
  padding: 7px 11px;
  cursor: pointer;
}

.filter-button.active {
  color: var(--text);
  border-color: var(--accent);
  background: #2a302e;
}

.filter-button.ok.active {
  border-color: var(--ok);
  background: rgba(63, 103, 65, 0.38);
}

.filter-button.warn.active {
  border-color: var(--warn);
  background: rgba(105, 78, 19, 0.42);
}

.filter-button.danger.active {
  border-color: #ffb2a8;
  background: var(--danger-bg);
}

.icon-action {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border: 1.5px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}

.icon-action.ok {
  border-color: var(--ok);
  background: rgba(63, 103, 65, 0.38);
  color: #e8ffe8;
}

.approval-column {
  display: grid;
  align-content: start;
  gap: 10px;
  border: 1.5px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 10px;
}

.approval-column.low {
  border-color: rgba(154, 214, 160, 0.55);
}

.approval-column.medium {
  border-color: rgba(232, 195, 106, 0.62);
}

.approval-column.high {
  border-color: rgba(255, 107, 95, 0.72);
}

.approval-item {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(24, 28, 27, 0.76);
  padding: 10px;
}

.approval-item.low {
  box-shadow: inset 4px 0 0 rgba(154, 214, 160, 0.92);
}

.approval-item.medium {
  box-shadow: inset 4px 0 0 rgba(232, 195, 106, 0.95);
}

.approval-item.high {
  box-shadow: inset 4px 0 0 rgba(255, 107, 95, 0.98);
}

.approval-history {
  display: grid;
  gap: 9px;
  border-top: 1px solid var(--line-soft);
  padding-top: 12px;
  margin-top: 12px;
}

.approval-history-track {
  display: flex;
  gap: 9px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  padding-bottom: 6px;
}

.approval-history-item {
  flex: 0 0 min(360px, 86vw);
  display: grid;
  gap: 5px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(24, 28, 27, 0.58);
  padding: 10px;
  scroll-snap-align: start;
}

.approval-modal-head {
  display: grid;
  gap: 7px;
  border: 1.5px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 12px;
}

.approval-modal-head.low {
  border-color: rgba(154, 214, 160, 0.55);
}

.approval-modal-head.medium {
  border-color: rgba(232, 195, 106, 0.62);
}

.approval-modal-head.high {
  border-color: rgba(255, 107, 95, 0.72);
}

.cert-preview-modal {
  max-width: 560px;
}

.cert-preview-frame {
  min-height: 280px;
  border: 1.5px solid var(--line-soft);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.045), transparent 32%),
    var(--panel-soft);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 20px;
  text-align: center;
}

.cert-preview-media,
.cert-preview-pdf {
  width: 100%;
  max-height: 420px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #0f1211;
}

.cert-preview-media {
  object-fit: contain;
}

.cert-preview-pdf {
  min-height: 360px;
}

.row,
.row-button {
  padding: 11px;
  display: grid;
  gap: 5px;
}

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

.row strong {
  font-weight: 600;
}

.calendar {
  padding: 12px;
  display: grid;
  gap: 9px;
  min-width: 0;
  align-content: start;
  align-self: start;
}

.calendar-month-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.calendar-month-nav .status {
  min-width: 150px;
  text-align: center;
}

.calendar-month-nav .icon-button {
  width: 38px;
  height: 38px;
}

.leave-calendar .day {
  min-height: 54px;
}

.calendar-head,
.calendar-grid {
  display: grid;
  grid-template-columns: 42px repeat(7, minmax(0, 1fr));
  gap: 5px;
  min-width: 0;
}

.calendar-head span,
.week-label,
.day {
  min-height: 42px;
  display: grid;
  place-items: center;
  min-width: 0;
}

.calendar-head span,
.week-label {
  color: var(--muted);
}

.day {
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: var(--panel-soft);
  color: var(--text);
  position: relative;
  overflow: hidden;
  width: 100%;
}

.day.event::after {
  content: "";
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  left: 50%;
  bottom: 5px;
  transform: translateX(-50%);
  background: var(--accent);
}

.day.warn::after {
  background: var(--warn);
}

.day.danger::after {
  background: var(--danger);
}

.day.muted-day {
  opacity: 0.45;
}

.day.selected {
  border-color: var(--accent);
  background: #303735;
}

.day.today {
  box-shadow: inset 0 0 0 1px var(--ok);
}

.day-count {
  position: absolute;
  top: 3px;
  right: 4px;
  min-width: 14px;
  height: 14px;
  padding: 0 4px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--danger-bg);
  color: #ffe3df;
  font-size: 0.68rem;
  line-height: 1;
}

.day-pending {
  position: absolute;
  top: 3px;
  left: 4px;
  min-width: 14px;
  height: 14px;
  padding: 0 4px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--warn);
  color: #111413;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
}

.calendar-detail {
  margin-top: 8px;
  border-top: 1px solid var(--line-soft);
  padding-top: 9px;
  display: grid;
  gap: 7px;
}

.leave-popover {
  position: relative;
  margin-top: 12px;
  padding: 13px;
  display: grid;
  gap: 10px;
  border: 1.5px solid var(--accent);
  border-radius: 8px;
  background: #202625;
  box-shadow: 0 16px 32px var(--shadow);
}

.leave-popover::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 52px;
  width: 14px;
  height: 14px;
  transform: rotate(45deg);
  border-left: 1.5px solid var(--accent);
  border-top: 1.5px solid var(--accent);
  background: #202625;
}

.detail-block {
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--line-soft);
  padding-top: 10px;
}

.person-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.person-chips span {
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--text);
  padding: 5px 9px;
  line-height: 1.1;
}

.chip-button {
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--text);
  padding: 5px 9px;
  line-height: 1.1;
  cursor: pointer;
}

.chip-button:hover {
  border-color: var(--accent);
  background: #242a28;
}

.form {
  display: grid;
  gap: 10px;
}

.login-form {
  width: min(100%, 360px);
  margin: 0 auto;
}

.text-button {
  min-height: 40px;
  border: 0;
  background: transparent;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.text-button:hover,
.text-button:focus-visible {
  color: var(--text);
}

.auth-help {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.auth-message {
  justify-items: stretch;
  text-align: center;
}

.auth-message .status {
  width: 100%;
  border-radius: 8px;
  padding: 12px;
  line-height: 1.45;
}

.login-role-switcher {
  grid-template-columns: repeat(3, 1fr);
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  color: var(--muted);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--text);
  padding: 10px;
}

.field textarea {
  min-height: 86px;
  resize: vertical;
}

.field input,
.field select {
  min-height: 44px;
}

.upload-panel {
  display: grid;
  gap: 10px;
  border: 1.5px dashed var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  padding: 10px;
}

.upload-panel input[type="file"] {
  padding: 8px;
}

.data-backup-area {
  min-height: 220px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.45;
}

.pilot-message-area {
  min-height: 260px;
  line-height: 1.5;
}

.pilot-checklist {
  display: grid;
  gap: 8px;
}

.check-row {
  min-width: 0;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 10px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 9px;
  color: var(--text);
}

.profile-card {
  padding: 14px;
  display: grid;
  gap: 12px;
}

.inline-form-panel {
  border: 1.5px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 12px;
  display: grid;
  gap: 10px;
}

.profile-card.selected {
  border-color: var(--accent);
  background: rgba(32, 38, 37, 0.98);
}

.employee-directory {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.employee-search {
  border: 1.5px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 12px;
  display: grid;
  gap: 7px;
}

.employee-search label {
  color: var(--muted);
}

.employee-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.employee-search-row input {
  width: 100%;
  min-height: 44px;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  padding: 10px 12px;
}

.employee-search-empty {
  grid-column: 1 / -1;
}

.account-table-wrap {
  margin-top: 12px;
  overflow-x: auto;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
}

.user-profiles-heading {
  align-items: flex-start;
  flex-wrap: wrap;
}

.account-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
  text-align: left;
}

.account-table th,
.account-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}

.account-table th {
  color: var(--muted);
  background: var(--panel-soft);
  font-weight: 500;
}

.account-table tbody tr:last-child td {
  border-bottom: 0;
}

.employee-row {
  display: grid;
  overflow: hidden;
}

.employee-row.selected,
.employee-row.expanded {
  border-color: var(--accent);
  background: rgba(32, 38, 37, 0.98);
}

.employee-row-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
}

.employee-row-toggle {
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 0;
  text-align: left;
}

.employee-row-main,
.employee-row-meta {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.employee-row-main span,
.employee-row-meta .muted {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.employee-row-meta {
  justify-items: end;
}

.employee-row-details {
  border-top: 1px solid var(--line-soft);
  padding: 10px;
  display: grid;
  gap: 10px;
}

.avatar.small {
  width: 38px;
  height: 38px;
  font-size: 0.78rem;
}

.compact-select {
  min-width: 18px;
}

.selection-bar {
  position: sticky;
  top: 12px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1.5px solid var(--accent);
  border-radius: 8px;
  background: #202625;
  box-shadow: 0 16px 32px var(--shadow);
  padding: 10px;
}

.select-line {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.select-line input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.profile-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.profile-head .status {
  margin-left: auto;
  flex: 0 0 auto;
}

.avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: var(--panel-soft);
  border: 1.5px solid var(--line);
  font-weight: 600;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.64);
}

.modal {
  width: min(560px, 100%);
  max-height: min(760px, calc(100vh - 36px));
  overflow: auto;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  background: #181c1b;
  box-shadow: 0 22px 46px rgba(0, 0, 0, 0.5);
  padding: 14px;
  display: grid;
  gap: 12px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 40;
  transform: translateX(-50%);
  max-width: min(420px, calc(100vw - 28px));
  border: 1.5px solid var(--accent);
  border-radius: 8px;
  background: #202625;
  color: var(--text);
  box-shadow: 0 16px 32px var(--shadow);
  padding: 11px 14px;
}

.share-preview {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 10px;
}

.cert-document-list {
  display: grid;
  gap: 8px;
}

.cert-document {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 10px;
}

.cert-document-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.cert-document-main > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.id06-card {
  border-color: rgba(216, 177, 102, 0.55);
}

.id06-update {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  align-items: end;
  gap: 10px;
  border-top: 1px solid var(--line-soft);
  padding-top: 10px;
}

.print-area {
  display: none;
}

.print-document {
  color: #111;
  background: #fff;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.print-header {
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 2px solid #111;
  padding-bottom: 14px;
  margin-bottom: 18px;
}

.print-header img {
  width: 78px;
  height: 78px;
  object-fit: contain;
  filter: invert(1);
}

.print-header div,
.print-profile,
.print-grid div,
.print-certificates {
  display: grid;
  gap: 4px;
}

.print-header strong {
  font-size: 1.35rem;
}

.print-header span,
.print-profile p,
.print-grid span,
.print-certificates span {
  color: #444;
}

.print-profile {
  page-break-inside: avoid;
  border: 1px solid #d8d8d8;
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 14px;
}

.print-profile-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #ddd;
  padding-bottom: 10px;
  margin-bottom: 12px;
}

.print-profile-head h2,
.print-profile-head p {
  margin: 0;
}

.print-profile-head span {
  border: 1px solid #111;
  border-radius: 999px;
  height: max-content;
  padding: 4px 10px;
}

.print-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.print-certificates {
  border-top: 1px solid #ddd;
  padding-top: 10px;
}

.drawer-backdrop {
  display: none;
}

@media print {
  @page {
    margin: 14mm;
  }

  body {
    background: #fff;
  }

  body * {
    visibility: hidden;
  }

  .print-area,
  .print-area * {
    visibility: visible;
  }

  .print-area {
    display: block;
    position: absolute;
    inset: 0;
    padding: 0;
  }

  .print-document {
    display: block;
  }
}

@media (max-width: 860px) {
  .layout {
    display: block;
  }

  .topbar {
    display: flex;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(320px, 86vw);
    z-index: 10;
    transform: translateX(-102%);
    transition: transform 180ms ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .drawer-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    border: 0;
    z-index: 9;
  }

  .content {
    padding: 14px;
  }

  .page-header {
    align-items: stretch;
    flex-direction: column;
  }

  .grid.two,
  .grid.three,
  .grid.four {
    grid-template-columns: 1fr;
  }

  .approval-grid {
    grid-template-columns: 1fr;
  }

  .vehicle-grid {
    grid-template-columns: 1fr;
  }

  .employee-directory {
    grid-template-columns: 1fr;
  }

  .employee-search-row {
    grid-template-columns: 1fr;
  }

  .selection-bar {
    top: 74px;
    align-items: stretch;
    flex-direction: column;
  }

  .week-summary-panel > .row-line {
    align-items: stretch;
    flex-direction: column;
  }

  .week-summary-panel .actions {
    justify-content: space-between;
  }

  .compact-stat-strip {
    grid-template-columns: repeat(auto-fit, minmax(86px, 1fr));
  }

  .compact-stat {
    padding: 8px;
  }

  .compact-stat strong {
    font-size: 1.18rem;
  }

  .employee-row-toggle {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .employee-row-meta {
    grid-column: 2;
    justify-items: start;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    column-gap: 8px;
  }

  .profile-head {
    align-items: flex-start;
  }

  .profile-head .status {
    margin-left: 0;
  }

  .id06-update {
    grid-template-columns: 1fr;
  }

  .leave-single-calendar {
    max-width: none;
    overflow: hidden;
  }

  .grid.four.leave-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .leave-metrics .tile {
    min-height: 104px;
    padding: 12px;
  }

  .leave-metrics .tile strong {
    font-size: 1.8rem;
  }

  .summary-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .summary-item:nth-child(2) {
    border-right: 0;
  }

  .summary-item:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .calendar-head,
  .calendar-grid {
    grid-template-columns: 28px repeat(7, minmax(30px, 1fr));
    gap: 3px;
  }

  .calendar-head span,
  .week-label,
  .day {
    min-height: 34px;
    font-size: 0.8rem;
  }

  .leave-calendar .day {
    min-height: 38px;
    padding-top: 2px;
  }

  .day-count {
    top: 2px;
    right: 2px;
    min-width: 12px;
    height: 12px;
    padding: 0 3px;
    font-size: 0.58rem;
  }

  .day-pending {
    top: 2px;
    left: 2px;
    min-width: 12px;
    height: 12px;
    padding: 0 3px;
    font-size: 0.58rem;
  }

  .leave-popover {
    margin-top: 9px;
    padding: 10px;
  }

  .leave-popover .row,
  .leave-popover .row-line {
    min-width: 0;
  }

  .leave-scroll {
    display: grid;
    overflow-x: visible;
    scroll-snap-type: none;
  }

  .leave-scroll-item {
    width: 100%;
    min-width: 0;
    flex-basis: auto;
  }
}
