:root {
  --bg: #f5f8fb;
  --panel: #ffffff;
  --ink: #142033;
  --muted: #647086;
  --line: #d9e2ec;
  --brand: #087f8c;
  --brand-dark: #0b4f5c;
  --accent: #e29a19;
  --rose: #b91c1c;
  --green: #12805c;
  --violet: #6253a4;
  --amber: #ca8a04;
  --soft: #e8f4f6;
  --shadow: 0 16px 38px rgba(17, 32, 48, 0.11);
  --shadow-strong: 0 26px 70px rgba(5, 37, 48, 0.24);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --sidebar-width: 268px;
}

* {
  box-sizing: border-box;
}

@keyframes pageRise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes softZoom {
  from {
    background-size: 100%;
  }
  to {
    background-size: 106%;
  }
}

@keyframes sheen {
  from {
    transform: translateX(-120%) rotate(8deg);
  }
  to {
    transform: translateX(120%) rotate(8deg);
  }
}

@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(21, 128, 61, 0.2);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(21, 128, 61, 0);
  }
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(23, 107, 135, 0.09), transparent 36%),
    linear-gradient(225deg, rgba(217, 119, 6, 0.09), transparent 34%),
    linear-gradient(180deg, #f8fafc 0%, #eef4f8 100%);
  font-family: Arial, Helvetica, sans-serif;
  text-rendering: optimizeLegibility;
}

button,
input,
select {
  font: inherit;
}

button {
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  padding: 9px 16px;
  color: #fff;
  background: linear-gradient(135deg, #176b87, #0f4c5c);
  cursor: pointer;
  font-weight: 700;
  box-shadow: 0 10px 20px rgba(15, 76, 92, 0.2);
  transition: transform 180ms var(--ease), box-shadow 180ms var(--ease), background 180ms var(--ease), border-color 180ms var(--ease);
}

button:hover {
  background: linear-gradient(135deg, #0f4c5c, #0b3945);
  box-shadow: 0 14px 28px rgba(15, 76, 92, 0.26);
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
}

button.secondary {
  color: #7a3e07;
  background: linear-gradient(135deg, #fff7ed, #fef3c7);
  border: 1px solid #f3d39b;
  box-shadow: 0 10px 18px rgba(217, 119, 6, 0.1);
}

button.ghost {
  color: var(--brand-dark);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #c9d7df;
  box-shadow: none;
}

button.danger {
  background: linear-gradient(135deg, #c2410c, #991b1b);
}

button:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  box-shadow: none;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--ink);
  background: #fff;
  transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease), background 160ms var(--ease);
}

input:focus,
select:focus {
  border-color: #176b87;
  box-shadow: 0 0 0 4px rgba(23, 107, 135, 0.14);
  outline: none;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
.file-button:focus-within {
  outline: 3px solid rgba(245, 158, 11, 0.38);
  outline-offset: 2px;
}

.hidden {
  display: none !important;
}

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(420px, 0.9fr) minmax(560px, 1.1fr);
  align-items: stretch;
  gap: 24px;
  padding: 22px;
  overflow: hidden;
  background:
    radial-gradient(circle at 15% 20%, rgba(236, 253, 245, 0.72), transparent 30%),
    radial-gradient(circle at 90% 12%, rgba(254, 243, 199, 0.54), transparent 28%),
    linear-gradient(135deg, #ecfdf5 0%, #f8fafc 48%, #e8f4f6 100%);
  position: relative;
}

.login-page::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(23, 107, 135, 0.16), transparent 42%),
    linear-gradient(315deg, rgba(217, 119, 6, 0.14), transparent 38%);
  pointer-events: none;
}

.login-page::after {
  content: "";
  position: absolute;
  width: 42%;
  height: 130%;
  top: -15%;
  left: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
  opacity: 0.45;
  transform: translateX(-120%) rotate(8deg);
  animation: sheen 9s ease-in-out infinite;
  pointer-events: none;
}

.site-banner {
  width: min(1500px, 100%);
  overflow: hidden;
  border-radius: 8px;
  background: #111827;
  box-shadow: var(--shadow);
}

.site-banner img {
  display: block;
  width: 100%;
  height: auto;
}

.login-banner {
  width: min(1180px, 100%);
  border: 1px solid rgba(0, 77, 64, 0.22);
  box-shadow: 0 20px 50px rgba(0, 45, 39, 0.2);
}

.dashboard-banner {
  margin-bottom: 18px;
}

.login-box {
  position: relative;
  z-index: 1;
  align-self: stretch;
  justify-self: stretch;
  width: 100%;
  min-height: calc(100vh - 44px);
  display: grid;
  align-content: center;
  padding: clamp(30px, 5vw, 72px);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(236, 253, 245, 0.86)),
    rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow-strong);
  backdrop-filter: blur(16px) saturate(1.24);
  animation: pageRise 520ms var(--ease) both;
  overflow: hidden;
}

.login-content {
  width: min(620px, 100%);
}

.login-visual {
  position: relative;
  z-index: 1;
  min-height: calc(100vh - 44px);
  overflow: hidden;
  border-radius: 18px;
  display: grid;
  place-items: center;
  padding: 16px;
  background:
    linear-gradient(135deg, #05221f, #0f3b36),
    #061f1c;
  box-shadow: var(--shadow-strong);
  animation: pageRise 650ms var(--ease) 120ms both;
}

.login-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(4, 20, 26, 0.28), transparent 36%),
    linear-gradient(180deg, transparent 62%, rgba(2, 44, 34, 0.28));
  pointer-events: none;
}

.login-visual img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  object-position: center;
  border-radius: 12px;
  background: #061f1c;
  filter: saturate(1.08) contrast(1.04);
  animation: softZoom 18s var(--ease) alternate infinite;
}

.login-box::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, #0f766e, #f59e0b, #b91c1c);
}

.login-kicker {
  width: fit-content;
  margin-bottom: 18px;
  padding: 8px 12px;
  border-radius: 999px;
  color: #0f4c5c;
  background: rgba(232, 244, 246, 0.82);
  border: 1px solid rgba(127, 179, 193, 0.52);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.login-box h1 {
  margin: 0;
  max-width: 460px;
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1.08;
  color: #064e3b;
  letter-spacing: 0;
}

.login-box p {
  margin: 10px 0 22px;
  color: #334155;
  font-weight: 700;
}

.powered-by {
  display: inline-block;
  margin: 0 0 16px;
  padding: 7px 12px;
  border-radius: 999px;
  color: #065f46;
  background: linear-gradient(135deg, #ecfdf5, #fffaf0);
  border: 1px solid rgba(52, 211, 153, 0.55);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.2px;
  box-shadow: 0 8px 18px rgba(6, 95, 70, 0.08);
}

.form-stack {
  width: min(460px, 100%);
  display: grid;
  gap: 14px;
}

.login-form-card {
  padding: 18px;
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(248, 250, 252, 0.58));
  border: 1px solid rgba(217, 226, 236, 0.72);
  box-shadow: 0 20px 44px rgba(15, 76, 92, 0.1);
}

.forgot-box {
  width: min(460px, 100%);
  margin-top: 22px;
  border-top: 1px solid var(--line);
  padding: 16px 18px 0;
  border-radius: 0 0 12px 12px;
}

.forgot-box summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 700;
  transition: color 160ms var(--ease), transform 160ms var(--ease);
}

.forgot-box summary:hover {
  color: #9a3412;
  transform: translateX(2px);
}

.message {
  min-height: 20px;
  color: var(--accent) !important;
  font-weight: 700;
}

.storage-status {
  display: block;
  width: min(460px, 100%);
  margin: 0 0 16px;
  padding: 10px 12px;
  border-radius: 9px;
  color: #064e3b;
  background: rgba(209, 250, 229, 0.86);
  border: 1px solid #a7f3d0;
  font-size: 12px;
  font-weight: 800;
  animation: pulseGlow 2.8s ease-in-out infinite;
}

.storage-status.error {
  color: #7f1d1d;
  background: rgba(254, 226, 226, 0.9);
  border-color: #fecaca;
}

.app-page {
  width: min(1500px, 100%);
  margin: 0 auto;
  padding: 22px;
  animation: pageRise 420ms var(--ease) both;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 230px;
  padding: 22px 24px;
  border-radius: 8px;
  color: #fff;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.78) 0%, rgba(0, 0, 0, 0.38) 42%, rgba(0, 0, 0, 0.12) 100%),
    url("../../assets/images/rescue-service-1122-banner.png") center center / contain no-repeat,
    #050607;
  box-shadow: var(--shadow-strong);
  overflow: hidden;
  position: relative;
}

.topbar::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 4px;
  background: linear-gradient(90deg, #0f766e, #f59e0b, #b91c1c);
}

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

.topbar h1 {
  color: #fff;
  text-shadow: 0 3px 12px rgba(0, 0, 0, 0.62);
}

.topbar h1,
.topbar p {
  margin: 0;
}

.topbar p {
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.84);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.58);
}

.topbar-credit {
  margin: 9px 0 0;
  color: #fff8e7;
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.28);
}

.topbar-status {
  width: fit-content;
  margin: 8px 0 0;
  color: #ecfdf5;
  background: rgba(6, 78, 59, 0.42);
  border-color: rgba(209, 250, 229, 0.34);
}

.topbar-status.error {
  color: #fff1f2;
  background: rgba(127, 29, 29, 0.48);
  border-color: rgba(254, 202, 202, 0.45);
}

.tabs {
  display: flex;
  gap: 10px;
  margin: 18px 0;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.tab {
  flex: 0 0 auto;
  color: var(--brand-dark);
  background: #fff;
  border: 1px solid #d4e0e7;
  box-shadow: 0 8px 18px rgba(23, 107, 135, 0.08);
  transition: transform 180ms var(--ease), box-shadow 180ms var(--ease), background 180ms var(--ease), color 180ms var(--ease);
}

.tab.active {
  color: #fff;
  background: linear-gradient(135deg, #176b87, #0f4c5c);
  border-color: transparent;
  box-shadow: 0 13px 26px rgba(23, 107, 135, 0.22);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  animation: pageRise 280ms var(--ease) both;
}

.toolbar,
.employee-form {
  padding: 18px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(217, 226, 236, 0.9);
  box-shadow: var(--shadow);
  transition: transform 180ms var(--ease), box-shadow 180ms var(--ease), border-color 180ms var(--ease);
}

.toolbar:hover,
.employee-form:hover,
.summary-layout article:hover,
.table-wrap:hover,
.stats-grid div:hover {
  border-color: rgba(23, 107, 135, 0.24);
  box-shadow: 0 20px 46px rgba(20, 33, 61, 0.14);
}

.toolbar {
  display: grid;
  grid-template-columns: 160px minmax(220px, 1fr) repeat(7, minmax(112px, auto));
  gap: 14px;
  align-items: end;
}

.incident-toolbar {
  grid-template-columns: minmax(220px, 1fr) repeat(4, minmax(130px, auto));
}

.employee-toolbar {
  grid-template-columns: 180px minmax(220px, 1fr) auto;
}

.leave-filter-toolbar {
  grid-template-columns: minmax(240px, 1fr) minmax(160px, 220px) minmax(160px, 220px) auto;
}

.leave-filter-toolbar button {
  min-height: 52px;
  padding-inline: 24px;
}

.filter-count {
  align-self: end;
  min-height: 40px;
  display: inline-grid;
  place-items: center;
  padding: 8px 12px;
  border-radius: 6px;
  color: var(--brand-dark);
  background: #e8f4f6;
  border: 1px solid #b8d5dd;
  font-size: 13px;
  font-weight: 800;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(120px, 1fr));
  gap: 12px;
}

.stats-grid div {
  min-height: 82px;
  padding: 15px;
  border-left: 5px solid var(--brand);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
  transition: transform 180ms var(--ease), box-shadow 180ms var(--ease);
}

.stats-grid div:hover {
  transform: translateY(-2px);
}

.stats-grid div:nth-child(1) {
  border-color: #176b87;
  background: linear-gradient(135deg, #f0f9fb, #dff0f4);
}

.stats-grid div:nth-child(2) {
  border-color: #15803d;
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
}

.stats-grid div:nth-child(3) {
  border-color: #991b1b;
  background: linear-gradient(135deg, #fff5f5, #fee2e2);
}

.stats-grid div:nth-child(4) {
  border-color: #d97706;
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
}

.stats-grid div:nth-child(5) {
  border-color: #5b4b8a;
  background: linear-gradient(135deg, #f6f4fb, #ebe7f5);
}

.stats-grid div:nth-child(6) {
  border-color: #64748b;
  background: linear-gradient(135deg, #f8fafc, #e2e8f0);
}

.stats-grid div:nth-child(7) {
  border-color: #ca8a04;
  background: linear-gradient(135deg, #fff7ed, #ffedd5);
}

.incident-stats div:nth-child(3) {
  border-color: #7c3aed;
  background: linear-gradient(135deg, #f5f3ff, #ede9fe);
}

.incident-form {
  grid-template-columns: 1fr;
}

.stats-grid strong {
  display: block;
  font-size: 28px;
  color: #111827;
}

.stats-grid span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.table-wrap {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: var(--shadow);
  transition: box-shadow 180ms var(--ease), border-color 180ms var(--ease);
}

.table-wrap.compact {
  box-shadow: none;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  text-align: left;
  vertical-align: middle;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: #ffffff;
  background: linear-gradient(135deg, #0f4c5c, #176b87);
  font-size: 13px;
}

tbody tr:nth-child(even) {
  background: #f8fafc;
}

tbody tr:hover {
  background: #edf8fb;
}

tr:last-child td {
  border-bottom: 0;
}

.status-select {
  max-width: 110px;
  font-weight: 800;
  color: var(--brand-dark);
  background: #e8f4f6;
  border-color: #b8d5dd;
}
.replacement-details {
  min-width: 190px;
  max-width: 260px;
  background: #fffdf7;
}

.replacement-details:disabled {
  background: #f1f5f9;
  color: var(--muted);
}

.summary-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 18px;
}

.summary-layout article {
  padding: 18px;
  min-width: 0;
  max-width: 100%;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid rgba(217, 226, 236, 0.9);
  box-shadow: var(--shadow);
  transition: transform 180ms var(--ease), box-shadow 180ms var(--ease), border-color 180ms var(--ease);
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-heading h2 {
  margin: 0;
  font-size: 18px;
  color: var(--brand-dark);
}

.section-heading span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.special-list {
  display: grid;
  gap: 10px;
}

.special-card {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 10px;
  padding: 12px;
  border: 1px solid #efd2a9;
  border-radius: 8px;
  background: linear-gradient(135deg, #fffaf0, #f8fafc);
  transition: transform 180ms var(--ease), box-shadow 180ms var(--ease);
}

.special-card:hover {
  transform: translateX(2px);
  box-shadow: 0 12px 24px rgba(154, 52, 18, 0.12);
}

.special-card strong {
  display: grid;
  place-items: center;
  min-height: 42px;
  border-radius: 6px;
  color: #fff;
  background: linear-gradient(135deg, #d97706, #9a3412);
}

.special-card span {
  color: var(--muted);
  font-size: 13px;
}

.employee-form {
  display: grid;
  grid-template-columns: 1fr 180px;
  gap: 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 14px;
}

.photo-editor {
  display: grid;
  align-content: start;
  gap: 12px;
}

.photo-preview {
  width: 150px;
  height: 180px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 2px dashed #7fb3c1;
  border-radius: 6px;
  color: var(--brand-dark);
  background: linear-gradient(135deg, #e8f4f6, #fff7ed);
  font-weight: 700;
  transition: border-color 180ms var(--ease), transform 180ms var(--ease), box-shadow 180ms var(--ease);
}

.photo-preview:hover {
  border-color: #176b87;
  box-shadow: 0 12px 26px rgba(23, 107, 135, 0.14);
  transform: translateY(-1px);
}

.photo-preview img,
.employee-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.leave-preview {
  width: 170px;
  height: 190px;
}

.leave-overview {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.leave-overview div {
  padding: 14px;
  border: 1px solid #d7e5e7;
  border-radius: 8px;
  background: #f8fbfb;
}

.leave-overview strong {
  display: block;
  color: var(--brand-dark);
  font-size: 24px;
}

.leave-overview span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.leave-notifications {
  display: grid;
  gap: 10px;
  margin: 0 0 18px;
  padding: 14px;
  border: 1px solid #f4c7a1;
  border-radius: 8px;
  background: #fff7ed;
}

.leave-notifications h2 {
  margin: 0;
  color: #9a3412;
  font-size: 16px;
}

.leave-alert {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 6px;
  background: #ffffff;
}

.leave-alert span {
  color: var(--muted);
  font-weight: 700;
}

.file-preview {
  display: grid;
  gap: 8px;
  padding: 12px;
  text-align: center;
  word-break: break-word;
}

.file-preview strong {
  display: inline-grid;
  place-items: center;
  min-height: 42px;
  border-radius: 6px;
  color: #ffffff;
  background: linear-gradient(135deg, #b91c1c, #7f1d1d);
}

.file-preview span {
  color: var(--muted);
  font-size: 12px;
}

.form-thumb {
  display: block;
  width: 72px;
  height: 86px;
  padding: 0;
  overflow: hidden;
  border: 2px solid #c6dce3;
  border-radius: 4px;
  background: #f0f7f9;
  box-shadow: none;
  cursor: pointer;
}

.form-thumb:hover {
  background: #e8f4f6;
  border-color: var(--accent);
  box-shadow: none;
}

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

.document-link {
  color: var(--brand-dark);
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
  font-weight: 800;
  text-decoration: underline;
  cursor: pointer;
}

.document-link:hover {
  color: var(--primary);
  background: transparent;
  box-shadow: none;
}

.file-button {
  color: var(--brand-dark);
  background: linear-gradient(135deg, #e8f4f6, #f8fafc);
  border: 1px solid #b8d5dd;
  border-radius: 6px;
  padding: 10px;
  text-align: center;
  cursor: pointer;
  transition: transform 180ms var(--ease), box-shadow 180ms var(--ease), border-color 180ms var(--ease);
}

.file-button:hover {
  border-color: #176b87;
  box-shadow: 0 10px 20px rgba(23, 107, 135, 0.12);
  transform: translateY(-1px);
}

.file-button input {
  display: none;
}

.form-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(11, 31, 58, 0.62);
}

.form-modal-card {
  width: min(920px, 96vw);
  max-height: 92vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(11, 31, 58, 0.28);
  overflow: hidden;
}

.form-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.form-modal-head strong {
  color: var(--primary);
}

.form-modal-body {
  min-height: 320px;
  overflow: auto;
  padding: 16px;
  background: #f8fafc;
}

.form-modal-body img,
.form-modal-body iframe {
  display: block;
  width: 100%;
  min-height: 70vh;
  border: 0;
  border-radius: 8px;
  background: #ffffff;
  object-fit: contain;
}

.actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.actions > button,
.actions > .file-button {
  flex: 0 1 auto;
}

.incident-form-actions {
  justify-content: flex-end;
  padding-top: 4px;
}

.incident-form-actions button {
  min-width: 150px;
}

.performance-proforma-card {
  display: grid;
  gap: 18px;
  margin-bottom: 18px;
  border-color: rgba(15, 95, 109, 0.16);
  background: linear-gradient(180deg, #ffffff 0%, #f8fbfc 100%);
}

.performance-toolbar {
  display: grid;
  gap: 16px;
}

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

.performance-page-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-weight: 700;
}

.performance-kpi-grid {
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  margin-bottom: 18px;
}

.performance-main-grid,
.performance-monthly-grid {
  display: grid;
  grid-template-columns: minmax(360px, 0.95fr) minmax(420px, 1.05fr);
  gap: 18px;
  align-items: start;
}

.daily-performance-card,
.monthly-performance-card,
.performance-history-card {
  display: grid;
  gap: 16px;
  margin-bottom: 18px;
  border-color: rgba(15, 95, 109, 0.16);
  background: linear-gradient(180deg, #ffffff 0%, #f8fbfc 100%);
}

.daily-performance-grid {
  grid-template-columns: repeat(4, minmax(170px, 1fr));
}

.daily-performance-criteria-wrap {
  box-shadow: none;
}

.daily-performance-criteria-wrap table {
  min-width: 0;
}

.daily-performance-criteria-wrap th,
.daily-performance-criteria-wrap td {
  text-align: center;
  padding: 10px 9px;
}

.daily-performance-criteria-wrap td:nth-child(2) {
  text-align: left;
  font-weight: 800;
  color: var(--primary);
}

.daily-performance-mark {
  width: 64px;
  height: 38px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #ffffff;
  color: var(--primary);
  font-size: 16px;
  font-weight: 800;
  text-align: center;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.daily-performance-mark::placeholder {
  color: #94a3b8;
}

.daily-performance-mark:hover {
  border-color: #94a3b8;
}

.daily-performance-mark:focus {
  border-color: #0f5f6d;
  box-shadow: 0 0 0 3px rgba(15, 95, 109, 0.16);
}

.daily-performance-criterion-remark {
  width: 100%;
  min-width: 110px;
  height: 36px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #ffffff;
  color: var(--primary);
  font-weight: 700;
  padding: 0 10px;
}

.daily-performance-remarks {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 800;
}

.daily-performance-remarks textarea {
  resize: vertical;
  min-height: 58px;
}

.daily-performance-total {
  grid-template-columns: repeat(4, minmax(110px, 1fr));
}

.daily-performance-message {
  min-height: 20px;
  margin: 0;
  font-weight: 800;
  color: var(--muted);
}

.daily-performance-message.success {
  color: #12805c;
}

.daily-performance-message.error {
  color: #dc2626;
}

.daily-performance-save-row {
  justify-content: stretch;
}

.daily-performance-save-row button {
  width: 100%;
  background: #087f8c;
}

.performance-history-filters {
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  padding: 12px;
}

.performance-history-card .performance-table-wrap {
  box-shadow: none;
}

.performance-history-card .performance-table-wrap table {
  min-width: 880px;
}

.performance-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.performance-pagination div {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.performance-pagination button {
  min-width: 32px;
  min-height: 32px;
  padding: 5px 9px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #ffffff;
  color: var(--primary);
  font-weight: 800;
}

.performance-pagination button.active {
  border-color: #087f8c;
  background: #087f8c;
  color: #ffffff;
}

.performance-pagination button:disabled {
  cursor: default;
  opacity: 0.45;
}

.performance-summary-grid,
.employee-performance-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  gap: 12px;
}

.performance-summary-grid article,
.employee-performance-summary div {
  display: grid;
  gap: 6px;
  min-height: 86px;
  padding: 14px;
  border: 1px solid var(--border);
  border-left: 4px solid #0f5f6d;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.performance-summary-grid span,
.employee-performance-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.performance-summary-grid strong,
.employee-performance-summary strong {
  color: var(--primary);
  font-size: 24px;
}

#performanceProformaTab,
#performanceProformaTab * {
  box-sizing: border-box;
}

#performanceProformaTab {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

#performanceProformaTab .panel-heading,
#performanceProformaTab .analytics-card,
#performanceProformaTab .table-wrap,
#performanceProformaTab .performance-main-grid,
#performanceProformaTab .performance-monthly-grid,
#performanceProformaTab .daily-performance-card,
#performanceProformaTab .performance-history-card,
#performanceProformaTab .monthly-performance-card,
#performanceProformaTab .graph-card {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

#performanceProformaTab .performance-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

#performanceProformaTab .performance-main-grid {
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.35fr);
  gap: 20px;
}

#performanceProformaTab .performance-monthly-grid {
  grid-template-columns: minmax(300px, 0.75fr) minmax(0, 1.75fr);
  gap: 20px;
}

#performanceProformaTab .performance-main-grid > *,
#performanceProformaTab .performance-monthly-grid > * {
  min-width: 0;
}

#performanceProformaTab .daily-performance-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

#performanceProformaTab label,
#performanceProformaTab input,
#performanceProformaTab select,
#performanceProformaTab textarea,
#performanceProformaTab button {
  max-width: 100%;
}

#performanceProformaTab input,
#performanceProformaTab select,
#performanceProformaTab textarea {
  width: 100%;
  min-width: 0;
}

#performanceProformaTab .daily-performance-total {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

#performanceProformaTab .monthly-performance-card .performance-summary-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

#performanceProformaTab .daily-performance-remarks textarea {
  width: 100%;
  max-width: 100%;
  min-height: 90px;
}

#performanceProformaTab #savePerformanceBtn {
  width: 100%;
  min-height: 50px;
}

#performanceProformaTab .performance-history-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

#performanceProformaTab .performance-history-card {
  overflow: hidden;
}

#performanceProformaTab .performance-history-card .performance-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

#performanceProformaTab .performance-history-card .performance-table-wrap table {
  min-width: 900px;
}

#performanceProformaTab .graph-card {
  overflow: hidden;
}

#performanceProformaTab .graph-card canvas {
  width: 100% !important;
  max-width: 100%;
}

.performance-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
}

.performance-actions {
  justify-content: flex-end;
}

.performance-variable-editor {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
}

.performance-variable-editor summary {
  cursor: pointer;
  color: var(--primary);
  font-weight: 800;
}

.performance-variable-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.performance-grid {
  display: grid;
  grid-template-columns: minmax(320px, 860px);
  justify-content: center;
  gap: 18px;
}

#performanceTrendChart {
  width: 100% !important;
  height: 190px !important;
  max-height: 190px;
}

.performance-alert-card .notification-list {
  max-height: 210px;
  overflow: auto;
}

.performance-ranking-card {
  padding: 18px;
}

.performance-ranking {
  display: grid;
  gap: 8px;
}

.performance-rank-row {
  display: grid;
  grid-template-columns: 42px 1fr 80px 70px 70px 120px;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #e6edf3;
  border-radius: 8px;
  background: #f8fbfc;
  color: var(--primary);
}

.performance-rank-row small,
.performance-rank-row em {
  color: var(--muted);
  font-style: normal;
  font-weight: 700;
}

.performance-table-wrap table tbody tr {
  cursor: pointer;
}

.performance-table-wrap td {
  text-align: center;
  vertical-align: middle;
}

.performance-table-wrap td:nth-child(2),
.performance-table-wrap td:nth-child(3),
.performance-table-wrap td:nth-child(16),
.performance-table-wrap td:nth-child(17) {
  text-align: left;
}

.performance-mark-input {
  width: 46px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #ffffff;
  color: var(--primary);
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
  text-align: center;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.performance-mark-input::placeholder {
  color: #94a3b8;
  font-weight: 800;
}

.performance-mark-input:hover {
  border-color: #94a3b8;
}

.performance-mark-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(11, 31, 58, 0.14);
}

.performance-mark-input[readonly] {
  cursor: default;
  background: #f8fafc;
  color: #475569;
}

.performance-mark-input::-webkit-outer-spin-button,
.performance-mark-input::-webkit-inner-spin-button {
  margin: 0;
  appearance: none;
}

.performance-mini-result {
  display: inline-grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 2px 8px;
  min-width: 118px;
  padding: 7px 9px;
  border: 1px solid #d8e6ea;
  border-radius: 8px;
  background: #f8fbfc;
  color: var(--primary);
  text-align: left;
  box-shadow: none;
}

.performance-mini-result:hover {
  border-color: #9fc3cc;
  background: #ffffff;
}

.performance-mini-result strong {
  font-size: 15px;
}

.performance-mini-result span,
.performance-mini-result em {
  color: #64748b;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.performance-mini-result em {
  grid-column: 1 / -1;
}

.performance-mini-result.pending {
  display: inline-flex;
  justify-content: center;
  min-width: 86px;
  background: #eef2f6;
  color: #64748b;
  font-weight: 800;
}

.roster-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.roster-form .section-heading {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  margin-bottom: 0;
}

.roster-form .form-grid {
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  align-items: end;
}

.roster-form .actions {
  justify-content: flex-end;
}

.roster-toolbar {
  grid-template-columns: repeat(3, minmax(180px, 1fr));
}

.roster-duty-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 9px;
  border-radius: 999px;
  background: #e8f5f7;
  color: #0b4f5c;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.roster-punishment-chip {
  background: #fdecec;
  color: #b42318;
}

.roster-table-wrap td:nth-child(3),
.roster-table-wrap td:nth-child(8) {
  min-width: 160px;
}

.roster-table-wrap th,
.roster-table-wrap td {
  text-align: center;
  vertical-align: middle;
  padding: 12px 10px;
  font-size: 13px;
}

.roster-table-wrap th:nth-child(2),
.roster-table-wrap td:nth-child(2),
.roster-table-wrap th:nth-child(5),
.roster-table-wrap td:nth-child(5) {
  text-align: left;
}

.roster-table-wrap th:nth-child(1),
.roster-table-wrap td:nth-child(1) {
  width: 54px;
}

.roster-table-wrap th:nth-child(2),
.roster-table-wrap td:nth-child(2),
.roster-table-wrap th:nth-child(7),
.roster-table-wrap td:nth-child(7) {
  white-space: nowrap;
}

.roster-final-select {
  width: 132px;
  min-height: 36px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #ffffff;
  color: #0b1f3a;
  font-weight: 800;
  text-align: center;
}

.roster-dayoff-input {
  width: 96px;
  min-height: 36px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #ffffff;
  color: #0b1f3a;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.roster-dayoff-input:hover {
  border-color: #94a3b8;
}

.roster-dayoff-input:focus {
  outline: none;
  border-color: #0b1f3a;
  box-shadow: 0 0 0 3px rgba(11, 31, 58, 0.12);
}

.roster-final-select:focus {
  outline: none;
  border-color: #0b1f3a;
  box-shadow: 0 0 0 3px rgba(11, 31, 58, 0.12);
}

.roster-trend,
.roster-status,
.roster-score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 74px;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  background: #eef2f6;
  color: #475569;
}

.roster-trend.up,
.roster-status.published,
.roster-status.high,
.roster-score.high {
  background: #eafaf1;
  color: #166534;
}

.roster-status.mid,
.roster-score.mid {
  background: #fff7e6;
  color: #9a6500;
}

.roster-status.pending,
.roster-score.pending,
.roster-status.draft {
  background: #eef2f6;
  color: #475569;
}

.roster-trend.down,
.roster-status.review,
.roster-status.low,
.roster-score.low {
  background: #fdecec;
  color: #b42318;
}

.roster-calendar-wrap {
  margin-top: 20px;
  overflow-x: auto;
}

.roster-calendar-wrap table {
  min-width: 1180px;
}

.roster-calendar-wrap th,
.roster-calendar-wrap td {
  text-align: center;
  padding: 8px 6px;
  font-size: 12px;
}

.roster-calendar-wrap th:first-child,
.roster-calendar-wrap td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 170px;
  text-align: left;
  background: #ffffff;
}

.roster-day-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: #f1f5f9;
  color: #334155;
  font-weight: 900;
}

.roster-day-code.f,
.roster-day-code.s {
  background: #e8f5f7;
  color: #0b4f5c;
}

.roster-day-code.t {
  background: #fdecec;
  color: #b42318;
}

.roster-day-code.l,
.roster-day-code.gh,
.roster-day-code.do {
  background: #fff7e6;
  color: #9a6500;
}

.review-field {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  color: #64748b;
  font-weight: 800;
}

.roster-check-field {
  display: flex;
  grid-template-columns: none;
  align-items: center;
}

.official-roster-panel {
  margin-top: 20px;
}

.roster-final-approval {
  display: flex;
  justify-content: flex-end;
  margin: 22px 0 8px;
}

.roster-final-approval button {
  min-width: 190px;
  min-height: 48px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 900;
  box-shadow: 0 12px 24px rgba(227, 27, 35, 0.18);
}

.official-roster-document {
  background: #ffffff;
  color: #000000;
  border: 1px solid #111111;
  padding: 22px;
  font-family: Arial, sans-serif;
}

.official-roster-document header {
  display: grid;
  grid-template-columns: 72px 1fr;
  align-items: center;
  gap: 16px;
  text-align: center;
  margin-bottom: 16px;
}

.official-logo {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border: 2px solid #111111;
  border-radius: 50%;
  font-weight: 900;
}

.official-roster-document h2,
.official-roster-document h3,
.official-roster-document h4 {
  margin: 2px 0;
  font-family: Arial, sans-serif;
  font-weight: 900;
  color: #000000;
}

.official-roster-document h2 {
  font-size: 17px;
}

.official-roster-document h3 {
  font-size: 15px;
  text-decoration: underline;
}

.official-roster-document h4 {
  font-size: 13px;
}

.official-roster-totals {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  margin: 8px 0 12px;
  border: 1px solid #000000;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.official-roster-totals span {
  padding: 6px 4px;
  border-right: 1px solid #000000;
}

.official-roster-totals span:last-child {
  border-right: none;
}

.official-roster-section {
  margin-top: 14px;
  page-break-inside: avoid;
}

.official-roster-section h3 {
  margin: 0;
  padding: 7px 8px;
  border: 1px solid #000000;
  border-bottom: none;
  text-align: center;
  font-size: 13px;
  text-decoration: none;
}

.official-roster-section table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.official-roster-section th,
.official-roster-section td {
  border: 1px solid #000000;
  padding: 6px 7px;
  font-size: 12px;
  line-height: 1.2;
  text-align: center;
  color: #000000;
}

.official-roster-section th:nth-child(2),
.official-roster-section td:nth-child(2),
.official-roster-section th:nth-child(3),
.official-roster-section td:nth-child(3) {
  text-align: left;
}

.official-roster-document footer {
  display: grid;
  grid-template-columns: 1fr 230px;
  gap: 18px;
  align-items: end;
  margin-top: 24px;
  font-weight: 800;
}

.official-sign {
  text-align: center;
  padding-top: 34px;
}

.official-sign strong,
.official-sign span {
  display: block;
}

@media print {
  body * {
    visibility: hidden !important;
  }
  #officialRosterPanel,
  #officialRosterPanel * {
    visibility: visible !important;
  }
  #officialRosterPanel {
    position: absolute;
    inset: 0;
    margin: 0;
    padding: 0;
    background: #ffffff;
  }
  .official-roster-document {
    border: none;
    box-shadow: none;
    padding: 10mm;
  }
  .official-roster-section {
    page-break-inside: avoid;
  }
}

.wide-field {
  grid-column: span 2;
}

.performance-grade {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #e8f5f7;
  color: #0b4f5c;
  font-size: 12px;
  font-weight: 800;
}

.grade-excellent { background: #e8f8ee; color: #166534; }
.grade-very-good,
.grade-good { background: #e8f5f7; color: #0f5f6d; }
.grade-satisfactory { background: #fff7e6; color: #9a5d00; }
.grade-needs-improvement,
.grade-poor { background: #fdecec; color: #b42318; }
.grade-unassessed { background: #eef2f6; color: #64748b; }

.performance-unassessed-row {
  background: #fbfdff;
  color: #64748b;
}

.performance-modal-card {
  width: min(980px, 96vw);
}

.performance-modal-body {
  display: grid;
  gap: 16px;
}

.performance-employee-strip,
.performance-live-total,
.performance-detail-score {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid #d8e6ea;
  border-radius: 8px;
  background: #f5fafb;
  color: var(--primary);
  font-weight: 700;
}

.performance-live-total {
  justify-content: flex-end;
}

.performance-live-total span,
.performance-detail-score span,
.performance-detail-score em {
  color: var(--muted);
  font-style: normal;
  font-weight: 800;
}

.performance-live-total strong,
.performance-detail-score strong {
  color: #0f5f6d;
  font-size: 20px;
}

.performance-detail-head h3 {
  margin: 0 0 4px;
  color: var(--primary);
}

.performance-detail-head p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.performance-detail-body h3 {
  margin: 14px 0 8px;
  color: var(--primary);
}

.performance-break-row {
  display: grid;
  grid-template-columns: 1fr 58px minmax(100px, 180px);
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid #edf2f7;
}

.performance-break-row i {
  height: 7px;
  border-radius: 999px;
  background: #e6edf3;
  overflow: hidden;
}

.performance-break-row b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #0f5f6d;
}

@media (max-width: 900px) {
  .performance-page-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .performance-main-grid,
  .performance-monthly-grid {
    grid-template-columns: 1fr;
  }

  .performance-summary-grid,
  .employee-performance-summary,
  .performance-filters,
  .performance-variable-grid,
  .performance-grid {
    grid-template-columns: 1fr 1fr;
  }
  .performance-rank-row {
    grid-template-columns: 40px 1fr 70px;
  }
  .performance-rank-row small,
  .performance-rank-row em {
    display: none;
  }
}

@media (max-width: 620px) {
  .daily-performance-grid,
  .daily-performance-total,
  .performance-kpi-grid,
  .performance-history-filters {
    grid-template-columns: 1fr;
  }

  .performance-pagination {
    align-items: stretch;
    flex-direction: column;
  }

  .performance-pagination div {
    justify-content: flex-start;
  }

  .performance-summary-grid,
  .employee-performance-summary,
  .performance-filters,
  .performance-variable-grid,
  .performance-grid {
    grid-template-columns: 1fr;
  }
  .wide-field {
    grid-column: auto;
  }
}

@media (max-width: 1199px) {
  #performanceProformaTab .performance-main-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1000px) {
  #performanceProformaTab .performance-monthly-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  #performanceProformaTab .performance-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #performanceProformaTab .daily-performance-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #performanceProformaTab .performance-history-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 800px) {
  #performanceProformaTab .daily-performance-total {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  #performanceProformaTab {
    gap: 14px;
  }

  #performanceProformaTab .analytics-card,
  #performanceProformaTab .toolbar,
  #performanceProformaTab .table-wrap {
    padding: 14px;
  }
}

@media (max-width: 700px) {
  #performanceProformaTab .performance-page-heading {
    align-items: stretch;
    flex-direction: column;
  }

  #performanceProformaTab .performance-page-heading .actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  #performanceProformaTab .performance-page-heading .actions button {
    width: 100%;
  }
}

@media (max-width: 600px) {
  #performanceProformaTab .daily-performance-grid,
  #performanceProformaTab .performance-history-filters {
    grid-template-columns: 1fr;
  }

  #performanceProformaTab .performance-history-filters button {
    width: 100%;
    min-height: 46px;
  }

  #performanceProformaTab .daily-performance-criteria-wrap {
    overflow: visible;
    padding: 0;
    border: none;
    background: transparent;
  }

  #performanceProformaTab .daily-performance-criteria-wrap table,
  #performanceProformaTab .daily-performance-criteria-wrap tbody,
  #performanceProformaTab .daily-performance-criteria-wrap tr,
  #performanceProformaTab .daily-performance-criteria-wrap td {
    display: block;
    width: 100%;
  }

  #performanceProformaTab .daily-performance-criteria-wrap table {
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0;
    background: transparent;
  }

  #performanceProformaTab .daily-performance-criteria-wrap thead {
    display: none;
  }

  #performanceProformaTab .daily-performance-criteria-wrap tr {
    margin-bottom: 12px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #ffffff;
    box-shadow: var(--shadow-soft);
  }

  #performanceProformaTab .daily-performance-criteria-wrap td {
    padding: 6px 0;
    border: none;
    text-align: left;
  }

  #performanceProformaTab .daily-performance-criteria-wrap td:first-child {
    color: #087f8c;
    font-weight: 900;
  }

  #performanceProformaTab .daily-performance-criteria-wrap td:nth-child(2) {
    font-size: 16px;
  }

  #performanceProformaTab .daily-performance-criteria-wrap td:nth-child(3)::before {
    content: "Max Marks";
  }

  #performanceProformaTab .daily-performance-criteria-wrap td:nth-child(4)::before {
    content: "Marks Obtained";
  }

  #performanceProformaTab .daily-performance-criteria-wrap td:nth-child(5)::before {
    content: "Remarks";
  }

  #performanceProformaTab .daily-performance-criteria-wrap td:nth-child(n+3)::before {
    display: block;
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
  }

  #performanceProformaTab .daily-performance-mark,
  #performanceProformaTab .daily-performance-criterion-remark {
    width: 100%;
    min-width: 0;
    min-height: 44px;
  }

  #performanceProformaTab .performance-pagination {
    align-items: flex-start;
    flex-direction: column;
    flex-wrap: wrap;
  }

  #performanceProformaTab .performance-pagination div {
    justify-content: flex-start;
  }

  #performanceProformaTab input,
  #performanceProformaTab select,
  #performanceProformaTab textarea,
  #performanceProformaTab button {
    min-height: 44px;
    font-size: 16px;
  }

  #performanceProformaTab .panel-heading h2 {
    font-size: 24px;
  }

  #performanceProformaTab .section-heading h2 {
    font-size: 18px;
  }
}

@media (max-width: 520px) {
  #performanceProformaTab .performance-kpi-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  #performanceProformaTab .daily-performance-total {
    grid-template-columns: 1fr;
  }

  #performanceProformaTab {
    gap: 10px;
  }

  #performanceProformaTab .analytics-card,
  #performanceProformaTab .toolbar,
  #performanceProformaTab .table-wrap {
    padding: 12px;
  }
}

@media (max-width: 420px) {
  #performanceProformaTab .monthly-performance-card .performance-summary-grid {
    grid-template-columns: 1fr;
  }
}

.employee-thumb {
  width: 52px;
  height: 62px;
  overflow: hidden;
  border: 2px solid #c6dce3;
  border-radius: 4px;
  background: #f0f7f9;
}

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

.empty {
  color: var(--muted);
  text-align: center;
  padding: 20px !important;
}

body {
  background:
    linear-gradient(135deg, rgba(8, 127, 140, 0.12), transparent 34%),
    linear-gradient(225deg, rgba(226, 154, 25, 0.11), transparent 32%),
    linear-gradient(180deg, #fbfdff 0%, #edf5f6 100%);
}

button {
  background: linear-gradient(135deg, #0d8f9d, #0b4f5c);
}

button:hover {
  background: linear-gradient(135deg, #0b7884, #073f49);
}

input,
select {
  border-radius: 7px;
}

input:focus,
select:focus {
  border-color: #0d8f9d;
  box-shadow: 0 0 0 4px rgba(8, 127, 140, 0.16);
}

.app-page {
  width: min(1540px, 100%);
}

.topbar {
  border-radius: 14px;
  background:
    linear-gradient(90deg, rgba(2, 24, 31, 0.88) 0%, rgba(2, 24, 31, 0.52) 43%, rgba(2, 24, 31, 0.16) 100%),
    url("../../assets/images/rescue-service-1122-banner.png") center center / contain no-repeat,
    #050607;
}

.tab {
  background: rgba(255, 255, 255, 0.88);
  border-color: #cfe0e5;
  box-shadow: 0 8px 18px rgba(8, 127, 140, 0.08);
}

.tab.active {
  background: linear-gradient(135deg, #0d8f9d, #0b4f5c);
}

.toolbar,
.employee-form,
.summary-layout article,
.table-wrap {
  border-radius: 12px;
}

.toolbar,
.employee-form {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 252, 252, 0.94));
  border-color: rgba(202, 220, 226, 0.95);
}

.quota-field {
  position: relative;
  padding: 10px;
  border: 1px solid rgba(8, 127, 140, 0.18);
  border-radius: 10px;
  color: #0b4f5c;
  background:
    linear-gradient(135deg, rgba(232, 248, 249, 0.92), rgba(255, 248, 232, 0.88));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.quota-field input {
  border-color: rgba(8, 127, 140, 0.32);
  background: rgba(255, 255, 255, 0.94);
  color: #0b4f5c;
  font-size: 18px;
  font-weight: 900;
}

.stats-grid div {
  border-radius: 12px;
}

th {
  background: linear-gradient(135deg, #073f49, #0d8f9d);
}

tbody tr:hover {
  background: #eaf8f7;
}

@media (max-width: 1000px) {
  .login-page {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .login-box {
    justify-self: center;
    min-height: auto;
    width: 100%;
  }

  .login-visual {
    min-height: auto;
    aspect-ratio: 16 / 7;
    order: -1;
  }

  .toolbar,
  .employee-toolbar,
  .employee-form,
  .summary-layout {
    grid-template-columns: 1fr;
  }

  .stats-grid,
  .form-grid {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }
}

@media (max-width: 620px) {
  .login-page {
    gap: 12px;
    padding: 12px;
  }

  .login-visual {
    aspect-ratio: 16 / 8;
    padding: 8px;
    border-radius: 12px;
  }

  .app-page {
    padding: 10px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    min-height: 190px;
    padding: 16px;
    background:
      linear-gradient(90deg, rgba(0, 0, 0, 0.82) 0%, rgba(0, 0, 0, 0.45) 100%),
      url("../../assets/images/rescue-service-1122-banner.png") center top / cover no-repeat,
      #050607;
  }

  .topbar h1 {
    max-width: 240px;
    font-size: 24px;
    line-height: 1.12;
  }

  .topbar p {
    font-size: 13px;
  }

  .topbar-credit,
  .topbar-status {
    max-width: 100%;
    white-space: normal;
    line-height: 1.35;
  }

  .topbar .ghost {
    width: 100%;
    max-width: 180px;
  }

  .tabs {
    gap: 8px;
    margin: 12px 0;
    padding-bottom: 8px;
  }

  .tab {
    min-height: 42px;
    padding: 8px 12px;
    font-size: 13px;
  }

  .toolbar,
  .employee-form,
  .summary-layout article {
    min-width: 0;
    max-width: 100%;
    padding: 12px;
  }

  .stats-grid,
  .leave-overview,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    gap: 9px;
  }

  .stats-grid div {
    min-height: 70px;
    padding: 12px;
  }

  .stats-grid strong {
    font-size: 24px;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  label {
    font-size: 12px;
  }

  input,
  select,
  button,
  .file-button {
    min-height: 44px;
    font-size: 14px;
  }

  .actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .actions > button,
  .actions > .file-button {
    width: 100%;
  }

  .photo-editor {
    justify-items: start;
  }

  .photo-preview,
  .leave-preview {
    width: 132px;
    height: 158px;
  }

  .leave-alert {
    display: grid;
  }

  .special-card {
    grid-template-columns: 64px 1fr;
    padding: 10px;
  }

  .table-wrap {
    border-radius: 6px;
  }

  .table-wrap::before {
    content: "Swipe table left/right";
    display: block;
    padding: 8px 10px;
    color: var(--muted);
    background: #f8fafc;
    border-bottom: 1px solid var(--line);
    font-size: 12px;
    font-weight: 700;
  }

  table {
    min-width: 720px;
    font-size: 13px;
  }

  th,
  td {
    padding: 8px 9px;
  }

  .employee-thumb {
    width: 44px;
    height: 52px;
  }

  .row-actions {
    display: grid;
    gap: 6px;
  }
}

@media (max-width: 380px) {
  .login-page {
    padding: 10px;
  }

  .login-box {
    padding: 20px;
  }

  .login-visual {
    aspect-ratio: 16 / 9;
  }

  .login-box h1,
  .topbar h1 {
    font-size: 21px;
  }

  .app-page {
    padding: 8px;
  }

  .topbar {
    min-height: 170px;
  }

  .toolbar,
  .employee-form,
  .summary-layout article {
    padding: 10px;
  }
}

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

/* Premium Rescue 1122 dashboard redesign */
:root {
  --primary: #0b1f3a;
  --secondary: #12345b;
  --rescue-red: #e31b23;
  --success: #16a34a;
  --warning: #f59e0b;
  --info: #2563eb;
  --purple: #7c3aed;
  --surface-bg: #f5f7fa;
  --card: #ffffff;
  --text: #172033;
  --muted: #64748b;
  --border: #dbe3ee;
  --shadow-soft: 0 12px 32px rgba(11, 31, 58, 0.08);
  --shadow-hover: 0 18px 44px rgba(11, 31, 58, 0.14);
}

body {
  color: var(--text);
  background: var(--surface-bg);
  font-family: Inter, "Segoe UI", Arial, Helvetica, sans-serif;
}

button {
  border-radius: 7px;
  background: var(--rescue-red);
  box-shadow: 0 10px 22px rgba(227, 27, 35, 0.18);
}

button:hover {
  background: #c9151d;
  box-shadow: 0 14px 28px rgba(227, 27, 35, 0.25);
}

button.secondary,
button.ghost,
.file-button {
  color: var(--primary);
  background: #ffffff;
  border: 1px solid var(--border);
  box-shadow: none;
}

button.secondary:hover,
button.ghost:hover,
.file-button:hover {
  color: var(--primary);
  background: #f8fafc;
  border-color: #b9c6d6;
}

button.danger {
  background: #991b1b;
}

input,
select {
  min-height: 42px;
  border-color: var(--border);
  border-radius: 7px;
  background: #fff;
}

input:focus,
select:focus {
  border-color: var(--info);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.login-page {
  grid-template-columns: minmax(380px, 0.75fr) minmax(520px, 1.25fr);
  background: linear-gradient(135deg, #07172b 0%, #102b4c 46%, #f5f7fa 46.2%, #f5f7fa 100%);
}

.login-box {
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
}

.login-box::before {
  background: linear-gradient(90deg, var(--rescue-red), var(--warning), var(--success));
}

.login-kicker,
.powered-by {
  color: var(--primary);
  background: #eef4fb;
  border-color: #d5e1ee;
}

.login-box h1 {
  color: var(--primary);
}

.login-mode-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  padding: 5px;
  margin: 18px 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #eef4fb;
}

.login-mode-tab {
  min-height: 40px;
  color: var(--primary);
  background: transparent;
  border: 0;
  box-shadow: none;
}

.login-mode-tab.active,
.login-mode-tab:hover {
  color: #ffffff;
  background: var(--primary);
  box-shadow: none;
}

.link-button {
  color: var(--primary);
  background: transparent;
  border: 0;
  box-shadow: none;
  text-decoration: underline;
}

.link-button:hover {
  color: var(--primary);
  background: transparent;
  box-shadow: none;
}

.login-visual {
  border-radius: 8px;
  background: var(--primary);
}

.storage-status {
  color: #166534;
  background: #dcfce7;
  border-color: #bbf7d0;
}

.storage-status.error {
  color: #991b1b;
  background: #fee2e2;
  border-color: #fecaca;
}

.app-page {
  width: 100%;
  min-height: 100vh;
  display: block;
  margin: 0;
  padding: 0;
  background: var(--surface-bg);
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 22px 18px;
  color: #ffffff;
  background: linear-gradient(180deg, var(--primary), #071629);
  box-shadow: 8px 0 30px rgba(11, 31, 58, 0.16);
  z-index: 20;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.brand-mark {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #ffffff;
  background: var(--rescue-red);
  font-weight: 900;
}

.sidebar-brand strong,
.sidebar-brand span,
.sidebar-footer strong,
.sidebar-footer span {
  display: block;
}

.sidebar-brand span,
.sidebar-footer span {
  color: rgba(255, 255, 255, 0.68);
  font-size: 12px;
  font-weight: 700;
}

.sidebar-nav {
  display: grid;
  align-content: start;
  gap: 8px;
  margin: 22px 0;
  overflow: visible;
}

.tab {
  width: 100%;
  justify-content: flex-start;
  min-height: 46px;
  color: rgba(255, 255, 255, 0.78);
  background: transparent;
  border: 1px solid transparent;
  box-shadow: none;
  text-align: left;
}

.tab:hover,
.tab.active {
  color: #ffffff;
  background: rgba(227, 27, 35, 0.18);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: none;
}

.tab.active {
  border-left: 4px solid var(--rescue-red);
}

.sidebar-footer {
  display: grid;
  gap: 10px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.role-chip,
.header-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 11px;
  border-radius: 999px;
  color: var(--primary);
  background: #ffffff;
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 800;
}

.role-chip {
  max-width: 100%;
  border-radius: 7px;
  white-space: normal;
  line-height: 1.35;
}

.app-shell {
  width: calc(100% - var(--sidebar-width));
  min-width: 0;
  margin-left: var(--sidebar-width);
  padding: 22px;
}

.topbar {
  position: relative;
  z-index: 50;
  min-height: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border-radius: 8px;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  overflow: visible;
}

.password-reset-bell {
  position: relative;
  z-index: 300;
}

.password-reset-bell-btn {
  position: relative;
  width: 48px;
  min-width: 48px;
  height: 48px;
  padding: 0;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: var(--primary);
  border: 2px solid rgba(226, 154, 25, 0.75);
  border-radius: 999px;
  box-shadow: 0 14px 32px rgba(11, 31, 58, 0.28);
}

.password-reset-bell-btn:hover {
  color: #ffffff;
  background: var(--primary);
  border-color: var(--accent);
  box-shadow: 0 18px 38px rgba(11, 31, 58, 0.36);
  transform: translateY(-1px);
}

.bell-symbol {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: var(--primary);
  background: var(--accent);
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
}

.password-reset-bell-btn .bell-count {
  position: absolute;
  right: -8px;
  top: -9px;
  min-width: 24px;
  min-height: 24px;
  padding: 4px 7px;
  border-radius: 999px;
  color: #ffffff;
  background: var(--rescue-red);
  border: 2px solid #ffffff;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.2;
}

.password-reset-panel {
  position: absolute;
  right: 0;
  top: 54px;
  z-index: 400;
  width: min(520px, calc(100vw - 32px));
  max-height: min(460px, calc(100vh - 150px));
  overflow: auto;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow-hover);
  transform-origin: top right;
  animation: notificationRollDown 180ms ease-out both;
}

@keyframes notificationRollDown {
  from {
    opacity: 0;
    transform: translateY(-8px) scaleY(0.94);
  }
  to {
    opacity: 1;
    transform: translateY(0) scaleY(1);
  }
}

.password-reset-panel > strong {
  display: block;
  color: var(--primary);
  font-size: 14px;
}

.password-reset-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.password-reset-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
}

.password-reset-item strong,
.password-reset-item span,
.password-reset-item small {
  display: block;
}

.password-reset-item strong {
  color: var(--primary);
}

.password-reset-item span,
.password-reset-item small,
.password-reset-empty {
  color: var(--muted);
  font-weight: 700;
}

.password-reset-item button {
  white-space: nowrap;
}

.employee-portal-page {
  min-height: 100vh;
  padding: 22px;
  background: var(--surface-bg);
}

.employee-portal-topbar,
.employee-portal-card,
.employee-summary-grid div {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  box-shadow: var(--shadow-soft);
}

.employee-portal-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  margin-bottom: 18px;
}

.employee-portal-topbar h1 {
  margin: 4px 0;
  color: var(--primary);
}

.employee-name-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.employee-shift-badge {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #e8f5f7;
  color: #0b4f5c;
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.employee-portal-topbar p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.employee-summary-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.employee-summary-grid div {
  min-height: 104px;
  padding: 16px;
  border-left: 5px solid var(--primary);
}

.employee-summary-grid div:nth-child(1) { border-left-color: var(--success); }
.employee-summary-grid div:nth-child(2) { border-left-color: var(--rescue-red); }
.employee-summary-grid div:nth-child(3) { border-left-color: var(--warning); }
.employee-summary-grid div:nth-child(4) { border-left-color: var(--info); }
.employee-summary-grid div:nth-child(5) { border-left-color: var(--muted); }
.employee-summary-grid div:nth-child(6) { border-left-color: var(--success); }

.employee-summary-grid strong,
.employee-summary-grid span {
  display: block;
}

.employee-summary-grid strong {
  color: var(--primary);
  font-size: 28px;
}

.employee-summary-grid span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.employee-portal-grid {
  display: grid;
  grid-template-columns: minmax(320px, 1.2fr) minmax(300px, 0.8fr);
  gap: 18px;
  margin-bottom: 18px;
}

.employee-portal-card {
  padding: 18px;
}

.employee-attendance-pie-body {
  justify-content: center;
  align-items: center;
  padding-top: 8px;
}

.employee-attendance-canvas-wrap {
  width: min(260px, 100%);
  aspect-ratio: 1 / 1;
  height: auto;
  margin-inline: auto;
}

.employee-attendance-canvas-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}

.employee-calendar-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.employee-calendar-nav {
  display: flex;
  gap: 8px;
}

.employee-calendar-weekdays,
.employee-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(34px, 1fr));
  gap: 8px;
}

.employee-calendar-weekdays {
  margin: 16px 0 8px;
}

.employee-calendar-weekdays span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

.employee-calendar-day,
.employee-calendar-empty {
  min-height: 68px;
  display: grid;
  align-content: space-between;
  padding: 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
}

.employee-calendar-day strong,
.employee-calendar-day em {
  display: block;
  font-style: normal;
}

.employee-calendar-day strong {
  color: var(--primary);
}

.employee-calendar-day em {
  justify-self: end;
  font-size: 12px;
  font-weight: 900;
}

.employee-calendar-day.status-P { background: #dcfce7; border-color: #bbf7d0; }
.employee-calendar-day.status-A { background: #fee2e2; border-color: #fecaca; }
.employee-calendar-day.status-L,
.employee-calendar-day.status-LP { background: #fef3c7; border-color: #fde68a; }
.employee-calendar-day.status-GH { background: #dbeafe; border-color: #bfdbfe; }
.employee-calendar-day.status-DO { background: #e5e7eb; border-color: #d1d5db; }
.employee-calendar-day.status-RP { background: #dcfce7; border-color: #bbf7d0; }

.employee-history-table {
  margin-top: 12px;
  box-shadow: none;
}

.topbar::after {
  display: none;
}

.topbar h1 {
  color: var(--primary);
  text-shadow: none;
  font-size: 22px;
}

.topbar p {
  color: var(--muted);
  text-shadow: none;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.topbar-status {
  width: auto;
  margin: 0;
}

.notification-dot {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: var(--rescue-red);
  background: #fff1f2;
  border: 1px solid #fecdd3;
}

.icon-button {
  display: none;
  width: 42px;
  min-width: 42px;
  padding: 0;
  font-size: 20px;
}

.hero-dashboard {
  position: relative;
  z-index: 1;
  min-height: 190px;
  display: grid;
  align-items: end;
  margin: 18px 0;
  padding: 28px;
  border-radius: 8px;
  color: #ffffff;
  background:
    linear-gradient(90deg, rgba(11, 31, 58, 0.92), rgba(18, 52, 91, 0.68), rgba(11, 31, 58, 0.24)),
    url("../../assets/images/rescue-service-1122-banner.png") center / cover no-repeat,
    var(--primary);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.hero-dashboard h2 {
  max-width: 720px;
  margin: 6px 0;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.05;
  letter-spacing: 0;
}

.hero-dashboard p {
  max-width: 660px;
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
}

.eyebrow {
  color: var(--rescue-red);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.panel-heading {
  display: grid;
  gap: 4px;
}

.panel-heading h2 {
  margin: 0;
  color: var(--primary);
  font-size: 24px;
}

.tab-panel.active {
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

.toolbar,
.employee-form,
.summary-layout article,
.table-wrap,
.analytics-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  box-shadow: var(--shadow-soft);
}

.toolbar:hover,
.employee-form:hover,
.summary-layout article:hover,
.table-wrap:hover,
.stats-grid div:hover,
.analytics-card:hover {
  border-color: #c4cfdd;
  box-shadow: var(--shadow-hover);
}

.toolbar {
  grid-template-columns: repeat(4, minmax(160px, 1fr));
}

.incident-toolbar {
  grid-template-columns: repeat(5, minmax(150px, 1fr));
}

.kpi-grid,
.stats-grid,
.incident-stats {
  grid-template-columns: repeat(4, minmax(150px, 1fr));
}

.stats-grid div {
  position: relative;
  min-height: 112px;
  padding: 18px;
  border: 1px solid var(--border);
  border-left: 5px solid var(--primary);
  border-radius: 8px;
  background: var(--card) !important;
  box-shadow: var(--shadow-soft);
}

.stats-grid div::after {
  content: "";
  position: absolute;
  right: 16px;
  top: 16px;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #eef4fb;
}

.stats-grid div:nth-child(2) { border-left-color: var(--success); }
.stats-grid div:nth-child(3) { border-left-color: var(--rescue-red); }
.stats-grid div:nth-child(4) { border-left-color: var(--warning); }
.stats-grid div:nth-child(5) { border-left-color: var(--info); }
.stats-grid div:nth-child(6) { border-left-color: var(--purple); }
.stats-grid div:nth-child(7) { border-left-color: #f97316; }
.stats-grid div:nth-child(8) { border-left-color: #475569; }

.stats-grid strong {
  font-size: 34px;
  color: var(--primary);
}

.analytics-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(280px, 1.2fr);
  gap: 18px;
  min-width: 0;
}

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

.donut-shell {
  display: flex;
  align-items: center;
  gap: 18px;
}

.attendance-donut {
  width: 118px;
  height: 118px;
  border-radius: 50%;
  background: conic-gradient(var(--success) 0deg, #e5e7eb 0deg);
  position: relative;
}

.attendance-donut::after {
  content: "";
  position: absolute;
  inset: 18px;
  border-radius: 50%;
  background: #ffffff;
}

#attendancePercentText {
  display: block;
  color: var(--primary);
  font-size: 32px;
}

.notification-list {
  display: grid;
  gap: 10px;
}

.notification-item {
  padding: 11px 12px;
  border-radius: 7px;
  background: #f8fafc;
  border: 1px solid var(--border);
  color: var(--muted);
  font-weight: 700;
}

.dashboard-chart {
  display: block;
  width: 100%;
  max-width: 100%;
  height: 230px;
  min-height: 230px;
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
}

.graph-card label {
  margin-bottom: 8px;
}

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

.pro-pie-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px;
  box-shadow: 0 8px 20px rgba(11, 31, 58, 0.05);
  min-width: 0;
}

.pro-pie-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.pro-pie-head h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 900;
  color: var(--primary, #0b1f3a);
  letter-spacing: 0;
  line-height: 1.25;
}

.pro-pie-sub {
  font-size: 11px;
  font-weight: 800;
  color: #16a34a;
  background: #eafaf1;
  padding: 3px 9px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0;
}

.pro-pie-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  width: 100%;
  min-width: 0;
}

.attendance-pie-body {
  margin-top: 14px;
}

.incident-pie-body {
  margin-top: 14px;
}

.pro-pie-canvas-wrap {
  position: relative;
  width: min(260px, 100%);
  aspect-ratio: 1 / 1;
  height: auto;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #ffffff;
  margin-inline: auto;
}

.pro-pie-canvas-wrap canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.pro-pie-center {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.pro-pie-center strong {
  font-size: 32px;
  font-weight: 800;
  color: #dc2626;
  line-height: 1.1;
}

.pro-pie-center span {
  font-size: 11px;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0;
  margin-top: 2px;
}

.pro-pie-legend {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  width: 100%;
  min-width: 0;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.pro-pie-legend-row {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  padding: 8px 0;
  border: 0;
  border-bottom: 1px solid #eef2f7;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.pro-pie-legend-row:last-child {
  border-bottom: 0;
}

.pro-pie-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
}

.pro-pie-legend-label {
  color: #3a3f47;
  font-weight: 800;
}

.pro-pie-legend-value {
  color: var(--primary, #0b1f3a);
  font-weight: 800;
  min-width: 24px;
  text-align: right;
}

.pro-pie-legend-pct {
  color: #8a8f98;
  font-weight: 700;
  font-size: 12px;
  min-width: 34px;
  text-align: right;
}

.pro-pie-progress {
  grid-column: 2 / 5;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: #eef3f8;
}

.pro-pie-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.leave-analytics,
.incident-analytics {
  align-items: stretch;
}

.incident-analytics {
  grid-template-columns: minmax(320px, 860px);
  justify-content: center;
}

.incident-trend-card {
  width: 100%;
}

.incident-analytics .pro-pie-card {
  width: min(100%, 680px);
  margin: 0 auto;
}

.leave-analytics {
  grid-template-columns: minmax(320px, 620px);
  justify-content: center;
}

.leave-analytics .pro-pie-card {
  width: 100%;
  max-width: 620px;
  margin: 0 auto;
}

.leave-analytics .pro-pie-body {
  justify-content: center;
}

#leaveGhBalanceBars {
  align-items: center;
  justify-content: center;
}

#leaveGhBalanceBars .pro-pie-canvas-wrap {
  width: min(260px, 100%);
  height: auto;
}

#leaveGhBalanceBars .pro-pie-center {
  transform: translate(-50%, -50%);
}

#leaveGhBalanceTotal {
  color: #16a34a;
  font-size: 30px;
}

.incident-analytics .dashboard-chart {
  min-height: 240px;
}

.incident-analytics .trend-chart {
  min-height: 190px;
  height: 190px;
}

.employee-portal-card .trend-chart {
  min-height: 190px;
  height: 190px;
}

th {
  background: var(--primary);
}

tbody tr:hover {
  background: #f8fbff;
}

.status-select {
  border-radius: 999px;
  font-weight: 900;
}

.status-select option[value="P"] { color: var(--success); }
.status-select option[value="A"] { color: var(--rescue-red); }
.status-select option[value="L"] { color: var(--warning); }
.status-select option[value="GH"] { color: var(--info); }
.status-select option[value="DO"] { color: var(--purple); }

.employee-form {
  grid-template-columns: minmax(0, 1fr) 210px;
}

.form-section-title {
  grid-column: 1 / -1;
  color: var(--primary);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.photo-preview {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.leave-overview {
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  margin: 0;
}

.leave-overview div {
  border-left: 5px solid var(--warning);
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.leave-overview div:nth-child(n+4) {
  border-left-color: var(--info);
}

.sidebar-overlay {
  display: none;
}

@media (max-width: 1180px) {
  .app-page {
    display: block;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: min(var(--sidebar-width), 86vw);
    height: 100vh;
    height: 100dvh;
    transform: translateX(-102%);
    transition: transform 220ms var(--ease);
    z-index: 30;
  }

  .app-shell {
    width: 100%;
    margin-left: 0;
  }

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

  body.sidebar-open .sidebar-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 25;
  }

  .icon-button {
    display: grid;
    place-items: center;
  }
}

@media (max-width: 900px) {
  .topbar,
  .topbar-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .toolbar,
  .incident-toolbar,
  .employee-form,
  .summary-layout,
  .analytics-grid,
  .employee-portal-grid {
    grid-template-columns: 1fr;
  }

  .kpi-grid,
  .stats-grid,
  .incident-stats,
  .leave-overview,
  .form-grid,
  .employee-summary-grid {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }
}

@media (max-width: 620px) {
  .login-page {
    background: var(--surface-bg);
  }

  .app-shell {
    padding: 10px;
  }

  .employee-portal-page {
    padding: 10px;
  }

  .employee-portal-topbar {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .employee-calendar-day,
  .employee-calendar-empty {
    min-height: 54px;
    padding: 7px;
  }

  .employee-calendar-nav {
    width: 100%;
  }

  .employee-calendar-nav button {
    flex: 1;
  }

  .password-reset-bell-btn {
    width: 44px;
    min-width: 44px;
    height: 44px;
  }

  .pro-pie-body {
    align-items: center;
  }

  .pro-pie-canvas-wrap {
    width: min(72vw, 240px);
    height: auto;
    margin: 0 auto;
  }

  .pro-pie-legend {
    width: 100%;
  }

  .hero-dashboard {
    min-height: 220px;
    padding: 18px;
  }

  .kpi-grid,
  .stats-grid,
  .incident-stats,
  .leave-overview,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    padding: 14px;
  }
}

#rosterTab .roster-form {
  grid-template-columns: 1fr !important;
  overflow: visible;
}

#rosterTab .roster-form .form-grid {
  width: 100%;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)) !important;
}

#rosterTab .roster-form label,
#rosterTab .roster-toolbar label {
  min-width: 0;
}

#rosterDesiredShiftOne,
#rosterDesiredShiftTwo,
#rosterPunishmentShift {
  border-left: 4px solid #0f5f6d;
}

#rosterPunishmentShift {
  border-left-color: #b42318;
}

#rosterTab .roster-toolbar {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)) !important;
}

/* Mobile compatibility overrides: keep the existing design, prevent overflow. */
html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

img,
canvas,
iframe {
  max-width: 100%;
}

button,
input,
select,
textarea {
  font-size: 16px;
}

@media (max-width: 900px) {
  html,
  body,
  .app-page,
  .app-shell,
  .tab-panel,
  .tab-panel.active,
  .hero-dashboard,
  .topbar,
  .toolbar,
  .stats-grid,
  .analytics-grid,
  .analytics-card,
  .table-wrap,
  .summary-layout {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .app-page {
    min-height: 100dvh;
  }

  .sidebar {
    max-width: min(var(--sidebar-width), 86vw);
    height: 100dvh;
    z-index: 30;
  }

  .app-shell,
  .employee-portal-page {
    width: 100%;
    min-width: 0;
  }

  .topbar {
    gap: 12px;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    align-items: center;
  }

  .topbar-brand,
  .topbar-actions {
    width: 100%;
    min-width: 0;
  }

  .topbar-brand {
    align-items: center;
    padding-right: 124px;
  }

  .topbar-credit {
    display: none;
  }

  .topbar-actions {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .topbar-status {
    position: absolute;
    top: 12px;
    right: 12px;
    grid-column: auto;
    max-width: 118px;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .header-pill,
  .topbar-status {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  .topbar-status {
    width: auto;
  }

  #sidebarToggle {
    color: #ffffff;
    background: var(--rescue-red);
    border-color: var(--rescue-red);
    box-shadow: 0 10px 20px rgba(227, 27, 35, 0.18);
  }

  .password-reset-bell {
    justify-self: start;
  }

  .password-reset-panel {
    left: 0;
    right: auto;
    width: min(92vw, 360px);
    max-height: 70dvh;
    overflow: auto;
  }

  .toolbar,
  .incident-toolbar,
  .roster-toolbar,
  .employee-filter-grid,
  .performance-filter-grid,
  .report-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .toolbar button,
  .incident-toolbar button,
  .roster-toolbar button,
  .form-actions button,
  .export-actions button {
    width: 100%;
  }

  .analytics-grid,
  .incident-analytics,
  .leave-analytics,
  .employee-portal-grid,
  .official-roster-layout {
    grid-template-columns: 1fr !important;
    min-width: 0;
  }

  .dashboard-chart,
  .trend-chart,
  .incident-analytics .trend-chart,
  .employee-portal-card .trend-chart {
    height: 220px;
    min-height: 220px;
  }
}

@media (max-width: 620px) {
  body {
    font-size: 13px;
  }

  .login-page {
    min-height: 100dvh;
    padding: 8px;
    display: block;
  }

  .login-box {
    width: 100%;
    min-height: auto;
    border-radius: 14px;
  }

  .login-content {
    padding: 16px 14px;
  }

  .login-box h1 {
    max-width: 100%;
    font-size: 24px;
    line-height: 1.08;
  }

  .login-visual {
    min-height: 150px;
    border-radius: 14px;
  }

  .app-shell {
    padding: 6px;
  }

  .topbar {
    padding: 10px;
    border-radius: 12px;
    gap: 8px;
    min-height: 0;
    position: relative;
  }

  .topbar h1 {
    max-width: 100%;
    font-size: 18px;
    line-height: 1.15;
    white-space: normal;
  }

  .topbar p,
  .topbar-credit,
  .topbar-status,
  .header-pill {
    font-size: 11px;
  }

  .topbar p,
  .topbar-credit {
    white-space: normal;
  }

  .topbar-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: center;
  }

  .topbar-status {
    grid-column: auto;
    justify-self: end;
    width: auto;
    min-height: 34px;
    padding-inline: 10px;
    max-width: 112px;
  }

  .topbar-actions .header-pill {
    min-height: 36px;
    padding-block: 8px;
  }

  .notification-dot {
    display: none;
  }

  .hero-dashboard {
    min-height: 128px;
    padding: 12px;
    border-radius: 12px;
    background-position: center;
    background-size: cover;
  }

  .hero-dashboard h2 {
    font-size: 19px;
    line-height: 1.1;
  }

  .hero-dashboard p {
    font-size: 11px;
    line-height: 1.4;
  }

  .panel-heading h2,
  .section-heading h2 {
    font-size: 18px;
    line-height: 1.2;
  }

  .toolbar,
  .incident-toolbar,
  .roster-toolbar,
  .employee-filter-grid,
  .performance-filter-grid,
  .report-filter-grid,
  .form-grid,
  .employee-form,
  .roster-form .form-grid {
    grid-template-columns: 1fr !important;
  }

  #attendanceTab > .toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 9px;
  }

  #attendanceTab > .toolbar label:nth-child(1),
  #attendanceTab > .toolbar label:nth-child(2),
  #attendanceTab > .toolbar #saveAttendanceBtn {
    grid-column: 1 / -1;
  }

  #attendanceTab > .toolbar #importAttendanceBtn,
  #attendanceTab > .toolbar #markAllPresentBtn,
  #attendanceTab > .toolbar #exportAttendanceBtn,
  #attendanceTab > .toolbar #exportAttendanceRangeBtn,
  #attendanceTab > .toolbar #exportLeaveGhBtn {
    min-height: 42px;
  }

  #attendanceTab > .toolbar #saveAttendanceBtn {
    background: var(--rescue-red);
    box-shadow: 0 14px 28px rgba(227, 27, 35, 0.18);
  }

  .kpi-grid,
  .stats-grid,
  .incident-stats,
  .leave-overview,
  .employee-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px;
  }

  .stats-grid div,
  .kpi-grid div,
  .incident-stats div,
  .leave-overview div,
  .employee-summary-grid div {
    min-height: 72px;
    padding: 11px;
  }

  .stats-grid strong,
  .kpi-grid strong,
  .incident-stats strong,
  .leave-overview strong,
  .employee-summary-grid strong {
    font-size: 24px;
  }

  .stats-grid span,
  .kpi-grid span,
  .incident-stats span,
  .leave-overview span,
  .employee-summary-grid span {
    font-size: 11px;
  }

  .summary-layout,
  .analytics-grid {
    gap: 10px;
  }

  .toolbar,
  .employee-form,
  .leave-form,
  .analytics-card,
  .table-wrap {
    padding: 12px;
  }

  .toolbar,
  .incident-toolbar,
  .roster-toolbar {
    gap: 9px;
  }

  .donut-shell {
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    text-align: center;
  }

  .analytics-card .graph-filter-grid {
    grid-template-columns: 1fr;
  }

  .attendance-donut {
    width: 92px;
    height: 92px;
  }

  .attendance-donut::after {
    inset: 14px;
  }

  #attendancePercentText {
    font-size: 24px;
  }
}

@media (max-width: 430px) {
  .topbar {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .topbar-status {
    grid-column: auto;
    justify-self: end;
  }

  .table-wrap {
    width: 100%;
    margin-inline: 0;
    border-radius: 12px;
  }

  .table-wrap::before {
    display: block;
    content: "Swipe table left/right";
    position: sticky;
    left: 0;
    padding: 8px 10px;
    font-size: 11px;
    font-weight: 800;
    color: var(--muted);
    background: #f8fafc;
    border-bottom: 1px solid var(--line);
    z-index: 2;
  }

  table {
    min-width: 720px;
  }

  th,
  td {
    padding: 10px 9px;
    font-size: 13px;
  }

  input,
  select,
  textarea,
  button,
  .file-button {
    min-height: 44px;
    width: 100%;
  }

  .icon-button,
  .password-reset-bell-btn {
    width: 44px;
    min-width: 44px;
    height: 44px;
  }

  .form-actions,
  .export-actions,
  .roster-actions,
  .modal-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .photo-editor,
  .profile-upload {
    width: 100%;
  }

  .photo-preview,
  .leave-preview {
    width: 100%;
    max-width: 260px;
    margin-inline: auto;
  }

  .pro-pie-card,
  .analytics-card,
  .dashboard-card,
  .employee-portal-card {
    border-radius: 12px;
    padding: 14px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .pro-pie-body,
  .leave-analytics .pro-pie-body {
    gap: 14px;
  }

  .pro-pie-canvas-wrap {
    width: min(54vw, 172px);
    height: auto;
  }

  .pro-pie-center strong {
    font-size: 26px;
  }

  .pro-pie-legend-row {
    grid-template-columns: 10px minmax(0, 1fr) auto auto;
  }

  .dashboard-chart,
  .trend-chart,
  .incident-analytics .trend-chart,
  .employee-portal-card .trend-chart {
    height: 174px;
    min-height: 174px;
  }

  .employee-calendar-grid {
    gap: 5px;
  }

  .employee-calendar-day,
  .employee-calendar-empty {
    min-height: 48px;
    padding: 6px 4px;
    font-size: 11px;
  }

  .modal {
    align-items: flex-start;
    padding: 10px;
    overflow: auto;
  }

  .modal-card {
    width: 100%;
    max-height: none;
    margin: 0;
  }
}

@media (min-width: 390px) and (max-width: 620px) {
  .analytics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .analytics-card,
  .pro-pie-card {
    padding: 12px;
  }

  .analytics-card .section-heading,
  .pro-pie-head {
    align-items: flex-start;
    gap: 4px;
    margin-bottom: 8px;
  }

  .analytics-card .section-heading h2,
  .pro-pie-head h3 {
    font-size: 14px;
    line-height: 1.15;
  }

  .analytics-card .section-heading span,
  .pro-pie-sub,
  .graph-card label {
    font-size: 10px;
  }

  .graph-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .pro-pie-body {
    gap: 8px;
  }

  .pro-pie-canvas-wrap {
    width: min(34vw, 150px);
  }

  .pro-pie-center strong {
    font-size: 22px;
  }

  .pro-pie-center span {
    font-size: 9px;
  }

  .pro-pie-legend {
    max-width: 100%;
  }

  .pro-pie-legend-row {
    gap: 6px;
    padding: 5px 0;
    font-size: 10px;
  }

  .pro-pie-progress {
    height: 4px;
  }
}

@media (max-width: 620px) {
  #leaveRecordTab .leave-analytics {
    grid-template-columns: 1fr !important;
    gap: 10px;
    margin-block: 10px;
  }

  #leaveRecordTab .leave-analytics .pro-pie-card {
    padding: 10px 12px;
    overflow: hidden;
  }

  #leaveRecordTab .leave-analytics .pro-pie-head {
    margin-bottom: 6px;
  }

  #leaveRecordTab #leaveGhBalanceBars {
    display: grid;
    grid-template-columns: minmax(122px, 148px) minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    justify-content: stretch;
  }

  #leaveRecordTab #leaveGhBalanceBars .pro-pie-canvas-wrap {
    width: clamp(122px, 36vw, 148px);
    height: clamp(122px, 36vw, 148px);
    aspect-ratio: 1 / 1;
    margin: 0;
  }

  #leaveRecordTab #leaveGhBalanceBars .pro-pie-center strong {
    font-size: 22px;
  }

  #leaveRecordTab #leaveGhBalanceBars .pro-pie-center span {
    font-size: 9px;
  }

  #leaveRecordTab #leaveGhBalanceLegend {
    min-width: 0;
    max-height: 146px;
    overflow-y: auto;
    gap: 3px;
    padding-right: 2px;
  }

  #leaveRecordTab #leaveGhBalanceLegend .pro-pie-legend-row {
    grid-template-columns: 8px minmax(0, 1fr) auto auto;
    gap: 5px;
    padding: 3px 0;
    font-size: 10px;
  }

  #leaveRecordTab #leaveGhBalanceLegend .pro-pie-dot {
    width: 8px;
    height: 8px;
  }

  #leaveRecordTab #leaveGhBalanceLegend .pro-pie-legend-value,
  #leaveRecordTab #leaveGhBalanceLegend .pro-pie-legend-pct {
    font-size: 10px;
    min-width: auto;
  }

  #leaveRecordTab #leaveGhBalanceLegend .pro-pie-progress {
    display: none;
  }
}

@media (max-width: 420px) {
  #leaveRecordTab #leaveGhBalanceBars {
    grid-template-columns: 116px minmax(0, 1fr);
    gap: 8px;
  }

  #leaveRecordTab #leaveGhBalanceBars .pro-pie-canvas-wrap {
    width: 116px;
    height: 116px;
  }

  #leaveRecordTab #leaveGhBalanceLegend {
    max-height: 116px;
  }

  #leaveRecordTab #leaveGhBalanceLegend .pro-pie-legend-pct {
    display: none;
  }
}

@media (max-width: 380px) {
  .topbar-brand {
    padding-right: 0;
  }

  .topbar-status {
    position: static;
    grid-column: 1 / -1;
    justify-self: stretch;
    width: 100%;
    max-width: 100%;
  }

  .analytics-grid {
    grid-template-columns: 1fr !important;
  }

  .kpi-grid,
  .stats-grid,
  .incident-stats,
  .leave-overview,
  .employee-summary-grid,
  #attendanceTab > .toolbar {
    grid-template-columns: 1fr !important;
  }

  .login-box h1,
  .hero-dashboard h2 {
    font-size: 22px;
  }

  .topbar h1,
  .panel-heading h2,
  .section-heading h2 {
    font-size: 18px;
  }

  .topbar-actions {
    grid-template-columns: 1fr;
  }

  table {
    min-width: 680px;
  }
}

/* Mobile app-style dashboard polish inspired by the provided reference. */
@media (max-width: 900px) {
  body {
    background: #f5f8fb;
  }

  .app-shell {
    padding: 16px;
    gap: 14px;
  }

  .topbar {
    min-height: 0;
    padding: 10px 0 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
    grid-template-columns: 52px minmax(0, 1fr) auto;
    align-items: center;
  }

  .topbar::after {
    display: none;
  }

  .topbar-brand {
    padding-right: 0;
  }

  .topbar h1 {
    color: var(--primary);
    font-size: 20px;
    line-height: 1.05;
    text-shadow: none;
    white-space: nowrap;
  }

  .topbar p {
    margin-top: 3px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    text-shadow: none;
  }

  #sidebarToggle {
    width: 52px;
    min-width: 52px;
    height: 52px;
    border-radius: 10px;
    color: #ffffff;
    background: var(--rescue-red);
    border-color: var(--rescue-red);
    font-size: 24px;
    box-shadow: 0 12px 24px rgba(227, 27, 35, 0.2);
  }

  .topbar-actions {
    display: contents;
  }

  .topbar-status {
    position: static;
    grid-column: 3;
    grid-row: 1;
    width: auto;
    max-width: 118px;
    min-height: 34px;
    margin: 0;
    padding: 7px 12px;
    border-radius: 9px;
    color: #047857;
    background: #dcfce7;
    border-color: #bbf7d0;
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: none;
  }

  .topbar-status::before {
    content: "";
    width: 8px;
    height: 8px;
    margin-right: 7px;
    border-radius: 999px;
    background: currentColor;
  }

  .topbar-status.error {
    color: #b91c1c;
    background: #fee2e2;
    border-color: #fecaca;
  }

  .header-pill {
    grid-row: 2;
    width: 100%;
    min-height: 42px;
    margin-top: 14px;
    padding: 10px 12px;
    border-radius: 999px;
    color: var(--primary);
    background: #ffffff;
    border: 1px solid #dbe3ef;
    font-size: 13px;
    font-weight: 900;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
  }

  #currentDate {
    grid-column: 1 / 3;
  }

  #currentDate::before {
    content: "□";
    margin-right: 8px;
    color: #0f5f6d;
    font-size: 13px;
  }

  #currentTime {
    grid-column: 3;
  }

  #currentTime::before {
    content: "○";
    margin-right: 8px;
    color: #0f5f6d;
    font-size: 13px;
  }

  .password-reset-bell {
    position: absolute;
    top: 66px;
    right: 0;
    z-index: 5;
  }

  .password-reset-bell:not(.hidden) + .notification-dot {
    display: none;
  }

  .hero-dashboard {
    min-height: 182px;
    margin-top: 10px;
    padding: 22px;
    border-radius: 14px;
    border: 0;
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.16);
    background:
      linear-gradient(90deg, rgba(5, 16, 31, 0.9) 0%, rgba(5, 16, 31, 0.58) 55%, rgba(5, 16, 31, 0.24) 100%),
      url("../../assets/images/rescue-service-1122-banner.png") center / cover no-repeat,
      #07111f;
  }

  .hero-dashboard .eyebrow,
  .panel-heading .eyebrow {
    color: var(--rescue-red);
    font-size: 12px;
    font-weight: 1000;
    letter-spacing: 0.9px;
  }

  .hero-dashboard h2 {
    max-width: 74%;
    margin-top: 10px;
    font-size: 24px;
    line-height: 1.15;
    color: #ffffff;
  }

  .hero-dashboard p {
    max-width: 74%;
    margin-top: 12px;
    color: rgba(255, 255, 255, 0.92);
    font-size: 14px;
    line-height: 1.45;
  }

  .tab-panel.active {
    gap: 14px;
  }

  .panel-heading {
    margin: 0;
    padding: 16px 18px 0;
    border-radius: 14px 14px 0 0;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-bottom: 0;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
  }

  .panel-heading h2 {
    color: var(--primary);
    font-size: 18px;
    text-transform: uppercase;
  }

  #attendanceTab > .toolbar {
    margin-top: -14px;
    padding: 18px;
    border-radius: 0 0 14px 14px;
    border-top: 0;
    background: #ffffff;
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.07);
  }

  #attendanceTab > .toolbar label,
  #attendanceTab > .toolbar .file-button,
  #attendanceTab > .toolbar button {
    min-height: 44px;
    border-radius: 8px;
  }

  #attendanceTab > .toolbar label:not(.file-button) {
    color: transparent;
    font-size: 0;
  }

  #attendanceTab > .toolbar label input,
  #attendanceTab > .toolbar label select {
    color: var(--primary);
    font-size: 14px;
  }

  #attendanceTab > .toolbar .file-button,
  #attendanceTab > .toolbar button {
    justify-content: center;
    color: var(--primary);
    font-size: 14px;
    font-weight: 900;
  }

  #attendanceTab > .toolbar .inline-file {
    align-items: center;
    background: #ffffff;
  }

  #attendanceTab > .toolbar #saveAttendanceBtn {
    min-height: 48px;
    border-radius: 9px;
    color: #ffffff;
    background: var(--rescue-red);
  }

  .stats-grid div,
  .kpi-grid div,
  .analytics-card,
  .summary-layout article,
  .table-wrap {
    border-radius: 12px;
    border-color: #e2e8f0;
    background: #ffffff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.07);
  }

  .stats-grid div,
  .kpi-grid div {
    min-height: 78px;
    padding: 14px 12px 14px 58px;
    border-left-width: 3px;
    position: relative;
    overflow: hidden;
  }

  .stats-grid div::before,
  .kpi-grid div::before {
    content: "";
    position: absolute;
    left: 16px;
    top: 50%;
    width: 30px;
    height: 30px;
    transform: translateY(-50%);
    border-radius: 999px;
    background: currentColor;
    opacity: 1;
    box-shadow: inset 0 0 0 9px rgba(255, 255, 255, 0.36);
  }

  .stats-grid div::after,
  .kpi-grid div::after {
    display: none;
  }

  .stats-grid div:nth-child(1),
  .kpi-grid div:nth-child(1) {
    color: #1976d2;
  }

  .stats-grid div:nth-child(2),
  .kpi-grid div:nth-child(2) {
    color: #16a34a;
  }

  .stats-grid div:nth-child(3),
  .kpi-grid div:nth-child(3) {
    color: #dc2626;
  }

  .stats-grid div:nth-child(4),
  .kpi-grid div:nth-child(4) {
    color: #f97316;
  }

  .stats-grid div:nth-child(5),
  .kpi-grid div:nth-child(5) {
    color: #7c3aed;
  }

  .stats-grid div:nth-child(6),
  .kpi-grid div:nth-child(6) {
    color: #4f46e5;
  }

  .stats-grid div:nth-child(7),
  .kpi-grid div:nth-child(7) {
    color: #f59e0b;
  }

  .stats-grid div:nth-child(8),
  .kpi-grid div:nth-child(8) {
    color: #475569;
  }

  .stats-grid strong,
  .kpi-grid strong {
    color: var(--primary);
    font-size: 24px;
    line-height: 1;
  }

  .stats-grid span,
  .kpi-grid span {
    margin-top: 5px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    max-width: 100%;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }

  .analytics-card .section-heading h2,
  .summary-layout .section-heading h2 {
    color: #0f5f6d;
    font-size: 15px;
    text-transform: uppercase;
  }

  .notifications-card {
    grid-column: 1 / -1;
  }

  .notification-list p {
    border-radius: 8px;
  }
}

@media (min-width: 390px) and (max-width: 620px) {
  .analytics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .notifications-card {
    grid-column: 1 / -1;
  }
}

@media (max-width: 430px) {
  .app-shell {
    padding: 14px;
  }

  .topbar {
    grid-template-columns: 52px minmax(0, 1fr) auto;
  }

  .topbar h1 {
    font-size: 20px;
  }

  .topbar p {
    font-size: 12px;
  }

  .topbar-status {
    max-width: 110px;
    padding-inline: 10px;
    font-size: 11px;
  }

  .hero-dashboard {
    min-height: 176px;
    padding: 20px;
  }

  .hero-dashboard h2,
  .hero-dashboard p {
    max-width: 78%;
  }

  .hero-dashboard h2 {
    font-size: 22px;
  }

  .hero-dashboard p {
    font-size: 13px;
  }
}

@media (max-width: 380px) {
  .app-shell {
    padding: 10px;
  }

  .topbar {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  #sidebarToggle {
    width: 48px;
    min-width: 48px;
    height: 48px;
  }

  .topbar-status {
    grid-column: 1 / -1;
    margin-top: 8px;
  }

  #currentDate,
  #currentTime {
    grid-column: 1 / -1;
    margin-top: 8px;
  }

  .hero-dashboard h2,
  .hero-dashboard p {
    max-width: 100%;
  }
}

/* Clean reactive glow + shimmer buttons. No visible dot pattern. */
.login-page,
.hero-dashboard {
  --reactive-x: 58%;
  --reactive-y: 42%;
  isolation: isolate;
}

.login-page {
  background:
    radial-gradient(circle at var(--reactive-x) var(--reactive-y), rgba(8, 127, 140, 0.24), transparent 34%),
    linear-gradient(135deg, #07172b 0%, #102b4c 46%, #f5f7fa 46.2%, #f5f7fa 100%) !important;
}

.hero-dashboard {
  background:
    radial-gradient(circle at var(--reactive-x) var(--reactive-y), rgba(255, 255, 255, 0.26), transparent 34%),
    linear-gradient(135deg, rgba(7, 22, 41, 0.96), rgba(8, 127, 140, 0.9)) !important;
  overflow: hidden;
}

.login-page::before,
.login-page::after,
.hero-dashboard::before,
.hero-dashboard::after {
  background-image: none !important;
}

button:not(.secondary):not(.ghost):not(.danger):not(.link-button):not(.login-mode-tab):not(.icon-button),
.file-button:not(.inline-file) {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

button:not(.secondary):not(.ghost):not(.danger):not(.link-button):not(.login-mode-tab):not(.icon-button)::before,
.file-button:not(.inline-file)::before {
  content: "";
  position: absolute;
  inset: -90% -45%;
  z-index: -1;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.36) 45%, transparent 60%);
  transform: translateX(-70%) rotate(8deg);
  animation: dha-shimmer-sweep 2.6s linear infinite;
  pointer-events: none;
}

button:not(.secondary):not(.ghost):not(.danger):not(.link-button):not(.login-mode-tab):not(.icon-button)::after,
.file-button:not(.inline-file)::after {
  content: "";
  position: absolute;
  inset: 1px;
  z-index: -2;
  border-radius: inherit;
  background: inherit;
  pointer-events: none;
}

@keyframes dha-shimmer-sweep {
  to {
    transform: translateX(70%) rotate(8deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  button:not(.secondary):not(.ghost):not(.danger):not(.link-button):not(.login-mode-tab):not(.icon-button)::before,
  .file-button:not(.inline-file)::before {
    animation: none;
  }
}

/* DHA 2026 full UI/UX refresh */
:root {
  --primary: #073b4c;
  --secondary: #0f766e;
  --rescue-red: #d62828;
  --success: #15803d;
  --warning: #b7791f;
  --info: #1d4ed8;
  --purple: #6d28d9;
  --surface-bg: #f3f7f8;
  --card: #ffffff;
  --text: #10202b;
  --muted: #5f7180;
  --border: #d8e3e7;
  --soft-blue: #e8f4f6;
  --shadow-soft: 0 10px 28px rgba(7, 59, 76, 0.08);
  --shadow-hover: 0 18px 42px rgba(7, 59, 76, 0.14);
  --sidebar-width: 286px;
}

body {
  color: var(--text);
  background:
    radial-gradient(circle at 12% 0%, rgba(15, 118, 110, 0.12), transparent 32%),
    linear-gradient(180deg, #f7fbfc 0%, var(--surface-bg) 100%);
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
}

button,
.file-button {
  border-radius: 10px;
  font-weight: 800;
}

button:not(.secondary):not(.ghost):not(.danger):not(.link-button):not(.login-mode-tab):not(.icon-button) {
  min-height: 44px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--rescue-red), #a4161a);
  box-shadow: 0 12px 24px rgba(214, 40, 40, 0.2);
}

button:not(.secondary):not(.ghost):not(.danger):not(.link-button):not(.login-mode-tab):not(.icon-button):hover {
  background: linear-gradient(135deg, #c81f27, #8f1217);
  box-shadow: 0 16px 32px rgba(214, 40, 40, 0.26);
}

button.secondary,
button.ghost,
.file-button {
  min-height: 42px;
  color: var(--primary);
  background: #ffffff;
  border: 1px solid var(--border);
  box-shadow: 0 4px 12px rgba(7, 59, 76, 0.04);
}

button.secondary:hover,
button.ghost:hover,
.file-button:hover {
  background: #f8fcfd;
  border-color: #b8ccd3;
}

input,
select,
textarea {
  border-radius: 10px;
  border-color: var(--border);
  background: #fbfdfd;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--secondary);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.13);
}

label {
  color: var(--muted);
  letter-spacing: 0;
}

.login-page {
  grid-template-columns: minmax(360px, 0.78fr) minmax(520px, 1.22fr);
  gap: 20px;
  padding: 20px;
  background:
    radial-gradient(circle at var(--reactive-x) var(--reactive-y), rgba(15, 118, 110, 0.24), transparent 33%),
    linear-gradient(132deg, #062332 0%, #073b4c 44%, #f4f8f9 44.2%, #f4f8f9 100%) !important;
}

.login-box {
  align-self: center;
  max-width: 520px;
  min-height: auto;
  margin-inline: auto;
  border: 1px solid rgba(216, 227, 231, 0.85);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 24px 70px rgba(7, 35, 50, 0.22);
  backdrop-filter: blur(18px);
}

.login-content {
  padding: 34px;
}

.login-box::before {
  height: 5px;
  border-radius: 18px 18px 0 0;
  background: linear-gradient(90deg, var(--rescue-red), var(--warning), var(--secondary));
}

.login-kicker,
.powered-by,
.storage-status {
  width: fit-content;
  border-radius: 999px;
}

.login-box h1 {
  color: var(--primary);
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.02;
}

.login-box p {
  color: var(--muted);
}

.login-form-card,
.forgot-box {
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #ffffff;
  box-shadow: 0 14px 30px rgba(7, 59, 76, 0.08);
}

.login-mode-tabs {
  border-radius: 999px;
  padding: 4px;
  background: #e9f2f4;
}

.login-mode-tab {
  border-radius: 999px;
}

.login-mode-tab.active,
.login-mode-tab:hover {
  background: var(--primary);
}

.login-visual {
  position: relative;
  min-height: calc(100vh - 40px);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 24px 70px rgba(7, 35, 50, 0.22);
}

.login-visual::before {
  display: block;
  background:
    linear-gradient(90deg, rgba(6, 35, 50, 0.72), rgba(6, 35, 50, 0.12)),
    radial-gradient(circle at 72% 24%, rgba(255, 255, 255, 0.18), transparent 34%) !important;
}

.login-visual img {
  transform: scale(1.02);
}

.app-page {
  background:
    radial-gradient(circle at 78% 0%, rgba(15, 118, 110, 0.1), transparent 30%),
    var(--surface-bg);
}

.sidebar {
  padding: 24px 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 22%),
    linear-gradient(180deg, #062332, #031821);
  box-shadow: 10px 0 34px rgba(3, 24, 33, 0.2);
}

.brand-mark {
  border-radius: 14px;
  background: linear-gradient(135deg, var(--rescue-red), #9f1239);
  box-shadow: 0 14px 28px rgba(214, 40, 40, 0.25);
}

.sidebar-brand {
  gap: 14px;
}

.sidebar-brand strong {
  font-size: 15px;
  letter-spacing: 0;
}

.tab {
  border-radius: 12px;
  padding: 11px 13px;
  color: rgba(255, 255, 255, 0.74);
}

.tab:hover,
.tab.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.11);
  border-color: rgba(255, 255, 255, 0.14);
}

.tab.active {
  border-left: 0;
  box-shadow: inset 4px 0 0 var(--rescue-red);
}

.app-shell {
  padding: 24px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 9;
  border: 1px solid rgba(216, 227, 231, 0.9);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(16px);
}

.topbar h1 {
  color: var(--primary);
  letter-spacing: 0;
}

.topbar p,
.topbar-credit {
  color: var(--muted);
}

.header-pill,
.role-chip {
  border-radius: 999px;
  border-color: #cfe0e5;
  background: #f5fbfc;
}

.hero-dashboard {
  min-height: 220px;
  margin: 22px 0;
  padding: 34px;
  border: 0;
  border-radius: 22px;
  background:
    radial-gradient(circle at var(--reactive-x) var(--reactive-y), rgba(255, 255, 255, 0.28), transparent 34%),
    linear-gradient(110deg, rgba(6, 35, 50, 0.96), rgba(15, 118, 110, 0.72)),
    url("../../assets/images/rescue-service-1122-banner.png") center / cover no-repeat !important;
  box-shadow: 0 22px 56px rgba(7, 59, 76, 0.18);
}

.hero-dashboard .eyebrow {
  color: #fbbf24;
}

.hero-dashboard h2 {
  max-width: 780px;
  font-size: clamp(30px, 4vw, 48px);
}

.hero-dashboard p {
  max-width: 680px;
}

.panel-heading {
  margin: 4px 0 2px;
}

.panel-heading h2,
.section-heading h2,
.pro-pie-head h3 {
  color: var(--primary);
  letter-spacing: 0;
}

.eyebrow {
  color: var(--secondary);
  letter-spacing: 0.04em;
}

.toolbar,
.employee-form,
.summary-layout article,
.table-wrap,
.analytics-card,
.pro-pie-card,
.employee-portal-card,
.performance-variable-editor,
.official-roster-panel {
  border: 1px solid rgba(216, 227, 231, 0.94);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow-soft);
}

.toolbar,
.employee-form {
  padding: 18px;
}

.toolbar:hover,
.employee-form:hover,
.summary-layout article:hover,
.table-wrap:hover,
.stats-grid div:hover,
.kpi-grid div:hover,
.analytics-card:hover,
.pro-pie-card:hover,
.employee-portal-card:hover {
  border-color: #b8ccd3;
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}

.stats-grid,
.kpi-grid,
.performance-summary-grid,
.employee-summary-grid {
  gap: 14px;
}

.stats-grid div,
.kpi-grid div,
.performance-summary-grid article,
.employee-summary-grid div {
  min-height: 96px;
  border: 1px solid rgba(216, 227, 231, 0.94);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(247, 251, 252, 0.98)) !important;
  box-shadow: var(--shadow-soft);
}

.stats-grid div::before,
.kpi-grid div::before {
  opacity: 0.95;
}

.stats-grid strong,
.kpi-grid strong,
.performance-summary-grid strong,
.employee-summary-grid strong {
  color: var(--primary);
  letter-spacing: 0;
}

.stats-grid span,
.kpi-grid span,
.performance-summary-grid span,
.employee-summary-grid span {
  color: var(--muted);
}

.analytics-grid,
.performance-main-grid,
.performance-monthly-grid,
.employee-portal-grid {
  gap: 18px;
}

.dashboard-chart,
.pro-pie-body,
.attendance-pie-body,
.incident-pie-body,
.leave-analytics .pro-pie-body {
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff, #f7fbfc);
}

.table-wrap {
  overflow: auto;
}

table {
  border-collapse: separate;
  border-spacing: 0;
}

thead th {
  color: var(--primary);
  background: #eef6f8;
  border-bottom: 1px solid var(--border);
}

tbody tr:nth-child(even) {
  background: #fbfdfd;
}

tbody tr:hover {
  background: #eef8f9;
}

td,
th {
  border-color: #e4edf0;
}

.form-modal-card {
  border-radius: 18px;
  border: 1px solid var(--border);
  box-shadow: 0 28px 90px rgba(3, 24, 33, 0.28);
}

.form-modal-head {
  border-radius: 18px 18px 0 0;
}

.employee-portal-page {
  background:
    radial-gradient(circle at 90% 0%, rgba(15, 118, 110, 0.1), transparent 28%),
    var(--surface-bg);
}

.employee-portal-topbar {
  border-radius: 18px;
  box-shadow: var(--shadow-soft);
}

@media (max-width: 900px) {
  .login-page {
    grid-template-columns: 1fr;
    padding: 14px;
    background:
      radial-gradient(circle at var(--reactive-x) var(--reactive-y), rgba(15, 118, 110, 0.2), transparent 34%),
      linear-gradient(180deg, #062332 0%, #073b4c 34%, #f4f8f9 34.2%, #f4f8f9 100%) !important;
  }

  .login-box {
    max-width: 100%;
  }

  .login-visual {
    min-height: 260px;
    border-radius: 18px;
  }

  .app-shell {
    padding: 16px;
  }

  .hero-dashboard {
    border-radius: 18px;
    padding: 24px;
  }
}

@media (max-width: 620px) {
  .login-content {
    padding: 24px;
  }

  .topbar,
  .toolbar,
  .employee-form,
  .analytics-card,
  .table-wrap,
  .employee-portal-card {
    border-radius: 14px;
  }

  .hero-dashboard h2,
  .hero-dashboard p {
    max-width: 100%;
  }
}

/* ===== RESCUE 1122 SINDH - CENTRAL DASHBOARD ===== */
.central-kpi-grid {
  grid-template-columns: repeat(5, minmax(140px, 1fr));
}

.central-kpi-grid div:nth-child(9) { border-left-color: var(--rescue-red); }
.central-kpi-grid div:nth-child(10) { border-left-color: var(--success); }

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

.central-toolbar {
  grid-template-columns: repeat(4, minmax(150px, 1fr)) auto;
}

.central-user-toolbar {
  grid-template-columns: minmax(200px, 320px) auto;
  justify-content: start;
}

.central-bars {
  display: grid;
  gap: 10px;
  max-height: 340px;
  overflow: auto;
  padding-right: 4px;
}

.central-bar-row {
  display: grid;
  grid-template-columns: minmax(90px, 1.1fr) minmax(80px, 2fr) 76px;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 700;
}

.central-bar-label {
  overflow: hidden;
  color: var(--primary);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.central-bar-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8eef3;
}

.central-bar-track i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--success, #16a34a);
  transition: width 300ms ease;
}

.central-bar-track i.incident { background: var(--rescue-red, #d62828); }
.central-bar-track i.muted { background: #cbd5e1; }

.central-bar-value {
  color: var(--muted);
  text-align: right;
}

.central-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.central-status.ok { color: #166534; background: #eafaf1; }
.central-status.warn { color: #b42318; background: #fdecec; }

.central-table-wrap th,
.central-table-wrap td {
  text-align: center;
}

.central-table-wrap th:nth-child(2),
.central-table-wrap td:nth-child(2),
.central-table-wrap td:nth-child(3) {
  text-align: left;
}

.central-total-row td {
  font-weight: 900;
  background: #eef6f8 !important;
  border-top: 2px solid var(--primary);
}

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

.central-actions button {
  min-height: 34px;
  padding: 6px 11px;
  font-size: 12px;
}

.central-form {
  grid-template-columns: 1fr;
}

.central-form .form-grid {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.central-hint {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.central-empty {
  color: var(--muted);
  font-weight: 700;
}

.back-to-central {
  width: 100%;
  margin: 4px 0 12px;
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.1) !important;
  border: 1px solid rgba(255, 255, 255, 0.24) !important;
}

.back-to-central:hover {
  background: rgba(255, 255, 255, 0.18) !important;
}

@media (max-width: 1180px) {
  .central-kpi-grid { grid-template-columns: repeat(3, minmax(140px, 1fr)); }
  .central-analytics { grid-template-columns: 1fr; }
  .central-toolbar { grid-template-columns: repeat(2, minmax(150px, 1fr)); }
  .central-sidebar-toggle {
    color: #ffffff;
    background: var(--rescue-red);
    border-color: var(--rescue-red);
  }
}

@media (max-width: 620px) {
  .central-kpi-grid,
  .central-toolbar,
  .central-user-toolbar { grid-template-columns: 1fr 1fr; }
  .central-toolbar button { grid-column: 1 / -1; }
  .central-bar-row { grid-template-columns: minmax(80px, 1fr) minmax(60px, 1.4fr) 70px; }
}

@media (max-width: 380px) {
  .central-kpi-grid,
  .central-toolbar,
  .central-user-toolbar { grid-template-columns: 1fr; }
}

/* User ID form - access types */
.central-user-grid {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) !important;
  align-items: start !important;
}

.central-access {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 14px 16px 16px;
  border: 1px solid var(--border, #d8e3e7);
  border-radius: 10px;
  background: #f8fbfc;
}

.central-access legend {
  padding: 0 6px;
  color: var(--primary);
  font-size: 14px;
  font-weight: 900;
}

.central-access-preset {
  max-width: 420px;
}

.central-access-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 8px 16px;
}

.central-access-item {
  display: flex !important;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--border, #d8e3e7);
  border-radius: 8px;
  background: #ffffff;
  color: var(--primary) !important;
  font-weight: 700;
  cursor: pointer;
}

.central-access-item input {
  width: 18px;
  min-width: 18px;
  height: 18px;
  min-height: 18px;
  margin: 0;
  accent-color: var(--rescue-red, #d62828);
}

.central-access-item:has(input:checked) {
  border-color: rgba(214, 40, 40, 0.45);
  background: #fff5f5;
}

.central-field-note {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.access-note {
  grid-column: 1 / -1;
  margin: 0;
  padding: 10px 14px;
  border: 1px solid #f4c7a1;
  border-radius: 8px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 13px;
  font-weight: 800;
}

.file-button.file-button-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* =====================================================================
   RESCUE 1122 SINDH - OFFICIAL THEME (final layer, overrides all above)
   Calm government palette: deep green structure, white paper, Rescue red
   only for primary actions and alerts. Bahnschrift (Windows' DIN road-sign
   face) for headings and figures; Segoe UI for text. Works fully offline.
   ===================================================================== */
:root {
  --o-paper: #f4f6f4;
  --o-surface: #ffffff;
  --o-ink: #18231e;
  --o-muted: #5a6a62;
  --o-line: #d9e1dc;
  --o-line-soft: #e8ede9;
  --o-green: #0e3b2e;
  --o-green-2: #155443;
  --o-green-tint: #e7f0eb;
  --o-red: #c8102e;
  --o-red-dark: #a00d25;
  --o-red-tint: #fbe9ec;
  --o-amber: #b45309;
  --o-amber-tint: #fdf3e2;
  --o-ok: #15803d;
  --o-ok-tint: #e6f4ea;
  --o-head: "Bahnschrift", "DIN Alternate", "Segoe UI", Arial, sans-serif;
  --o-body: "Segoe UI", "Segoe UI Variable", Tahoma, Arial, sans-serif;
  --o-livery: repeating-linear-gradient(135deg, var(--o-red) 0 14px, #ffffff 14px 28px);

  /* remap tokens used by earlier layers */
  --primary: var(--o-green);
  --rescue-red: var(--o-red);
  --surface-bg: var(--o-paper);
  --card: var(--o-surface);
  --border: var(--o-line);
  --muted: var(--o-muted);
  --success: var(--o-ok);
  --warning: var(--o-amber);
  --info: var(--o-green-2);
  --purple: #4b5d8a;
  --shadow: none;
  --shadow-soft: none;
  --shadow-strong: none;
  --brand: var(--o-green);
  --brand-dark: var(--o-green);
  --ink: var(--o-ink);
  --line: var(--o-line);
}

html { -webkit-text-size-adjust: 100%; }

body {
  color: var(--o-ink) !important;
  background: var(--o-paper) !important;
  font-family: var(--o-body) !important;
  font-size: 14px;
}

h1, h2, h3,
.stats-grid strong,
.performance-summary-grid strong,
.employee-summary-grid strong,
.leave-overview strong,
.brand-mark {
  font-family: var(--o-head) !important;
  letter-spacing: 0 !important;
}

/* No ambient animation */
*, *::before, *::after {
  animation: none !important;
}
.login-page::after, .login-page::before,
.hero-dashboard::before, .hero-dashboard::after,
.stats-grid div::after { display: none !important; }

.eyebrow { display: none !important; }

/* ---------- Buttons ---------- */
button,
button:not(.secondary):not(.ghost):not(.danger):not(.link-button):not(.login-mode-tab):not(.icon-button) {
  min-height: 38px;
  padding: 8px 16px;
  border: 1px solid var(--o-red) !important;
  border-radius: 6px !important;
  color: #ffffff !important;
  background: var(--o-red) !important;
  box-shadow: none !important;
  font-family: var(--o-body);
  font-size: 13.5px;
  font-weight: 600 !important;
  letter-spacing: 0;
  transform: none !important;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}
button:not(.secondary):not(.ghost):not(.danger):not(.link-button):not(.login-mode-tab):not(.icon-button)::before,
button:not(.secondary):not(.ghost):not(.danger):not(.link-button):not(.login-mode-tab):not(.icon-button)::after { display: none !important; }
button:not(.secondary):not(.ghost):not(.danger):not(.link-button):not(.login-mode-tab):not(.icon-button):hover {
  background: var(--o-red-dark) !important;
  border-color: var(--o-red-dark) !important;
}
button.secondary {
  color: var(--o-green) !important;
  background: #ffffff !important;
  border: 1px solid #b9c9c0 !important;
  border-radius: 6px !important;
  box-shadow: none !important;
  font-weight: 600 !important;
  transform: none !important;
}
button.secondary:hover { background: var(--o-green-tint) !important; border-color: var(--o-green-2) !important; }
button.ghost {
  color: var(--o-green) !important;
  background: transparent !important;
  border: 1px solid var(--o-line) !important;
  border-radius: 6px !important;
  box-shadow: none !important;
  font-weight: 600 !important;
}
button.ghost:hover { background: var(--o-green-tint) !important; }
button.danger {
  color: var(--o-red) !important;
  background: #ffffff !important;
  border: 1px solid #e7a3ae !important;
  border-radius: 6px !important;
  box-shadow: none !important;
  font-weight: 600 !important;
}
button.danger:hover { color: #ffffff !important; background: var(--o-red) !important; border-color: var(--o-red) !important; }
button:disabled, button[disabled] {
  opacity: 0.45 !important;
  cursor: not-allowed !important;
}
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .file-button:focus-within {
  outline: 3px solid rgba(21, 84, 67, 0.35) !important;
  outline-offset: 2px !important;
}

.file-button {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 14px !important;
  border: 1px dashed #9fb5a9 !important;
  border-radius: 6px !important;
  color: var(--o-green) !important;
  background: #ffffff !important;
  box-shadow: none !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  transform: none !important;
}
.file-button:hover { background: var(--o-green-tint) !important; }

/* ---------- Inputs ---------- */
label {
  color: var(--o-muted) !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}
input, select, textarea {
  min-height: 38px;
  border: 1px solid #cdd7d1 !important;
  border-radius: 6px !important;
  color: var(--o-ink) !important;
  background: #ffffff !important;
  box-shadow: none !important;
  font-family: var(--o-body) !important;
  font-size: 14px !important;
  font-weight: 400 !important;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--o-green-2) !important;
  box-shadow: 0 0 0 3px rgba(21, 84, 67, 0.14) !important;
}
input[type="checkbox"] { min-height: 0; accent-color: var(--o-red); }

/* ---------- Sidebar ---------- */
.sidebar {
  background: var(--o-green) !important;
  box-shadow: none !important;
  padding: 0 0 18px !important;
}
.sidebar-brand {
  position: relative;
  padding: 26px 20px 20px !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}
.sidebar-brand::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 6px;
  background: var(--o-livery);
}
.brand-mark {
  width: 46px !important;
  height: 46px !important;
  border-radius: 50% !important;
  background: var(--o-red) !important;
  box-shadow: none !important;
  font-size: 13px !important;
  font-weight: 700 !important;
}
.sidebar-brand strong { font-family: var(--o-head); font-size: 15px !important; font-weight: 600 !important; }
.sidebar-brand span { color: rgba(255, 255, 255, 0.66) !important; font-weight: 400 !important; }

.sidebar-nav { gap: 2px !important; margin: 14px 0 !important; padding: 0 10px; }
.sidebar .tab,
.sidebar button.tab:not(.secondary):not(.ghost):not(.danger) {
  min-height: 42px !important;
  padding: 9px 14px !important;
  border: 0 !important;
  border-radius: 6px !important;
  color: rgba(255, 255, 255, 0.78) !important;
  background: transparent !important;
  box-shadow: none !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  text-align: left;
  justify-content: flex-start;
}
.sidebar .tab:hover:not(:disabled) { color: #ffffff !important; background: rgba(255, 255, 255, 0.08) !important; }
.sidebar .tab.active,
.sidebar button.tab.active:not(.secondary):not(.ghost):not(.danger) {
  color: var(--o-green) !important;
  background: #ffffff !important;
  font-weight: 600 !important;
  box-shadow: inset 4px 0 0 var(--o-red) !important;
}
.sidebar .tab:disabled { opacity: 0.4 !important; }

.sidebar-footer {
  margin: 0 14px;
  padding-top: 16px !important;
  border-top: 1px solid rgba(255, 255, 255, 0.12) !important;
  gap: 8px !important;
}
.sidebar-footer > span:first-of-type { text-transform: none; }
.sidebar-footer strong {
  color: #ffffff;
  font-size: 13px !important;
  font-weight: 600 !important;
  line-height: 1.4;
  word-break: break-word;
}
.sidebar-footer .role-chip { display: none !important; }
.sidebar-footer button.ghost {
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.3) !important;
}
.sidebar-footer button.ghost:hover { background: rgba(255, 255, 255, 0.1) !important; }
.back-to-central { margin: 0 !important; }

/* ---------- Page shell & header ---------- */
.app-page { background: var(--o-paper) !important; }
.app-shell { padding: 24px 28px 40px !important; }

.topbar {
  position: relative !important;
  min-height: 0 !important;
  padding: 22px 24px 18px !important;
  border: 1px solid var(--o-line) !important;
  border-radius: 8px !important;
  color: var(--o-ink) !important;
  background: #ffffff !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  overflow: hidden;
}
.topbar::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 5px;
  background: var(--o-livery);
}
.topbar::after { display: none !important; }
.topbar h1 {
  margin: 0 !important;
  color: var(--o-green) !important;
  font-size: 26px !important;
  font-weight: 600 !important;
  line-height: 1.15 !important;
  text-shadow: none !important;
}
.topbar p { margin-top: 4px !important; color: var(--o-muted) !important; text-shadow: none !important; font-size: 14px; }
.topbar .powered-by,
.topbar-credit { display: none !important; }

.storage-status,
.topbar-status {
  width: auto !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 6px 10px 6px 26px !important;
  position: relative;
  border: 1px solid #c7e3cf !important;
  border-radius: 999px !important;
  color: #14532d !important;
  background: var(--o-ok-tint) !important;
  box-shadow: none !important;
  font-size: 12px !important;
  font-weight: 600 !important;
}
.storage-status::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 50%;
  width: 8px;
  height: 8px;
  margin-top: -4px;
  border-radius: 50%;
  background: var(--o-ok);
}
.storage-status.error {
  color: #7f1d1d !important;
  background: var(--o-red-tint) !important;
  border-color: #f2b8c2 !important;
}
.storage-status.error::before { background: var(--o-red); }

.header-pill {
  min-height: 0 !important;
  padding: 6px 10px !important;
  border: 1px solid var(--o-line) !important;
  border-radius: 6px !important;
  color: var(--o-ink) !important;
  background: var(--o-paper) !important;
  font-family: var(--o-head);
  font-size: 13px !important;
  font-weight: 500 !important;
}
.notification-dot { display: none !important; }

.hero-dashboard { display: none !important; }

.panel-heading {
  margin: 26px 0 2px !important;
  padding: 0 !important;
}
.panel-heading h2 {
  margin: 0 !important;
  color: var(--o-green) !important;
  font-size: 22px !important;
  font-weight: 600 !important;
}
.panel-heading p { color: var(--o-muted) !important; font-weight: 400 !important; }

.tab-panel.active { gap: 16px !important; }

/* ---------- Panels ---------- */
.toolbar,
.employee-form,
.analytics-card,
.summary-layout article,
.employee-portal-card,
.performance-variable-editor,
.performance-filters,
.central-access {
  border: 1px solid var(--o-line) !important;
  border-radius: 8px !important;
  background: #ffffff !important;
  box-shadow: none !important;
  transform: none !important;
}
.toolbar:hover, .employee-form:hover, .table-wrap:hover, .summary-layout article:hover, .stats-grid div:hover {
  box-shadow: none !important;
  border-color: var(--o-line) !important;
  transform: none !important;
}
.central-access { background: var(--o-paper) !important; }

.section-heading h2 {
  color: var(--o-ink) !important;
  font-size: 16px !important;
  font-weight: 600 !important;
}
.section-heading span { color: var(--o-muted) !important; font-weight: 400 !important; font-size: 12.5px !important; }

.form-section-title {
  color: var(--o-green) !important;
  background: none !important;
  border: 0 !important;
  border-bottom: 1px solid var(--o-line) !important;
  border-radius: 0 !important;
  padding: 0 0 8px !important;
  font-family: var(--o-head);
  font-size: 15px !important;
  font-weight: 600 !important;
}

/* ---------- Figures: one ruled panel instead of floating cards ---------- */
.stats-grid,
.performance-summary-grid,
.employee-summary-grid,
.leave-overview {
  gap: 1px !important;
  padding: 0 !important;
  overflow: hidden;
  border: 1px solid var(--o-line) !important;
  border-radius: 8px !important;
  background: var(--o-line) !important;
}
.stats-grid div,
.performance-summary-grid article,
.employee-summary-grid div,
.leave-overview div,
.employee-performance-summary div {
  min-height: 0 !important;
  padding: 14px 16px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: #ffffff !important;
  box-shadow: none !important;
  transform: none !important;
}
.stats-grid strong,
.performance-summary-grid strong,
.employee-summary-grid strong,
.leave-overview strong {
  display: block;
  color: var(--o-ink) !important;
  font-size: 28px !important;
  font-weight: 600 !important;
  line-height: 1.1 !important;
}
.stats-grid span,
.performance-summary-grid span,
.employee-summary-grid span,
.leave-overview span {
  color: var(--o-muted) !important;
  font-size: 12.5px !important;
  font-weight: 500 !important;
}
/* colour carries meaning only where the figure itself is a status */
.kpi-grid:not(.incident-stats):not(.central-kpi-grid):not(.fleet-kpis):not(.store-kpis):not(.hr-kpis) div:nth-child(2) strong { color: var(--o-ok) !important; }
.kpi-grid:not(.incident-stats):not(.central-kpi-grid):not(.fleet-kpis):not(.store-kpis):not(.hr-kpis) div:nth-child(3) strong { color: var(--o-red) !important; }
.central-kpi-grid div:nth-child(3) strong { color: var(--o-ok) !important; }
.central-kpi-grid div:nth-child(4) strong,
.central-kpi-grid div:nth-child(7) strong { color: var(--o-red) !important; }

/* ---------- Tables ---------- */
.table-wrap {
  border: 1px solid var(--o-line) !important;
  border-radius: 8px !important;
  background: #ffffff !important;
  box-shadow: none !important;
}
table { font-size: 13.5px; }
th {
  color: var(--o-muted) !important;
  background: #eef2ef !important;
  border-bottom: 1px solid var(--o-line) !important;
  font-family: var(--o-body);
  font-size: 12.5px !important;
  font-weight: 600 !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
}
td { border-bottom: 1px solid var(--o-line-soft) !important; color: var(--o-ink); }
tbody tr:nth-child(even) { background: transparent !important; }
tbody tr:hover { background: #f6f9f7 !important; }
td.empty { color: var(--o-muted) !important; font-style: normal; text-align: center !important; padding: 26px !important; }
.central-total-row td { background: var(--o-green-tint) !important; border-top: 2px solid var(--o-green) !important; }

.status-select { font-weight: 600 !important; }

/* ---------- Status chips ---------- */
.central-status, .roster-status, .roster-score, .roster-trend, .performance-grade {
  border-radius: 4px !important;
  font-weight: 600 !important;
}
.central-status.ok { color: #14532d !important; background: var(--o-ok-tint) !important; }
.central-status.warn { color: #9f1239 !important; background: var(--o-red-tint) !important; }

.notification-item {
  padding: 10px 12px !important;
  border: 0 !important;
  border-left: 3px solid var(--o-amber) !important;
  border-radius: 0 6px 6px 0 !important;
  color: var(--o-ink) !important;
  background: var(--o-amber-tint) !important;
  box-shadow: none !important;
  font-size: 13px !important;
  font-weight: 500 !important;
}

.central-bar-track { height: 8px !important; background: var(--o-line-soft) !important; }
.central-bar-track i:not([style*="background"]) { background: var(--o-ok) !important; }
.central-bar-track i.incident { background: var(--o-red) !important; }
.central-bar-label { color: var(--o-ink) !important; font-weight: 500 !important; }
.central-bar-value { font-family: var(--o-head); }

.message { color: var(--o-green-2) !important; font-weight: 600 !important; }
.central-hint { font-weight: 400 !important; }
.access-note { font-weight: 600 !important; }

.central-access-item {
  border-radius: 6px !important;
  font-weight: 500 !important;
}
.central-access-item:has(input:checked) {
  border-color: var(--o-green-2) !important;
  background: var(--o-green-tint) !important;
}
.central-access-item input { accent-color: var(--o-green-2) !important; }

/* ---------- Login ---------- */
.login-page {
  grid-template-columns: minmax(380px, 520px) 1fr !important;
  gap: 0 !important;
  padding: 0 !important;
  background: var(--o-paper) !important;
}
.login-box {
  min-height: 100vh !important;
  padding: 56px 56px 40px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: #ffffff !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  align-content: center;
}
.login-box::before {
  height: 8px !important;
  background: var(--o-livery) !important;
}
.login-content { width: 100% !important; max-width: 400px; }
.login-kicker {
  margin: 0 0 6px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  color: var(--o-red) !important;
  background: none !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}
.login-box h1 {
  margin: 0 !important;
  color: var(--o-green) !important;
  font-size: 40px !important;
  font-weight: 600 !important;
  line-height: 1.05 !important;
}
.login-box p.login-lead {
  margin: 10px 0 24px !important;
  color: var(--o-muted) !important;
  font-size: 15px !important;
  font-weight: 400 !important;
  line-height: 1.5;
}
.login-box .storage-status { display: inline-block; margin: 0 0 18px !important; }
.login-form-card {
  width: 100% !important;
  padding: 0 !important;
  border: 0 !important;
  background: none !important;
  box-shadow: none !important;
}
.login-form-card button[type="submit"] { width: 100%; min-height: 44px !important; font-size: 15px !important; }
.login-mode-tabs {
  display: grid !important;
  grid-template-columns: 1fr 1fr;
  gap: 0 !important;
  margin: 0 0 18px !important;
  padding: 3px !important;
  border: 1px solid var(--o-line) !important;
  border-radius: 8px !important;
  background: var(--o-paper) !important;
}
.login-mode-tab,
button.login-mode-tab {
  min-height: 36px !important;
  border: 0 !important;
  border-radius: 6px !important;
  color: var(--o-muted) !important;
  background: transparent !important;
  box-shadow: none !important;
  font-weight: 600 !important;
}
.login-mode-tab.active,
button.login-mode-tab.active {
  color: var(--o-green) !important;
  background: #ffffff !important;
  box-shadow: 0 1px 2px rgba(14, 59, 46, 0.12) !important;
}
.login-mode-tab:hover:not(.active) { background: transparent !important; color: var(--o-ink) !important; }
.link-button { color: var(--o-green-2) !important; background: none !important; border: 0 !important; box-shadow: none !important; font-weight: 600 !important; }
.forgot-box {
  width: 100% !important;
  margin-top: 22px !important;
  padding: 14px 0 0 !important;
  border-top: 1px solid var(--o-line) !important;
}
.forgot-box summary { color: var(--o-green-2) !important; font-weight: 600 !important; transform: none !important; }
.login-credit {
  margin: 30px 0 0 !important;
  padding: 0 !important;
  border: 0 !important;
  color: var(--o-muted) !important;
  background: none !important;
  box-shadow: none !important;
  font-size: 12px !important;
  font-weight: 400 !important;
}
.login-visual {
  min-height: 100vh !important;
  padding: 0 !important;
  border-radius: 0 !important;
  background: var(--o-green) !important;
  box-shadow: none !important;
}
.login-visual::before {
  background: linear-gradient(90deg, rgba(14, 59, 46, 0.35), transparent 30%) !important;
}
.login-visual img {
  border-radius: 0 !important;
  object-fit: cover !important;
  filter: none !important;
  transform: none !important;
}

/* ---------- Employee portal ---------- */
.employee-portal-page { background: var(--o-paper) !important; }
.employee-portal-topbar {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--o-line) !important;
  border-radius: 8px !important;
  color: var(--o-ink) !important;
  background: #ffffff !important;
  box-shadow: none !important;
}
.employee-portal-topbar::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 5px;
  background: var(--o-livery);
}
.employee-portal-topbar h1 { color: var(--o-green) !important; }
.employee-portal-topbar p { color: var(--o-muted) !important; }
.employee-shift-badge {
  border-radius: 4px !important;
  color: var(--o-green) !important;
  background: var(--o-green-tint) !important;
  border: 0 !important;
}

/* ---------- Modals ---------- */
.form-modal { background: rgba(14, 35, 28, 0.55) !important; }
.form-modal-card { border-radius: 8px !important; box-shadow: 0 20px 50px rgba(14, 35, 28, 0.25) !important; }

/* ---------- Small screens ---------- */
@media (max-width: 1180px) {
  .app-shell { padding: 16px !important; }
  .icon-button,
  #sidebarToggle,
  .central-sidebar-toggle {
    color: #ffffff !important;
    background: var(--o-green) !important;
    border: 0 !important;
    border-radius: 6px !important;
  }
}
@media (max-width: 900px) {
  .login-page { grid-template-columns: 1fr !important; }
  .login-visual { display: none !important; }
  .login-box { min-height: 100vh !important; padding: 40px 22px !important; }
  .login-box h1 { font-size: 32px !important; }
}
@media (max-width: 620px) {
  .topbar { padding: 18px 16px 14px !important; }
  .topbar h1 { font-size: 21px !important; }
  .stats-grid strong { font-size: 24px !important; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ---- Official theme: fixes after screen review ---- */
.sidebar .sidebar-nav button.tab:not(.secondary):not(.ghost):not(.danger):not(.link-button):not(.login-mode-tab):not(.icon-button) {
  min-height: 42px !important;
  padding: 9px 14px !important;
  border: 0 !important;
  border-radius: 6px !important;
  color: rgba(255, 255, 255, 0.8) !important;
  background: transparent !important;
  box-shadow: none !important;
  font-size: 14px !important;
  font-weight: 500 !important;
}
.sidebar .sidebar-nav button.tab:not(.secondary):not(.ghost):not(.danger):not(.link-button):not(.login-mode-tab):not(.icon-button):hover:not(:disabled) {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.08) !important;
}
.sidebar .sidebar-nav button.tab.active:not(.secondary):not(.ghost):not(.danger):not(.link-button):not(.login-mode-tab):not(.icon-button) {
  color: var(--o-green) !important;
  background: #ffffff !important;
  font-weight: 600 !important;
  box-shadow: inset 4px 0 0 var(--o-red) !important;
}

/* Password-reset bell: quiet button with a red count only when needed */
.password-reset-bell-btn,
button.password-reset-bell-btn:not(.secondary):not(.ghost):not(.danger):not(.link-button):not(.login-mode-tab):not(.icon-button) {
  width: 40px !important;
  min-width: 40px !important;
  height: 40px !important;
  min-height: 40px !important;
  padding: 0 !important;
  border: 1px solid var(--o-line) !important;
  border-radius: 6px !important;
  color: var(--o-green) !important;
  background: #ffffff !important;
  box-shadow: none !important;
}
.password-reset-bell-btn:hover { background: var(--o-green-tint) !important; }
.bell-symbol {
  color: var(--o-green) !important;
  background: none !important;
  border: 2px solid var(--o-green) !important;
  font-family: var(--o-head);
}
.bell-count {
  color: #ffffff !important;
  background: var(--o-red) !important;
  border: 2px solid #ffffff !important;
  box-shadow: none !important;
}

/* Shift badge and other small labels: sentence case */
.employee-shift-badge, .role-chip, .filter-count { text-transform: none !important; font-weight: 600 !important; }
.filter-count { color: var(--o-green) !important; background: var(--o-green-tint) !important; border: 0 !important; border-radius: 6px !important; }

/* Login: plain "Change password" disclosure */
.forgot-box,
details.forgot-box {
  border: 0 !important;
  border-top: 1px solid var(--o-line) !important;
  border-radius: 0 !important;
  background: none !important;
  box-shadow: none !important;
}
.forgot-box summary { padding: 0 !important; background: none !important; border: 0 !important; box-shadow: none !important; }
.login-form-card .message:empty { min-height: 0 !important; margin: 0 !important; }

/* Mobile: remove leftover decorations from older layers */
.stats-grid div::before, .kpi-grid div::before,
.performance-summary-grid article::before, .employee-summary-grid div::before { display: none !important; content: none !important; }
.stats-grid div, .kpi-grid div { color: inherit !important; }
.panel-heading,
.panel-heading h2 {
  text-transform: none !important;
  background: none !important;
  border: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}
.panel-heading { padding: 0 !important; }
#attendanceTab > .toolbar { margin-top: 0 !important; border: 1px solid var(--o-line) !important; border-radius: 8px !important; }

@media (max-width: 900px) {
  .topbar {
    display: grid !important;
    grid-template-columns: 44px minmax(0, 1fr) !important;
    align-items: center !important;
    gap: 10px 12px !important;
  }
  .topbar-actions {
    display: flex !important;
    grid-column: 1 / -1 !important;
    flex-wrap: wrap;
    gap: 8px !important;
    justify-content: flex-start !important;
  }
  .topbar-status, .storage-status.topbar-status {
    position: relative !important;
    grid-column: auto !important;
    max-width: none !important;
    min-height: 0 !important;
  }
  .topbar h1 { font-size: 20px !important; }
  .topbar p { font-size: 13px !important; }
  #sidebarToggle, .central-sidebar-toggle {
    width: 44px !important; min-width: 44px !important; height: 44px !important; min-height: 44px !important;
    font-size: 20px !important;
    box-shadow: none !important;
  }
}
.sidebar .sidebar-nav button.tab.active:not(.secondary):not(.ghost):not(.danger):not(.link-button):not(.login-mode-tab):not(.icon-button):hover {
  color: var(--o-green) !important;
  background: #ffffff !important;
}
.form-section-title { text-transform: none !important; letter-spacing: 0 !important; }
.quota-field {
  padding: 0 !important;
  border: 0 !important;
  background: none !important;
  box-shadow: none !important;
}

/* ===== Charts: donut + legend (official theme) ===== */
.pro-pie-card { padding: 18px 20px !important; }
.pro-pie-head h3 { color: var(--o-ink) !important; font-family: var(--o-head); font-size: 16px !important; font-weight: 600 !important; }
.pro-pie-sub {
  color: var(--o-green-2) !important;
  background: var(--o-green-tint) !important;
  border-radius: 4px !important;
  text-transform: none !important;
  font-weight: 600 !important;
}
.pro-pie-body,
.attendance-pie-body,
.incident-pie-body,
.employee-attendance-pie-body,
.leave-analytics .pro-pie-body,
#leaveGhBalanceBars {
  display: grid !important;
  grid-template-columns: minmax(170px, 220px) minmax(0, 1fr) !important;
  align-items: center !important;
  justify-items: stretch !important;
  gap: 22px !important;
  margin-top: 12px !important;
}
.pro-pie-canvas-wrap {
  width: 100% !important;
  max-width: 220px;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  overflow: visible !important;
}
.pro-pie-center strong {
  color: var(--o-ink) !important;
  font-family: var(--o-head);
  font-size: 34px !important;
  font-weight: 600 !important;
}
.pro-pie-center span {
  color: var(--o-muted) !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  text-transform: none !important;
}
.pie-is-empty .pro-pie-center strong { color: #9aa8a0 !important; }

.pro-pie-legend {
  max-width: none !important;
  gap: 4px !important;
}
.pro-pie-legend-row {
  display: grid !important;
  grid-template-columns: 26px minmax(0, 1fr) auto 44px !important;
  grid-template-areas: "sym label value pct" "sym bar bar bar";
  align-items: center !important;
  column-gap: 10px !important;
  row-gap: 5px !important;
  padding: 7px 0 !important;
  border: 0 !important;
  border-bottom: 1px solid var(--o-line-soft) !important;
  border-radius: 0 !important;
  background: none !important;
  box-shadow: none !important;
}
.pro-pie-legend-row:last-child { border-bottom: 0 !important; }
.pro-pie-legend-row .pie-symbol { grid-area: sym; }
.pro-pie-legend-label { grid-area: label; color: var(--o-ink) !important; font-size: 13px !important; font-weight: 500 !important; }
.pro-pie-legend-value { grid-area: value; color: var(--o-ink) !important; font-family: var(--o-head); font-size: 15px !important; font-weight: 600 !important; }
.pro-pie-legend-pct { grid-area: pct; color: var(--o-muted) !important; font-size: 12px !important; font-weight: 500 !important; text-align: right; }
.pro-pie-progress {
  grid-area: bar;
  height: 4px !important;
  border-radius: 2px !important;
  background: var(--o-line-soft) !important;
  overflow: hidden;
}
.pro-pie-progress i { display: block; height: 100%; border-radius: 2px !important; }

.pie-symbol {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  color: #ffffff;
  background: var(--c);
  flex: none;
}
.pie-symbol-light {
  color: var(--o-ink);
  background: var(--c);
}

.pie-tooltip {
  position: absolute;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px 7px 7px;
  border: 1px solid var(--o-line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 6px 18px rgba(14, 35, 28, 0.14);
  color: var(--o-ink);
  font-size: 12.5px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, calc(-100% - 12px)) !important;
  transition: opacity 90ms ease;
}
.pie-tooltip.show { opacity: 1; }
.pie-tooltip strong { display: block; font-weight: 600; }
.pie-tooltip em { color: var(--o-muted); font-style: normal; }

/* Attendance overview: CSS donut as a thin ring */
.attendance-donut {
  width: 132px !important;
  height: 132px !important;
  border-radius: 50% !important;
  box-shadow: none !important;
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 16px), #000 calc(100% - 15px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 16px), #000 calc(100% - 15px));
}
.attendance-donut::before, .attendance-donut::after { display: none !important; }
.donut-shell strong { color: var(--o-ink) !important; font-family: var(--o-head); font-size: 34px !important; font-weight: 600 !important; }
.donut-shell span { color: var(--o-muted) !important; font-weight: 500 !important; }

/* ===== Icons ===== */
.ui-icon-svg { display: block; flex: none; }
.sidebar .sidebar-nav .tab {
  display: flex !important;
  align-items: center !important;
  gap: 11px !important;
}
.nav-icon { display: inline-flex; opacity: 0.85; }
.sidebar .tab.active .nav-icon { opacity: 1; color: var(--o-red); }

.has-tile-icon { position: relative; padding-right: 54px !important; }
.tile-icon {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: var(--c);
  background: color-mix(in srgb, var(--c) 12%, #ffffff);
}

.btn-icon { display: inline-flex; margin-right: 7px; vertical-align: -3px; }
button:has(.btn-icon) { display: inline-flex !important; align-items: center; justify-content: center; }

@media (max-width: 760px) {
  .pro-pie-body,
  .attendance-pie-body,
  .incident-pie-body,
  .employee-attendance-pie-body,
  .leave-analytics .pro-pie-body,
  #leaveGhBalanceBars {
    grid-template-columns: 1fr !important;
    justify-items: center !important;
  }
  .pro-pie-legend { width: 100%; }
  .has-tile-icon { padding-right: 46px !important; }
  .tile-icon { width: 28px; height: 28px; top: 12px; right: 10px; }
}
.pro-pie-body, .attendance-pie-body, .incident-pie-body, .employee-attendance-pie-body, #leaveGhBalanceBars {
  padding: 0 !important;
  border: 0 !important;
  background: none !important;
  box-shadow: none !important;
}
.central-bar-row.with-symbol { grid-template-columns: 26px minmax(80px, 1fr) minmax(80px, 1.6fr) 40px !important; }


/* Figures panel: ruled cells without a grey gap when a row is not full */
.stats-grid, .performance-summary-grid, .employee-summary-grid, .leave-overview {
  gap: 0 !important;
  background: #ffffff !important;
}
.stats-grid > div, .performance-summary-grid > article, .employee-summary-grid > div, .leave-overview > div {
  box-shadow: 1px 0 0 var(--o-line), 0 1px 0 var(--o-line) !important;
}

/* ===== Employee profile pop-up ===== */
.employee-name-link {
  min-height: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  color: var(--o-green) !important;
  background: none !important;
  box-shadow: none !important;
  font: inherit !important;
  font-weight: 600 !important;
  text-align: left;
  text-decoration: underline;
  text-decoration-color: rgba(21, 84, 67, 0.3);
  text-underline-offset: 3px;
  cursor: pointer;
}
.employee-name-link:hover { color: var(--o-red) !important; text-decoration-color: currentColor; }
button.employee-thumb.profile-trigger {
  width: 44px !important;
  height: 52px !important;
  min-height: 0 !important;
  padding: 0 !important;
  overflow: hidden;
  border: 1px solid var(--o-line) !important;
  border-radius: 6px !important;
  background: var(--o-green-tint) !important;
  box-shadow: none !important;
  cursor: pointer;
}
.profile-initials { color: var(--o-green); font-family: var(--o-head); font-size: 15px; font-weight: 600; }

body.modal-open { overflow: hidden; }
.employee-profile-card {
  width: min(980px, 96vw) !important;
  max-height: 92vh !important;
  display: grid !important;
  grid-template-rows: auto minmax(0, 1fr) auto !important;
}
.employee-profile-head {
  position: relative;
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 26px 24px 18px;
  border-bottom: 1px solid var(--o-line);
  background: #ffffff;
}
.employee-profile-head::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 5px;
  background: var(--o-livery);
}
.profile-photo {
  width: 88px;
  height: 104px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--o-line);
  border-radius: 8px;
  background: var(--o-green-tint);
  color: var(--o-green);
  font-family: var(--o-head);
  font-size: 30px;
  font-weight: 600;
}
.profile-photo img { width: 100%; height: 100%; object-fit: cover; }
.profile-identity h2 { margin: 0; color: var(--o-green); font-size: 26px; font-weight: 600; line-height: 1.15; }
.profile-identity p { margin: 3px 0 10px; color: var(--o-muted); }
.profile-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.profile-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 4px;
  color: var(--o-ink);
  background: var(--o-paper);
  border: 1px solid var(--o-line);
  font-size: 12.5px;
  font-weight: 500;
}
.profile-chip.strong { color: #ffffff; background: var(--o-green); border-color: var(--o-green); font-weight: 600; }
.profile-chip.warn { color: #9f1239; background: var(--o-red-tint); border-color: #f2b8c2; }
.profile-close,
button.profile-close:not(.secondary):not(.ghost):not(.danger):not(.link-button):not(.login-mode-tab):not(.icon-button) {
  align-self: start;
  width: 38px !important;
  min-height: 38px !important;
  padding: 0 !important;
  display: grid !important;
  place-items: center;
  color: var(--o-muted) !important;
  background: #ffffff !important;
  border: 1px solid var(--o-line) !important;
}
button.profile-close:hover { color: var(--o-ink) !important; background: var(--o-paper) !important; }

.employee-profile-body {
  display: grid;
  gap: 14px;
  padding: 18px 24px 22px !important;
  background: var(--o-paper) !important;
}
.profile-section {
  padding: 16px 18px;
  border: 1px solid var(--o-line);
  border-radius: 8px;
  background: #ffffff;
}
.profile-section h3 { margin: 0 0 12px; color: var(--o-ink); font-size: 15px; font-weight: 600; }
.profile-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.profile-section-head h3 { margin: 0; }
.profile-month-nav { display: flex; gap: 6px; }
.profile-month-nav button { min-height: 32px !important; padding: 4px 12px !important; font-size: 12.5px !important; }

.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 0;
  border-top: 1px solid var(--o-line-soft);
}
.profile-grid.compact { margin-top: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.profile-field {
  display: grid;
  gap: 2px;
  padding: 9px 10px 9px 0;
  border-bottom: 1px solid var(--o-line-soft);
}
.profile-field span { color: var(--o-muted); font-size: 12px; }
.profile-field strong { color: var(--o-ink); font-size: 14px; font-weight: 500; word-break: break-word; }

.profile-counts {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.profile-count {
  display: grid;
  justify-items: center;
  gap: 3px;
  padding: 10px 4px;
  border: 1px solid var(--o-line-soft);
  border-radius: 8px;
  text-align: center;
}
.profile-count strong { font-family: var(--o-head); font-size: 22px; font-weight: 600; line-height: 1; }
.profile-count span:last-child { color: var(--o-muted); font-size: 11.5px; line-height: 1.2; }

.profile-strip {
  display: grid;
  grid-template-columns: repeat(16, minmax(0, 1fr));
  gap: 4px;
}
.profile-day {
  display: grid;
  justify-items: center;
  gap: 1px;
  padding: 4px 0 5px;
  border-radius: 5px;
  color: #ffffff;
  background: var(--c);
  font-size: 10.5px;
  line-height: 1.1;
}
.profile-day em { font-style: normal; opacity: 0.85; }
.profile-day b { font-family: var(--o-head); font-size: 11.5px; font-weight: 600; }
.profile-day.empty { color: var(--o-muted); background: var(--o-line-soft); }
.profile-note { margin: 10px 0 0; color: var(--o-muted); font-size: 13px; }

.profile-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.profile-meter { margin-bottom: 12px; }
.profile-meter-top { display: flex; justify-content: space-between; margin-bottom: 5px; font-size: 13px; }
.profile-meter-top strong { font-family: var(--o-head); font-size: 15px; font-weight: 600; }
.profile-meter-track { height: 8px; border-radius: 4px; background: var(--o-line-soft); overflow: hidden; }
.profile-meter-track i { display: block; height: 100%; border-radius: 4px; }
.profile-meter small { color: var(--o-muted); font-size: 12px; }

.profile-perf { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.profile-perf div { padding: 10px; border: 1px solid var(--o-line-soft); border-radius: 8px; text-align: center; }
.profile-perf strong { display: block; font-family: var(--o-head); font-size: 22px; font-weight: 600; }
.profile-perf span { color: var(--o-muted); font-size: 12px; }

.profile-table { width: 100%; min-width: 0 !important; font-size: 13px; }
.profile-table th, .profile-table td { padding: 7px 8px !important; }
.profile-type { display: inline-flex; align-items: center; gap: 8px; }
.profile-type .pie-symbol { width: 22px; height: 22px; }

.employee-profile-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 24px;
  border-top: 1px solid var(--o-line);
  background: #ffffff;
}

@media (max-width: 760px) {
  .employee-profile-head { grid-template-columns: 64px minmax(0, 1fr) auto; padding: 22px 16px 14px; gap: 12px; }
  .profile-photo { width: 64px; height: 76px; font-size: 22px; }
  .profile-identity h2 { font-size: 20px; }
  .employee-profile-body { padding: 14px 12px !important; }
  .profile-counts { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .profile-strip { grid-template-columns: repeat(8, minmax(0, 1fr)); }
  .profile-two-col { grid-template-columns: 1fr; }
  .employee-profile-actions { padding: 10px 12px; flex-wrap: wrap; }
  .employee-profile-actions button { flex: 1 1 auto; }
}

@media print {
  body.printing-profile * { visibility: hidden !important; }
  body.printing-profile #employeeProfileModal,
  body.printing-profile #employeeProfileModal * { visibility: visible !important; }
  body.printing-profile #employeeProfileModal { position: absolute !important; inset: 0 !important; background: #ffffff !important; padding: 0 !important; display: block !important; }
  body.printing-profile .employee-profile-card { width: 100% !important; max-height: none !important; box-shadow: none !important; display: block !important; }
  body.printing-profile .employee-profile-body { overflow: visible !important; background: #ffffff !important; }
  body.printing-profile .employee-profile-actions,
  body.printing-profile .profile-close,
  body.printing-profile .profile-month-nav { display: none !important; }
  body.printing-profile .profile-day, body.printing-profile .pie-symbol, body.printing-profile .profile-chip.strong {
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
}
@media (max-width: 760px) {
  .employee-profile-actions { flex-wrap: nowrap !important; gap: 6px !important; }
  .employee-profile-actions button { flex: 1 1 0 !important; min-width: 0 !important; padding: 8px 6px !important; font-size: 12.5px !important; }
}

/* ===== Staff form sections & transfer ===== */
.employee-form-fields { display: grid; gap: 14px; min-width: 0; }
.employee-form-fields .form-section-title { margin-top: 4px; }
.service-title { margin-top: 10px !important; }
.transfer-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  color: #9f1239;
  background: var(--o-red-tint);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.transfer-card { width: min(560px, 96vw) !important; }
.transfer-body { display: grid; gap: 14px; min-height: 0 !important; background: #ffffff !important; }
.transfer-employee {
  display: grid;
  gap: 2px;
  padding: 12px 14px;
  border-left: 3px solid var(--o-green);
  border-radius: 0 6px 6px 0;
  background: var(--o-green-tint);
}
.transfer-employee strong { color: var(--o-green); font-family: var(--o-head); font-size: 17px; font-weight: 600; }
.transfer-employee span { color: var(--o-muted); font-size: 13px; }
.transfer-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.transfer-note { margin: 0; color: var(--o-muted); font-size: 12.5px; line-height: 1.5; }
.transfer-actions { justify-content: flex-end; }
@media (max-width: 560px) { .transfer-row { grid-template-columns: 1fr; } }

/* ===== Fleet ===== */
.central-kpi-grid { grid-template-columns: repeat(6, minmax(130px, 1fr)) !important; }
@media (max-width: 1180px) { .central-kpi-grid { grid-template-columns: repeat(3, minmax(130px, 1fr)) !important; } }
@media (max-width: 620px) { .central-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; } }

.fleet-analytics { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) !important; }
.fleet-toolbar { grid-template-columns: minmax(220px, 1.4fr) minmax(150px, 1fr) minmax(150px, 1fr) auto !important; }
.fleet-log-toolbar { grid-template-columns: minmax(150px, 220px) minmax(180px, 280px) auto !important; justify-content: start; }
.fleet-form, .fleet-log-form { grid-template-columns: 1fr !important; }

.fleet-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px 4px 6px;
  border-radius: 4px;
  color: var(--c);
  background: color-mix(in srgb, var(--c) 12%, #ffffff);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}
select.fleet-status-select {
  min-width: 132px;
  min-height: 34px !important;
  padding: 4px 8px !important;
  border-color: color-mix(in srgb, var(--c) 45%, #ffffff) !important;
  color: var(--c) !important;
  background: color-mix(in srgb, var(--c) 9%, #ffffff) !important;
  font-weight: 600 !important;
  font-size: 13px !important;
}
.fleet-date { display: inline-grid; gap: 1px; white-space: nowrap; }
.fleet-date small { font-size: 11px; font-weight: 600; }
.fleet-date.overdue { color: var(--o-red); font-weight: 600; }
.fleet-date.soon { color: var(--o-amber); font-weight: 600; }
.fleet-date.muted, small.muted { color: var(--o-muted); }
.fleet-log-type { display: inline-flex; align-items: center; gap: 6px; }
.notification-item.alert-red { border-left-color: var(--o-red) !important; background: var(--o-red-tint) !important; }
.notification-item.alert-ok { border-left-color: var(--o-ok) !important; background: var(--o-ok-tint) !important; }

.vehicle-card { width: min(900px, 96vw) !important; }
.vehicle-body { display: grid; gap: 14px; background: var(--o-paper) !important; }
.vehicle-head {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--o-line);
  border-radius: 8px;
  background: #ffffff;
}
.vehicle-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 10px;
  color: var(--o-green);
  background: var(--o-green-tint);
}
.vehicle-head h2 { margin: 0; color: var(--o-green); font-size: 22px; font-weight: 600; }
.vehicle-head p { margin: 2px 0 0; color: var(--o-muted); }
.vehicle-stats { grid-template-columns: repeat(4, 1fr) !important; margin: 0 !important; }
.vehicle-stats div { background: #ffffff; }
@media (max-width: 760px) {
  .fleet-analytics, .fleet-toolbar, .fleet-log-toolbar { grid-template-columns: 1fr !important; }
  .vehicle-stats { grid-template-columns: repeat(2, 1fr) !important; }
  .vehicle-head { grid-template-columns: 44px minmax(0, 1fr); }
  .vehicle-head .fleet-status { grid-column: 1 / -1; justify-self: start; }
}

.fleet-kpis div:nth-child(2) strong { color: var(--o-ok) !important; }
.fleet-kpis div:nth-child(5) strong { color: var(--o-red) !important; }
button.employee-name-link:not(.secondary):not(.ghost):not(.danger):not(.link-button):not(.login-mode-tab):not(.icon-button) {
  min-height: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  color: var(--o-green) !important;
  background: none !important;
  box-shadow: none !important;
  font-weight: 600 !important;
  text-decoration: underline;
}
button.employee-name-link:not(.secondary):not(.ghost):not(.danger):not(.link-button):not(.login-mode-tab):not(.icon-button):hover {
  color: var(--o-red) !important;
  background: none !important;
}
#fleetBody .employee-name-link { white-space: nowrap; }

/* ===== Store inventory ===== */
.store-page .stats-grid { margin: 18px 0 4px; }
.store-kpis { grid-template-columns: repeat(6, minmax(120px, 1fr)) !important; }
.store-kpis div:nth-child(2) strong { color: var(--o-amber) !important; }
.store-kpis div:nth-child(3) strong { color: var(--o-red) !important; }
.store-toolbar { grid-template-columns: minmax(220px, 1.4fr) minmax(160px, 1fr) minmax(160px, 1fr) auto !important; }
.store-form { grid-template-columns: 1fr !important; }
td.num, th.num { text-align: right !important; white-space: nowrap; }
.stock-qty { font-family: var(--o-head); font-size: 16px; font-weight: 600; }
.qty-in { color: var(--o-ok); font-weight: 600; }
.qty-out { color: var(--o-red); font-weight: 600; }
.req-line { line-height: 1.6; }
.req-line.short { color: var(--o-red); }
.req-line small { color: var(--o-muted); }
.nav-badge {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  margin-left: auto;
  padding: 0 6px;
  border-radius: 10px;
  color: #ffffff;
  background: var(--o-red);
  font-size: 11.5px;
  font-weight: 700;
}
.store-add-line { display: flex; align-items: end; }
.req-lines { display: flex; flex-wrap: wrap; gap: 8px; min-height: 24px; }
.req-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 6px 5px 12px;
  border: 1px solid var(--o-line);
  border-radius: 6px;
  background: var(--o-green-tint);
  font-size: 13px;
}
.req-chip button { min-height: 26px !important; width: 26px; padding: 0 !important; display: grid !important; place-items: center; }
.inline-search { min-width: 220px; }
.inline-search input { min-height: 34px; }
@media (max-width: 1180px) { .store-kpis { grid-template-columns: repeat(3, minmax(120px, 1fr)) !important; } }
@media (max-width: 760px) {
  .store-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .store-toolbar, .store-request-grid { grid-template-columns: 1fr !important; }
}

/* Hidden must always win, including buttons that carry an icon */
.hidden, .hidden.hidden, button.hidden, button.hidden:has(.btn-icon) { display: none !important; }

/* =====================================================================
   UX PASS 2: calmer layout, fold-away forms, notices, user card
   ===================================================================== */
:root {
  --o-lift: 0 1px 2px rgba(14, 59, 46, 0.05), 0 4px 14px rgba(14, 59, 46, 0.04);
  --o-radius: 10px;
}

/* Panels: a soft lift off the page and a slightly rounder corner */
.toolbar, .employee-form, .analytics-card, .table-wrap, .summary-layout article,
.employee-portal-card, .stats-grid, .performance-summary-grid, .profile-section, .tool-drawer {
  border-radius: var(--o-radius) !important;
  box-shadow: var(--o-lift) !important;
}
.tab-panel.active { gap: 18px !important; }
.panel-heading { margin-top: 30px !important; }
.panel-heading p { margin: 4px 0 0 !important; font-size: 14px; }

/* Tables: sticky headers, calmer rows, comfortable height */
.table-wrap { max-height: none; }
th { position: sticky; top: 0; z-index: 2; }
td { padding-top: 11px !important; padding-bottom: 11px !important; }
tbody tr { transition: background 120ms ease; }
.table-wrap.compact { box-shadow: none !important; }

/* Attendance: daily bar on top, sheet before charts */
.attendance-daily-bar {
  grid-template-columns: minmax(170px, 220px) minmax(220px, 1fr) auto auto !important;
  align-items: end !important;
}
.attendance-daily-bar #saveAttendanceBtn { min-width: 170px; min-height: 42px !important; }
.attendance-sheet td:nth-child(1) { font-weight: 500; }
#attendanceTab .analytics-grid {
  grid-template-columns: minmax(280px, 0.8fr) minmax(0, 1.4fr) !important;
  grid-template-areas: "overview person" "notes person";
  align-items: start;
}
#attendanceTab .analytics-grid > article:nth-child(1) { grid-area: overview; }
#attendanceTab .analytics-grid > article:nth-child(2) { grid-area: person; }
#attendanceTab .analytics-grid > article:nth-child(3) { grid-area: notes; }
.donut-shell { gap: 22px !important; }

/* Fold-away "Import & reports" drawer */
.tool-drawer {
  border: 1px solid var(--o-line);
  background: #ffffff;
}
.tool-drawer > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  color: var(--o-green);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.tool-drawer > summary::-webkit-details-marker { display: none; }
.tool-drawer > summary::before {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 150ms ease;
}
.tool-drawer[open] > summary::before { transform: rotate(45deg); }
.tool-drawer[open] > summary { border-bottom: 1px solid var(--o-line-soft); }
.tool-drawer-body {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  padding: 16px 18px 18px;
}
.tool-group h3 { margin: 0 0 8px; color: var(--o-ink); font-size: 13.5px; font-weight: 600; }
.tool-row { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; }
.tool-row label { flex: 1 1 140px; }

/* Fold-away forms */
.collapsible-form { position: relative; }
.collapsible-form > .collapse-toggle,
button.collapse-toggle:not(.secondary):not(.ghost):not(.danger):not(.link-button):not(.login-mode-tab):not(.icon-button) {
  grid-column: 1 / -1;
  display: flex !important;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px !important;
  margin: -4px 0 0;
  padding: 6px 4px !important;
  border: 0 !important;
  color: var(--o-green) !important;
  background: none !important;
  box-shadow: none !important;
  font-family: var(--o-head);
  font-size: 16px !important;
  font-weight: 600 !important;
  text-align: left;
  justify-content: flex-start;
}
.collapse-plus {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  color: #ffffff;
  background: var(--o-green);
}
.collapse-label { flex: 1; }
.collapse-chevron { color: var(--o-muted); transition: transform 150ms ease; }
.collapsible-form:not(.is-collapsed) .collapse-chevron { transform: rotate(180deg); }
.collapsible-form:not(.is-collapsed) .collapse-plus { background: var(--o-red); }
.collapsible-form.is-collapsed { padding-top: 10px !important; padding-bottom: 10px !important; }
.collapsible-form.is-collapsed > :not(.collapse-toggle) { display: none !important; }
.collapse-toggle:hover .collapse-label { text-decoration: underline; text-underline-offset: 3px; }

/* Corner notices */
.toast-stack {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 500;
  display: grid;
  gap: 10px;
  width: min(380px, calc(100vw - 32px));
}
.toast {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 26px;
  align-items: start;
  gap: 10px;
  padding: 12px 10px 12px 12px;
  border: 1px solid var(--o-line);
  border-left: 4px solid var(--o-green-2);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 10px 30px rgba(14, 35, 28, 0.18);
  color: var(--o-ink);
  font-size: 13.5px;
  line-height: 1.45;
  animation: toastIn 180ms ease-out both !important;
}
.toast.leaving { opacity: 0; transform: translateY(6px); transition: opacity 180ms ease, transform 180ms ease; }
.toast-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; color: #ffffff; background: var(--o-green-2); }
.toast-ok { border-left-color: var(--o-ok); }
.toast-ok .toast-icon { background: var(--o-ok); }
.toast-error { border-left-color: var(--o-red); }
.toast-error .toast-icon { background: var(--o-red); }
.toast-text { padding-top: 5px; word-break: break-word; }
.toast-close,
button.toast-close:not(.secondary):not(.ghost):not(.danger):not(.link-button):not(.login-mode-tab):not(.icon-button) {
  width: 26px;
  min-height: 26px !important;
  padding: 0 !important;
  display: grid !important;
  place-items: center;
  border: 0 !important;
  color: var(--o-muted) !important;
  background: none !important;
}
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .toast { animation: none !important; } }

/* Sidebar user card */
.user-card {
  display: grid !important;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  font-size: 13px !important;
}
.user-avatar {
  display: grid !important;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--o-green);
  background: #ffffff;
  font-family: var(--o-head);
  font-size: 15px;
  font-weight: 600;
}
.user-meta { display: grid !important; gap: 1px; min-width: 0; }
.user-meta strong { color: #ffffff; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-meta small { display: block !important; color: rgba(255, 255, 255, 0.7); font-size: 12px; font-weight: 400; line-height: 1.35; }
.user-meta small.user-id { color: rgba(255, 255, 255, 0.5); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-footer > span:first-of-type { color: rgba(255, 255, 255, 0.55) !important; font-size: 11.5px !important; }

/* Employee photo thumbs (were picking up the red button style) */
button.employee-thumb.profile-trigger:not(.secondary):not(.ghost):not(.danger):not(.link-button):not(.login-mode-tab):not(.icon-button) {
  width: 42px !important;
  height: 50px !important;
  min-height: 0 !important;
  padding: 0 !important;
  border: 1px solid var(--o-line) !important;
  border-radius: 6px !important;
  color: var(--o-green) !important;
  background: var(--o-green-tint) !important;
  box-shadow: none !important;
}
button.employee-thumb.profile-trigger:hover { border-color: var(--o-green-2) !important; }
.profile-initials { color: var(--o-green) !important; }

/* Today's special marks: light list instead of orange blocks */
.special-card {
  grid-template-columns: 54px minmax(0, 1fr) !important;
  align-items: center;
  padding: 10px 12px !important;
  border: 1px solid var(--o-line-soft) !important;
  border-radius: 8px !important;
  background: #ffffff !important;
  box-shadow: none !important;
  transform: none !important;
}
.special-card strong {
  min-height: 30px !important;
  border-radius: 6px !important;
  color: var(--o-ink) !important;
  background: var(--o-amber-tint) !important;
  font-family: var(--o-head);
  font-size: 13px;
}
.summary-layout { gap: 18px !important; }

/* Row action buttons a touch smaller so tables breathe */
.row-actions button { min-height: 34px !important; padding: 6px 12px !important; font-size: 12.5px !important; }

@media (max-width: 900px) {
  #attendanceTab .analytics-grid { grid-template-columns: 1fr !important; grid-template-areas: "overview" "person" "notes"; }
  .attendance-daily-bar { grid-template-columns: 1fr 1fr !important; }
  .attendance-daily-bar label { grid-column: 1 / -1; }
}
@media (max-width: 620px) {
  .toast-stack { right: 16px; left: 16px; bottom: 16px; width: auto; }
}
.sidebar-footer .user-card .user-avatar { color: var(--o-green) !important; font-size: 15px !important; font-weight: 600 !important; }
#attendanceTab .analytics-grid { grid-template-rows: auto 1fr; }
#attendanceTab .analytics-grid > article:nth-child(3) { align-self: start; }


/* ===== HR - Staff Records (central) ===== */
.hr-views {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  width: fit-content;
  max-width: 100%;
  background: var(--o-surface);
  border: 1px solid var(--o-line);
  border-radius: 999px;
  box-shadow: var(--o-lift);
}
button.hr-view:not(.secondary):not(.ghost):not(.danger):not(.link-button):not(.login-mode-tab):not(.icon-button) {
  min-height: 34px !important;
  padding: 6px 16px !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: transparent !important;
  color: var(--o-muted) !important;
  box-shadow: none !important;
  font-family: var(--o-head);
  font-size: 13.5px !important;
  font-weight: 600 !important;
  letter-spacing: 0.01em;
  transform: none !important;
}
button.hr-view::before, button.hr-view::after { display: none !important; }
button.hr-view:not(.secondary):not(.ghost):not(.danger):not(.link-button):not(.login-mode-tab):not(.icon-button):hover { background: var(--o-green-tint) !important; color: var(--o-green) !important; }
button.hr-view.active:not(.secondary):not(.ghost):not(.danger):not(.link-button):not(.login-mode-tab):not(.icon-button), button.hr-view.active:not(.secondary):not(.ghost):not(.danger):not(.link-button):not(.login-mode-tab):not(.icon-button):hover { background: var(--o-green) !important; color: #fff !important; }
.hr-toolbar {
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)) !important;
  align-items: end !important;
}
.hr-toolbar .hr-search { grid-column: span 2; }
.hr-toolbar .hr-actions { display: flex; gap: 8px; align-items: end; justify-content: flex-end; grid-column: -2 / -1; }
.hr-toolbar .hr-check { display: flex !important; flex-direction: row !important; align-items: center; gap: 8px; min-height: 40px; }
.hr-toolbar .hr-check input { width: 18px; height: 18px; margin: 0; accent-color: var(--o-green); }
.hr-kpis { grid-template-columns: repeat(6, minmax(130px, 1fr)) !important; }
.hr-note { margin: -6px 2px 0 !important; }
.hr-table-wrap table { min-width: 980px; }
.hr-table-wrap td, .hr-table-wrap th { white-space: nowrap; }
.hr-table-wrap td:nth-child(n+2) { max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.hr-pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--o-green-tint);
  color: var(--o-green);
}
.hr-pill-ok { background: var(--o-ok-tint); color: var(--o-ok); }
.hr-pill-warn { background: var(--o-amber-tint); color: var(--o-amber); }
.hr-pill-out { background: var(--o-red-tint); color: var(--o-red-dark); }
.hr-pill-muted { background: var(--o-paper); color: var(--o-muted); }
.hr-type {
  display: inline-grid;
  place-items: center;
  min-width: 30px;
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: var(--c, var(--o-green));
}
td.hr-bad { color: var(--o-red) !important; font-weight: 700; }
button.hr-station-link.link-button {
  padding: 0 !important;
  min-height: 0 !important;
  border: 0 !important;
  background: none !important;
  color: var(--o-green-2) !important;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--o-line);
  text-underline-offset: 3px;
  cursor: pointer;
}
button.hr-station-link.link-button:hover { color: var(--o-red) !important; text-decoration-color: currentColor; }
@media (max-width: 1180px) { .hr-kpis { grid-template-columns: repeat(3, minmax(120px, 1fr)) !important; } }
@media (max-width: 760px) {
  .hr-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .hr-toolbar .hr-search, .hr-toolbar .hr-actions { grid-column: 1 / -1; }
  .hr-views { border-radius: 14px; }
}
.sidebar .sidebar-nav .tab.hidden { display: none !important; }
.hr-toolbar .hr-check.hidden, .hr-toolbar label.hidden { display: none !important; }

/* ===== Store: typed item names, central stock ===== */
.store-new-fields { display: contents; }
.store-new-fields.hidden { display: none !important; }
td.qty-low { color: var(--o-amber) !important; font-weight: 700; }
.central-stock-heading { margin-top: 8px; }
.central-stock-toolbar { grid-template-columns: minmax(240px, 2fr) minmax(180px, 1fr) !important; }
.central-store-kpis div:nth-child(2) strong { color: var(--o-amber) !important; }
.central-store-kpis div:nth-child(3) strong { color: var(--o-red) !important; }
#appPage .sidebar .sidebar-nav .tab.hidden { display: none !important; }

/* ===== Store request item table & store in-charge IDs ===== */
.req-table-wrap { overflow-x: auto; border: 1px solid var(--o-line); border-radius: 8px; background: var(--o-surface); }
.req-table { width: 100%; min-width: 720px; border-collapse: collapse; }
.req-table th { background: var(--o-green-tint); color: var(--o-green); font-size: 12.5px; text-align: left; padding: 8px 10px; }
.req-table td { padding: 6px 8px; border-top: 1px solid var(--o-line-soft); vertical-align: top; }
.req-table input, .req-table select { width: 100%; min-height: 38px; }
.req-table .req-sn { width: 44px; text-align: center; color: var(--o-muted); font-weight: 600; padding-top: 16px; }
.req-table th.req-sn { padding-top: 8px; }
.req-table .req-unit { width: 110px; }
.req-table .req-qty { width: 110px; }
.req-table .req-del { width: 46px; text-align: center; }
.req-table .req-hint { display: block; min-height: 14px; margin-top: 3px; font-size: 11.5px; color: var(--o-muted); }
.req-table button.req-remove { min-height: 34px !important; width: 34px; padding: 0 !important; display: inline-grid !important; place-items: center; margin-top: 2px; }
.req-table-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.store-request-grid { grid-template-columns: minmax(220px, 360px) !important; }
.incharge-grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)) !important; }
#inchargeBody code { font-family: var(--o-head); font-weight: 600; color: var(--o-green); }

/* ===== Station inventory ===== */
.inv-add-grid { grid-template-columns: minmax(260px, 2fr) repeat(3, minmax(120px, 1fr)) !important; }
.inv-add-grid .inv-item-field { grid-column: span 1; }
.inv-add-grid .inv-remarks-field { grid-column: span 2; }
.station-inv-form .actions { align-items: center; flex-wrap: wrap; }
.inv-heading { flex-wrap: wrap; gap: 10px; }
.inv-heading-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
@media (max-width: 900px) {
  .inv-add-grid { grid-template-columns: 1fr 1fr !important; }
  .inv-add-grid .inv-item-field, .inv-add-grid .inv-remarks-field { grid-column: 1 / -1; }
}

/* ===== Store Manager ===== */
.central-store-kpis div:nth-child(1) strong { color: var(--o-amber) !important; }
.central-store-kpis div:nth-child(2) strong { color: #2a78d6 !important; }
.central-store-kpis div:nth-child(3) strong { color: var(--o-amber) !important; }
.central-store-kpis div:nth-child(4) strong { color: var(--o-red) !important; }
.sm-badge {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--o-red);
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
}
.sm-badge.hidden { display: none !important; }
.sm-pane { display: grid; gap: 16px; }
.sm-pane.hidden { display: none !important; }
.sm-flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  counter-reset: none;
}
.sm-flow div {
  position: relative;
  display: grid;
  grid-template-columns: 30px 1fr;
  column-gap: 10px;
  align-items: center;
  padding: 12px 14px;
  background: var(--o-surface);
  border: 1px solid var(--o-line);
  border-radius: var(--o-radius, 10px);
}
.sm-flow span {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--o-green);
  color: #fff;
  font-family: var(--o-head);
  font-weight: 700;
}
.sm-flow strong { font-size: 13.5px; color: var(--o-ink); }
.sm-flow small { color: var(--o-muted); font-size: 12px; }
.sm-req-toolbar { grid-template-columns: minmax(200px, 1fr) minmax(180px, 1fr) minmax(220px, 1.5fr) !important; }
.sm-request-list { display: grid; gap: 12px; }
.sm-req-card {
  display: grid;
  gap: 10px;
  padding: 16px 18px;
  background: var(--o-surface);
  border: 1px solid var(--o-line);
  border-left: 4px solid var(--o-amber);
  border-radius: var(--o-radius, 10px);
  box-shadow: var(--o-lift);
}
.sm-req-card.status-forwarded { border-left-color: #2a78d6; }
.sm-req-card.status-issued, .sm-req-card.status-received { border-left-color: var(--o-ok); }
.sm-req-card.status-rejected { border-left-color: var(--o-red); }
.sm-req-card header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.sm-req-card header > div { display: grid; gap: 2px; }
.sm-req-station { font-family: var(--o-head); font-size: 17px; color: var(--o-green); }
.sm-req-body { display: grid; gap: 6px; }
.sm-req-body .req-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 14px; }
.sm-avail { display: inline-flex; flex-wrap: wrap; gap: 4px; margin-left: 6px; }
.sm-chip { padding: 1px 7px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--o-paper); color: var(--o-muted); }
.sm-chip.ok { background: var(--o-ok-tint); color: var(--o-ok); }
.sm-chip.part { background: var(--o-amber-tint); color: var(--o-amber); }
.sm-chip.none { background: var(--o-red-tint); color: var(--o-red-dark); }
.sm-req-card footer { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 4px; border-top: 1px dashed var(--o-line); }
.sm-return-note { margin: 0; padding: 8px 10px; border-radius: 6px; background: var(--o-amber-tint); color: var(--o-amber); font-size: 13px; display: flex; gap: 6px; align-items: center; }
.sm-timeline { list-style: none; margin: 6px 0 0; padding: 0 0 0 12px; border-left: 2px solid var(--o-line); display: grid; gap: 3px; font-size: 12.5px; color: var(--o-ink); }
.sm-timeline li span { color: var(--o-muted); font-variant-numeric: tabular-nums; }
.sm-empty {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 34px 16px;
  text-align: center;
  color: var(--o-muted);
  background: var(--o-surface);
  border: 1px dashed var(--o-line);
  border-radius: var(--o-radius, 10px);
}
.sm-empty svg { color: var(--o-ok); }
.sm-empty strong { color: var(--o-ink); font-size: 15px; }
.sm-route-note {
  grid-column: 1 / -1;
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--o-green-tint);
  color: var(--o-green);
  font-size: 13.5px;
}
.sm-keeper-types { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.sm-keeper-types div { display: grid; gap: 3px; padding: 10px 12px; border: 1px solid var(--o-line); border-radius: 8px; background: var(--o-paper); }
.sm-keeper-types strong { color: var(--o-green); font-size: 13.5px; }
.sm-keeper-types small { color: var(--o-muted); font-size: 12.5px; }
.sm-modal-card { width: min(720px, 96vw) !important; }
.sm-modal-body { display: grid; gap: 12px; }
.sm-modal-info { display: grid; gap: 2px; padding: 10px 12px; border-radius: 8px; background: var(--o-green-tint); }
.sm-modal-info strong { font-family: var(--o-head); font-size: 16px; color: var(--o-green); }
.sm-modal-info span { font-size: 13px; color: var(--o-muted); }
.sm-lines input.sm-issue-qty { width: 90px; text-align: right; padding: 6px 8px; }
.sm-modal-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.qty-low { color: var(--o-amber) !important; font-weight: 600; }
@media (max-width: 900px) {
  .sm-flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sm-req-toolbar, .sm-keeper-types { grid-template-columns: 1fr !important; }
}
.sm-modal-body .table-wrap table { min-width: 0 !important; width: 100%; }
.sm-modal-body .table-wrap { overflow-x: auto; }
.sm-lines input.sm-issue-qty { width: 90px !important; min-width: 0 !important; display: inline-block; }

/* ===== Store Management screens ===== */
.sm-sidenav { display: none; flex-direction: column; gap: 2px; margin: 0 0 6px; padding-left: 6px; }
#centralPage.store-admin-mode .sm-sidenav:not(.st-sidenav) { display: flex; }
#appPage.store-only-mode .st-sidenav { display: flex; }
#centralPage.store-admin-mode .sm-views,
#centralPage.store-admin-mode [data-tab="centralStoresTab"] { display: none !important; }
#appPage.store-only-mode .st-views,
#appPage.store-only-mode .sidebar-nav .tab[data-tab="storeRequestTab"] { display: none !important; }
.sm-side {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 42px; padding: 9px 14px;
  border: 0; border-radius: 6px; background: transparent; color: rgba(255, 255, 255, 0.78);
  font-size: 14px; font-weight: 500; text-align: left; cursor: pointer; box-shadow: none;
}
.sm-side:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }
.sm-side.active { color: var(--o-green); background: #fff; font-weight: 600; box-shadow: inset 4px 0 0 var(--o-red); }
.sm-side .nav-badge { margin-left: auto; }
.st-pane.hidden { display: none !important; }
.st-pane { display: grid; gap: 16px; }

.sm-banner { padding: 10px 14px; border-radius: var(--o-radius); background: var(--o-green-tint); color: var(--o-green); font-size: 13.5px; }
.sm-quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.sm-quick button {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 14px; text-align: left;
  background: var(--o-surface); color: var(--o-ink); border: 1px solid var(--o-line); border-radius: var(--o-radius); box-shadow: var(--o-lift); cursor: pointer;
}
.sm-quick button:hover { border-color: var(--o-green-2); }
.sm-quick button strong { font-family: var(--o-head); color: var(--o-green); }
.sm-quick button small { color: var(--o-muted); font-weight: 400; }
.sm-quick-icon { color: var(--o-red); }
.sm-kpi-link { cursor: pointer; }
.sm-kpi-link:hover { box-shadow: 0 0 0 2px var(--o-green-2) inset; }
.sm-att { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--o-surface); border: 1px solid var(--o-line); border-left: 4px solid var(--o-amber); border-radius: 8px; margin-bottom: 8px; }
.sm-att > div { flex: 1; display: grid; gap: 2px; }
.sm-att small { color: var(--o-muted); }
.sm-att-icon { color: var(--o-amber); display: grid; }
.sm-two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.sm-empty { display: grid; justify-items: center; gap: 4px; padding: 22px; text-align: center; color: var(--o-muted); background: var(--o-surface); border: 1px dashed var(--o-line); border-radius: var(--o-radius); }
.sm-empty svg { color: var(--o-ok); }
.sm-chip.res { background: #e4effb; color: #1d5fae; }
.sm-form, .sm-form-grid { display: grid; gap: 12px; }
.sm-form-grid { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.sm-form-grid .wide-field { grid-column: 1 / -1; }
.sm-checks { display: grid; gap: 6px; margin: 10px 0; }
.sm-dialog-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.sm-dialog-grid .wide-field { grid-column: 1 / -1; }
.sm-dialog-info { margin: 10px 0 0; padding: 8px 12px; border-radius: 8px; background: var(--o-green-tint); color: var(--o-green); font-size: 13px; }
.sm-dialog-wide { width: min(900px, 96vw) !important; max-width: 96vw !important; }
.sm-doc { background: #fff; color: #18231e; padding: 18px; border: 1px solid var(--o-line); border-radius: 8px; overflow: auto; }
.sm-doc h1 { font-size: 15px; text-align: center; color: var(--o-green); margin: 6px 0 0; }
.sm-doc h2 { font-size: 17px; text-align: center; margin: 4px 0 12px; }
.sm-doc .stripe { height: 6px; background: repeating-linear-gradient(135deg, #c8102e 0 12px, #fff 12px 24px); }
.sm-doc table { width: 100%; border-collapse: collapse; margin: 8px 0; }
.sm-doc th, .sm-doc td { border: 1px solid #b8c4bd; padding: 4px 8px; text-align: left; }
.sm-doc .meta td { border: 0; }
.sm-doc .n { text-align: right; }
.sm-doc .bad { color: var(--o-red); font-weight: 700; }
.sm-doc .note { color: var(--o-muted); font-size: 12.5px; }
.sm-doc .sign { display: flex; gap: 20px; margin-top: 40px; }
.sm-doc .sign div { flex: 1; border-top: 1px solid #18231e; padding-top: 4px; text-align: center; font-size: 12px; }
.sm-plan { margin: 8px 0; padding-left: 18px; display: grid; gap: 4px; font-size: 13.5px; }
.assess-table input { width: 84px; text-align: right; }
.assess-table input.as-rem { width: 150px; text-align: left; }
.req-cost input, .req-amount { min-width: 80px; }
.req-amount { text-align: right; white-space: nowrap; }
button.danger-solid { background: var(--o-red); color: #fff; }
@media (max-width: 760px) {
  .sm-two-col, .sm-dialog-grid { grid-template-columns: 1fr; }
  .sm-att { flex-wrap: wrap; }
}

/* Store Management: override the generic red button look for navigation-style buttons and fix form layout */
.sidebar .sm-sidenav button.sm-side:not(.secondary):not(.ghost):not(.danger):not(.link-button):not(.login-mode-tab):not(.icon-button) {
  min-height: 42px; padding: 9px 14px; border: 0 !important; border-radius: 6px !important;
  color: rgba(255, 255, 255, 0.78) !important; background: transparent !important;
  font-size: 14px; font-weight: 500 !important; justify-content: flex-start; text-align: left;
}
.sidebar .sm-sidenav button.sm-side:not(.secondary):not(.ghost):not(.danger):not(.link-button):not(.login-mode-tab):not(.icon-button):hover {
  color: #fff !important; background: rgba(255, 255, 255, 0.08) !important;
}
.sidebar .sm-sidenav button.sm-side.active:not(.secondary):not(.ghost):not(.danger):not(.link-button):not(.login-mode-tab):not(.icon-button) {
  color: var(--o-green) !important; background: #fff !important; font-weight: 600 !important; box-shadow: inset 4px 0 0 var(--o-red) !important;
}
.sm-quick button:not(.secondary):not(.ghost):not(.danger):not(.link-button):not(.login-mode-tab):not(.icon-button) {
  display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start; height: auto;
  color: var(--o-ink) !important; background: var(--o-surface) !important; border: 1px solid var(--o-line) !important;
  box-shadow: var(--o-lift) !important; text-align: left; padding: 14px;
}
.sm-quick button:not(.secondary):not(.ghost):not(.danger):not(.link-button):not(.login-mode-tab):not(.icon-button):hover { border-color: var(--o-green-2) !important; }
.sm-quick button strong { color: var(--o-green); }
.sm-quick button small { color: var(--o-muted); font-weight: 400; }
.employee-form.sm-form { display: flex !important; flex-direction: column; gap: 12px; }
.employee-form.sm-form .section-heading { margin: 0; }
.employee-form.sm-form:hover { transform: none; }
.sm-form .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.danger-text{color:var(--o-red)!important}
#smInvHead th:first-child, #smInvBody td:first-child { position: sticky; left: 0; z-index: 1; background: var(--o-surface); box-shadow: 1px 0 0 var(--o-line); }
#smInvHead th:first-child { background: var(--o-paper); z-index: 2; }
.sm-photos { display: flex; flex-wrap: wrap; gap: 8px; }
.sm-photos img { height: 84px; border: 1px solid var(--o-line); border-radius: 6px; object-fit: cover; }
.sm-addphoto { display: grid; gap: 4px; margin-top: 10px; font-size: 13px; }
.sm-doc .photo-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.sm-doc .photo-grid img { max-width: 48%; max-height: 360px; border: 1px solid #b8c4bd; }
.export-bar { display: flex; justify-content: flex-end; align-items: center; gap: 6px; margin: 0 0 4px; font-size: 12px; color: var(--o-muted); }
.export-bar button.secondary { min-height: 28px !important; padding: 2px 12px !important; font-size: 12px !important; }
@media print { .export-bar { display: none !important; } }
.sm-store-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.sm-store-card { display: flex; flex-direction: column; align-items: stretch; gap: 8px; text-align: left; padding: 14px; }
.sm-store-card:not(.secondary):not(.ghost):not(.danger):not(.link-button):not(.login-mode-tab):not(.icon-button) {
  color: var(--o-ink) !important; background: var(--o-surface) !important; border: 1px solid var(--o-line) !important; box-shadow: var(--o-lift) !important; height: auto; justify-content: flex-start;
}
.sm-store-card:not(.secondary):not(.ghost):not(.danger):not(.link-button):not(.login-mode-tab):not(.icon-button):hover { border-color: var(--o-green-2) !important; transform: translateY(-1px) !important; }
.sm-store-card-top { display: flex; justify-content: space-between; gap: 6px; align-items: center; }
.sm-store-card-top strong { font-family: var(--o-head); color: var(--o-green); font-size: 15px; }
.sm-store-card-nums { display: flex; gap: 16px; }
.sm-store-card-nums span { display: grid; font-size: 11.5px; color: var(--o-muted); }
.sm-store-card-nums b { font-size: 18px; color: var(--o-ink); font-family: var(--o-head); }
.sm-store-card-flags { display: flex; flex-wrap: wrap; gap: 4px; min-height: 20px; }
.sm-store-head { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; justify-content: space-between; }
.sm-store-head h2 { margin: 0; color: var(--o-green); }
.sm-keeper-list { display: flex; flex-wrap: wrap; gap: 10px; }
.sm-keeper { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--o-line); border-radius: 8px; background: var(--o-paper); }
.sm-keeper > div { display: grid; }
.sm-keeper small { color: var(--o-muted); }
.sm-link { color: var(--o-green); text-decoration: none; }
.sm-link:hover { text-decoration: underline; }

/* ===================== Fleet Management ===================== */
.fm-sidenav { display: none; }
#centralPage.fm-active .fm-sidenav, #appPage.fm-active .fm-sidenav { display: flex; }
#centralPage.fleet-mode .sidebar-nav .tab[data-tab="centralFleetTab"],
#appPage.fleet-only-mode .sidebar-nav .tab[data-tab="fmStationTab"] { display: none !important; }
.fm-root { display: grid; gap: 14px; color: var(--o-ink); }
.fm-root .hidden, .fm-modal.hidden { display: none !important; }
.fm-body { display: grid; gap: 14px; min-width: 0; }
.fm-root *, .fm-modal * { box-sizing: border-box; }
.muted { color: var(--o-muted); }
.ok { color: var(--o-ok); } .bad { color: var(--o-red); } .warn { color: var(--o-amber); }

/* header bar */
.fm-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 10px 14px; background: #fff; border: 1px solid var(--o-line); border-top: 3px solid var(--o-red); border-radius: 8px; position: relative; z-index: 5; }
.fm-hl { flex: none; }
.fm-head-l { display: flex; align-items: center; gap: 10px; }
.fm-head-l strong { display: block; font-family: var(--o-head); font-size: 17px; color: var(--o-green); }
.fm-head-l small { color: var(--o-muted); font-size: 12.5px; }
.fm-head-mark { width: 38px; height: 38px; border-radius: 8px; background: var(--o-red-tint); color: var(--o-red); display: grid; place-items: center; }
.fm-search { position: relative; flex: 1 1 280px; min-width: 200px; }
.fm-search input { width: 100%; min-height: 40px; padding: 8px 12px; border: 1px solid var(--o-line); border-radius: 6px; background: #fff; font-size: 14px; }
.fm-searchres { position: absolute; left: 0; right: 0; top: 44px; z-index: 30; max-height: 60vh; overflow: auto; background: #fff; border: 1px solid var(--o-line); border-radius: 8px; box-shadow: 0 10px 28px rgba(0,0,0,.14); }
.fm-hr { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.fm-user { text-align: right; line-height: 1.25; }
.fm-user b { display: block; font-size: 13.5px; }
.fm-user small { color: var(--o-muted); font-size: 12px; }
.fm-bellwrap { position: relative; }
.fm-bellpanel { position: absolute; right: 0; top: 46px; width: min(380px, 92vw); max-height: 70vh; overflow: auto; background: #fff; border: 1px solid var(--o-line); border-radius: 8px; box-shadow: 0 12px 30px rgba(0,0,0,.16); z-index: 40; text-align: left; }
.fm-bellhead { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; background: var(--o-paper); font-size: 13px; }
.pad { padding: 12px; }
.fm-count { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--o-red); color: #fff; font-size: 11.5px; text-align: center; font-weight: 700; }

/* title bars, cards */
.fm-titlebar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; }
.fm-titlebar h2 { margin: 2px 0; font-family: var(--o-head); font-size: 24px; color: var(--o-green); display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.fm-titlebar p { margin: 0; color: var(--o-muted); }
.fm-card { background: #fff; border: 1px solid var(--o-line); border-radius: 8px; padding: 16px; min-width: 0; }
.fm-card h3 { margin: 0 0 10px; font-size: 15.5px; color: var(--o-green); font-family: var(--o-head); }
.fm-card h3 small { color: var(--o-muted); font-weight: 400; font-family: var(--o-body); }
.fm-card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.fm-card-head h3 { margin: 0; }
.fm-sub-h { margin-top: 16px; }
.fm-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.fm-charts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.fm-btnrow { display: flex; gap: 8px; align-items: center; }
.fm-btnrow.wrap { flex-wrap: wrap; }
.fm-note { padding: 8px 12px; border-radius: 6px; background: var(--o-paper); font-size: 13px; margin: 8px 0 0; }
.fm-note.warn { background: var(--o-amber-tint); color: var(--o-amber); }
.fm-note.bad { background: var(--o-red-tint); color: var(--o-red-dark); }
.fm-active-filter { padding: 8px 12px; background: var(--o-red-tint); border-radius: 6px; margin-bottom: 10px; font-size: 13.5px; }
.fm-more { margin: 8px 0 0; font-size: 13px; }

/* KPI tiles */
.fm-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.fm-kpis.small { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.fm-kpi, .fm-kpi.static { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 14px 14px 12px; text-align: left; background: #fff; border: 1px solid var(--o-line); border-left: 4px solid var(--c, var(--o-green)); border-radius: 8px; min-height: 92px; }
.fm-kpi strong { font-family: var(--o-head); font-size: 26px; line-height: 1.1; color: var(--o-ink); }
.fm-kpi span { color: var(--o-muted); font-size: 13px; }
.fm-kpi small { color: var(--o-muted); font-size: 11.5px; }
.fm-kpi-i { position: absolute; right: 10px; top: 10px; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 12%, #fff); color: var(--c) !important; }
button.fm-kpi { cursor: pointer; }
.fm-kpi.static { cursor: default; }

/* charts */
.fm-chart-empty { display: grid; place-items: center; min-height: 130px; color: var(--o-muted); font-size: 13px; background: var(--o-paper); border-radius: 6px; }
.fm-donut { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.fm-donut svg { width: 150px; height: 150px; flex: none; }
.fm-donut-n { font: 700 24px var(--o-head); fill: var(--o-ink); }
.fm-donut-l { font: 11px var(--o-body); fill: var(--o-muted); }
.fm-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; flex: 1; min-width: 130px; font-size: 12.5px; }
.fm-legend li { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.fm-legend i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.fm-legend span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fm-hbars { display: grid; gap: 7px; }
.fm-hbar { display: grid; grid-template-columns: minmax(80px, 38%) 1fr auto; align-items: center; gap: 8px; font-size: 12.5px; cursor: pointer; }
.fm-hbar-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fm-hbar-t { height: 12px; background: var(--o-paper); border-radius: 6px; overflow: hidden; }
.fm-hbar-t span { display: block; height: 100%; border-radius: 6px; }
.fm-vbars { width: 100%; height: auto; max-height: 190px; }
.fm-vb-v { font: 600 8.5px var(--o-body); fill: var(--o-ink); }
.fm-vb-l { font: 9px var(--o-body); fill: var(--o-muted); }

/* chips, links, filters */
.fm-chip { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; color: var(--c, #555); background: color-mix(in srgb, var(--c, #555) 12%, #fff); border: 1px solid color-mix(in srgb, var(--c, #555) 30%, #fff); }
.fm-chip-x { padding: 4px 10px; border-radius: 6px; background: var(--o-paper); font-size: 12.5px; align-self: end; }
.fm-sub { display: block; font-size: 11.5px; color: var(--o-muted); font-weight: 400; margin-top: 1px; }
.fm-sub.bad { color: var(--o-red); } .fm-sub.warn { color: var(--o-amber); }
.fm-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin: 0 0 10px; }
.fm-filter { display: grid; gap: 3px; font-size: 12px; color: var(--o-muted); min-width: 140px; }
.fm-filter.grow { flex: 1 1 240px; }
.fm-filter input, .fm-filter select { min-height: 38px; padding: 6px 10px; border: 1px solid var(--o-line); border-radius: 6px; background: #fff; font-size: 13.5px; color: var(--o-ink); width: 100%; }
.fm-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; margin: 0 14px 8px 0; cursor: pointer; }
.fm-req { color: var(--o-red); font-style: normal; }

/* tables */
.fm-table { min-width: 880px; font-size: 13px; }
.fm-table th { background: var(--o-green) !important; color: #fff !important; font-size: 12.5px; white-space: nowrap; }
.fm-table td { vertical-align: top; }
.fm-table td.n, .fm-table th.n { text-align: right; white-space: nowrap; }
.fm-table td.c, .fm-table th.c { text-align: center; }
.fm-table td.empty { text-align: center; color: var(--o-muted); padding: 22px; }
.fm-table tr.fm-total td { font-weight: 700; background: var(--o-green-tint); }
.fm-table.fm-check-table { min-width: 0; }
.fm-alert-line { display: flex; gap: 6px; align-items: baseline; margin: 2px 0; font-size: 12.5px; }
.fm-link { padding: 0 !important; min-height: 0 !important; border: 0 !important; background: none !important; color: var(--o-red-dark) !important; font-weight: 600 !important; text-align: left; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; font-size: inherit; box-shadow: none !important; }
.fm-file { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; margin: 1px 2px; border: 1px solid var(--o-line); border-radius: 999px; background: #fff; font-size: 11.5px; color: var(--o-green); cursor: pointer; }

/* buttons */
.fm-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; min-height: 38px; padding: 8px 16px; border-radius: 6px; font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.fm-btn.small { min-height: 30px; padding: 4px 11px; font-size: 12.5px; }
.fm-btn.big { min-height: 46px; padding: 10px 22px; font-size: 15px; }
.fm-btn.secondary { color: var(--o-green) !important; background: #fff !important; border: 1px solid #b9c9c0 !important; }
.fm-btn.secondary:hover { border-color: var(--o-green) !important; background: var(--o-green-tint) !important; }
.fm-btn.danger { color: #fff !important; background: #7f1d1d !important; border: 1px solid #7f1d1d !important; }
.fm-btn.danger:hover { background: #5f1414 !important; }
.fm-btn.blocked { opacity: .5; }
.fm-btn:disabled { opacity: .55; cursor: wait; }

/* station cards, quick actions */
.fm-stgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.fm-stcard { display: block; text-align: left; padding: 14px; background: #fff; border: 1px solid var(--o-line); border-left: 4px solid var(--o-green); border-radius: 8px; cursor: pointer; }
.fm-stcard:hover { border-left-color: var(--o-red); }
.fm-stcard strong { font-size: 15.5px; color: var(--o-green); }
.fm-stnums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.fm-stnums span { font-size: 11.5px; color: var(--o-muted); display: grid; }
.fm-stnums b { font-size: 18px; color: var(--o-ink); }
.fm-stnums .ok b { color: var(--o-ok); } .fm-stnums .bad b { color: var(--o-red); } .fm-stnums .warn b { color: var(--o-amber); }
.fm-quicks { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.fm-quick { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 14px; text-align: left; background: #fff; border: 1px solid var(--o-line); border-radius: 8px; cursor: pointer; color: var(--o-red); }
.fm-quick strong { color: var(--o-green); font-size: 14px; }
.fm-quick small { color: var(--o-muted); font-weight: 400; }
.fm-quick:hover { border-color: var(--o-red); }
.fm-depgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.fm-depveh { display: flex; align-items: center; gap: 8px; justify-content: space-between; padding: 5px 0; border-bottom: 1px dashed var(--o-line-soft); font-size: 13px; }
.fm-depveh span { flex: 1; color: var(--o-muted); font-size: 12px; }

/* vehicle profile */
.fm-vhead { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 16px; align-items: center; }
.fm-photo { width: 150px; height: 108px; border-radius: 8px; background: var(--o-paper); display: grid; place-items: center; color: var(--o-muted); overflow: hidden; }
.fm-photo img { width: 100%; height: 100%; object-fit: cover; }
.fm-vinfo h2 { margin: 0; font-family: var(--o-head); font-size: 26px; color: var(--o-green); }
.fm-vinfo p { margin: 2px 0 8px; color: var(--o-muted); }
.fm-vmeta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; font-size: 13px; }
.fm-vmeta span { display: inline-flex; align-items: center; gap: 4px; }
.fm-tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 2px solid var(--o-line); }
.fm-tab { padding: 9px 14px; cursor: pointer; white-space: nowrap; font-weight: 600; font-size: 13.5px; }
.fm-kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; margin: 0; }
.fm-kv dt { font-size: 11.5px; color: var(--o-muted); text-transform: uppercase; letter-spacing: .03em; }
.fm-kv dd { margin: 1px 0 0; font-size: 14px; word-break: break-word; }

/* request detail */
.fm-steps { list-style: none; margin: 0; padding: 4px 0 8px; display: flex; overflow-x: auto; gap: 0; }
.fm-step { position: relative; flex: 1 0 104px; text-align: center; padding: 0 4px; font-size: 11.5px; color: var(--o-muted); display: grid; justify-items: center; gap: 4px; }
.fm-step::before { content: ""; position: absolute; top: 12px; left: -50%; right: 50%; height: 3px; background: var(--o-line); z-index: 0; }
.fm-step:first-child::before { display: none; }
.fm-step.done::before, .fm-step.current::before { background: var(--o-ok); }
.fm-dot { position: relative; z-index: 1; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: #fff; border: 2px solid var(--o-line); color: #fff; font-size: 16px; line-height: 1; }
.fm-step.done .fm-dot { background: var(--o-ok); border-color: var(--o-ok); }
.fm-step.current .fm-dot { background: var(--o-red); border-color: var(--o-red); box-shadow: 0 0 0 4px var(--o-red-tint); }
.fm-step.skipped .fm-dot { border-style: dashed; }
.fm-step.rejected .fm-dot { background: var(--o-red); border-color: var(--o-red); }
.fm-step.rejected b, .fm-step.current b { color: var(--o-red-dark); }
.fm-step.done b { color: var(--o-ink); }
.fm-step b { font-weight: 600; line-height: 1.2; }
.fm-step small { font-size: 10.5px; color: var(--o-muted); }
.fm-actions { border-top: 3px solid var(--o-red); }
.fm-files { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.fm-filecard { display: grid; gap: 2px; padding: 8px; border: 1px solid var(--o-line); border-radius: 6px; font-size: 12px; }
.fm-filecard img { width: 100%; height: 90px; object-fit: cover; border-radius: 4px; cursor: pointer; }
.fm-doc { display: grid; place-items: center; height: 90px; background: var(--o-paper); border-radius: 4px; color: var(--o-green); cursor: pointer; }
.fm-filecard small { color: var(--o-muted); }

/* reports */
.fm-repwrap { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 14px; align-items: start; }
.fm-replist { display: grid; gap: 4px; background: #fff; border: 1px solid var(--o-line); border-radius: 8px; padding: 8px; }
.fm-repbody .table-wrap { margin-top: 6px; }

/* notifications / search lists */
.fm-note-item, .fm-sr { display: grid; gap: 1px; width: 100%; text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--o-line-soft); cursor: pointer; font-size: 12.5px; }
.fm-note-item.unread { background: #fff7f8; }
.fm-note-item b, .fm-sr b { font-size: 13px; }
.fm-note-item span, .fm-sr small, .fm-note-item small { color: var(--o-muted); font-weight: 400; }
.fm-sr-k { font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--o-red-dark); font-weight: 700; }

/* forms and pop-ups */
.fm-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.fm-field { display: grid; gap: 4px; align-content: start; min-width: 0; }
.fm-field.wide { grid-column: 1 / -1; }
.fm-field label { font-size: 12.5px; font-weight: 600; color: var(--o-ink); }
.fm-field input, .fm-field select, .fm-field textarea { width: 100%; min-height: 38px; padding: 7px 10px; border: 1px solid var(--o-line); border-radius: 6px; background: #fff; font-size: 14px; font-family: var(--o-body); }
.fm-field textarea { resize: vertical; }
.fm-field input[type=file] { padding: 6px; }
.fm-field small { font-size: 11.5px; }
.fm-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px; }
.fm-checks label { font-weight: 400; display: flex; gap: 6px; align-items: center; }
.fm-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; padding: 12px; margin-bottom: 12px; background: var(--o-green-tint); border-radius: 8px; }
.fm-auto small { display: block; color: var(--o-muted); font-size: 11px; text-transform: uppercase; }
.fm-auto b { font-size: 13.5px; word-break: break-word; }
.fm-auto input { width: 100%; min-height: 32px; padding: 4px 8px; border: 1px solid var(--o-line); border-radius: 6px; }
.fm-modal { position: fixed; inset: 0; z-index: 4000; display: flex; align-items: flex-start; justify-content: center; padding: 4vh 12px; background: rgba(20, 30, 25, .5); overflow: auto; }
.fm-modal-card { width: min(560px, 100%); background: #fff; border-radius: 10px; border-top: 4px solid var(--o-red); box-shadow: 0 20px 50px rgba(0,0,0,.3); display: flex; flex-direction: column; max-height: 92vh; }
.fm-modal-card.wide { width: min(860px, 100%); }
.fm-modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--o-line); }
.fm-modal-head strong { font-family: var(--o-head); font-size: 17px; color: var(--o-green); }
.fm-x { width: 34px; height: 34px; font-size: 22px; line-height: 1; border-radius: 6px; cursor: pointer; color: var(--o-muted); }
.fm-modal-body { padding: 16px 18px; overflow: auto; }
.fm-modal-foot { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center; padding: 12px 18px; border-top: 1px solid var(--o-line); background: var(--o-paper); border-radius: 0 0 10px 10px; }
.fm-modal-msg { color: var(--o-red-dark); font-size: 13px; flex: 1 1 200px; font-weight: 600; }
.fm-modal-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.fm-imgview { text-align: center; } .fm-imgview img { max-width: 100%; max-height: 70vh; border-radius: 6px; }

@media (max-width: 1100px) { .fm-charts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 820px) {
  .fm-two, .fm-charts, .fm-form, .fm-kv, .fm-repwrap { grid-template-columns: 1fr; }
  .fm-vhead { grid-template-columns: 1fr; }
  .fm-photo { width: 100%; }
  .fm-hr { margin-left: 0; width: 100%; justify-content: space-between; }
  .fm-search { order: 3; flex-basis: 100%; }
  .fm-titlebar h2 { font-size: 20px; }
  .fm-replist { display: flex; overflow-x: auto; }
  .fm-replist button { white-space: nowrap; }
  .fm-btn.big { width: 100%; }
}

/* keep the global red button rule off navigation-style fleet buttons */
:is(.fm-root,.fm-modal) button.fm-kpi:not(.secondary):not(.ghost):not(.danger):not(.link-button):not(.login-mode-tab):not(.icon-button){color:var(--o-ink)!important;background:#fff!important;border:1px solid var(--o-line)!important;border-left:4px solid var(--c,#0e3b2e)!important;border-radius:8px!important;font-weight:400!important;min-height:92px;padding:14px 14px 12px}
:is(.fm-root,.fm-modal) button.fm-kpi:not(.secondary):not(.ghost):not(.danger):not(.link-button):not(.login-mode-tab):not(.icon-button):hover{border-color:var(--c)!important;background:#fbfcfb!important}
:is(.fm-root,.fm-modal) button.fm-stcard:not(.secondary):not(.ghost):not(.danger):not(.link-button):not(.login-mode-tab):not(.icon-button){color:var(--o-ink)!important;background:#fff!important;border:1px solid var(--o-line)!important;border-left:4px solid var(--o-green)!important;border-radius:8px!important;font-weight:400!important;min-height:0;padding:14px}
:is(.fm-root,.fm-modal) button.fm-stcard:not(.secondary):not(.ghost):not(.danger):not(.link-button):not(.login-mode-tab):not(.icon-button):hover{border-left-color:var(--o-red)!important;background:#fbfcfb!important}
:is(.fm-root,.fm-modal) button.fm-quick:not(.secondary):not(.ghost):not(.danger):not(.link-button):not(.login-mode-tab):not(.icon-button){color:var(--o-red)!important;background:#fff!important;border:1px solid var(--o-line)!important;border-radius:8px!important;font-weight:400!important;height:auto;padding:14px}
:is(.fm-root,.fm-modal) button.fm-quick:not(.secondary):not(.ghost):not(.danger):not(.link-button):not(.login-mode-tab):not(.icon-button):hover{border-color:var(--o-red)!important;background:#fffafa!important}
:is(.fm-root,.fm-modal) button.fm-tab:not(.secondary):not(.ghost):not(.danger):not(.link-button):not(.login-mode-tab):not(.icon-button){color:var(--o-muted)!important;background:transparent!important;border:0!important;border-bottom:3px solid transparent!important;border-radius:0!important;font-weight:600!important;margin-bottom:-2px;min-height:0}
:is(.fm-root,.fm-modal) button.fm-tab:not(.secondary):not(.ghost):not(.danger):not(.link-button):not(.login-mode-tab):not(.icon-button):hover{color:var(--o-green)!important;background:var(--o-green-tint)!important}
:is(.fm-root,.fm-modal) button.fm-tab:not(.secondary):not(.ghost):not(.danger):not(.link-button):not(.login-mode-tab):not(.icon-button).active{color:var(--o-red-dark)!important;border-bottom-color:var(--o-red)!important}
:is(.fm-root,.fm-modal) button.fm-file:not(.secondary):not(.ghost):not(.danger):not(.link-button):not(.login-mode-tab):not(.icon-button){color:var(--o-green)!important;background:#fff!important;border:1px solid var(--o-line)!important;border-radius:999px!important;font-weight:500!important;min-height:0;padding:2px 8px}
:is(.fm-root,.fm-modal) button.fm-file:not(.secondary):not(.ghost):not(.danger):not(.link-button):not(.login-mode-tab):not(.icon-button):hover{background:var(--o-green-tint)!important}
:is(.fm-root,.fm-modal) button.fm-bell:not(.secondary):not(.ghost):not(.danger):not(.link-button):not(.login-mode-tab):not(.icon-button){color:var(--o-green)!important;background:#fff!important;border:1px solid var(--o-line)!important;border-radius:8px!important;position:relative;width:42px;min-height:42px;padding:0;display:grid;place-items:center;overflow:visible}
:is(.fm-root,.fm-modal) button.fm-bell:not(.secondary):not(.ghost):not(.danger):not(.link-button):not(.login-mode-tab):not(.icon-button):hover{background:var(--o-green-tint)!important}
:is(.fm-root,.fm-modal) .fm-bell i{position:absolute;top:-6px;right:-6px;min-width:18px;height:18px;padding:0 4px;border-radius:9px;background:var(--o-red);color:#fff;font:700 11px/18px var(--o-body);font-style:normal;text-align:center}
:is(.fm-root,.fm-modal) button.fm-x:not(.secondary):not(.ghost):not(.danger):not(.link-button):not(.login-mode-tab):not(.icon-button){color:var(--o-muted)!important;background:transparent!important;border:0!important;box-shadow:none!important;min-height:34px;padding:0}
:is(.fm-root,.fm-modal) button.fm-x:not(.secondary):not(.ghost):not(.danger):not(.link-button):not(.login-mode-tab):not(.icon-button):hover{background:var(--o-paper)!important}
:is(.fm-root,.fm-modal) button.fm-note-item:not(.secondary):not(.ghost):not(.danger):not(.link-button):not(.login-mode-tab):not(.icon-button){color:var(--o-ink)!important;background:transparent!important;border:0!important;border-bottom:1px solid var(--o-line-soft)!important;border-radius:0!important;font-weight:400!important;min-height:0;padding:9px 12px;justify-content:flex-start}
:is(.fm-root,.fm-modal) button.fm-note-item:not(.secondary):not(.ghost):not(.danger):not(.link-button):not(.login-mode-tab):not(.icon-button):hover{background:var(--o-paper)!important}
:is(.fm-root,.fm-modal) button.fm-sr:not(.secondary):not(.ghost):not(.danger):not(.link-button):not(.login-mode-tab):not(.icon-button){color:var(--o-ink)!important;background:transparent!important;border:0!important;border-bottom:1px solid var(--o-line-soft)!important;border-radius:0!important;font-weight:400!important;min-height:0;padding:9px 12px}
:is(.fm-root,.fm-modal) button.fm-sr:not(.secondary):not(.ghost):not(.danger):not(.link-button):not(.login-mode-tab):not(.icon-button):hover{background:var(--o-paper)!important}
:is(.fm-root,.fm-modal) .fm-replist button:not(.secondary):not(.ghost):not(.danger):not(.link-button):not(.login-mode-tab):not(.icon-button){color:var(--o-ink)!important;background:transparent!important;border:0!important;border-radius:6px!important;text-align:left;font-weight:500!important;justify-content:flex-start;min-height:36px;padding:6px 10px}
:is(.fm-root,.fm-modal) .fm-replist button:not(.secondary):not(.ghost):not(.danger):not(.link-button):not(.login-mode-tab):not(.icon-button):hover{background:var(--o-green-tint)!important}
:is(.fm-root,.fm-modal) .fm-replist button.active:not(.secondary):not(.ghost):not(.danger):not(.link-button):not(.login-mode-tab):not(.icon-button){color:#fff!important;background:var(--o-green)!important}

:is(.fm-root,.fm-modal) button.fm-link:not(.secondary):not(.ghost):not(.danger):not(.link-button):not(.login-mode-tab):not(.icon-button){padding:0!important;min-height:0!important;border:0!important;background:none!important;color:var(--o-red-dark)!important;font-weight:600!important;text-align:left;text-decoration:underline;text-underline-offset:2px;font-size:inherit;box-shadow:none!important;border-radius:0!important}
:is(.fm-root,.fm-modal) button.fm-link:not(.secondary):not(.ghost):not(.danger):not(.link-button):not(.login-mode-tab):not(.icon-button):hover{background:none!important;color:var(--o-red)!important}
:is(.fm-root,.fm-modal) button.fm-btn.small:not(.secondary):not(.ghost):not(.danger):not(.link-button):not(.login-mode-tab):not(.icon-button){min-height:30px;padding:4px 11px;font-size:12.5px}
:is(.fm-root,.fm-modal) button.fm-btn.big:not(.secondary):not(.ghost):not(.danger):not(.link-button):not(.login-mode-tab):not(.icon-button){min-height:46px;padding:10px 22px;font-size:15px}
:is(.fm-root,.fm-modal) button.fm-btn.small.secondary,:is(.fm-root,.fm-modal) button.fm-btn.small.danger{min-height:30px;padding:4px 11px;font-size:12.5px}

.fm-kpis.ten { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1180px) { .fm-kpis.ten { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); } }
.fm-table th, .fm-table td { padding: 8px 9px; }
.fm-table.mini { min-width: 0; }

.fm-vhead > .fm-btnrow { grid-column: 1 / -1; }
@media (max-width: 820px) { .fm-replist button { flex: none !important; } }

/* Login picture: fixed-height panel, picture fills it from the top (logos and title stay visible) */
@media (min-width: 901px) {
  .login-visual { height: calc(100vh - 44px); min-height: 0; }
  .login-visual img { object-fit: cover; object-position: center top; animation: none; }
}

/* ===== Password management (change password, forgot password, admin reset) ===== */
.pw-modal { position: fixed; inset: 0; z-index: 5000; display: flex; align-items: flex-start; justify-content: center; padding: 8vh 14px 14px; background: rgba(14, 30, 24, .55); overflow: auto; }
.pw-modal.hidden { display: none !important; }
.pw-card { width: min(460px, 100%); background: #fff; border-radius: 14px; box-shadow: 0 24px 60px rgba(0, 0, 0, .35); overflow: hidden; border-top: 5px solid var(--o-red, #c8102e); }
.pw-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; background: var(--o-paper, #f4f6f4); border-bottom: 1px solid #dfe5e1; color: var(--o-green, #0e3b2e); font-size: 16px; }
.pw-modal .pw-x { border: 0 !important; background: transparent !important; color: #374151 !important; font-size: 24px; line-height: 1; padding: 0 6px !important; box-shadow: none !important; cursor: pointer; width: auto !important; }
.pw-modal .pw-x.hidden { display: none !important; }
.pw-body { padding: 16px 18px 18px; }
.pw-form { display: grid; gap: 12px; }
.pw-form label { display: grid; gap: 5px; font-weight: 600; font-size: 13px; color: #1f2d27; }
.pw-form input[type=password], .pw-form input[type=text] { width: 100%; }
.pw-inline { display: flex; gap: 8px; align-items: stretch; }
.pw-inline input { flex: 1; font-family: Consolas, "Courier New", monospace; letter-spacing: .06em; }
.pw-inline button { width: auto !important; white-space: nowrap; }
.pw-form .pw-check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.pw-form .pw-check input { width: auto; }
.pw-note { margin: 0 0 12px; font-size: 13.5px; color: #374151; line-height: 1.45; }
.pw-note.warn { background: #fff7e0; border: 1px solid #ecd48a; border-radius: 8px; padding: 9px 12px; color: #6a4b00; }
.pw-hint { margin: 0; font-size: 12px; color: #6b7280; }
.pw-msg { margin: 0; min-height: 18px; font-size: 13px; font-weight: 600; color: #374151; }
.pw-msg.bad { color: #b91c1c; }
.pw-msg.ok { color: #15803d; }
.pw-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.pw-actions button { width: auto !important; min-width: 130px; }
.pw-actions .hidden { display: none !important; }
.pw-temp { margin: 4px 0; padding: 12px; text-align: center; font: 700 24px Consolas, "Courier New", monospace; letter-spacing: .12em; background: #f4f6f4; border: 1px dashed #0e3b2e; border-radius: 8px; user-select: all; }
.pw-panel { margin: 0 0 18px; padding: 14px 16px; background: #fff; border: 1px solid #dfe5e1; border-left: 5px solid var(--o-red, #c8102e); border-radius: 12px; }
.pw-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.pw-panel-head h3 { margin: 0; color: var(--o-green, #0e3b2e); }
.pw-done { margin-top: 10px; }
.pw-done summary { cursor: pointer; font-weight: 600; color: #374151; }
.pw-flag { color: #b45309; font-weight: 700; }
.employee-topbar-actions { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.login-form-card .link-button { margin-top: 2px; }
@media (max-width: 520px) { .pw-modal { padding-top: 3vh; } .pw-actions button { flex: 1; } }

.pw-modal .pw-x:hover { color: #c8102e !important; background: transparent !important; }
.pw-modal .pw-x { min-width: 0 !important; height: auto !important; }

/* ===== Clear all data (Central Admin) ===== */
.clear-data-card { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin: 22px 0 8px; padding: 16px 18px; border: 1px solid #e3a3a3; border-left: 5px solid #b91c1c; border-radius: 12px; background: #fff5f5; }
.clear-data-card.hidden { display: none !important; }
.clear-data-card h3 { margin: 0 0 4px; color: #991b1b; font-size: 17px; }
.clear-data-card p { margin: 0; max-width: 62ch; color: #4b2a2a; font-size: 14px; }
.clear-data-card button { width: auto !important; white-space: nowrap; }
.cd-card .pw-check { align-items: flex-start; }
.cd-card .pw-check small { font-weight: 400; color: #4b5563; font-size: 12.5px; }
.clear-data-card h3 { color: #991b1b !important; }
.clear-data-card p { color: #4b2a2a !important; }
.clear-data-card .cd-buttons { display: flex; flex-wrap: wrap; gap: 10px; }
.clear-data-card .cd-intro { flex: 1 1 280px; }

/* HR department rights sub-group in the central user form */
.central-hr-rights { grid-column: 1 / -1; margin-top: 8px; padding: 10px 12px; border: 1px dashed #94a3b8; border-radius: 10px; background: rgba(148,163,184,.08); }
.central-hr-rights.hidden { display: none; }
.central-hr-group { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin-top: 6px; }
.central-hr-group em { font-style: normal; font-weight: 700; min-width: 90px; opacity: .75; }
.central-hr-group label { display: inline-flex; gap: 5px; align-items: center; }

/* HR KPI tiles are clickable */
#hrKpis > .kpi-link { cursor: pointer; transition: transform .15s ease, box-shadow .15s ease; }
#hrKpis > .kpi-link:hover { transform: translateY(-3px); box-shadow: 0 8px 22px rgba(0,0,0,.18); }
#hrKpis > .kpi-link:focus-visible { outline: 3px solid var(--md-primary, #1F5FBF); outline-offset: 2px; }

/* Leave requests */
.lr-actions { white-space: nowrap; }
.lr-actions button { margin: 2px 3px 2px 0; padding: 6px 10px; font-size: 12px; }
.leave-requests-panel .section-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
#leaveRequestCard .form-actions { margin: 8px 0; }

/* Station roster (EO / SHI) */
.sr-topbar { margin: 0 0 12px; padding: 10px 14px; border-radius: 10px; font-size: 14px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.sr-topbar.hidden { display: none; }
.sr-info { background: #E0ECFF; color: #123A7A; border: 1px solid #9DBBEF; }
.sr-warn { background: #FFF1D6; color: #7A4A00; border: 1px solid #F1C26B; }
.sr-bad { background: #FDE2E2; color: #8A1111; border: 1px solid #F0A0A0; }
.sr-topbar button { margin-left: auto; padding: 6px 12px; }
#stationRoster .sr-unassigned td { background: rgba(245, 158, 11, .10); }
#stationRoster td select, #stationRoster td input { min-width: 120px; }
#stationRoster .sr-status { margin: 8px 0; }


/* Incident Type Graph: full-width card, larger donut, view toggle + month filter, month-wise chart */
.incident-analytics .incident-type-card {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  min-width: 0;
}
.incident-type-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.incident-type-title h2 { margin: 0; }
.incident-type-title span { display: block; margin-top: 2px; color: #64748B; font-size: 12px; }
.incident-type-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.incident-seg {
  display: inline-flex;
  padding: 3px;
  border-radius: 10px;
  background: #EEF2F6;
  border: 1px solid #E2E8F0;
}
#incidentTypeSeg button {
  min-height: 0 !important;
  height: 30px !important;
  padding: 0 12px !important;
  border: 0 !important;
  border-radius: 7px !important;
  background: transparent !important;
  color: #475569 !important;
  box-shadow: none !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  transform: none !important;
  white-space: nowrap;
  cursor: pointer;
}
#incidentTypeSeg button.active {
  background: #ffffff !important;
  color: #0F172A !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.14) !important;
}
#incidentTypeMonth {
  width: auto !important;
  min-width: 140px;
  height: 36px !important;
  padding: 0 30px 0 10px !important;
  font-size: 12px !important;
}
#incidentTypeMonth[hidden], #incidentTypeBreakdown[hidden], #incidentTypeMonthly[hidden] { display: none !important; }
#incidentTypeBreakdown {
  grid-template-columns: 260px minmax(0, 1fr) !important;
  gap: 28px !important;
  margin-top: 16px !important;
  min-height: 260px;
}
#incidentTypeBreakdown .pro-pie-canvas-wrap {
  width: 260px !important;
  max-width: 100% !important;
  height: 260px !important;
  aspect-ratio: 1 / 1;
}
#incidentTypeBreakdown .pro-pie-center span { margin: 0 0 2px; font-size: 11px; letter-spacing: 0.02em; }
#incidentTypeBreakdown .pro-pie-center strong { font-size: 36px !important; line-height: 1; }
#incidentTypeBreakdown .pro-pie-legend { width: 100%; }
.incident-type-monthly { margin-top: 16px; }
#incidentTypeMonthChart {
  display: block;
  width: 100% !important;
  height: 300px !important;
}
.incident-month-legend {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 16px;
  font-size: 12px;
  color: #475569;
}
.incident-month-legend li { display: inline-flex; align-items: center; gap: 6px; }
.incident-month-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.incident-month-legend b { color: #0F172A; font-weight: 700; }
.incident-month-hint { margin: 6px 0 0; text-align: center; font-size: 11px; color: #94A3B8; }
@media (max-width: 760px) {
  #incidentTypeBreakdown { grid-template-columns: 1fr !important; justify-items: center !important; }
  #incidentTypeBreakdown .pro-pie-canvas-wrap { width: 230px !important; height: 230px !important; }
  #incidentTypeMonthChart { height: 260px !important; }
  .incident-type-controls { width: 100%; }
}


/* Incident Monthly Trend: futuristic dark glass panel with neon accents */
.incident-analytics .neo-trend-card {
  position: relative;
  overflow: hidden;
  padding: 20px 22px 16px !important;
  border: 1px solid rgba(34, 211, 238, 0.28) !important;
  border-radius: 16px !important;
  color: #E0F2FE;
  background:
    radial-gradient(120% 90% at 0% 0%, rgba(34, 211, 238, 0.16), transparent 55%),
    radial-gradient(90% 80% at 100% 0%, rgba(167, 139, 250, 0.18), transparent 60%),
    linear-gradient(160deg, #0B1530 0%, #070D1F 100%) !important;
  box-shadow: 0 18px 40px rgba(2, 6, 23, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.06) !important;
}
.incident-analytics .neo-trend-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(148, 197, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 197, 255, 0.05) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.9), transparent 85%);
  -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.9), transparent 85%);
}
.incident-analytics .neo-trend-card::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #22D3EE, #A78BFA, transparent);
  opacity: 0.85;
}
.incident-analytics .neo-trend-card:hover { transform: none !important; border-color: rgba(34, 211, 238, 0.5) !important; }
.neo-trend-card > * { position: relative; z-index: 1; }
.neo-trend-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.neo-trend-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #67E8F9;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.neo-trend-eyebrow i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22D3EE;
  box-shadow: 0 0 0 0 rgba(34, 211, 238, 0.7);
  animation: neoPulse 2s infinite;
}
@keyframes neoPulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 211, 238, 0.7); }
  70% { box-shadow: 0 0 0 8px rgba(34, 211, 238, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 211, 238, 0); }
}
@media (prefers-reduced-motion: reduce) { .neo-trend-eyebrow i { animation: none; } }
.incident-analytics .neo-trend-card h2 {
  margin: 4px 0 2px !important;
  color: #F0F9FF !important;
  text-shadow: 0 0 18px rgba(34, 211, 238, 0.35);
}
#incidentTrendSub { display: block; color: rgba(186, 230, 253, 0.7) !important; font-size: 12px; }
#incidentTrendPeriod.neo-trend-select {
  width: auto !important;
  min-width: 170px;
  height: 38px !important;
  padding: 0 34px 0 12px !important;
  border: 1px solid rgba(34, 211, 238, 0.45) !important;
  border-radius: 10px !important;
  color: #E0F2FE !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  background-color: rgba(8, 18, 38, 0.75) !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2367E8F9' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
  -webkit-appearance: none;
  appearance: none;
  box-shadow: 0 0 14px rgba(34, 211, 238, 0.18) !important;
  cursor: pointer;
}
#incidentTrendPeriod.neo-trend-select:focus { outline: 2px solid rgba(34, 211, 238, 0.6) !important; outline-offset: 2px; }
#incidentTrendPeriod option, #incidentTrendPeriod optgroup { background: #0B1530; color: #E0F2FE; }
.neo-trend-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 16px 0 6px; }
.neo-trend-stats > div {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(148, 197, 255, 0.14);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015));
  min-width: 0;
}
.neo-trend-stats span { display: block; color: rgba(186, 230, 253, 0.65); font-size: 10.5px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; }
.neo-trend-stats strong { display: inline-block; margin-top: 2px; color: #F0F9FF; font-size: 22px; font-weight: 700; line-height: 1.15; text-shadow: 0 0 14px rgba(34, 211, 238, 0.45); }
.neo-trend-stats em { margin-left: 6px; color: #F9A8D4; font-size: 11px; font-style: normal; font-weight: 600; white-space: nowrap; }
#incidentTrendChart.neo-trend-chart { display: block; width: 100% !important; height: 260px !important; min-height: 0 !important; background: transparent !important; border: 0 !important; box-shadow: none !important; }
@media (max-width: 760px) {
  .incident-analytics .neo-trend-card { padding: 16px 14px 12px !important; }
  #incidentTrendPeriod.neo-trend-select { width: 100% !important; }
  .neo-trend-stats strong { font-size: 18px; }
  .neo-trend-stats em { display: block; margin: 0; }
  #incidentTrendChart.neo-trend-chart { height: 220px !important; }
}


/* Incident Type Graph donut: hard-coded 240px box, canvas and centre label pinned to it (no auto sizing) */
#incidentTypeBreakdown.incident-pie-body {
  display: grid !important;
  grid-template-columns: 240px minmax(0, 1fr) !important;
  align-items: center !important;
  justify-items: stretch !important;
  gap: 32px !important;
  min-height: 240px !important;
  height: auto !important;
  margin-top: 18px !important;
}
#incidentTypeBreakdown > .pro-pie-canvas-wrap {
  position: relative !important;
  display: block !important;
  width: 240px !important;
  min-width: 240px !important;
  max-width: 240px !important;
  height: 240px !important;
  min-height: 240px !important;
  max-height: 240px !important;
  aspect-ratio: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: visible !important;
  flex: none !important;
}
#incidentTypeBreakdown > .pro-pie-canvas-wrap > canvas#incidentTypeChart {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 240px !important;
  height: 240px !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
  transform: none !important;
}
#incidentTypeBreakdown > .pro-pie-canvas-wrap > .pro-pie-center {
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  width: 150px !important;
  margin: 0 !important;
  transform: translate(-50%, -50%) !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  z-index: 2;
}
#incidentTypeBreakdown .pro-pie-center span { margin: 0 0 4px !important; font-size: 11px !important; line-height: 1.2 !important; }
#incidentTypeBreakdown .pro-pie-center strong { font-size: 36px !important; line-height: 1 !important; }
#incidentTypeBreakdown > .pro-pie-legend { width: 100% !important; min-width: 0 !important; margin: 0 !important; }
@media (max-width: 760px) {
  #incidentTypeBreakdown.incident-pie-body { grid-template-columns: 1fr !important; justify-items: center !important; gap: 20px !important; }
  #incidentTypeBreakdown > .pro-pie-canvas-wrap { width: 240px !important; height: 240px !important; }
}

/* Keep the futuristic trend panel's own look under every theme */
html[data-style] .incident-analytics #incidentTrendCard.neo-trend-card,
.incident-analytics #incidentTrendCard.neo-trend-card {
  border: 1px solid rgba(34, 211, 238, 0.28) !important;
  background:
    radial-gradient(120% 90% at 0% 0%, rgba(34, 211, 238, 0.16), transparent 55%),
    radial-gradient(90% 80% at 100% 0%, rgba(167, 139, 250, 0.18), transparent 60%),
    linear-gradient(160deg, #0B1530 0%, #070D1F 100%) !important;
  transform: none !important;
}
#incidentTrendCard > canvas#incidentTrendChart { width: 100% !important; height: 260px !important; }


/* Incident Type Graph: same dark neon panel as the trend card, under every theme */
html[data-style] .incident-analytics #incidentTypeCard.neo-type-card,
.incident-analytics #incidentTypeCard.neo-type-card {
  position: relative;
  overflow: hidden;
  padding: 20px 22px 18px !important;
  color: #E0F2FE !important;
  border: 1px solid rgba(34, 211, 238, 0.28) !important;
  border-radius: 16px !important;
  background:
    radial-gradient(110% 90% at 100% 0%, rgba(167, 139, 250, 0.16), transparent 55%),
    radial-gradient(90% 80% at 0% 100%, rgba(34, 211, 238, 0.12), transparent 60%),
    linear-gradient(160deg, #0B1530 0%, #070D1F 100%) !important;
  box-shadow: 0 18px 40px rgba(2, 6, 23, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.06) !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  transform: none !important;
}
#incidentTypeCard.neo-type-card::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #A78BFA, #22D3EE, transparent);
  opacity: 0.85;
  pointer-events: none;
}
#incidentTypeCard .incident-type-title h2 { color: #F0F9FF !important; text-shadow: 0 0 18px rgba(34, 211, 238, 0.3); }
#incidentTypeCard #incidentTypeSub { color: rgba(186, 230, 253, 0.7) !important; }

/* view toggle */
#incidentTypeCard #incidentTypeSeg { background: rgba(8, 18, 38, 0.75) !important; border: 1px solid rgba(34, 211, 238, 0.35) !important; }
#incidentTypeCard #incidentTypeSeg button { color: rgba(186, 230, 253, 0.75) !important; background: transparent !important; }
#incidentTypeCard #incidentTypeSeg button.active {
  color: #04121F !important;
  background: linear-gradient(135deg, #22D3EE, #67E8F9) !important;
  box-shadow: 0 0 14px rgba(34, 211, 238, 0.45) !important;
}

/* month select */
#incidentTypeCard #incidentTypeMonth {
  border: 1px solid rgba(34, 211, 238, 0.45) !important;
  border-radius: 10px !important;
  color: #E0F2FE !important;
  font-weight: 600 !important;
  background-color: rgba(8, 18, 38, 0.75) !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2367E8F9' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
  -webkit-appearance: none;
  appearance: none;
  box-shadow: 0 0 14px rgba(34, 211, 238, 0.18) !important;
}
#incidentTypeCard #incidentTypeMonth option { background: #0B1530; color: #E0F2FE; }

/* donut + legend */
#incidentTypeCard #incidentTypeBreakdown { background: none !important; border: 0 !important; box-shadow: none !important; }
#incidentTypeCard .pro-pie-canvas-wrap { background: transparent !important; box-shadow: none !important; }
#incidentTypeCard .pro-pie-center span { color: rgba(186, 230, 253, 0.75) !important; text-transform: uppercase; letter-spacing: 0.1em !important; font-size: 10px !important; font-weight: 700 !important; }
#incidentTypeCard .pro-pie-center strong { color: #F0F9FF !important; text-shadow: 0 0 16px rgba(34, 211, 238, 0.5); }
#incidentTypeCard .pro-pie-legend-row { border-bottom-color: rgba(148, 197, 255, 0.10) !important; background: transparent !important; }
#incidentTypeCard .pro-pie-legend-label { color: #E0F2FE !important; }
#incidentTypeCard .pro-pie-legend-value { color: #F0F9FF !important; }
#incidentTypeCard .pro-pie-legend-pct { color: rgba(186, 230, 253, 0.6) !important; }
#incidentTypeCard .pro-pie-progress { background: rgba(148, 197, 255, 0.12) !important; }
#incidentTypeCard .pro-pie-progress i { box-shadow: 0 0 8px currentColor; }

/* month-wise view */
#incidentTypeCard .incident-month-legend { color: rgba(186, 230, 253, 0.8) !important; }
#incidentTypeCard .incident-month-legend b { color: #F0F9FF !important; }
#incidentTypeCard .incident-month-hint { color: rgba(186, 230, 253, 0.5) !important; }
#incidentTypeCard #incidentTypeMonthChart { background: transparent !important; border: 0 !important; }

/* hidden views must stay hidden (beats the hard-coded display rules above) */
#incidentTypeCard #incidentTypeBreakdown[hidden],
#incidentTypeCard #incidentTypeMonthly[hidden],
#incidentTypeCard #incidentTypeMonth[hidden] { display: none !important; }


/* Central portal: hint under Incidents by Type when the selected month is empty */
.central-month-hint { margin-top: 12px; padding-top: 10px; border-top: 1px dashed rgba(148, 163, 184, 0.3); }
.central-month-hint-text { margin: 0 0 8px; font-size: 12px; opacity: 0.8; }
.central-month-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
#centralIncidentBars .central-month-chip {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  min-height: 0 !important;
  height: 28px !important;
  padding: 0 10px !important;
  border-radius: 999px !important;
  border: 1px solid rgba(34, 211, 238, 0.45) !important;
  background: rgba(34, 211, 238, 0.10) !important;
  color: inherit !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  box-shadow: none !important;
  transform: none !important;
  cursor: pointer;
}
#centralIncidentBars .central-month-chip b { color: #22D3EE; }
#centralIncidentBars .central-month-chip:hover { background: rgba(34, 211, 238, 0.2) !important; }


/* Central portal: Date-wise Report (attendance / incidents per day, all stations) */
#centralDatewise.central-datewise { margin-top: 18px; padding: 18px 20px !important; }
.central-datewise-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.central-datewise-head h2 { margin: 0; }
#centralDatewiseSub { display: block; margin-top: 2px; font-size: 12px; opacity: 0.75; }
.central-datewise-seg { display: inline-flex; padding: 3px; border-radius: 10px; border: 1px solid rgba(34, 211, 238, 0.35); background: rgba(148, 163, 184, 0.10); }
#centralDatewiseSeg button {
  height: 32px !important; min-height: 0 !important; padding: 0 16px !important;
  border: 0 !important; border-radius: 7px !important; background: transparent !important;
  color: inherit !important; opacity: 0.75; box-shadow: none !important; transform: none !important;
  font-size: 13px !important; font-weight: 600 !important; white-space: nowrap; cursor: pointer;
}
#centralDatewiseSeg button.active { opacity: 1; color: #04121F !important; background: linear-gradient(135deg, #22D3EE, #67E8F9) !important; box-shadow: 0 0 12px rgba(34, 211, 238, 0.4) !important; }
.central-datewise-controls { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin-top: 14px; }
.central-datewise-controls label { display: grid; gap: 4px; font-size: 12px; font-weight: 600; min-width: 150px; }
.central-datewise-quick { display: inline-flex; flex-wrap: wrap; gap: 6px; }
#centralDatewise .central-datewise-quick button {
  height: 34px !important; min-height: 0 !important; padding: 0 12px !important; border-radius: 999px !important;
  border: 1px solid rgba(34, 211, 238, 0.45) !important; background: rgba(34, 211, 238, 0.10) !important;
  color: inherit !important; box-shadow: none !important; transform: none !important; font-size: 12px !important; font-weight: 600 !important;
}
#centralDatewise .central-datewise-quick button:hover { background: rgba(34, 211, 238, 0.22) !important; }
.central-datewise-note { margin: 8px 0 0; font-size: 11px; opacity: 0.6; }
.central-datewise-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin: 14px 0 12px; }
.central-datewise-summary > div { padding: 10px 12px; border-radius: 10px; border: 1px solid rgba(148, 163, 184, 0.22); background: rgba(148, 163, 184, 0.06); min-width: 0; }
.central-datewise-summary span { display: block; font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.7; }
.central-datewise-summary strong { display: block; margin-top: 2px; font-size: 20px; }
.central-datewise-summary em { font-size: 10.5px; font-style: normal; opacity: 0.6; }
.central-datewise-loading { grid-column: 1 / -1; margin: 0; font-size: 13px; opacity: 0.8; }
.central-datewise-table { max-height: 520px; overflow: auto; margin-top: 4px; }
.central-datewise-table table { min-width: 100%; }
.central-datewise-table th { position: sticky; top: 0; z-index: 1; white-space: nowrap; }
.central-datewise-table td { white-space: nowrap; }
.central-datewise-date { font-weight: 600; }
.central-datewise-zero td { opacity: 0.55; }
.central-day-cell { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.central-day-cell.ok { background: rgba(21, 128, 61, 0.16); color: #22C55E; }
.central-day-cell.alert { background: rgba(234, 179, 8, 0.16); color: #EAB308; }
.central-day-cell.warn { background: rgba(200, 16, 46, 0.14); color: #F43F5E; }
.central-day-cell.muted { opacity: 0.5; }
#centralDatewiseDetailWrap[hidden] { display: none !important; }
.central-datewise-detail-title { margin: 18px 0 8px; font-size: 15px; }
@media (max-width: 760px) {
  #centralDatewise.central-datewise { padding: 14px !important; }
  .central-datewise-controls label { min-width: 0; flex: 1 1 140px; }
}


/* Central portal: date controls under the Present % and Incidents by Type card titles */
.central-card-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 2px 0 12px; padding-bottom: 12px; border-bottom: 1px solid rgba(148, 163, 184, 0.2); }
.central-card-controls input[type="date"], .central-card-controls input[type="month"] { width: 165px !important; height: 34px !important; min-height: 0 !important; padding: 0 10px !important; font-size: 13px !important; }
.central-card-controls input[hidden] { display: none !important; }
#centralOverview .central-card-btn {
  height: 34px !important; min-height: 0 !important; min-width: 34px; padding: 0 12px !important;
  border-radius: 8px !important; border: 1px solid rgba(34, 211, 238, 0.45) !important;
  background: rgba(34, 211, 238, 0.10) !important; color: inherit !important;
  box-shadow: none !important; transform: none !important; font-size: 13px !important; font-weight: 600 !important; line-height: 1;
}
#centralOverview .central-card-btn:hover:not(:disabled) { background: rgba(34, 211, 238, 0.22) !important; }
#centralOverview .central-card-btn:disabled { opacity: 0.4; cursor: not-allowed; }
#centralPresentPrev, #centralPresentNext { font-size: 18px !important; padding: 0 10px !important; }
.central-card-seg { display: inline-flex; padding: 3px; border-radius: 9px; border: 1px solid rgba(34, 211, 238, 0.35); background: rgba(148, 163, 184, 0.10); }
#centralIncidentSeg button {
  height: 26px !important; min-height: 0 !important; padding: 0 14px !important; border: 0 !important; border-radius: 6px !important;
  background: transparent !important; color: inherit !important; opacity: 0.75; box-shadow: none !important; transform: none !important;
  font-size: 12px !important; font-weight: 600 !important; cursor: pointer;
}
#centralIncidentSeg button.active { opacity: 1; color: #04121F !important; background: linear-gradient(135deg, #22D3EE, #67E8F9) !important; }
#centralIncidentBars .central-month-chip[data-incident-jump] { cursor: pointer; }


/* Date-wise Report: TOTAL row pinned at the top, hide-empty-days checkbox, station counts */
.central-datewise-controls label.central-datewise-check { display: inline-flex !important; align-items: center; gap: 8px; min-width: 0; height: 34px; padding: 0 4px; font-size: 12.5px; cursor: pointer; }
.central-datewise-check input { width: 16px !important; height: 16px !important; min-height: 0 !important; margin: 0; accent-color: #22D3EE; }
#centralDatewiseBody tr.central-datewise-total-top td { background: rgba(34, 211, 238, 0.10) !important; border-bottom: 2px solid rgba(34, 211, 238, 0.45) !important; vertical-align: top; }
#centralDatewiseBody tr.central-datewise-total-top small { font-size: 10.5px; opacity: 0.7; }
.central-day-count { display: inline-block; min-width: 24px; padding: 2px 8px; border-radius: 999px; text-align: center; font-weight: 700; background: rgba(200, 16, 46, 0.18); color: #FB7185; }


/* Current Day Special Marks: theme-neutral rows (readable on dark and light themes), colour per mark */
#specialSummary .special-card {
  --sc: #EDA100;
  display: grid !important;
  grid-template-columns: 52px minmax(0, 1fr) !important;
  align-items: center !important;
  gap: 12px !important;
  padding: 10px 12px !important;
  border: 1px solid color-mix(in srgb, var(--sc) 35%, transparent) !important;
  border-left: 4px solid var(--sc) !important;
  border-radius: 10px !important;
  background: color-mix(in srgb, var(--sc) 9%, transparent) !important;
  box-shadow: none !important;
  color: inherit !important;
  transform: none !important;
}
#specialSummary .special-card:hover { background: color-mix(in srgb, var(--sc) 15%, transparent) !important; }
#specialSummary .special-card > strong {
  display: grid !important;
  place-items: center !important;
  min-height: 34px !important;
  border-radius: 8px !important;
  color: #ffffff !important;
  background: var(--sc) !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  letter-spacing: 0.04em;
}
#specialSummary .special-text { display: grid; gap: 2px; min-width: 0; }
#specialSummary .special-text b {
  color: var(--md-on-surface, inherit) !important;
  font-size: 14px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#specialSummary .special-text span {
  color: var(--md-on-surface-variant, inherit) !important;
  font-size: 12.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#specialSummary .special-a { --sc: #C8102E; }
#specialSummary .special-l { --sc: #C98A00; }
#specialSummary .special-gh { --sc: #2A78D6; }
#specialSummary .special-do { --sc: #D9568A; }
#specialSummary .special-lp { --sc: #EB6834; }
#specialSummary .special-rp { --sc: #6D5BD0; }


/* Employee portal calendar: readable status label (code + word) on every theme */
#employeeCalendarGrid .employee-calendar-day {
  --ec: #64748B;
  display: grid !important;
  grid-template-rows: auto 1fr;
  align-content: space-between !important;
  gap: 6px;
  padding: 8px 9px !important;
  border: 1px solid color-mix(in srgb, var(--ec) 40%, transparent) !important;
  border-radius: 10px !important;
  background: color-mix(in srgb, var(--ec) 14%, transparent) !important;
  color: var(--md-on-surface, inherit) !important;
  min-width: 0;
}
#employeeCalendarGrid .employee-calendar-day > strong { color: var(--md-on-surface, inherit) !important; font-size: 14px; font-weight: 800; }
#employeeCalendarGrid .employee-calendar-empty { background: transparent !important; border: 1px dashed rgba(148, 163, 184, 0.25) !important; }
#employeeCalendarGrid .employee-calendar-mark {
  justify-self: stretch !important;
  display: flex !important;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-style: normal;
}
#employeeCalendarGrid .employee-calendar-mark b {
  flex: none;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--ec);
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.03em;
}
#employeeCalendarGrid .employee-calendar-mark span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--md-on-surface, inherit);
  font-size: 11.5px;
  font-weight: 600;
}
#employeeCalendarGrid .employee-calendar-mark.none { justify-content: flex-end; opacity: 0.45; font-weight: 700; }
#employeeCalendarGrid .status-P { --ec: #15803D; }
#employeeCalendarGrid .status-A { --ec: #C8102E; }
#employeeCalendarGrid .status-L { --ec: #C98A00; }
#employeeCalendarGrid .status-GH { --ec: #2A78D6; }
#employeeCalendarGrid .status-DO { --ec: #D9568A; }
#employeeCalendarGrid .status-LP { --ec: #EB6834; }
#employeeCalendarGrid .status-RP { --ec: #6D5BD0; }
@media (max-width: 760px) {
  /* small phones: show just the coloured code */
  #employeeCalendarGrid .employee-calendar-mark span { display: none; }
  #employeeCalendarGrid .employee-calendar-mark { justify-content: flex-end; }
  #employeeCalendarGrid .employee-calendar-day { padding: 6px !important; }
}

/* Daily compilation (bottom of Attendance tab) */
.dc-sheet{background:#fff;color:#000;font-family:"Times New Roman",serif;padding:18px;border:1px solid #bbb;border-radius:8px;overflow-x:auto;margin-top:10px}
.dc-sheet [contenteditable]{outline:none}
.dc-sheet [contenteditable]:focus{background:#fff8c5}
.dc-sheet .dc-head{display:flex;align-items:center;gap:14px;justify-content:center}
.dc-sheet .dc-logo{width:64px;height:auto}
.dc-sheet .dc-org{text-align:center;font-weight:700;font-size:15px;line-height:1.35}
.dc-sheet .dc-date{text-align:center;font-weight:700;margin:12px 0}
.dc-sheet .dc-title{text-align:center;text-decoration:underline;font-size:17px;margin:18px 0 8px}
.dc-sheet table{border-collapse:collapse;width:100%;min-width:560px}
.dc-sheet .dc-table th,.dc-sheet .dc-table td{border:1px solid #000;text-align:center;padding:6px 4px;font-size:13px;background:#fff;color:#000}
.dc-sheet .dc-sum{width:auto;min-width:0}
.dc-sheet .dc-sum td{border:none;font-size:17px;font-weight:700;padding:1px 14px 1px 0;background:none;color:#000}
.dc-sheet .dc-sumh{font-size:17px;margin:18px 0 6px}
.dc-sheet .dc-break{border-top:2px dashed #999;margin:22px 0}
label[hidden]{display:none!important}

/* ---- Station inventory sheet: fits the screen, centered numbers ---- */
table.inv-sheet { table-layout: fixed; width: 100%; }
table.inv-sheet th, table.inv-sheet td { padding: 9px 5px; text-align: center; vertical-align: middle; font-size: 13px; overflow-wrap: anywhere; }
table.inv-sheet th { font-size: 10.5px; letter-spacing: .02em; line-height: 1.25; white-space: normal; }
table.inv-sheet .num { text-align: center; }
table.inv-sheet .c-sr { width: 52px; }
table.inv-sheet .c-item { width: 22%; text-align: left; }
table.inv-sheet .c-uom { width: 64px; }
table.inv-sheet .c-rem { width: 13%; text-align: left; }
table.inv-sheet .c-act { width: 250px; }
table.inv-sheet .row-actions { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; }
table.inv-sheet .row-actions button { padding: 4px 9px; font-size: 12px; min-height: 0; }
table.inv-sheet tr.inv-total td { font-weight: 700; border-top: 2px solid rgba(255,255,255,.18); }
