:root {
  --bg: #f3f7fa;
  --surface: #ffffff;
  --surface-2: #e8f4f8;
  --surface-3: #dff1f7;
  --line: #d0e1e9;
  --line-strong: #a9c5d2;
  --text: #12242d;
  --muted: #5f7480;
  --brand: #22bfe0;
  --brand-dark: #0a9fc2;
  --nav: #061116;
  --blue: #1e6fa8;
  --amber: #b7791f;
  --red: #b42318;
  --green: #16865f;
  --purple: #5b5fc7;
  --shadow: 0 18px 44px rgba(5, 24, 34, 0.16);
  --radius: 8px;
  --sidebar: 244px;
  --row-head: 250px;
  --day: minmax(76px, 1fr);
  --row-h: 74px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

[hidden] {
  display: none !important;
}

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.62;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.05;
}

h2 {
  font-size: 18px;
}

h3 {
  font-size: 15px;
}

.muted {
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
}

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
  background: var(--nav);
}

.password-view {
  position: fixed;
  inset: 0;
  z-index: 50;
  padding: 20px;
  display: grid;
  place-items: center;
  background: rgba(6, 17, 22, 0.92);
}

.login-panel {
  width: min(380px, 100%);
  padding: 22px;
  display: grid;
  gap: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.22);
}

.password-panel {
  width: min(390px, 100%);
  padding: 22px;
  display: grid;
  gap: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
}

.login-logo {
  width: 260px;
  height: auto;
  display: block;
  margin: 0 auto 4px;
  object-fit: contain;
}

.login-panel h1,
.login-panel .muted,
.password-panel h1,
.password-panel .muted {
  text-align: center;
}

.app-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
}

.sidebar {
  min-height: 100vh;
  min-height: 100dvh;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  background: var(--nav);
  color: #f8fbfd;
}

.brand {
  display: grid;
  justify-items: center;
}

.brand-logo {
  width: 188px;
  height: auto;
  display: block;
  flex: 0 0 auto;
  object-fit: contain;
  border-radius: 6px;
}

.brand > div {
  display: none;
}

.brand-name {
  font-weight: 850;
  font-size: 15px;
}

.brand-subtitle {
  margin-top: 2px;
  color: rgba(248, 251, 253, 0.7);
  font-size: 13px;
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-item {
  width: 100%;
  min-height: 40px;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: rgba(248, 251, 253, 0.82);
  font-weight: 750;
  text-align: left;
}

.nav-item.active,
.nav-item:hover {
  background: rgba(34, 191, 224, 0.18);
  border-color: rgba(34, 191, 224, 0.2);
  color: #fff;
}

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

.field-label,
.summary-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.sidebar .field-label {
  color: rgba(248, 251, 253, 0.72);
}

.profile-box {
  padding: 10px;
  display: grid;
  gap: 3px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.08);
}

.profile-box strong,
.profile-box span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.is-tech .sidebar {
  min-height: auto;
  padding: 10px 14px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.is-tech .brand-logo {
  width: 116px;
}

.is-tech .brand-name,
.is-tech .brand-subtitle,
.is-tech .sidebar .field-label {
  display: none;
}

.is-tech .nav-list {
  display: flex;
  gap: 6px;
  min-width: 0;
  overflow: auto;
}

.is-tech .nav-item {
  width: auto;
  min-width: 112px;
  min-height: 38px;
  padding: 8px 10px;
  text-align: center;
  white-space: nowrap;
}

.is-tech .sidebar-footer {
  margin-top: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.is-tech .profile-box {
  min-width: 150px;
  padding: 7px 9px;
}

.is-tech .main-area {
  padding: 16px;
  background: var(--bg);
  color: var(--text);
}

.is-tech .topbar {
  align-items: stretch;
}

.is-tech .muted {
  color: var(--muted);
}

.is-tech .toolbar {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 48px;
  gap: 8px;
}

.is-tech .toolbar .icon-btn,
.is-tech .toolbar .ghost-btn {
  min-height: 48px;
}

.profile-box span {
  color: rgba(248, 251, 253, 0.72);
  font-size: 13px;
}

.main-area {
  min-width: 0;
  padding: 22px;
}

.page-section {
  display: grid;
  gap: 14px;
}

.topbar,
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

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

.primary-btn,
.ghost-btn,
.danger-btn,
.icon-btn {
  min-height: 40px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  padding: 9px 13px;
  font-weight: 800;
  white-space: nowrap;
}

.primary-btn {
  background: var(--brand);
  color: #031318;
}

.primary-btn:hover {
  background: var(--brand-dark);
  color: #fff;
}

.ghost-btn {
  border-color: var(--line);
  background: #fff;
  color: var(--text);
}

.ghost-btn:hover,
.icon-btn:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
}

.danger-btn {
  border-color: rgba(180, 35, 24, 0.3);
  background: #fff5f4;
  color: var(--red);
}

.icon-btn {
  width: 40px;
  padding: 0;
  display: grid;
  place-items: center;
  border-color: var(--line);
  background: #fff;
  color: var(--text);
}

.small-btn {
  min-height: 32px;
  padding: 6px 9px;
  font-size: 12px;
}

.full-btn {
  width: 100%;
}

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

.form-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.form-field input,
.form-field select,
.form-field textarea,
.search-input,
.select-control,
#signerNameInput,
#executionComments {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  padding: 9px 10px;
  outline: none;
}

.form-field textarea,
#executionComments {
  resize: vertical;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus,
.search-input:focus,
.select-control:focus,
#signerNameInput:focus,
#executionComments:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(34, 191, 224, 0.18);
}

.compact-control {
  min-width: 156px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.summary-tile {
  min-height: 80px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.summary-tile strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
  line-height: 1;
}

.summary-tile.warning strong {
  color: var(--red);
}

.work-grid,
.split-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  gap: 14px;
}

.dashboard-work-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.work-panel,
.terrain-column {
  min-width: 0;
  padding: 14px;
  display: grid;
  align-content: start;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.card-list,
.machine-list,
.billing-list {
  display: grid;
  gap: 10px;
}

.machine-inventory-panel {
  width: 100%;
}

.rental-inventory-panel {
  width: 100%;
}

.machine-inventory-list {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  align-items: stretch;
}

.rental-inventory-list {
  grid-template-columns: 1fr;
}

.machine-inventory-list .empty-state {
  grid-column: 1 / -1;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(320px, 1fr);
  gap: 14px;
  align-items: start;
}

.admin-users-panel {
  grid-column: 1 / -1;
}

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

.admin-user-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 10px;
}

.admin-user-card {
  min-width: 0;
  padding: 12px;
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdfe;
}

.admin-user-head {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.admin-user-head strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-user-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

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

.check-inline {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.check-inline input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  accent-color: var(--brand-dark);
}

.maintenance-toggle-btn {
  width: 100%;
  min-height: 54px;
  padding: 10px 12px;
  display: grid;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  text-align: left;
}

.maintenance-toggle-btn strong {
  font-size: 14px;
  font-weight: 900;
}

.maintenance-toggle-btn span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.maintenance-toggle-btn.active {
  border-color: rgba(180, 35, 24, 0.34);
  background: #fff5f4;
  color: var(--red);
}

.maintenance-toggle-btn.active span {
  color: var(--red);
}

.machine-inventory-list .machine-card {
  min-height: 210px;
  align-items: stretch;
  flex-direction: column;
  border-left: 6px solid var(--machine-color, var(--line));
}

.machine-inventory-list .card-actions {
  justify-content: flex-start;
  margin-top: auto;
}

.machine-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
}

.machine-dashboard-group {
  min-width: 0;
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fbfc;
}

.machine-dashboard-group header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.machine-dashboard-group h3 {
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.machine-dashboard-group header span {
  min-width: 28px;
  min-height: 24px;
  padding: 3px 8px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.rental-card,
.mission-card,
.billing-row {
  min-width: 0;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdfe;
}

.compact-card {
  align-items: stretch;
}

.mission-card {
  display: grid;
  align-items: stretch;
}

.card-main,
.mission-card {
  min-width: 0;
  gap: 6px;
}

.card-main {
  display: grid;
}

.machine-card .card-main strong {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.machine-color-swatch {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  display: inline-block;
  border: 1px solid rgba(6, 17, 22, 0.18);
  border-radius: 50%;
}

.machine-current-hours {
  color: var(--text);
  font-weight: 900;
}

.card-main strong,
.card-main span,
.mission-card strong,
.mission-card span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-main span,
.mission-card span,
.billing-row span {
  color: var(--muted);
  font-size: 13px;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.status-pill {
  width: max-content;
  max-width: 100%;
  padding: 4px 8px;
  display: inline-block;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 12px;
  font-weight: 850;
}

.status-pill.ready_departure,
.rental-block.ready_departure {
  background: var(--brand);
  color: #031318;
}

.status-pill.out,
.status-pill.return_due,
.rental-block.out,
.rental-block.return_due {
  background: var(--blue);
  color: #fff;
}

.status-pill.closed,
.rental-block.closed {
  background: var(--green);
  color: #fff;
}

.status-pill.issue,
.rental-block.issue {
  background: var(--red);
  color: #fff;
}

.status-pill.draft,
.rental-block.draft {
  background: #697983;
  color: #fff;
}

.status-pill.cancelled,
.rental-block.cancelled {
  background: #7a6b5d;
  color: #fff;
}

.status-pill.available {
  background: var(--green);
  color: #fff;
}

.status-pill.maintenance {
  background: var(--red);
  color: #fff;
}

.machine-line {
  min-height: 54px;
  padding: 9px 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdfe;
}

.machine-line.revision-due {
  border-color: rgba(180, 35, 24, 0.34);
  background: #fffafa;
}

.machine-line div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.machine-line > div span {
  color: var(--muted);
  font-size: 13px;
}

.revision-alert,
.card-main .revision-alert,
.machine-line > div .revision-alert {
  width: fit-content;
  max-width: 100%;
  padding: 3px 7px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  overflow: visible;
}

.revision-alert.due,
.card-main .revision-alert.due,
.machine-line > div .revision-alert.due {
  border-color: rgba(180, 35, 24, 0.34);
  background: #fff5f4;
  color: var(--red);
}

.machine-revision-line,
.machine-vgp-line {
  width: fit-content;
  max-width: 100%;
  padding: 3px 7px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.machine-revision-line strong,
.machine-vgp-line strong {
  color: var(--brand-dark);
  font-weight: 900;
}

.machine-revision-line.due,
.machine-vgp-line.due {
  border-color: rgba(180, 35, 24, 0.34);
  background: #fff5f4;
  color: var(--muted);
}

.machine-revision-line.due strong,
.machine-vgp-line.due strong {
  color: var(--red);
}

.revision-alert.vgp {
  border-color: rgba(30, 111, 168, 0.28);
}

.revision-alert.vgp.due {
  border-color: rgba(180, 35, 24, 0.34);
}

.revision-step-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.revision-step-controls strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.revision-step-controls span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.revision-step-controls span.updated {
  color: var(--brand-dark);
}

.machine-status-badge {
  width: max-content;
  max-width: 100%;
  min-height: 26px;
  padding: 4px 8px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.machine-category-badge {
  width: max-content;
  max-width: 100%;
  min-height: 26px;
  padding: 4px 8px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(180, 35, 24, 0.34);
  border-radius: 999px;
  background: #fff5f4;
  color: var(--red);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.machine-category-badge strong,
.maintenance-rental-warning strong,
.maintenance-alert-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-size: 12px;
  line-height: 1;
}

.maintenance-rental-warning {
  width: fit-content;
  max-width: 100%;
  padding: 4px 8px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(180, 35, 24, 0.34);
  border-radius: 999px;
  background: #fff5f4;
  color: var(--red);
  font-size: 12px;
  font-weight: 900;
}

.card-main .machine-status-badge,
.machine-line .machine-status-badge,
.row-head .machine-status-badge {
  color: var(--text);
  font-size: 12px;
}

.card-main .machine-status-badge span,
.machine-line .machine-status-badge span,
.row-head .machine-status-badge span {
  overflow: visible;
  text-overflow: clip;
}

.machine-status-badge.available {
  border-color: rgba(24, 168, 107, 0.32);
  background: rgba(24, 168, 107, 0.09);
}

.machine-status-badge.out {
  border-color: rgba(13, 122, 189, 0.32);
  background: rgba(13, 122, 189, 0.09);
}

.machine-status-badge.maintenance {
  border-color: rgba(180, 35, 24, 0.34);
  background: rgba(180, 35, 24, 0.1);
}

.machine-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  display: block;
  border-radius: 50%;
  background: var(--green);
}

.machine-dot.out {
  background: var(--blue);
}

.machine-dot.maintenance {
  background: var(--red);
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.timeline-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.timeline-grid {
  min-width: 1120px;
}

.timeline-grid.tech-calendar {
  min-width: 0;
}

.is-tech .timeline-wrap {
  overflow: visible;
  border: 0;
  background: transparent;
}

.tech-calendar-board {
  display: grid;
  gap: 0;
  padding-bottom: 12px;
}

.tech-weekday-head {
  margin-left: 32px;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-align: center;
  text-transform: uppercase;
}

.tech-week-row {
  min-height: 132px;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  grid-template-areas:
    "num days"
    "num bars";
  border-top: 1px solid var(--line);
  padding: 7px 0 10px;
}

.tech-week-number {
  grid-area: num;
  padding-top: 22px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.tech-week-days {
  grid-area: days;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.tech-day-cell {
  min-width: 0;
  min-height: 26px;
  display: grid;
  place-items: center;
  color: var(--text);
  font-size: 15px;
}

.tech-day-cell.today strong {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--brand);
  color: #031318;
}

.tech-day-cell.outside-month {
  color: #9aadb8;
  background: #f8fbfc;
}

.tech-week-bars {
  grid-area: bars;
  min-height: 78px;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  grid-auto-rows: 24px;
  gap: 5px 2px;
  align-content: start;
}

.tech-calendar-bar {
  min-width: 0;
  min-height: 24px;
  padding: 3px 5px;
  border: 0;
  border-radius: 4px;
  background: #278ea7;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.1;
  text-align: left;
  overflow: hidden;
}

.tech-calendar-bar span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tech-calendar-bar.maintenance-warning {
  display: flex;
  align-items: center;
  gap: 4px;
}

.tech-calendar-bar.maintenance-warning span {
  min-width: 0;
}

.tech-calendar-bar .maintenance-alert-icon {
  width: 16px;
  height: 16px;
  background: #fff;
  color: var(--red);
  font-size: 11px;
}

.tech-calendar-bar.ready_departure {
  background: #c39a25;
}

.tech-calendar-bar.out,
.tech-calendar-bar.return_due {
  background: #278ea7;
}

.tech-calendar-bar.issue {
  background: #b85b55;
}

.tech-calendar-bar.closed {
  background: var(--green);
}

.tech-calendar-bar.draft {
  background: #697983;
}

.tech-calendar-bar.cancelled {
  background: #7a6b5d;
}

.admin-calendar-board {
  padding: 0 8px 12px;
}

.admin-calendar .tech-week-row {
  min-height: 138px;
}

.admin-calendar .tech-calendar-bar {
  box-shadow: 0 8px 16px rgba(5, 24, 34, 0.11);
}

.tech-empty-week {
  grid-column: 1 / -1;
  padding: 5px 0;
  color: var(--muted);
  font-size: 12px;
}

.tech-agenda-list {
  display: grid;
  gap: 14px;
}

.tech-day-group {
  display: grid;
  gap: 8px;
}

.tech-day-header {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.tech-day-header h2 {
  font-size: 16px;
}

.tech-day-header span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

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

.tech-mission-card {
  width: 100%;
  min-height: 92px;
  padding: 11px 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px 10px;
  border: 1px solid var(--line);
  border-left: 7px solid var(--blue);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 12px 28px rgba(5, 24, 34, 0.09);
  color: var(--text);
  text-align: left;
}

.tech-mission-card.ready_departure {
  border-left-color: var(--brand);
}

.tech-mission-card.out,
.tech-mission-card.return_due {
  border-left-color: var(--blue);
}

.tech-mission-card.issue {
  border-left-color: var(--red);
}

.tech-mission-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.tech-mission-main strong {
  font-size: 18px;
}

.tech-mission-main span {
  color: var(--muted);
  font-size: 14px;
}

.tech-mission-card > .status-pill {
  grid-column: 1 / -1;
}

.tech-mission-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.tech-mission-meta span {
  min-width: 0;
  padding: 9px;
  display: grid;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdfe;
}

.tech-mission-meta em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 850;
  text-transform: uppercase;
}

.tech-mission-meta strong {
  min-width: 0;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tech-action-label {
  min-height: 34px;
  padding: 8px 11px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: var(--brand);
  color: #031318;
  font-weight: 900;
  text-align: center;
}

.tech-mission-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.tech-mission-time {
  min-width: 50px;
  color: var(--text);
  font-weight: 900;
  text-align: right;
}

.timeline-header,
.timeline-row {
  display: grid;
  grid-template-columns: var(--row-head) repeat(14, var(--day));
}

.timeline-header {
  position: sticky;
  top: 0;
  z-index: 6;
  background: var(--surface);
  border-bottom: 1px solid var(--line-strong);
}

.corner-cell,
.date-cell,
.row-head,
.day-cell {
  border-right: 1px solid var(--line);
}

.corner-cell,
.date-cell {
  min-height: 56px;
  padding: 9px 10px;
}

.corner-cell {
  position: sticky;
  left: 0;
  z-index: 8;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.date-cell {
  display: grid;
  align-content: center;
  gap: 3px;
  text-align: center;
}

.date-cell span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.date-cell.today {
  background: #e5f9fe;
  color: var(--brand-dark);
}

.timeline-row {
  position: relative;
  min-height: var(--row-h);
  border-bottom: 1px solid var(--line);
}

.row-head {
  position: sticky;
  left: 0;
  z-index: 5;
  min-height: var(--row-h);
  padding: 10px;
  display: grid;
  align-content: center;
  gap: 4px;
  background: #fbfdfe;
}

.row-head > strong,
.row-head > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-head > span {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.row-head em {
  font-style: normal;
}

.day-cell {
  min-height: var(--row-h);
  background-image: linear-gradient(to bottom, rgba(34, 191, 224, 0.045), rgba(34, 191, 224, 0.045));
  background-position: 0 100%;
  background-repeat: no-repeat;
  background-size: 100% 1px;
}

.rental-layer {
  pointer-events: none;
  position: absolute;
  left: var(--row-head);
  right: 0;
  top: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(14, var(--day));
}

.rental-block {
  pointer-events: auto;
  align-self: center;
  min-width: 0;
  min-height: 48px;
  margin: 8px 4px;
  padding: 7px 9px;
  display: grid;
  align-content: center;
  gap: 2px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: var(--radius);
  box-shadow: 0 10px 20px rgba(5, 24, 34, 0.14);
  text-align: left;
  overflow: hidden;
}

.rental-block strong,
.rental-block span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rental-block span {
  font-size: 11px;
  opacity: 0.92;
}

.rental-block em {
  width: max-content;
  max-width: 100%;
  margin-top: 3px;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.24);
  color: inherit;
  font-size: 11px;
  font-style: normal;
  font-weight: 850;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rental-block.direct-action {
  min-height: 60px;
  padding: 9px 10px;
}

.rental-block.blocked-action {
  border-color: rgba(180, 35, 24, 0.45);
  background: #fff5f4;
  color: var(--red);
}

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

.rental-form .wide,
.form-actions.wide {
  grid-column: 1 / -1;
}

.color-field input[type="color"] {
  width: 100%;
  min-height: 42px;
  padding: 4px;
  cursor: pointer;
}

.color-preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.color-preset {
  width: 26px;
  height: 26px;
  border: 1px solid rgba(6, 17, 22, 0.22);
  border-radius: 999px;
  cursor: pointer;
}

.color-preset.active {
  border-color: #061116;
  outline: 3px solid rgba(13, 122, 189, 0.22);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

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

.count-badge {
  min-width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  font-weight: 850;
}

.mission-times {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.mission-times span {
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--muted);
  font-size: 12px;
}

.mission-times strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 13px;
}

.billing-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.3fr) repeat(4, minmax(120px, 0.75fr)) auto;
}

.billing-row > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.billing-row > .billing-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.billing-actions .ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.detail-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 20;
  width: min(560px, 100vw);
  height: 100vh;
  height: 100dvh;
  padding: 18px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
  border-left: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
  transform: translateX(105%);
  transition: transform 180ms ease;
}

.detail-drawer.open {
  transform: translateX(0);
}

.detail-drawer.signature-mode {
  width: min(760px, 100vw);
}

.drawer-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.eyebrow {
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.drawer-content {
  min-height: 0;
  overflow: auto;
  padding-bottom: env(safe-area-inset-bottom);
}

.detail-drawer.signature-mode .drawer-content {
  overflow: hidden;
  padding-bottom: 0;
}

.detail-stack,
.execution-form {
  display: grid;
  gap: 12px;
}

.execution-step {
  display: grid;
  gap: 12px;
}

.detail-panel {
  padding: 13px;
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdfe;
}

.sticky-summary {
  position: sticky;
  top: 0;
  z-index: 2;
}

.detail-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(208, 225, 233, 0.75);
  padding-bottom: 7px;
}

.detail-line span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.detail-line strong {
  min-width: 0;
  text-align: right;
}

.detail-line.configuration-line span,
.detail-line.configuration-line strong {
  color: #d71920;
}

.note-text {
  padding: 10px;
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  line-height: 1.45;
}

.check-row,
.toggle-row {
  min-height: 48px;
  padding: 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.check-row input,
.toggle-row input {
  width: 22px;
  height: 22px;
  accent-color: var(--brand);
}

.check-main {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.check-main span {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.machine-control-panel {
  gap: 12px;
}

.machine-control-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.machine-control-toolbar h3 {
  margin: 0;
}

.machine-control-toolbar div {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: flex-end;
}

.machine-control-section {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
}

.machine-control-section summary {
  min-height: 50px;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  background: #eef7fb;
  color: var(--brand-dark);
  font-weight: 950;
}

.machine-control-section summary strong {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.machine-control-rows {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.machine-control-row {
  padding: 10px;
  display: grid;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.machine-control-row.nok {
  border-color: rgba(180, 35, 24, 0.34);
  background: #fffafa;
}

.machine-control-row.invalid {
  outline: 3px solid rgba(180, 35, 24, 0.22);
}

.machine-control-row-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.machine-control-row-head strong {
  min-width: 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.25;
}

.machine-control-critical {
  flex: 0 0 auto;
  padding: 3px 7px;
  border-radius: 999px;
  background: #fff5f4;
  color: var(--red);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.machine-control-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.machine-control-options label {
  min-height: 42px;
  display: grid;
}

.machine-control-options input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.machine-control-options span {
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f7fafb;
  color: var(--text);
  font-weight: 900;
}

.machine-control-options input:checked + span {
  border-color: var(--brand);
  background: rgba(13, 122, 189, 0.1);
  color: var(--brand-dark);
}

.machine-control-options input[value="nok"]:checked + span {
  border-color: rgba(180, 35, 24, 0.42);
  background: #fff5f4;
  color: var(--red);
}

.machine-control-nok-detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 0.7fr);
  gap: 8px;
}

.machine-control-nok-detail label {
  display: grid;
  gap: 5px;
}

.machine-control-nok-detail span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.machine-control-nok-detail input {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  padding: 9px 10px;
}

.machine-control-status-preview {
  width: fit-content;
  max-width: 100%;
  padding: 7px 10px;
  border: 1px solid rgba(24, 168, 107, 0.32);
  border-radius: 999px;
  background: rgba(24, 168, 107, 0.09);
  color: var(--green);
  font-size: 13px;
  font-weight: 950;
}

.machine-control-status-preview.reserve,
.revision-alert.reserve {
  border-color: rgba(195, 154, 37, 0.42);
  background: #fff8e2;
  color: #8a6500;
}

.machine-control-status-preview.blocked {
  border-color: rgba(180, 35, 24, 0.34);
  background: #fff5f4;
  color: var(--red);
}

.machine-control-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.machine-control-summary span {
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.machine-control-summary strong {
  color: var(--text);
}

.machine-control-summary .missing strong {
  color: var(--red);
}

.vgp-start-panel {
  display: grid;
  gap: 12px;
}

.vgp-start-choice {
  min-height: 96px;
  padding: 16px;
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  text-align: left;
}

.vgp-start-choice strong {
  color: var(--brand-dark);
  font-size: 20px;
  font-weight: 900;
}

.vgp-start-choice span {
  color: var(--muted);
  font-weight: 750;
}

.vgp-equipment-switch {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.vgp-equipment-choice {
  min-height: 86px;
  padding: 14px;
  display: grid;
  gap: 5px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.vgp-equipment-choice strong {
  color: var(--brand-dark);
  font-size: 18px;
  font-weight: 950;
}

.vgp-equipment-choice span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
}

.vgp-equipment-choice.active {
  border-color: var(--brand);
  background: #eaf7fb;
  box-shadow: 0 0 0 3px rgba(34, 191, 224, 0.18);
}

.vgp-equipment-choice[data-vgp-equipment="treuil"].active {
  border-color: #d96c06;
  background: #fff4e8;
  box-shadow: 0 0 0 3px rgba(217, 108, 6, 0.18);
}

.vgp-equipment-choice.active strong::after {
  content: " actif";
  margin-left: 8px;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.vgp-equipment-choice[data-vgp-equipment="treuil"].active strong::after {
  background: #d96c06;
}

.vgp-report-card {
  border-left: 5px solid var(--brand);
}

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

.vgp-list-group + .vgp-list-group {
  margin-top: 14px;
}

.vgp-list-title,
.vgp-client-group h4 {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--brand-dark);
  font-size: 15px;
  font-weight: 950;
}

.vgp-list-title {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #eef7fb;
}

.vgp-list-title strong,
.vgp-client-group h4 span {
  min-width: 28px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #fff;
  color: var(--brand);
  text-align: center;
  font-size: 12px;
}

.vgp-client-groups,
.vgp-client-group {
  display: grid;
  gap: 10px;
}

.vgp-client-group {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.vgp-pdf-section {
  display: grid;
  gap: 10px;
}

.vgp-pdf-section-title {
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #eef4f7;
  color: var(--text);
  font-size: 13px;
  font-weight: 950;
}

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

.vgp-characteristic-grid .wide {
  grid-column: 1 / -1;
}

.vgp-option-group {
  margin: 0;
  padding: 10px;
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.vgp-option-group legend {
  padding: 0 4px;
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.vgp-option-group label {
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-weight: 750;
}

.vgp-option-group input {
  width: 18px;
  height: 18px;
  accent-color: var(--brand-dark);
}

.vgp-emergency-lines {
  display: grid;
  gap: 8px;
}

.vgp-emergency-line {
  padding: 9px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px;
  gap: 10px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.vgp-emergency-check {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-weight: 850;
}

.vgp-emergency-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--brand-dark);
}

.vgp-inline-quantity {
  display: grid;
  gap: 5px;
}

.vgp-inline-quantity span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.vgp-inline-quantity input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  padding: 8px 10px;
}

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

.vgp-cuts-row .vgp-emergency-check,
.vgp-emergency-summary-box {
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.vgp-emergency-summary-box {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  border-color: #efb5b5;
  background: #fffafa;
}

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

.vgp-security-details .wide {
  grid-column: 1 / -1;
}

.vgp-section-title {
  margin-top: 4px;
  padding: 7px 9px;
  border-radius: var(--radius);
  background: #fff5f4;
  color: var(--red);
  font-size: 13px;
  font-weight: 950;
  text-transform: uppercase;
}

.vgp-checklist-toolbar {
  display: flex;
  justify-content: flex-end;
}

.vgp-check-row {
  padding: 9px;
  display: grid;
  grid-template-columns: minmax(170px, 0.9fr) auto minmax(180px, 1fr);
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.vgp-check-title {
  min-width: 0;
  font-weight: 850;
}

.vgp-status-choice {
  display: inline-grid;
  grid-template-columns: repeat(3, 48px);
  gap: 4px;
}

.vgp-status-choice label {
  min-height: 34px;
  display: grid;
}

.vgp-status-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.vgp-status-choice span {
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fbfc;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.vgp-status-choice input:checked + span {
  border-color: var(--brand-dark);
  background: var(--brand);
  color: #061116;
}

.vgp-observation-input {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.vgp-signature-panel {
  min-height: 220px;
}

.check-main em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.fuel-check-row {
  grid-template-columns: minmax(0, 1fr) minmax(112px, 140px);
}

.fuel-check-main {
  grid-template-columns: minmax(0, 1fr);
}

.check-comment {
  margin-top: -6px;
}

.issue-fields {
  margin-top: -6px;
  padding: 10px;
  display: none;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.issue-fields.active {
  display: grid;
  border-color: rgba(215, 25, 32, 0.45);
  background: #fff7f7;
}

.issue-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-self: end;
  color: #d71920;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.issue-toggle input {
  width: 20px;
  height: 20px;
  accent-color: #d71920;
}

.issue-photo-status {
  color: #d71920;
  font-size: 12px;
  font-weight: 850;
}

.fuel-level-field {
  display: grid;
  gap: 4px;
}

.fuel-level-field span {
  color: #d71920;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.fuel-level-field select {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(215, 25, 32, 0.35);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  padding: 9px 10px;
  font-weight: 850;
}

.file-input {
  width: 100%;
  padding: 10px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: #fff;
}

.native-file-input {
  position: fixed;
  left: -9999px;
  top: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.required-photo-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.required-photo-btn {
  min-height: 62px;
  padding: 10px;
  display: grid;
  align-content: center;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  text-align: center;
}

.required-photo-btn strong {
  font-size: 14px;
  font-weight: 900;
}

.required-photo-btn span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.required-photo-btn.done {
  border-color: rgba(24, 134, 95, 0.34);
  background: #f1fbf7;
  color: var(--green);
}

.required-photo-btn.done span {
  color: var(--green);
}

.photo-actions {
  min-height: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

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

.photo-grid figure {
  position: relative;
  margin: 0;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.pending-photo {
  padding-top: 32px;
}

.remove-photo-btn {
  position: absolute;
  top: 5px;
  right: 5px;
  z-index: 1;
  min-height: 26px;
  padding: 4px 7px;
  border: 1px solid rgba(180, 35, 24, 0.24);
  border-radius: var(--radius);
  background: #fff5f4;
  color: var(--red);
  font-size: 11px;
  font-weight: 850;
}

.photo-grid img {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: block;
  object-fit: cover;
}

.photo-grid figcaption {
  padding: 6px;
  color: var(--muted);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.control-archive {
  align-content: start;
}

.control-archive-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.control-archive-head h3 {
  margin: 0;
}

.control-archive-head .ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.checklist-archive {
  display: grid;
  gap: 6px;
}

.archive-check-row {
  padding: 8px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  font-size: 12px;
}

.archive-check-row span {
  min-width: 0;
  font-weight: 800;
}

.archive-check-row strong {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.archive-check-row p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
}

.archive-check-row.has-issue {
  border-color: rgba(215, 25, 32, 0.4);
  background: #fff7f7;
}

.archive-check-row.has-issue strong,
.archive-check-row.has-issue p {
  color: #d71920;
}

.signature-preview {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.signature-preview img {
  width: 100%;
  height: 138px;
  display: block;
  object-fit: contain;
  background: #fff;
}

.signature-preview figcaption {
  padding: 7px 9px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.signature-canvas {
  width: 100%;
  height: 190px;
  display: block;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #fff;
  touch-action: none;
}

.signature-page {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 10px;
}

.signature-terminal-top {
  min-width: 0;
}

.signature-name-field {
  margin: 0;
}

.signature-pad-panel {
  min-height: 0;
  padding: 8px;
  display: grid;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdfe;
}

.signature-page .signature-canvas {
  height: 100%;
  min-height: 320px;
}

.signature-terminal-actions {
  padding: 10px 0 calc(10px + env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.signature-terminal-actions .primary-btn,
.signature-terminal-actions .ghost-btn {
  min-height: 52px;
}

.drawer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.execution-step > .drawer-actions {
  position: sticky;
  bottom: 0;
  z-index: 4;
  margin: 0 -2px;
  padding: 10px 2px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.86), var(--surface) 28%);
  backdrop-filter: blur(8px);
}

.notice {
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: 13px;
}

.notice.error {
  border: 1px solid rgba(180, 35, 24, 0.28);
  background: #fff5f4;
  color: var(--red);
}

.notice.warning {
  border: 1px solid rgba(180, 35, 24, 0.28);
  background: #fff5f4;
  color: var(--red);
}

.revision-control-alert {
  font-weight: 900;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 30;
  max-width: min(360px, calc(100vw - 40px));
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--nav);
  color: #fff;
  box-shadow: var(--shadow);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  padding: 18px;
  display: grid;
  place-items: center;
  background: rgba(6, 17, 22, 0.32);
}

.revision-modal {
  width: min(560px, 100%);
  max-height: min(720px, calc(100vh - 36px));
  padding: 16px;
  display: grid;
  gap: 14px;
  overflow: auto;
  border: 1px solid rgba(180, 35, 24, 0.28);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 22px 52px rgba(5, 24, 34, 0.22);
}

.revision-modal header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.revision-modal h2 {
  color: var(--red);
  font-size: 24px;
}

.revision-modal-content h3 {
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.revision-modal-content {
  display: grid;
  gap: 12px;
}

.revision-modal-list {
  display: grid;
  gap: 8px;
}

.revision-modal-row {
  padding: 10px;
  display: grid;
  gap: 3px;
  border: 1px solid rgba(180, 35, 24, 0.22);
  border-radius: var(--radius);
  background: #fffafa;
}

.revision-modal-row strong,
.revision-modal-row span,
.revision-modal-row em {
  min-width: 0;
  overflow-wrap: anywhere;
}

.revision-modal-row span {
  color: var(--muted);
  font-size: 13px;
}

.revision-modal-row em {
  color: var(--red);
  font-size: 13px;
  font-style: normal;
  font-weight: 900;
}

.empty-state,
.empty-inline {
  padding: 14px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
  background: #fff;
}

.empty-inline {
  padding: 10px;
  font-size: 13px;
}

@media (orientation: landscape) and (max-height: 560px) {
  .detail-drawer {
    width: 100vw;
    padding: 10px max(12px, env(safe-area-inset-right)) 10px max(12px, env(safe-area-inset-left));
    gap: 8px;
  }

  .drawer-header {
    align-items: center;
  }

  .drawer-header h2 {
    font-size: 16px;
    line-height: 1.15;
  }

  .drawer-content {
    padding-bottom: 0;
  }

  .detail-stack,
  .execution-form,
  .execution-step {
    gap: 8px;
  }

  .detail-panel {
    padding: 10px;
    gap: 8px;
  }

  .sticky-summary {
    position: static;
  }

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

  .execution-step > .drawer-actions {
    padding: 8px 2px calc(8px + env(safe-area-inset-bottom));
  }

  .detail-drawer.signature-mode {
    width: 100vw;
  }

  .detail-drawer.signature-mode .drawer-header {
    display: none;
  }

  .detail-drawer.signature-mode .drawer-content {
    min-height: 0;
  }

  .signature-page {
    grid-template-columns: minmax(210px, 0.38fr) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 8px;
  }

  .signature-terminal-top {
    grid-column: 1;
    grid-row: 1;
    align-self: start;
  }

  .signature-pad-panel {
    grid-column: 2;
    grid-row: 1 / span 2;
    padding: 6px;
  }

  .signature-page .signature-canvas {
    height: 100%;
    min-height: 0;
  }

  .signature-terminal-actions {
    grid-column: 1;
    grid-row: 2;
    grid-template-columns: 1fr;
    align-self: end;
    padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
    border-top: 0;
  }

  .signature-terminal-actions .primary-btn,
  .signature-terminal-actions .ghost-btn {
    min-height: 46px;
  }
}

@media (max-width: 1100px) {
  .work-grid,
  .split-layout,
  .terrain-board,
  .admin-grid {
    grid-template-columns: 1fr;
  }

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

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

  .admin-users-panel {
    grid-column: auto;
  }
}

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

  .sidebar {
    min-height: auto;
  }

  .nav-list {
    grid-template-columns: repeat(7, minmax(128px, 1fr));
    overflow: auto;
  }

  .main-area {
    padding: 16px;
  }

  .topbar,
  .topbar-actions,
  .rental-card,
  .billing-row {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions {
    display: grid;
  }

  .summary-grid,
  .rental-form,
  .billing-row {
    grid-template-columns: 1fr 1fr;
  }

  .is-tech .sidebar {
    padding: 9px 12px;
  }

  .is-tech .profile-box {
    min-width: 120px;
  }

  .is-tech .timeline-wrap {
    margin-inline: -2px;
  }
}

@media (max-width: 560px) {
  :root {
    --row-head: 196px;
    --day: minmax(70px, 1fr);
  }

  .summary-grid,
  .rental-form,
  .admin-user-fields,
  .photo-grid,
  .vgp-equipment-switch,
  .machine-inventory-list,
  .admin-user-list,
  .machine-list,
  .mission-times,
  .billing-row {
    grid-template-columns: 1fr;
  }

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

  .login-logo {
    width: 220px;
  }

  .card-actions,
  .drawer-actions {
    justify-content: stretch;
  }

  .card-actions > *,
  .drawer-actions > * {
    flex: 1 1 auto;
  }

  .vgp-check-row {
    grid-template-columns: 1fr;
  }

  .machine-control-toolbar,
  .machine-control-row-head,
  .machine-control-nok-detail {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .machine-control-toolbar,
  .machine-control-row-head {
    flex-direction: column;
  }

  .machine-control-toolbar div {
    justify-content: stretch;
  }

  .machine-control-toolbar div > * {
    flex: 1 1 auto;
  }

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

  .vgp-characteristic-grid,
  .vgp-emergency-line,
  .vgp-cuts-row,
  .vgp-emergency-summary-box {
    grid-template-columns: 1fr;
  }

  .vgp-security-details {
    grid-template-columns: 1fr;
  }

  .detail-drawer {
    width: 100vw;
    padding: 12px;
    gap: 10px;
  }

  .is-tech .sidebar {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .is-tech .nav-list {
    grid-column: 1 / -1;
    order: 3;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
  }

  .is-tech .nav-item {
    width: 100%;
    min-width: 0;
  }

  .is-tech .brand-logo {
    width: 128px;
  }

  .is-tech .profile-box {
    display: none;
  }

  .is-tech .full-btn {
    min-height: 38px;
    padding: 7px 10px;
    font-size: 13px;
  }

  .is-tech .main-area {
    padding: 12px;
  }

  .is-tech .topbar {
    gap: 8px;
  }

  .is-tech .topbar h1 {
    font-size: 24px;
  }

  .is-tech .toolbar {
    grid-template-columns: 46px minmax(0, 1fr) 46px;
  }

  .tech-day-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .tech-mission-card {
    min-height: 0;
    padding: 11px;
  }

  .tech-mission-main strong {
    font-size: 17px;
  }

  .tech-mission-footer {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .tech-action-label {
    min-height: 36px;
  }

  .drawer-header {
    align-items: stretch;
  }

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

  .execution-step > .drawer-actions {
    margin-inline: -4px;
    padding: 9px 4px calc(12px + env(safe-area-inset-bottom));
  }

  .execution-step > .drawer-actions .primary-btn,
  .execution-step > .drawer-actions .ghost-btn {
    min-height: 48px;
  }

  .signature-page .signature-canvas {
    min-height: 300px;
  }

  .signature-terminal-actions {
    grid-template-columns: 0.8fr 1.2fr;
  }
}
