:root {
  color-scheme: dark;
  font-family: Arial, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --page: #080909;
  --surface: #101312;
  --surface-raised: #171a18;
  --text: #f4f2ed;
  --muted: #a0a5a1;
  --border: #292e2b;
  --field: #111513;
  --field-border: #3a403c;
  --accent: #c5242b;
  --accent-hover: #dc3036;
  --settings-grid-min: 250px;
  background: var(--page);
  color: var(--text);
}

:root[data-theme="light"] {
  color-scheme: light;
  --page: #f2f4f1;
  --surface: #ffffff;
  --surface-raised: #f4f6f3;
  --text: #202722;
  --muted: #68716b;
  --border: #d9dfda;
  --field: #ffffff;
  --field-border: #c5cec7;
  --accent: #a91f26;
  --accent-hover: #8f1920;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background: var(--page);
  transition: color 180ms ease, background-color 180ms ease;
}

button,
input {
  font: inherit;
}

.login-page {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  isolation: isolate;
  background: var(--page);
}

.login-layout {
  display: grid;
  width: min(100%, 1500px);
  min-height: 100svh;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 430px);
  align-items: center;
  gap: clamp(44px, 8vw, 132px);
  margin: 0 auto;
  padding: 40px clamp(28px, 6vw, 92px);
}

.brand-stage {
  position: relative;
  display: grid;
  min-height: min(760px, 88svh);
  place-items: center;
  overflow: hidden;
}

.brand-stage::after {
  position: absolute;
  top: 10%;
  right: 0;
  bottom: 10%;
  border-right: 1px solid var(--border);
  content: "";
}

.brand-illustration {
  display: block;
  width: min(100%, 440px);
  height: min(76svh, 700px);
  object-fit: contain;
  filter: drop-shadow(0 18px 40px rgb(195 54 15 / 13%));
}

.brand-signature {
  position: absolute;
  bottom: 24px;
  left: clamp(12px, 3vw, 48px);
  display: grid;
  gap: 5px;
}

.brand-signature span:first-child {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.brand-signature span:last-child {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.login-panel {
  width: 100%;
  padding: 18px 0;
}

.panel-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 76px;
}

.wordmark {
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-decoration: none;
  white-space: nowrap;
}

.wordmark > span {
  margin-left: 7px;
  color: #e64a37;
  font-size: 10px;
}

.theme-switch {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  gap: 9px;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 0;
  font-size: 12px;
  cursor: pointer;
}

.theme-switch-track {
  display: inline-flex;
  width: 36px;
  height: 21px;
  align-items: center;
  padding: 3px;
  background: #424844;
  border: 1px solid #5a625c;
  border-radius: 99px;
  transition: background-color 180ms ease;
}

.theme-switch-track > span {
  width: 13px;
  height: 13px;
  background: #f5f3ee;
  border-radius: 50%;
  transform: translateX(14px);
  transition: transform 180ms ease;
}

.theme-switch[aria-checked="false"] .theme-switch-track {
  background: #c5ccc6;
  border-color: #aeb7b0;
}

.theme-switch[aria-checked="false"] .theme-switch-track > span {
  background: #ffffff;
  transform: translateX(0);
}

.eyebrow {
  margin: 0 0 12px;
  color: #e65a3a;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

h1 {
  margin: 0;
  font-size: 36px;
  font-weight: 650;
}

.intro {
  margin: 10px 0 32px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.login-panel form {
  display: grid;
  gap: 10px;
}

label {
  margin-top: 8px;
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
}

input {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  color: var(--text);
  background: var(--field);
  border: 1px solid var(--field-border);
  border-radius: 3px;
}

input:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 3px solid #4f9c8d;
  outline-offset: 3px;
}

.primary-action {
  min-height: 48px;
  margin-top: 14px;
  color: #ffffff;
  background: var(--accent);
  border: 0;
  border-radius: 3px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 150ms ease;
}

.primary-action:hover {
  background: var(--accent-hover);
}

.form-error {
  margin: 0 0 18px;
  padding: 11px 12px;
  color: #ffb2aa;
  background: rgb(197 36 43 / 13%);
  border-left: 3px solid #d53c37;
  font-size: 13px;
  line-height: 1.45;
}

:root[data-theme="light"] .form-error {
  color: #8f1920;
  background: #fff1f0;
}

.dashboard-page {
  position: relative;
  display: grid;
  grid-template-columns: 2cm minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  height: 100svh;
  min-height: 0;
  overflow: hidden;
  background: var(--page);
  transition: grid-template-columns 180ms ease;
}

.dashboard-page > main {
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior-y: contain;
}

.dashboard-sidebar {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  width: 2cm;
  height: 100%;
  min-height: 0;
  justify-content: space-between;
  align-items: center;
  padding: 18px 6px 12px;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--surface);
  border-right: 1px solid var(--border);
  transition: width 180ms ease, padding 180ms ease;
}

.sidebar-header {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.mobile-menu-toggle {
  display: none;
}

.sidebar-brand {
  display: grid;
  width: 100%;
  min-height: 44px;
  place-items: center;
}

.sidebar-logo {
  display: block;
  width: 34px;
  height: 40px;
  object-fit: contain;
}

.sidebar-brand-label {
  display: none;
}

.wordmark > .sidebar-brand-label {
  margin-left: 0;
  color: var(--text);
  font-size: 14px;
}

.wordmark > .sidebar-brand-label > span {
  margin-left: 7px;
  color: #e64a37;
  font-size: 10px;
}

.sidebar-menu-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  width: 100%;
  justify-content: space-between;
  align-items: center;
  margin-top: 24px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.sidebar-link {
  display: flex;
  width: 44px;
  height: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
  transition: all 150ms ease;
}

.sidebar-link:hover {
  color: var(--text);
  background: var(--surface-raised);
  border-color: var(--border);
}

.sidebar-link[aria-current="page"] {
  color: #ffffff;
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 4px 14px rgb(197 36 43 / 35%);
}

.sidebar-svg {
  width: 20px;
  height: 20px;
  flex: none;
  transition: transform 150ms ease;
}

.sidebar-link:hover .sidebar-svg {
  transform: scale(1.08);
}

.sidebar-link[aria-current="page"] .sidebar-svg {
  transform: scale(1.05);
}

.sidebar-link-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.sidebar-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  width: 100%;
}

.sidebar-user {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: transparent;
  padding: 0;
  cursor: default;
}

.sidebar-user img {
  width: 34px;
  height: 34px;
  flex: none;
  object-fit: contain;
  background: #080909;
  border: 1px solid var(--border);
  border-radius: 50%;
}

.sidebar-user-details {
  display: none;
}

.sidebar-logout-form {
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  width: 100%;
}

.logout-button {
  display: flex;
  width: 44px;
  height: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 150ms ease;
}

.logout-button:hover {
  color: #ff8579;
  background: rgba(230, 74, 55, 0.12);
  border-color: rgba(230, 74, 55, 0.4);
}

.logout-svg {
  transition: transform 150ms ease;
}

.logout-button:hover .logout-svg {
  transform: translateX(2px);
}

.dashboard-content {
  position: relative;
  min-height: 100svh;
  isolation: isolate;
}

.dashboard-content::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  background: url("/alshams-line-logo.svg") center 45% / auto min(42vh, 320px) no-repeat;
  content: "";
  opacity: 0.08;
  pointer-events: none;
}

.overview-content {
  width: min(100%, 1100px);
  margin: 0 auto;
  padding: 48px 36px;
}

.overview-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}

.overview-heading .eyebrow {
  margin-bottom: 8px;
}

.overview-heading h1 {
  font-size: 32px;
}

.overview-heading > div > p:last-child {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.overview-link {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  padding: 0 13px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--field-border);
  border-radius: 3px;
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
}

.overview-link:hover {
  background: var(--surface-raised);
}

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

.staff-count-card {
  display: grid;
  min-height: 132px;
  align-content: space-between;
  gap: 24px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 2px solid var(--accent);
  border-radius: 3px;
}

.staff-count-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.staff-count-card strong {
  color: var(--text);
  font-size: 36px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

@media (min-width: 761px) and (hover: hover) and (pointer: fine) {
  .dashboard-page:has(.dashboard-sidebar:hover),
  .dashboard-page:has(.dashboard-sidebar:focus-within) {
    grid-template-columns: 240px minmax(0, 1fr);
  }

  .dashboard-sidebar:hover,
  .dashboard-sidebar:focus-within {
    width: 240px;
    justify-items: stretch;
    padding-right: 14px;
    padding-left: 14px;
  }

  .dashboard-sidebar:hover .sidebar-brand,
  .dashboard-sidebar:focus-within .sidebar-brand {
    display: flex;
    justify-content: flex-start;
    padding-left: 8px;
  }

  .dashboard-sidebar:hover .sidebar-logo,
  .dashboard-sidebar:focus-within .sidebar-logo {
    display: none;
  }

  .dashboard-sidebar:hover .sidebar-brand-label,
  .dashboard-sidebar:focus-within .sidebar-brand-label {
    display: inline;
  }

  .dashboard-sidebar:hover .sidebar-nav,
  .dashboard-sidebar:focus-within .sidebar-nav {
    justify-items: stretch;
  }

  .dashboard-sidebar:hover .sidebar-link,
  .dashboard-sidebar:focus-within .sidebar-link {
    width: 100%;
    justify-content: flex-start;
    gap: 11px;
    padding: 0 13px;
  }

  .dashboard-sidebar:hover .sidebar-link-label,
  .dashboard-sidebar:focus-within .sidebar-link-label {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip-path: none;
    white-space: nowrap;
  }

  .dashboard-sidebar:hover .sidebar-footer,
  .dashboard-sidebar:focus-within .sidebar-footer {
    justify-items: stretch;
  }

  .dashboard-sidebar:hover .sidebar-user > span,
  .dashboard-sidebar:focus-within .sidebar-user > span {
    display: grid;
  }

  .dashboard-sidebar:hover .sidebar-user strong,
  .dashboard-sidebar:focus-within .sidebar-user strong {
    color: var(--text);
    font-size: 13px;
  }

  .dashboard-sidebar:hover .sidebar-user small,
  .dashboard-sidebar:focus-within .sidebar-user small {
    color: var(--muted);
    font-size: 11px;
  }

  .dashboard-sidebar:hover .logout-button,
  .dashboard-sidebar:focus-within .logout-button {
    display: flex;
    width: 100%;
    justify-content: flex-start;
    gap: 11px;
    padding: 0 13px;
  }
}

@media (max-width: 760px) {
  .overview-content {
    padding: 32px 20px;
  }

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

  .dashboard-page {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
  }

  .dashboard-sidebar {
    position: relative;
    display: grid;
    width: 100%;
    height: auto;
    min-height: 0;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    justify-items: stretch;
    align-items: center;
    gap: 14px;
    padding: 16px 20px 12px;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .sidebar-brand {
    display: flex;
    width: fit-content;
    min-height: 0;
  }

  .sidebar-logo {
    display: none;
  }

  .sidebar-brand-label {
    display: inline;
  }

  .sidebar-nav {
    display: flex;
    justify-items: stretch;
    gap: 6px;
    min-width: 0;
  }

  .sidebar-link {
    width: auto;
    min-width: 0;
    min-height: 44px;
    flex: 1;
    justify-content: center;
    padding: 0 12px;
    border-radius: 0;
    border-bottom: 2px solid transparent;
    box-shadow: none;
  }

  .sidebar-icon,
  .logout-icon {
    display: none;
  }

  .sidebar-link-label {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip-path: none;
    white-space: nowrap;
  }

  .sidebar-link[aria-current="page"] {
    border-bottom-color: var(--accent);
  }

  .sidebar-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 0;
    padding-top: 10px;
  }

  .sidebar-user > span {
    display: grid;
    min-width: 0;
    gap: 4px;
  }

  .sidebar-user strong,
  .sidebar-user small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .sidebar-user strong {
    color: var(--text);
    font-size: 13px;
  }

  .sidebar-user small {
    color: var(--muted);
    font-size: 11px;
  }

  .sidebar-footer form {
    flex: none;
  }

  .sidebar-footer .logout-button {
    display: block;
    width: auto;
    min-height: 40px;
    padding: 0 13px;
  }

  .dashboard-content {
    min-height: 0;
  }

  .login-layout {
    display: grid;
    min-height: 100svh;
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    place-items: center;
    padding: 24px;
  }

  .brand-stage {
    display: none;
  }

  .login-panel {
    position: relative;
    z-index: 1;
    width: min(100%, 440px);
    min-width: 0;
    padding: 30px 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-top: 3px solid var(--accent);
  }

  .panel-toolbar {
    margin-bottom: 56px;
  }

}

@media (max-width: 460px) {
  .dashboard-sidebar {
    padding-right: 16px;
    padding-left: 16px;
  }

  .sidebar-user small {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

.settings-content {
  width: min(100%, 960px);
  margin: 0 auto;
  padding: 58px 32px 90px;
}

.settings-heading {
  margin-bottom: 34px;
}

.settings-heading .eyebrow {
  margin-bottom: 9px;
}

.settings-heading h1 {
  font-size: 32px;
}

.settings-heading > p:last-child {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.settings-section {
  padding: 28px 0 32px;
  border-top: 1px solid var(--border);
}

.section-heading {
  margin-bottom: 22px;
}

.section-heading h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 650;
}

.section-heading p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--settings-grid-min)), 1fr));
  gap: 20px 24px;
}

.settings-form label {
  display: grid;
  min-width: 0;
  gap: 8px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.settings-form input:not([type="color"]):not([type="file"]):not([type="checkbox"]):not([type="hidden"]) {
  width: 100%;
  min-height: 44px;
  padding: 9px 11px;
  color: var(--text);
  background: var(--field);
  border: 1px solid var(--field-border);
  border-radius: 2px;
}

.appearance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  align-items: start;
  gap: 32px;
}

.theme-setting {
  display: grid;
  align-content: start;
  justify-items: start;
  gap: 9px;
}

.theme-setting .theme-switch {
  min-height: 42px;
  padding: 0 10px;
  color: var(--text);
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: 3px;
}

.theme-setting .field-hint {
  max-width: 260px;
  line-height: 1.45;
}

.color-setting {
  align-content: start;
}

.color-control {
  display: flex;
  min-height: 46px;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-family: Consolas, monospace;
  font-size: 13px;
}

.color-control input[type="color"] {
  width: 50px;
  height: 42px;
  padding: 3px;
  background: var(--field);
  border: 1px solid var(--field-border);
  border-radius: 3px;
  cursor: pointer;
}

.logo-setting {
  display: grid;
  align-content: start;
  gap: 10px;
}

.field-label {
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.logo-control {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-control img {
  width: 62px;
  height: 62px;
  padding: 6px;
  object-fit: contain;
  background: #080909;
  border: 1px solid var(--border);
  border-radius: 3px;
}

.logo-control input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.file-button {
  display: inline-flex !important;
  min-height: 38px;
  align-items: center;
  padding: 0 12px;
  color: var(--text) !important;
  background: var(--surface-raised);
  border: 1px solid var(--field-border);
  border-radius: 2px;
  cursor: pointer;
}

.logo-control:focus-within .file-button {
  outline: 3px solid #4f9c8d;
  outline-offset: 3px;
}

.field-hint {
  color: var(--muted);
  font-size: 12px;
}

.remove-logo {
  display: inline-flex !important;
  width: fit-content;
  align-items: center;
  gap: 8px !important;
  color: var(--muted) !important;
  font-size: 12px !important;
  font-weight: 400 !important;
}

.settings-form input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent);
}

.password-details {
  border: 1px solid var(--border);
}

.password-details summary {
  padding: 13px 15px;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}

.password-grid {
  padding: 5px 15px 17px;
}

.settings-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.settings-actions .primary-action {
  min-width: 145px;
  margin: 0;
  padding: 0 18px;
}

.form-success {
  margin: 0 0 20px;
  padding: 11px 12px;
  color: #9be1c0;
  background: rgb(31 132 85 / 14%);
  border-left: 3px solid #2f9f6b;
  font-size: 13px;
}

:root[data-theme="light"] .form-success {
  color: #17623d;
}

.staff-content {
  width: min(100%, 1050px);
  margin: 0 auto;
  padding: 42px 32px 72px;
}

.staff-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.staff-heading .eyebrow {
  margin-bottom: 8px;
}

.staff-heading h1 {
  font-size: 32px;
}

.staff-heading > div > p:last-child {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.staff-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.staff-search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 280px;
  max-width: 100%;
}

.staff-search-input {
  width: 100%;
  min-height: 42px;
  padding: 8px 34px 8px 38px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 13px;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.staff-search-input:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 2px rgb(197 36 43 / 20%);
}

.staff-search-wrapper .search-icon {
  position: absolute;
  left: 12px;
  font-size: 14px;
  color: var(--muted);
  pointer-events: none;
  opacity: 0.8;
}

.search-clear-btn {
  position: absolute;
  right: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  border-radius: 50%;
  padding: 0;
  transition: all 120ms ease;
}

.search-clear-btn:hover {
  color: var(--text);
  background: var(--field-border);
}

.add-employee-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 18px;
  font-size: 13px;
  font-weight: 650;
  border-radius: 6px;
  white-space: nowrap;
  margin: 0;
  cursor: pointer;
  box-shadow: 0 2px 8px rgb(197 36 43 / 25%);
}

.add-employee-btn .btn-icon {
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
}

.staff-directory-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 16px;
}

.staff-count {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.staff-count strong {
  color: var(--text);
  font-size: 16px;
}

/* Modal Popup Dialog */
.staff-modal {
  padding: 0;
  border: 0;
  background: transparent;
  max-width: min(94vw, 680px);
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.75);
  margin: auto;
}

.staff-modal::backdrop {
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.modal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  animation: modalScaleIn 180ms ease-out forwards;
}

@keyframes modalScaleIn {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-raised);
}

.modal-header h2 {
  margin: 2px 0 0;
  font-size: 20px;
  font-weight: 650;
}

.modal-close-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  transition: all 120ms ease;
}

.modal-close-btn:hover {
  color: var(--text);
  background: var(--surface);
  border-color: var(--field-border);
}

.modal-card .employee-form {
  display: grid;
  gap: 18px;
  padding: 22px 24px;
  overflow-y: auto;
  border-top: 0;
}

.employee-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 16px 20px;
}

.employee-form-grid .full-width-field {
  grid-column: 1 / -1;
}

.employee-form label {
  display: grid;
  min-width: 0;
  align-content: start;
  gap: 8px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.employee-form input,
.employee-form select {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 9px 12px;
  color: var(--text);
  background: var(--field);
  border: 1px solid var(--field-border);
  border-radius: 4px;
  font: inherit;
  transition: border-color 150ms ease;
}

.employee-form input:focus,
.employee-form select:focus {
  border-color: var(--accent);
  outline: none;
}

.employee-form input[type="file"] {
  padding: 8px;
  font-size: 12px;
}

.employee-form .field-hint {
  font-weight: 400;
  color: var(--muted);
  font-size: 11px;
}

.employee-form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.secondary-action {
  min-height: 44px;
  padding: 0 18px;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--field-border);
  border-radius: 4px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease;
}

.secondary-action:hover {
  background: var(--surface-raised);
  border-color: var(--muted);
}

.employee-form-actions .primary-action {
  min-width: 140px;
  margin: 0;
  padding: 0 20px;
  border-radius: 4px;
}

.employee-list {
  display: grid;
  gap: 12px;
}

.employee-card {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  align-items: start;
  gap: 18px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease, background-color 140ms ease;
  outline: none;
}

.employee-card:hover {
  border-color: var(--field-border);
  background: var(--surface-raised);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

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

.employee-title-link {
  color: inherit;
  text-decoration: none;
  transition: color 140ms ease;
}

.employee-title-link:hover {
  color: var(--accent-hover);
}

.employee-card-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.view-profile-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 14px;
  line-height: 1;
  transition: all 140ms ease;
}

.employee-card:hover .view-profile-arrow {
  color: #ffffff;
  background: var(--accent);
  border-color: var(--accent);
  transform: translateX(3px);
}

.contact-card-link {
  color: var(--text);
  text-decoration-color: var(--field-border);
  text-underline-offset: 3px;
  transition: color 140ms ease;
}

.contact-card-link:hover {
  color: var(--accent-hover);
}

.employee-photo {
  width: 68px;
  height: 68px;
  object-fit: cover;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.employee-card-main {
  min-width: 0;
}

.employee-card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.employee-id {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.employee-id strong {
  margin-left: 5px;
  color: var(--text);
  font-size: 11px;
}

.employee-card h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 650;
}

.employee-role {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.employee-status {
  flex: none;
  padding: 5px 9px;
  color: #9be1c0;
  background: rgb(31 132 85 / 14%);
  border: 1px solid rgb(47 159 107 / 35%);
  border-radius: 2px;
  font-size: 11px;
  font-weight: 650;
}

.status-on-leave {
  color: #f0c879;
  background: rgb(197 139 36 / 12%);
  border-color: rgb(197 139 36 / 35%);
}

.status-inactive {
  color: var(--muted);
  background: var(--surface-raised);
  border-color: var(--border);
}

:root[data-theme="light"] .employee-status {
  color: #17623d;
  background: #e9f7ef;
  border-color: #aadabe;
}

:root[data-theme="light"] .status-on-leave {
  color: #78520a;
  background: #fff7df;
  border-color: #e5cf91;
}

.employee-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr));
  gap: 14px 18px;
  margin: 18px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.employee-meta dt {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 11px;
}

.employee-meta dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
}

.employee-meta a {
  color: var(--text);
  text-decoration-color: var(--field-border);
  text-underline-offset: 3px;
}

.employee-empty {
  margin: 0;
  padding: 24px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 14px;
}

/* Employee Detail Page */
.employee-detail-content {
  max-width: 1040px;
  margin: 0 auto;
  padding: 32px 36px 64px;
}

.detail-nav {
  margin-bottom: 22px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  padding: 7px 14px;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  transition: all 140ms ease;
}

.back-link:hover {
  color: var(--text);
  background: var(--surface-raised);
  border-color: var(--field-border);
  transform: translateX(-2px);
}

.employee-hero-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 24px;
}

.employee-hero-cover {
  height: 110px;
  background: linear-gradient(135deg, rgba(197, 36, 43, 0.4) 0%, rgba(20, 24, 22, 0.95) 100%);
  border-bottom: 1px solid var(--border);
}

:root[data-theme="light"] .employee-hero-cover {
  background: linear-gradient(135deg, rgba(197, 36, 43, 0.25) 0%, rgba(235, 240, 237, 0.95) 100%);
}

.employee-hero-body {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  padding: 0 28px 28px;
  margin-top: -46px;
}

.employee-avatar-wrapper {
  position: relative;
  flex: none;
}

.employee-hero-avatar {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 50%;
  background: var(--surface);
  border: 4px solid var(--surface);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.employee-status-badge {
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 3px solid var(--surface);
  background: #2f9f6b;
}

.employee-status-badge.status-on-leave {
  background: #f0c879;
}

.employee-status-badge.status-inactive {
  background: var(--muted);
}

.employee-hero-meta {
  flex: 1;
  min-width: 0;
  padding-top: 50px;
}

.employee-hero-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.employee-id-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 11px;
  margin-bottom: 8px;
}

.employee-id-pill .id-label {
  color: var(--muted);
  font-weight: 700;
  font-size: 9px;
  letter-spacing: 0.05em;
}

.employee-hero-meta h1 {
  margin: 0 0 6px;
  font-size: 28px;
  font-weight: 700;
}

.employee-hero-role {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.employee-hero-role .dept-name {
  color: var(--text);
  font-weight: 550;
}

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

.detail-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
}

.full-span-card {
  grid-column: 1 / -1;
}

.detail-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.header-icon-box {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  color: var(--accent);
}

.detail-card-header h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 650;
}

.detail-info-list {
  display: grid;
  gap: 16px;
  margin: 0;
}

.info-row dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.info-row dd {
  margin: 0;
  color: var(--text);
  font-size: 14px;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  text-decoration: none;
  transition: color 140ms ease;
}

.contact-link:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.system-record-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
}

.system-label {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.system-record-grid p {
  margin: 0;
  font-size: 14px;
  color: var(--text);
}

.code-value {
  font-family: monospace;
  font-size: 12px;
  color: var(--muted);
}

.employee-not-found {
  padding: 48px 24px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.inline-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  text-decoration: none;
  margin-top: 18px;
}

@media (max-width: 768px) {
  .dashboard-page {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    height: 100svh;
    overflow: hidden;
  }

  .dashboard-sidebar {
    width: 100%;
    height: auto;
    min-height: 56px;
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    padding: 10px 16px;
    background: var(--surface);
    border-right: 0;
    border-bottom: 1px solid var(--border);
    overflow: visible;
  }

  .sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 40px;
  }

  .sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    width: auto;
    min-height: auto;
  }

  .sidebar-logo {
    width: 28px;
    height: 32px;
  }

  .sidebar-brand-label {
    display: inline-block;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: var(--text);
  }

  .sidebar-brand-label span {
    color: #e64a37;
    font-size: 10px;
    margin-left: 4px;
  }

  .mobile-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--surface-raised);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    cursor: pointer;
    padding: 0;
    transition: background-color 150ms ease, border-color 150ms ease;
  }

  .mobile-menu-toggle:hover {
    background: var(--field-border);
  }

  .menu-icon-bars {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 18px;
    height: 13px;
  }

  .menu-icon-bars span {
    display: block;
    height: 2px;
    width: 100%;
    background: var(--text);
    border-radius: 2px;
    transition: transform 180ms ease, opacity 180ms ease;
  }

  .dashboard-sidebar.menu-open .menu-icon-bars span:nth-child(1) {
    transform: translateY(5.5px) rotate(45deg);
  }

  .dashboard-sidebar.menu-open .menu-icon-bars span:nth-child(2) {
    opacity: 0;
  }

  .dashboard-sidebar.menu-open .menu-icon-bars span:nth-child(3) {
    transform: translateY(-5.5px) rotate(-45deg);
  }

  .sidebar-menu-content {
    display: none;
    width: 100%;
    flex-direction: column;
    padding: 16px 0 8px;
    gap: 16px;
    border-top: 1px solid var(--border);
    margin-top: 10px;
    animation: sidebarDropdown 180ms ease-out forwards;
  }

  .dashboard-sidebar.menu-open .sidebar-menu-content {
    display: flex;
  }

  .sidebar-nav {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 6px;
    justify-items: stretch;
  }

  .sidebar-link {
    display: flex;
    width: 100%;
    min-height: 46px;
    height: auto;
    align-items: center;
    justify-content: flex-start;
    padding: 0 16px;
    gap: 14px;
    border-radius: 8px;
    color: var(--text);
    background: var(--surface-raised);
    border: 1px solid var(--border);
    font-size: 14px;
    font-weight: 550;
  }

  .sidebar-link:hover {
    background: var(--field-border);
    border-color: var(--muted);
  }

  .sidebar-link[aria-current="page"] {
    background: var(--accent);
    border-color: var(--accent);
    color: #ffffff;
    box-shadow: 0 4px 12px rgb(197 36 43 / 30%);
  }

  .sidebar-link .sidebar-svg {
    width: 20px;
    height: 20px;
  }

  .sidebar-link:hover .sidebar-svg,
  .sidebar-link[aria-current="page"] .sidebar-svg {
    transform: none;
  }

  .sidebar-link-label {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip-path: none;
    white-space: normal;
    font-size: 14px;
    font-weight: 600;
  }

  .sidebar-footer {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 10px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    margin-top: 0;
  }

  .sidebar-user {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    padding: 10px 14px;
    background: var(--surface-raised);
    border: 1px solid var(--border);
    border-radius: 8px;
    width: 100%;
    height: auto;
  }

  .sidebar-user-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    overflow: hidden;
  }

  .sidebar-user-details strong {
    font-size: 13px;
    color: var(--text);
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
  }

  .sidebar-user-details small {
    font-size: 11px;
    color: var(--muted);
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
  }

  .sidebar-logout-form {
    width: 100%;
  }

  .logout-button {
    display: flex;
    width: 100%;
    min-height: 46px;
    height: auto;
    align-items: center;
    justify-content: flex-start;
    gap: 14px;
    padding: 0 16px;
    border-radius: 8px;
    background: transparent;
    border: 1px solid rgba(230, 74, 55, 0.35);
    color: #ff8579;
    font-size: 14px;
    font-weight: 600;
  }

  .logout-button:hover {
    background: rgba(230, 74, 55, 0.12);
    border-color: rgba(230, 74, 55, 0.5);
  }

  .logout-button:hover .logout-svg {
    transform: none;
  }

  .staff-content {
    padding: 24px 16px 44px;
  }

  .settings-content {
    padding: 28px 16px 52px;
  }

  .appearance-grid {
    gap: 20px;
  }

  .employee-detail-content {
    padding: 20px 16px 48px;
  }

  .employee-hero-body {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0 20px 24px;
  }

  .employee-hero-meta {
    padding-top: 14px;
    width: 100%;
  }

  .employee-hero-title-row {
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }

  .employee-detail-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

@keyframes sidebarDropdown {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 520px) {
  .overview-content {
    padding: 26px 16px 40px;
  }

  .overview-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 22px;
  }

  .overview-heading h1 {
    font-size: 28px;
  }

  .staff-count-card {
    min-height: 108px;
    gap: 18px;
    padding: 14px;
  }

  .staff-count-card p {
    font-size: 12px;
  }

  .staff-count-card strong {
    font-size: 30px;
  }

  .staff-content {
    padding: 26px 16px 40px;
  }

  .staff-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 20px;
  }

  .staff-heading h1 {
    font-size: 28px;
  }

  .staff-header-actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .staff-search-wrapper {
    width: 100%;
    min-width: 0;
  }

  .add-employee-btn {
    width: 100%;
    justify-content: center;
  }

  .modal-card {
    max-height: 94vh;
  }

  .modal-header {
    padding: 16px 18px 14px;
  }

  .modal-card .employee-form {
    padding: 16px 18px;
  }

  .employee-form-actions {
    flex-direction: column-reverse;
  }

  .employee-form-actions .secondary-action,
  .employee-form-actions .primary-action {
    width: 100%;
  }

  .employee-card {
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 12px;
    padding: 13px;
  }

  .employee-photo {
    width: 48px;
    height: 48px;
  }

  .employee-card-heading {
    flex-direction: column;
    gap: 10px;
  }

  .employee-meta {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .login-layout {
    min-height: 100svh;
    padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  }

  .login-panel {
    padding: 24px 20px;
  }

  .panel-toolbar {
    margin-bottom: 36px;
  }

  .settings-content {
    padding: 34px 18px 52px;
  }

  .settings-grid {
    gap: 16px;
  }

  .password-grid {
    padding-right: 12px;
    padding-left: 12px;
  }
}

@media (max-width: 520px) and (max-height: 620px) {
  .login-layout {
    align-items: start;
  }

  .login-panel {
    padding-top: 20px;
    padding-bottom: 20px;
  }

  .panel-toolbar {
    margin-bottom: 24px;
  }
}

@media (max-width: 360px) {
  .login-panel {
    padding-right: 16px;
    padding-left: 16px;
  }

  .login-panel h1 {
    font-size: 32px;
  }
}