﻿:root {
  color-scheme: dark;
  --ink: #eef5f3;
  --muted: #a8b7b3;
  --line: #32413f;
  --surface: #17201f;
  --page: #0c1111;
  --teal: #16b5a9;
  --teal-dark: #0b7c74;
  --coral: #ff665c;
  --amber: #f6c24b;
  --asphalt: #0f1515;
  --asphalt-soft: #202b2a;
  --metal: #121a19;
  --road-line: #f6c24b;
  --shadow: 0 22px 54px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  color: var(--ink);
  background:
    linear-gradient(
      90deg,
      transparent 0 calc(50% - 2px),
      rgba(246, 194, 75, 0.16) calc(50% - 2px) calc(50% + 2px),
      transparent calc(50% + 2px)
    ),
    radial-gradient(circle at top left, rgba(255, 102, 92, 0.16), transparent 24rem),
    radial-gradient(circle at bottom right, rgba(22, 181, 169, 0.16), transparent 28rem),
    linear-gradient(135deg, #0c1111 0%, #131b1a 54%, #0a0e0e 100%);
  background-attachment: fixed;
}

button,
input,
select {
  font: inherit;
}

a {
  color: #72ded5;
  font-weight: 700;
  text-decoration: none;
}

.language-switch {
  position: fixed;
  top: 14px;
  inset-inline-end: 14px;
  z-index: 20;
}

.language-switch .ghost-button {
  min-height: 40px;
  padding-inline: 14px;
}

[dir="rtl"] body {
  text-align: right;
}

[dir="rtl"] .timeline-actions,
[dir="rtl"] .pagination-controls {
  justify-content: flex-start;
}

.login-shell,
.app-shell {
  width: min(100%, 1040px);
  max-width: 100vw;
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px;
}

.login-shell {
  display: grid;
  align-items: center;
  gap: 22px;
}

.brand-panel {
  position: relative;
  overflow: hidden;
  min-height: 250px;
  padding: 28px;
  border-radius: 8px;
  color: #fff;
  background:
    linear-gradient(140deg, rgba(21, 30, 30, 0.92), rgba(7, 92, 86, 0.78)),
    url("assets/city-routes.svg") center / cover no-repeat;
  display: grid;
  align-content: end;
  gap: 28px;
  box-shadow: var(--shadow);
}

.brand-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(115deg, transparent 0 58%, rgba(255, 255, 255, 0.09) 58% 59%, transparent 59%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px 16px);
  pointer-events: none;
}

.brand-panel::after {
  content: "";
  position: absolute;
  inset-inline: 28px;
  bottom: 24px;
  height: 5px;
  border-radius: 999px;
  background: repeating-linear-gradient(
    90deg,
    var(--road-line) 0 40px,
    transparent 40px 66px
  );
  opacity: 0.88;
  pointer-events: none;
}

.brand-panel > * {
  position: relative;
  z-index: 1;
}

.brand-mark {
  width: 72px;
  height: 72px;
  padding: 13px;
  border: 1px solid rgba(255, 255, 255, 0.46);
  border-radius: 8px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: end;
  gap: 7px;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 -10px 22px rgba(0, 0, 0, 0.2);
}

.brand-mark span {
  display: block;
  border-radius: 999px 999px 4px 4px;
  background: #101716;
}

.brand-mark span:nth-child(1) {
  height: 22px;
  background: var(--amber);
}

.brand-mark span:nth-child(2) {
  height: 42px;
}

.brand-mark span:nth-child(3) {
  height: 31px;
  background: var(--coral);
}

.eyebrow {
  margin: 0 0 8px;
  color: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  opacity: 0.82;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
  line-height: 1.04;
}

h1 {
  max-width: 12ch;
  font-size: 2.5rem;
}

h2 {
  font-size: 2rem;
}

.intro {
  max-width: 32rem;
  margin: 14px 0 0;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.6;
}

.login-card,
.module-card,
.users-panel {
  width: 100%;
  padding: 26px;
  border: 1px solid rgba(74, 95, 91, 0.82);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(31, 42, 40, 0.96), rgba(18, 26, 25, 0.94)),
    var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

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

.login-links {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

.login-heading .eyebrow,
.app-header .eyebrow,
.module-card .eyebrow {
  color: var(--coral);
}

.login-form,
.add-user-form {
  display: grid;
  gap: 18px;
}

.role-selector {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.role-selector legend,
.field span {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.role-selector legend {
  grid-column: 1 / -1;
}

.role-selector label {
  min-width: 0;
  cursor: pointer;
}

.role-selector input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.role-selector span {
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
  text-align: center;
  overflow-wrap: anywhere;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease;
}

.role-selector input:checked + span {
  border-color: var(--teal);
  color: #fff;
  background: var(--teal);
}

.role-selector input:focus-visible + span,
input:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(232, 93, 79, 0.34);
  outline-offset: 3px;
}

.field {
  display: grid;
}

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

.field-warning {
  margin-top: 8px;
  color: var(--coral);
  font-size: 0.78rem;
  font-weight: 750;
  line-height: 1.35;
}

.field input {
  width: 100%;
  min-height: 52px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--metal);
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.field input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(11, 124, 116, 0.13);
  outline: 0;
}

.field select {
  width: 100%;
  min-height: 52px;
  padding: 0 38px 0 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--metal);
}

.field select[multiple] {
  min-height: 150px;
  padding: 10px 12px;
}

.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 0.92rem;
}

.demo-note {
  margin: -6px 0 0;
  padding: 11px 12px;
  border: 1px solid rgba(11, 124, 116, 0.18);
  border-radius: 8px;
  color: #72ded5;
  background: rgba(22, 181, 169, 0.13);
  font-size: 0.88rem;
  font-weight: 750;
  line-height: 1.4;
}

.remember {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 650;
}

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

.form-message {
  min-height: 20px;
  margin: -4px 0;
  color: var(--coral);
  font-size: 0.9rem;
  font-weight: 700;
}

.form-message.success {
  color: #72ded5;
}

button {
  min-height: 54px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, var(--asphalt), var(--teal-dark));
  font-weight: 850;
  cursor: pointer;
  box-shadow: 0 14px 28px rgba(21, 32, 31, 0.24);
  transition:
    transform 160ms ease,
    background 160ms ease;
}

button:hover {
  background: linear-gradient(135deg, var(--teal-dark), var(--asphalt));
  transform: translateY(-1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.is-hidden {
  display: none !important;
}

.app-shell {
  width: min(100%, 1180px);
  display: grid;
  align-content: start;
  gap: 22px;
}

.app-header {
  padding-top: 12px;
  display: grid;
  gap: 16px;
}

.app-header h1 {
  max-width: none;
}

.session-pill {
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: rgba(18, 26, 25, 0.9);
  box-shadow: 0 10px 26px rgba(24, 38, 36, 0.08);
}

.session-pill span {
  padding-inline: 10px;
  color: #72ded5;
  font-weight: 850;
}

.dashboard-user-chip {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 850;
}

.dashboard-user-photo {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid rgba(244, 195, 93, 0.5);
  border-radius: 999px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  color: var(--ink);
  background-color: rgba(244, 195, 93, 0.16);
  background-position: center;
  background-size: cover;
  font-size: 0.76rem;
}

.web-push-control {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.web-push-control .form-message {
  max-width: 220px;
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.25;
}

.ghost-button {
  min-height: 40px;
  padding: 0 14px;
  color: var(--ink);
  background: #22302e;
  box-shadow: none;
}

.ghost-button:hover {
  color: #fff;
  background: #0b1010;
}

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

.summary-band article {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(246, 194, 75, 0.24), transparent 5px),
    rgba(23, 32, 31, 0.92);
}

.login-notice {
  display: grid;
  gap: 6px;
  margin-top: 18px;
  padding: 14px 16px;
  color: var(--text);
  background: rgba(244, 195, 93, 0.08);
  border: 1px solid rgba(244, 195, 93, 0.28);
  border-radius: 8px;
}

.login-notice strong {
  font-size: 0.95rem;
}

.login-notice span {
  color: var(--muted);
  line-height: 1.5;
}

.summary-band span {
  display: block;
  color: var(--ink);
  font-size: 1.7rem;
  font-weight: 900;
  line-height: 1;
}

.summary-band p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 750;
}

.dashboard-grid {
  display: grid;
  gap: 14px;
}

body.captain-experience {
  padding-bottom: calc(82px + env(safe-area-inset-bottom));
  background: linear-gradient(145deg, #0b1110, #14201d 58%, #101716);
}

.captain-experience #appScreen .app-header {
  padding-top: max(12px, env(safe-area-inset-top));
}

.captain-experience #appScreen .app-header > div:first-child {
  display: none;
}

.captain-experience #appScreen .session-pill {
  padding: 0;
  border: 0;
  justify-content: flex-end;
  background: transparent;
  box-shadow: none;
}

.captain-experience #appScreen .session-pill > #activeRole,
.captain-experience #appScreen .session-pill > .ghost-button,
.captain-experience #appScreen .session-pill > button:not(.dashboard-user-chip) {
  display: none;
}

.captain-dashboard {
  display: grid;
  gap: 18px;
}

.captain-welcome,
.captain-section-heading,
.captain-primary-action,
.captain-assignment,
.captain-activity-item,
.captain-task-list a,
.captain-alerts a {
  min-width: 0;
}

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

.captain-welcome h2,
.captain-dashboard-section h2,
.captain-assignment h2 {
  margin: 0;
  letter-spacing: 0;
}

.captain-welcome h2 {
  font-size: clamp(1.5rem, 7vw, 2.25rem);
}

.captain-welcome > div > p:last-child,
.captain-assignment p {
  margin: 6px 0 0;
  color: var(--muted);
}

.captain-status-badge {
  flex: 0 0 auto;
  padding: 7px 10px;
  border: 1px solid rgba(255, 102, 92, 0.32);
  border-radius: 999px;
  color: #ffb5ae;
  background: rgba(255, 102, 92, 0.1);
  font-size: 0.76rem;
  font-weight: 850;
}

.captain-status-badge.is-active {
  border-color: rgba(22, 181, 169, 0.4);
  color: #72ded5;
  background: rgba(22, 181, 169, 0.12);
}

.captain-primary-action {
  padding: 18px;
  border: 1px solid rgba(246, 194, 75, 0.34);
  border-radius: 8px;
  display: grid;
  gap: 16px;
  background: #1d2926;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.22);
}

.captain-primary-copy {
  display: flex;
  align-items: center;
  gap: 14px;
}

.captain-primary-copy > div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.captain-primary-copy strong {
  font-size: 1.55rem;
  line-height: 1.1;
}

.captain-primary-copy span:last-child {
  color: var(--muted);
  line-height: 1.4;
}

.captain-primary-icon,
.captain-assignment-icon,
.captain-list-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  color: var(--amber);
}

.captain-primary-icon {
  width: 52px;
  height: 52px;
  border: 1px solid rgba(246, 194, 75, 0.32);
  border-radius: 8px;
  background: #111817;
}

.captain-primary-icon svg,
.captain-assignment-icon svg,
.captain-list-icon svg,
.captain-more-links svg,
.captain-mobile-nav svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.captain-primary-action > button {
  min-height: 52px;
  width: 100%;
  font-size: 1rem;
}

.captain-alerts {
  display: grid;
  gap: 8px;
}

.captain-alerts a {
  padding: 12px 14px;
  border-inline-start: 4px solid var(--coral);
  border-radius: 6px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink);
  background: #251d1c;
}

.captain-alerts strong {
  color: #ffb5ae;
}

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

.captain-today-grid article {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #17201f;
}

.captain-today-grid span {
  display: block;
  color: var(--ink);
  font-size: 1.35rem;
  font-weight: 900;
}

.captain-today-grid p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.captain-assignment {
  padding: 16px;
  border-block: 1px solid var(--line);
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
}

.captain-assignment img,
.captain-assignment-icon {
  width: 64px;
  height: 64px;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: cover;
  background: #101716;
}

.captain-assignment small {
  display: block;
  margin-top: 5px;
  color: #72ded5;
}

.captain-assignment > a {
  grid-column: 1 / -1;
  min-height: 42px;
  border: 1px solid rgba(22, 181, 169, 0.28);
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(22, 181, 169, 0.1);
}

.captain-dashboard-section {
  display: grid;
  gap: 12px;
}

.captain-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
}

.captain-section-heading > a {
  padding-block: 8px;
}

.captain-task-list,
.captain-activity-list {
  display: grid;
  gap: 8px;
}

.captain-task-list a,
.captain-activity-item {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  background: #151e1c;
}

.captain-task-list a > span:nth-child(2),
.captain-activity-item > span:nth-child(2) {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.captain-task-list small,
.captain-activity-item small,
.captain-activity-item time {
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.35;
}

.captain-task-list strong,
.captain-activity-item strong,
.captain-activity-item small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.captain-list-icon {
  width: 36px;
  height: 36px;
  border-radius: 7px;
  color: #72ded5;
  background: rgba(22, 181, 169, 0.1);
}

.captain-list-icon svg {
  width: 20px;
  height: 20px;
}

.captain-activity-item time {
  max-width: 92px;
  text-align: end;
}

.captain-empty-state {
  margin: 0;
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.captain-mobile-nav {
  position: fixed;
  z-index: 70;
  inset-inline: 10px;
  bottom: max(8px, env(safe-area-inset-bottom));
  width: min(calc(100% - 20px), 680px);
  min-height: 66px;
  margin-inline: auto;
  padding: 7px;
  border: 1px solid #384744;
  border-radius: 8px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  background: rgba(16, 23, 22, 0.97);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(14px);
}

.captain-mobile-nav a,
.captain-mobile-nav button {
  min-width: 0;
  min-height: 50px;
  padding: 4px 2px;
  border: 0;
  border-radius: 6px;
  display: grid;
  place-items: center;
  gap: 2px;
  color: var(--muted);
  background: transparent;
  box-shadow: none;
}

.captain-mobile-nav a.is-active,
.captain-mobile-nav button.is-active {
  color: var(--amber);
  background: rgba(246, 194, 75, 0.1);
}

.captain-mobile-nav span {
  position: relative;
  display: grid;
  place-items: center;
}

.captain-mobile-nav svg {
  width: 22px;
  height: 22px;
}

.captain-mobile-nav small {
  max-width: 100%;
  overflow: hidden;
  font-size: 0.67rem;
  font-weight: 800;
  line-height: 1.05;
  text-align: center;
  text-overflow: clip;
  white-space: normal;
}

.captain-mobile-nav b {
  position: absolute;
  top: -7px;
  inset-inline-end: -10px;
  min-width: 17px;
  height: 17px;
  padding-inline: 4px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--coral);
  font-size: 0.6rem;
}

.captain-more-backdrop {
  position: fixed;
  z-index: 80;
  inset: 0;
  display: grid;
  align-items: end;
  background: rgba(0, 0, 0, 0.62);
}

.captain-more-sheet {
  width: min(100%, 680px);
  max-height: calc(88vh - env(safe-area-inset-top));
  margin-inline: auto;
  padding: 10px 18px calc(20px + env(safe-area-inset-bottom));
  border: 1px solid #394744;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  overflow-y: auto;
  background: #131c1a;
  box-shadow: 0 -20px 55px rgba(0, 0, 0, 0.42);
}

.captain-more-handle {
  width: 46px;
  height: 4px;
  margin: 0 auto 13px;
  border-radius: 999px;
  background: #53615e;
}

.captain-more-sheet header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.captain-more-sheet header button {
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 50%;
  color: var(--ink);
  background: #24302e;
  box-shadow: none;
  font-size: 1.5rem;
}

.captain-more-links {
  margin-block: 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.captain-more-links a {
  min-height: 72px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  background: #192321;
}

.captain-more-links a > span {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  color: #72ded5;
}

.captain-logout-button {
  width: 100%;
  min-height: 48px;
  color: #ffb5ae;
  background: rgba(255, 102, 92, 0.1);
  box-shadow: none;
}

.module-card {
  position: relative;
  overflow: hidden;
  box-shadow: 0 12px 34px rgba(22, 42, 38, 0.1);
}

.module-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--coral), var(--road-line), var(--teal));
}

.module-card > * {
  position: relative;
  z-index: 1;
}

.module-card.is-restricted {
  background: rgba(23, 32, 31, 0.68);
}

.module-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

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

.module-icon {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(22, 181, 169, 0.28);
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--amber);
  background: rgba(12, 17, 17, 0.58);
}

.module-icon svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.module-card h2 {
  font-size: 1.18rem;
  line-height: 1.18;
}

.status-pill {
  flex: 0 0 auto;
  padding: 6px 9px;
  border-radius: 999px;
  color: #72ded5;
  background: rgba(22, 181, 169, 0.13);
  font-size: 0.74rem;
  font-weight: 850;
}

.is-restricted .status-pill {
  color: #ffb5ae;
  background: rgba(255, 102, 92, 0.12);
}

.permission-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.55;
}

.permission-list li + li {
  margin-top: 6px;
}

.action-row {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.module-action {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(11, 124, 116, 0.18);
  border-radius: 8px;
  display: inline-grid;
  place-items: center;
  color: #72ded5;
  background: rgba(22, 181, 169, 0.13);
  font-size: 0.82rem;
  font-weight: 850;
}

.module-action:disabled,
.table-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.users-panel {
  position: relative;
  overflow: hidden;
  box-shadow: 0 12px 34px rgba(22, 42, 38, 0.1);
}

.users-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--asphalt), var(--road-line), var(--coral));
}

.users-panel > * {
  position: relative;
  z-index: 1;
}

.page-actions {
  margin-bottom: 20px;
  display: grid;
  gap: 14px;
}

.page-actions h2 {
  font-size: 1.55rem;
}

.transaction-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: stretch;
  margin: 0 0 18px;
}

.transaction-summary-card {
  display: grid;
  min-width: min(100%, 220px);
  gap: 4px;
  padding: 14px 16px;
  text-align: start;
  color: var(--text);
  border: 1px solid rgba(244, 195, 93, 0.34);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(246, 194, 75, 0.24), transparent 5px),
    rgba(23, 32, 31, 0.94);
}

.transaction-summary-card:hover,
.transaction-summary-card.is-active {
  border-color: rgba(244, 195, 93, 0.72);
  background:
    linear-gradient(90deg, rgba(246, 194, 75, 0.36), transparent 5px),
    rgba(31, 42, 39, 0.98);
}

.transaction-summary-card span {
  color: var(--ink);
  font-size: 1.85rem;
  font-weight: 900;
  line-height: 1;
}

.transaction-summary-card strong {
  font-size: 0.95rem;
}

.transaction-summary-card small {
  color: var(--muted);
  font-weight: 700;
}

.users-toolbar {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
}

.export-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  align-items: end;
}

.logs-toolbar {
  display: grid;
  grid-template-columns: minmax(130px, 180px) minmax(0, 1fr);
  gap: 12px;
  align-items: end;
  margin-bottom: 18px;
}

.logs-toolbar .export-controls {
  grid-template-columns: repeat(4, minmax(120px, 1fr));
}

.export-controls .field {
  gap: 4px;
}

.export-controls button {
  min-height: 46px;
}

.users-panel > .export-controls {
  margin-bottom: 18px;
}

.pagination-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  margin-top: 14px;
}

.pagination-controls span {
  color: var(--muted);
  font-weight: 800;
}

.pagination-controls .ghost-button {
  min-height: 40px;
}

@media (max-width: 759px) {
  .login-shell,
  .app-shell {
    width: 100%;
    max-width: 100vw;
    padding-inline: 14px;
  }

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

  .captain-experience .app-shell {
    padding-top: 12px;
    padding-bottom: 24px;
  }

  .captain-experience #appScreen .app-header {
    margin-top: 40px;
  }

  .captain-experience #appScreen .dashboard-user-chip {
    flex-basis: auto;
  }

  .captain-welcome {
    align-items: flex-start;
  }

  .captain-status-badge {
    max-width: 116px;
    text-align: center;
  }

  .captain-activity-item {
    grid-template-columns: 36px minmax(0, 1fr);
  }

  .captain-activity-item time {
    grid-column: 2;
    max-width: none;
    text-align: start;
  }

  .app-header h1 {
    overflow-wrap: anywhere;
  }

  .session-pill {
    align-items: stretch;
  }

  .dashboard-user-chip {
    flex: 1 1 100%;
  }

  .dashboard-user-chip span {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .web-push-control {
    flex: 1 1 100%;
  }

  .web-push-control .form-message {
    max-width: none;
  }

  .session-pill > .ghost-button,
  .session-pill > button,
  .session-pill > span:not(.dashboard-user-photo) {
    flex: 1 1 calc(50% - 8px);
    min-width: 0;
  }

  .session-pill .ghost-button {
    padding-inline: 10px;
    overflow-wrap: anywhere;
  }

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

  .summary-band article {
    padding: 12px 10px;
  }

  .summary-band p {
    font-size: 0.76rem;
    overflow-wrap: anywhere;
  }

  .module-topline {
    align-items: stretch;
    gap: 10px;
  }

  .module-icon {
    width: 40px;
    height: 40px;
  }

  .module-heading {
    gap: 10px;
  }

  .logs-toolbar {
    grid-template-columns: 1fr;
  }

  .logs-toolbar .export-controls {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }
}

.search-field {
  min-width: 0;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101716;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.users-table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
}

.vehicles-table {
  min-width: 840px;
}

.projects-table {
  min-width: 820px;
}

.keys-table {
  min-width: 760px;
}

.logs-table {
  min-width: 920px;
}

.cards-table {
  min-width: 720px;
}

.users-table th,
.users-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  font-size: 0.9rem;
}

.users-table th {
  color: #fff;
  background: #0b1010;
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.users-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.03);
}

.users-table tbody tr:hover {
  background: rgba(246, 194, 75, 0.1);
}

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

.status-badge {
  display: inline-grid;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  place-items: center;
  color: #72ded5;
  background: rgba(22, 181, 169, 0.13);
  font-size: 0.78rem;
  font-weight: 850;
}

.status-badge.is-inactive {
  color: #ffb5ae;
  background: rgba(255, 102, 92, 0.12);
}

.table-button {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(11, 124, 116, 0.18);
  border-radius: 8px;
  color: #72ded5;
  background: rgba(22, 181, 169, 0.13);
  box-shadow: none;
  font-size: 0.8rem;
  font-weight: 850;
}

.table-button:hover:not(:disabled) {
  color: #fff;
  background: var(--teal-dark);
}

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

.bill-correction-alert,
.bill-correction-notice {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(255, 193, 7, 0.45);
  border-radius: 8px;
  color: #ffe8a3;
  background: rgba(255, 193, 7, 0.09);
}

.bill-correction-alert p,
.bill-correction-notice p {
  margin: 4px 0 0;
}

#billCorrectionList {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.empty-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

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

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

.form-actions .ghost-button {
  min-height: 54px;
}

.bill-submit-progress {
  display: grid;
  gap: 8px;
}

.project-update-submit-progress {
  display: grid;
  gap: 8px;
}

.bill-submit-progress-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 750;
}

.project-update-submit-progress-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 750;
}

.bill-submit-progress progress {
  width: 100%;
  height: 12px;
  accent-color: var(--teal);
}

.project-update-submit-progress progress {
  width: 100%;
  height: 12px;
  accent-color: var(--teal);
}

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

.salary-adjustment-row {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--metal);
}

.details-grid {
  margin: 0;
  display: grid;
  gap: 12px;
}

.details-grid div {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--metal);
}

.details-grid dt {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.details-grid dd {
  margin: 0;
  color: var(--ink);
  font-weight: 750;
  overflow-wrap: anywhere;
}

.details-grid .overtime-review-notice {
  grid-column: 1 / -1;
  margin: 0;
  padding: 14px;
  border: 1px solid #f0b429;
  border-inline-start: 4px solid #d97706;
  border-radius: 8px;
  background: #fff7df;
  color: #7c3f00;
  font-weight: 800;
  line-height: 1.5;
}

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

.leaderboard-heading h2 {
  margin: 4px 0 0;
}

.leaderboard-cap {
  padding: 8px 10px;
  border: 1px solid #d7a72f;
  border-radius: 8px;
  background: #fff7d6;
  color: #684b00;
  font-size: 0.82rem;
  font-weight: 800;
}

.leaderboard-rank {
  display: inline-grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  background: var(--metal);
  color: var(--ink);
  font-weight: 900;
}

.leaderboard-progress {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 650;
}

.tier-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 900;
  white-space: nowrap;
}

.tier-bronze { border-color: #a66a42; background: #f5e2d4; color: #713b20; }
.tier-silver { border-color: #8d98a5; background: #edf0f3; color: #424b55; }
.tier-gold { border-color: #c99600; background: #fff3bf; color: #6d5100; }
.tier-platinum { border-color: #4f8f89; background: #dff3f0; color: #245e59; }
.tier-master { border-color: #526fba; background: #e5ebfa; color: #29478f; }
.tier-grand-master { border-color: #8d4e9f; background: #f2e4f5; color: #662877; }

@media (max-width: 620px) {
  .leaderboard-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .leaderboard-table-wrap {
    overflow: visible;
  }

  .leaderboard-table,
  .leaderboard-table tbody {
    display: block;
    min-width: 0;
  }

  .leaderboard-table thead {
    display: none;
  }

  .leaderboard-table tr {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) auto;
    align-items: center;
    gap: 4px 10px;
    margin-bottom: 8px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--metal);
  }

  .leaderboard-table td {
    padding: 0;
    border: 0;
  }

  .leaderboard-table td:first-child {
    grid-row: 1 / 3;
  }

  .leaderboard-table td:nth-child(3) {
    grid-column: 2;
  }

  .leaderboard-table td:last-child {
    grid-column: 3;
    grid-row: 1 / 3;
  }
}

.salary-adjustment-detail dd {
  white-space: pre-line;
}

.key-assignment-panel {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--metal);
}

.key-assignment-groups {
  display: grid;
  gap: 14px;
}

.key-assignment-group {
  display: grid;
  gap: 10px;
}

.key-assignment-group h3 {
  margin: 0;
  color: #72ded5;
  font-size: 1rem;
  line-height: 1.2;
}

.key-assignment-row {
  display: grid;
  gap: 8px;
}

.project-update-controls,
.timeline-feed {
  display: grid;
  gap: 16px;
}

.project-update-form {
  display: grid;
  gap: 12px;
}

.project-update-photo-preview,
.timeline-photo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: min(100%, 520px);
}

.project-update-photo-preview img {
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: cover;
  width: 100%;
}

.timeline-photo-grid button {
  appearance: none;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0;
}

.timeline-photo-grid button:only-child {
  grid-column: 1 / -1;
}

.field textarea {
  width: 100%;
  min-height: 120px;
  resize: vertical;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--metal);
  outline: none;
}

.field textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(11, 124, 116, 0.13);
}

.timeline-item {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(11, 124, 116, 0.12), transparent 5px),
    var(--metal);
}

.timeline-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
}

.timeline-meta span,
.timeline-project {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.timeline-item p {
  margin: 0;
  line-height: 1.55;
  white-space: pre-wrap;
}

.timeline-photo {
  display: block;
  aspect-ratio: 4 / 3;
  width: 100%;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.vehicle-photo-cell {
  width: 96px;
}

.vehicle-photo-thumbnail,
.vehicle-detail-photo {
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
}

.vehicle-photo-thumbnail {
  width: 76px;
  height: 52px;
}

.vehicle-photo-thumbnail img,
.vehicle-detail-photo img,
.vehicle-photo-preview-wrap img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.vehicle-detail-photo {
  width: min(100%, 360px);
  aspect-ratio: 4 / 3;
}

.vehicle-photo-preview-wrap {
  width: min(100%, 480px);
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.key-photo-pair {
  display: flex;
  min-width: 170px;
  gap: 10px;
  align-items: center;
}

.key-vehicle-photo {
  width: 64px;
  height: 44px;
  flex: 0 0 auto;
}

.key-vehicle-photo-placeholder {
  width: 64px;
  min-height: 44px;
  padding: 4px;
  border: 1px dashed var(--line);
  border-radius: 6px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  color: var(--muted);
  font-size: 0.72rem;
  text-align: center;
}

.photo-viewer-open {
  overflow: hidden;
}

.photo-viewer {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
  background: rgba(7, 12, 20, 0.86);
}

.photo-viewer-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: #080d15;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.36);
}

.photo-viewer-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  color: #f8fafc;
  background: #10151f;
}

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

.photo-viewer-actions .ghost-button {
  width: auto;
  min-height: 40px;
  color: #f8fafc;
  border-color: rgba(255, 255, 255, 0.26);
  background: rgba(255, 255, 255, 0.08);
}

.photo-viewer-stage {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  display: grid;
  place-items: center;
  padding: 12px;
}

.photo-viewer-stage img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 6px;
}

.photo-viewer-stage iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.contract-preview {
  width: 100%;
  max-height: 60vh;
  overflow: auto;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--metal);
  font: inherit;
  line-height: 1.65;
  white-space: pre-wrap;
}

.timeline-actions {
  display: flex;
  justify-content: flex-end;
}

@media (min-width: 760px) {
  .login-shell,
  .app-shell {
    grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.7fr);
    padding: 40px;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .app-header {
    grid-template-columns: 1fr auto;
    align-items: end;
  }

  .captain-primary-action {
    grid-template-columns: minmax(0, 1fr) minmax(180px, 240px);
    align-items: center;
  }

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

  .captain-assignment {
    grid-template-columns: 72px minmax(0, 1fr) auto;
  }

  .captain-assignment > a {
    grid-column: auto;
    min-width: 150px;
    padding-inline: 18px;
  }

  .brand-panel {
    min-height: 620px;
    padding: 42px;
  }

  h1 {
    font-size: 4.5rem;
  }

  .login-card {
    padding: 34px;
  }

  .module-card {
    padding: 24px;
  }

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

  .users-panel {
    padding: 24px;
  }

  .users-toolbar {
    grid-template-columns: minmax(220px, 1.4fr) repeat(3, minmax(150px, 1fr));
    align-items: end;
  }

  .vehicles-toolbar {
    grid-template-columns: minmax(220px, 1.4fr) repeat(4, minmax(128px, 1fr));
  }

  .page-actions {
    grid-template-columns: 1fr auto;
    align-items: end;
  }

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

  .add-user-form .form-message,
  .add-user-form .bill-submit-progress,
  .add-user-form .form-actions {
    grid-column: 1 / -1;
  }

  .field-wide {
    grid-column: 1 / -1;
  }

  .form-actions {
    grid-template-columns: minmax(180px, 240px) minmax(140px, 180px);
  }

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

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

  .brand-panel,
  .login-card,
  .module-card,
  .users-panel {
    padding: 20px;
  }

  .role-selector {
    grid-template-columns: 1fr;
  }

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

