:root {
  --navy: #09233d;
  --navy-2: #0e3155;
  --accent: #f2b84b;
  --page: #f4f7fa;
  --line: #d6dee6;
  --text: #071426;
  --muted: #5d6b7c;
  --blue: #123d6f;
  --success: #28824a;
  --warning: #e59622;
  --danger: #d92336;
}

html {
  font-size: 16px;
  min-height: 100%;
}

body {
  background: var(--page);
  color: var(--text);
  font-family: "Segoe UI", "Inter", "Roboto", Arial, sans-serif;
  font-weight: 400;
  margin: 0;
}

a {
  text-decoration: none;
}

.btn-primary {
  background: #123d6f;
  border-color: #123d6f;
  font-weight: 600;
}

.btn-primary:hover {
  background: #0d315b;
  border-color: #0d315b;
}

.form-control {
  border: 1px solid #d2dbe4;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .12);
  min-height: 45px;
}

.form-label {
  color: #061426;
  font-weight: 600;
}

.auth-body {
  background: #f3f6f9;
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(560px, 1.08fr) minmax(440px, .92fr);
  min-height: 100vh;
}

.login-brand {
  background: #092642;
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 58px 60px;
  position: relative;
}

.login-logo {
  align-items: center;
  display: flex;
  gap: 16px;
}

.brand-mark {
  align-items: center;
  background: var(--accent);
  border-radius: 3px;
  color: #1f2937;
  display: inline-flex;
  font-size: 1.35rem;
  font-weight: 900;
  height: 55px;
  justify-content: center;
  width: 55px;
}

.brand-shield {
  border: 2px solid currentColor;
  border-radius: 9px 9px 12px 12px;
  display: block;
  height: 24px;
  position: relative;
  width: 20px;
}

.brand-shield::after {
  background: currentColor;
  bottom: -5px;
  content: "";
  height: 8px;
  left: 5px;
  position: absolute;
  transform: rotate(45deg);
  width: 8px;
}

.login-logo strong,
.sidebar-brand strong {
  display: block;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.2;
}

.login-logo span,
.sidebar-brand span {
  color: #c4d2e0;
  display: block;
  font-size: .86rem;
  letter-spacing: .08em;
  margin-top: 3px;
}

.login-intro {
  margin-top: 130px;
  max-width: 700px;
}

.login-intro h1 {
  font-size: 2.25rem;
  font-weight: 650;
  margin-bottom: 22px;
}

.login-intro p {
  color: #edf5ff;
  font-size: 1.05rem;
  line-height: 1.7;
  max-width: 620px;
}

.role-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  margin-top: 36px;
  max-width: 840px;
}

.role-grid span {
  border: 1px solid rgba(185, 208, 230, .22);
  border-radius: 3px;
  color: #fff;
  font-weight: 500;
  padding: 12px 16px;
}

.login-footnote {
  bottom: 56px;
  color: #c4d2e0;
  font-size: .82rem;
  letter-spacing: .05em;
  margin: 0;
  position: absolute;
}

.login-panel-wrap {
  align-items: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px;
}

.login-card {
  background: #fff;
  border: 1px solid #d2dbe4;
  border-radius: 10px;
  box-shadow: 0 2px 4px rgba(15, 23, 42, .16);
  max-width: 560px;
  padding: 30px;
  width: 100%;
}

.login-card-heading {
  margin-bottom: 24px;
}

.login-card-heading h2 {
  font-size: 1.35rem;
  font-weight: 600;
  margin: 0 0 6px;
}

.login-card-heading p:last-child {
  color: #5d6b7c;
  margin: 0;
}

.auth-tabs {
  background: #e8edf2;
  border-radius: 6px;
  display: grid;
  gap: 4px;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 34px;
  padding: 4px;
}

.auth-tabs a {
  border-radius: 5px;
  color: #334155;
  font-weight: 500;
  padding: 10px;
  text-align: center;
}

.auth-tabs a.active {
  background: #fff;
  box-shadow: 0 1px 4px rgba(15, 23, 42, .18);
  color: #001125;
}

.or-divider {
  align-items: center;
  color: #536477;
  display: flex;
  font-size: .8rem;
  gap: 10px;
  justify-content: center;
  margin: 32px 0 16px;
}

.or-divider::before,
.or-divider::after {
  background: #d6dee6;
  content: "";
  flex: 1;
  height: 1px;
}

.issued-by {
  color: #46576a;
  font-size: .78rem;
  letter-spacing: .06em;
  margin-top: 32px;
}

.app-body {
  background: var(--page);
}

.app-frame {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  background: var(--navy);
  color: #fff;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.sidebar-brand {
  align-items: center;
  display: flex;
  gap: 12px;
  padding: 22px 16px;
}

.side-nav {
  border-top: 1px solid rgba(255, 255, 255, .06);
  display: grid;
  gap: 4px;
  padding: 18px 10px;
}

.side-nav p {
  color: #b7c6d5;
  font-size: .9rem;
  font-weight: 500;
  margin: 0 10px 8px;
}

.side-nav a {
  align-items: center;
  border-radius: 5px;
  color: #fff;
  display: flex;
  font-size: .94rem;
  font-weight: 400;
  gap: 10px;
  min-height: 44px;
  padding: 0 11px;
}

.nav-icon {
  border: 1.8px solid currentColor;
  border-radius: 4px;
  box-sizing: border-box;
  display: inline-block;
  flex: 0 0 auto;
  height: 18px;
  opacity: .95;
  position: relative;
  width: 18px;
}

.nav-icon::before,
.nav-icon::after {
  background: currentColor;
  content: "";
  position: absolute;
}

.nav-icon-dashboard::before {
  height: 1.8px;
  left: 3px;
  top: 7px;
  width: 10px;
}

.nav-icon-dashboard::after {
  height: 10px;
  left: 7px;
  top: 3px;
  width: 1.8px;
}

.nav-icon-user {
  border-radius: 50%;
}

.nav-icon-user::before {
  border-radius: 50%;
  height: 5px;
  left: 5px;
  top: 3px;
  width: 5px;
}

.nav-icon-user::after {
  border-radius: 7px 7px 2px 2px;
  height: 5px;
  left: 3px;
  top: 10px;
  width: 9px;
}

.nav-icon-work,
.nav-icon-request,
.nav-icon-report,
.nav-icon-master,
.nav-icon-agency,
.nav-icon-pass {
  border-radius: 3px;
}

.nav-icon-work::before,
.nav-icon-request::before,
.nav-icon-report::before,
.nav-icon-master::before,
.nav-icon-agency::before,
.nav-icon-pass::before {
  height: 1.7px;
  left: 4px;
  top: 5px;
  width: 8px;
}

.nav-icon-work::after,
.nav-icon-request::after,
.nav-icon-report::after,
.nav-icon-master::after,
.nav-icon-agency::after,
.nav-icon-pass::after {
  height: 1.7px;
  left: 4px;
  top: 10px;
  width: 8px;
}

.nav-icon-workflow {
  border-radius: 50%;
}

.nav-icon-workflow::before {
  height: 2px;
  left: 4px;
  top: 8px;
  transform: rotate(-35deg);
  width: 9px;
}

.nav-icon-medical::before {
  height: 10px;
  left: 7px;
  top: 3px;
  width: 2px;
}

.nav-icon-medical::after {
  height: 2px;
  left: 3px;
  top: 7px;
  width: 10px;
}

.nav-icon-safety {
  border-radius: 2px 2px 8px 8px;
}

.nav-icon-visitor,
.nav-icon-admin,
.nav-icon-audit {
  border-radius: 50%;
}

.side-nav a:hover,
.side-nav a:focus,
.side-nav a.active {
  background: rgba(255, 255, 255, .08);
}

.side-nav a.active {
  background: #18385d;
  border-left: 3px solid var(--accent);
  font-weight: 600;
}

.sidebar-user {
  border-top: 1px solid rgba(255, 255, 255, .08);
  margin-top: auto;
  padding: 20px;
}

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

.sidebar-user span {
  color: #b7c6d5;
  font-size: .86rem;
}

.app-main {
  min-width: 0;
}

.topbar {
  align-items: center;
  background: #fff;
  border-bottom: 1px solid #d4dce4;
  box-shadow: 0 1px 4px rgba(15, 23, 42, .14);
  display: flex;
  justify-content: space-between;
  min-height: 70px;
  padding: 0 34px 0 24px;
}

.topbar-title,
.topbar-actions,
.user-chip {
  align-items: center;
  display: flex;
}

.topbar-title {
  gap: 22px;
}

.topbar-title strong,
.user-chip strong {
  display: block;
  font-weight: 600;
}

.topbar-title span,
.user-chip span {
  color: var(--muted);
  display: block;
  font-size: .82rem;
  letter-spacing: .04em;
}

.topbar-actions {
  gap: 18px;
}

.user-menu-button {
  background: transparent;
  border: 0;
  color: inherit;
  gap: 0;
  padding: 0;
  text-align: left;
}

.user-menu-button:focus-visible {
  outline: 2px solid #123d6f;
  outline-offset: 4px;
}

.user-menu-caret {
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid #0f172a;
  height: 0;
  margin-left: 12px;
  width: 0;
}

.user-menu {
  border: 1px solid #d2dbe4;
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .16);
  min-width: 230px;
  padding: 8px;
}

.user-menu .dropdown-header {
  color: #0f172a;
  padding: 8px 10px;
}

.user-menu .dropdown-header strong,
.user-menu .dropdown-header span {
  display: block;
}

.user-menu .dropdown-header span {
  color: var(--muted);
  font-size: .78rem;
  letter-spacing: .04em;
  margin-top: 2px;
  text-transform: uppercase;
}

.user-menu .dropdown-item {
  border-radius: 4px;
  font-weight: 500;
  padding: 8px 10px;
}

.icon-button,
.bell-button {
  background: transparent;
  border: 0;
  color: #0f172a;
  font-size: 1.1rem;
}

.menu-toggle {
  height: 34px;
  position: relative;
  width: 34px;
}

.menu-toggle span,
.menu-toggle::before,
.menu-toggle::after {
  background: currentColor;
  border-radius: 999px;
  content: "";
  height: 2px;
  left: 8px;
  position: absolute;
  width: 18px;
}

.menu-toggle span {
  top: 16px;
}

.menu-toggle::before {
  top: 10px;
}

.menu-toggle::after {
  top: 22px;
}

.sidebar-collapsed .app-frame {
  grid-template-columns: 86px minmax(0, 1fr);
}

.sidebar-collapsed .sidebar-brand {
  justify-content: center;
}

.sidebar-collapsed .sidebar-brand div:last-child,
.sidebar-collapsed .side-nav p,
.sidebar-collapsed .side-nav a span:not(.nav-icon),
.sidebar-collapsed .sidebar-user {
  display: none;
}

.sidebar-collapsed .side-nav a {
  justify-content: center;
}

.bell-button {
  position: relative;
}

.bell-shape {
  border: 1.8px solid currentColor;
  border-bottom: 0;
  border-radius: 9px 9px 3px 3px;
  display: inline-block;
  height: 16px;
  position: relative;
  width: 14px;
}

.bell-shape::after {
  background: currentColor;
  border-radius: 50%;
  bottom: -4px;
  content: "";
  height: 4px;
  left: 4px;
  position: absolute;
  width: 4px;
}

.bell-button > span:last-child {
  background: #dc1f2e;
  border: 2px solid #fff;
  border-radius: 50%;
  height: 11px;
  position: absolute;
  right: -2px;
  top: 0;
  width: 11px;
}

.avatar {
  align-items: center;
  background: #0f3159;
  border-radius: 3px;
  color: #fff;
  display: inline-flex;
  font-size: .85rem;
  font-weight: 600;
  height: 34px;
  justify-content: center;
  margin-right: 10px;
  width: 36px;
}

.app-content {
  padding: 44px 38px;
}

.page-heading {
  align-items: flex-start;
  border-bottom: 1px solid #d2dbe4;
  display: flex;
  gap: 20px;
  justify-content: space-between;
  margin-bottom: 30px;
  padding-bottom: 24px;
}

.page-heading .btn {
  flex: 0 0 auto;
  margin-top: 2px;
}

.page-heading h1 {
  font-size: 1.85rem;
  font-weight: 650;
  margin: 0 0 8px;
}

.page-heading p,
.panel-header p {
  color: #435366;
  margin: 0;
}

.metric-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(4, minmax(190px, 1fr));
  margin-bottom: 30px;
}

.metric-card,
.workspace-panel {
  background: #fff;
  border: 1px solid #d2dbe4;
  border-radius: 10px;
  box-shadow: 0 2px 4px rgba(15, 23, 42, .12);
}

.metric-card {
  align-items: center;
  display: flex;
  gap: 20px;
  min-height: 118px;
  padding: 25px 28px;
}

.metric-card.highlight {
  border-left: 5px solid #123d6f;
}

.metric-card span {
  color: #3f4f61;
  display: block;
  font-size: .84rem;
  font-weight: 600;
  letter-spacing: .04em;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.metric-card strong {
  color: #001125;
  display: block;
  font-size: 1.9rem;
  line-height: 1;
}

.metric-icon {
  align-items: center;
  border-radius: 4px;
  display: flex;
  height: 55px;
  justify-content: center;
  width: 55px;
}

.metric-shape {
  border: 2px solid currentColor;
  border-radius: 5px;
  display: inline-block;
  height: 24px;
  position: relative;
  width: 24px;
}

.metric-shape::before,
.metric-shape::after {
  background: currentColor;
  content: "";
  position: absolute;
}

.metric-user {
  border-radius: 50%;
}

.metric-user::before {
  border-radius: 50%;
  height: 7px;
  left: 7px;
  top: 4px;
  width: 7px;
}

.metric-user::after {
  border-radius: 8px 8px 3px 3px;
  height: 7px;
  left: 5px;
  top: 14px;
  width: 11px;
}

.metric-agency::before,
.metric-work::before,
.metric-request::before,
.metric-pending::before,
.metric-document::before {
  height: 2px;
  left: 5px;
  top: 7px;
  width: 12px;
}

.metric-agency::after,
.metric-work::after,
.metric-request::after,
.metric-pending::after,
.metric-document::after {
  height: 2px;
  left: 5px;
  top: 14px;
  width: 12px;
}

.metric-pending {
  border-radius: 50%;
}

.metric-pending::before {
  height: 7px;
  left: 10px;
  top: 4px;
  width: 2px;
}

.metric-pending::after {
  height: 2px;
  left: 10px;
  top: 11px;
  transform: rotate(35deg);
  transform-origin: left center;
  width: 7px;
}

.metric-icon.teal {
  background: #e0f3f7;
  color: #0087a8;
}

.metric-icon.blue,
.metric-icon.blue-soft {
  background: #e8eef6;
  color: #123d6f;
}

.metric-icon.green {
  background: #dff2e6;
  color: #237944;
}

.dashboard-grid {
  display: grid;
  gap: 30px;
  grid-template-columns: minmax(0, 2fr) minmax(360px, .9fr);
}

.workspace-panel {
  padding: 30px;
}

.panel-header {
  margin-bottom: 20px;
}

.panel-header h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 3px;
}

.activity-table {
  border: 1px solid #d2dbe4;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 4px;
  overflow: hidden;
  width: 100%;
}

.activity-table th {
  background: #f4f6f8;
  color: #425367;
  font-weight: 600;
}

.activity-table th,
.activity-table td {
  border-bottom: 1px solid #d2dbe4;
  padding: 12px 10px;
}

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

.status {
  border-radius: 5px;
  display: inline-block;
  font-size: .82rem;
  font-weight: 600;
  padding: 5px 12px;
  text-transform: uppercase;
}

.status.issued {
  background: #dff2e6;
  border: 1px solid #abd6ba;
  color: #237944;
}

.status.pending,
.status.returned {
  background: #fff0d8;
  border: 1px solid #f0c783;
  color: #a75b00;
}

.status.approved {
  background: #ddf1fb;
  border: 1px solid #a9d7ee;
  color: #0076a8;
}

.status.rejected {
  background: #ffe3e8;
  border: 1px solid #efb0bb;
  color: var(--danger);
}

.workflow-bars {
  display: grid;
  gap: 14px;
}

.workflow-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
}

.bar-track {
  background: #e9eef3;
  border-radius: 999px;
  height: 7px;
  overflow: hidden;
}

.bar-track span {
  background: #123d6f;
  border-radius: inherit;
  display: block;
  height: 100%;
}

.workflow-bar:first-child .bar-track span {
  background: #0087a8;
}

.workflow-bar:last-child .bar-track span {
  background: #28824a;
}

.module-grid {
  display: grid;
  gap: 22px;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.section-kicker {
  color: #64748b;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .06em;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.feature-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 18px;
}

.feature-list li {
  color: #273548;
}

.filter-bar {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(260px, 1fr) 160px 110px auto;
  margin-bottom: 18px;
}

.report-filter {
  grid-template-columns: minmax(260px, 1fr) 180px 150px 150px auto;
}

.admin-table {
  min-width: 1000px;
}

.admin-table a {
  color: #123d6f;
  font-weight: 500;
}

.table-actions {
  white-space: nowrap;
}

.table-actions form,
.table-actions a {
  display: inline-block;
  margin: 2px;
}

.muted {
  color: #64748b;
  font-size: .86rem;
}

.admin-form {
  max-width: 1100px;
}

.form-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
}

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

.form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 24px;
}

.checklist-grid {
  border: 1px solid #d2dbe4;
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  padding: 16px;
}

.document-upload-list {
  border: 1px solid #d2dbe4;
  border-radius: 8px;
  display: grid;
  gap: 12px;
  padding: 16px;
}

.document-upload-row {
  align-items: center;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(220px, .8fr) minmax(260px, 1fr);
}

.document-upload-row span {
  color: #273548;
  font-weight: 500;
}

.camera-panel {
  border: 1px solid #d2dbe4;
  border-radius: 8px;
  display: grid;
  gap: 14px;
  padding: 16px;
}

.camera-preview {
  align-items: center;
  background: #eef3f8;
  border: 1px dashed #b9c7d6;
  border-radius: 6px;
  display: flex;
  justify-content: center;
  min-height: 260px;
  overflow: hidden;
}

.camera-preview video,
.camera-preview img {
  display: none;
  max-height: 320px;
  max-width: 100%;
}

.camera-preview canvas {
  display: none;
}

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

.review-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 24px;
}

.detail-layout {
  align-items: start;
  display: grid;
  gap: 22px;
  grid-template-columns: 150px minmax(0, 1fr);
}

.worker-photo {
  aspect-ratio: 3 / 4;
  background: #eef3f8;
  border: 1px solid #d2dbe4;
  border-radius: 6px;
  object-fit: cover;
  width: 150px;
}

.detail-list {
  display: grid;
  gap: 10px 18px;
  grid-template-columns: 160px minmax(0, 1fr);
  margin: 0;
}

.detail-list dt {
  color: #526174;
  font-weight: 600;
}

.detail-list dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.review-form textarea {
  resize: vertical;
}

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

.timeline-item {
  border-left: 3px solid #123d6f;
  padding-left: 14px;
}

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

.timeline-item span,
.timeline-item small {
  color: #64748b;
}

.timeline-item p {
  margin: 8px 0 0;
}

.pager {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-top: 18px;
}

@media (max-width: 1200px) {
  .app-frame {
    grid-template-columns: 240px minmax(0, 1fr);
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(190px, 1fr));
  }

  .dashboard-grid,
  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-brand {
    min-height: 620px;
  }
}

@media (max-width: 760px) {
  .app-frame {
    grid-template-columns: 1fr;
  }

  .page-heading {
    display: block;
  }

  .page-heading .btn {
    margin-top: 16px;
  }

  .sidebar {
    min-height: auto;
  }

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

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
    padding: 16px;
  }

  .app-content,
  .login-brand,
  .login-panel-wrap {
    padding: 24px;
  }

  .metric-grid,
  .review-grid,
  .detail-layout,
  .detail-list,
  .role-grid,
  .filter-bar,
  .form-grid,
  .document-upload-row,
  .checklist-grid {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: span 1;
  }

  .login-intro {
    margin-top: 60px;
  }

  .login-footnote {
    margin-top: 40px;
    position: static;
  }
}
