:root {
  --navy: #1A2332;
  --navy-light: #28344A;
  --orange: #FF6B35;
  --orange-dark: #E2521F;
  --cream: #F7F5F1;
  --white: #FFFFFF;
  --ink: #1A2332;
  --ink-soft: #5B6472;
  --line: #E2DED5;
  --green: #2D7D4F;
  --red: #C9402B;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 2px 10px rgba(26,35,50,0.08);
  --shadow-lg: 0 8px 28px rgba(26,35,50,0.16);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--cream);
  color: var(--ink);
  font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

#app {
  position: relative;
  height: 100vh;
  width: 100%;
  overflow: hidden;
}

.screen {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  background: var(--cream);
  overflow-y: auto;
  padding-bottom: env(safe-area-inset-bottom);
}
.screen.active { display: flex; }

/* ---------------- Loading ---------------- */
#screen-loading {
  align-items: center;
  justify-content: center;
  background: var(--navy);
  gap: 16px;
}
.loading-mark {
  width: 64px; height: 64px;
  border-radius: 16px;
  background: var(--orange);
  color: white;
  font-weight: 800;
  font-size: 22px;
  letter-spacing: 0.5px;
  display: flex; align-items: center; justify-content: center;
}
.loading-text { color: rgba(255,255,255,0.7); font-size: 14px; }

/* ---------------- Login ---------------- */
#screen-login {
  align-items: center;
  justify-content: center;
  background: var(--navy);
  padding: 24px;
}
.login-wrap { width: 100%; max-width: 360px; }
.brand {
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 36px;
}
.brand-logo-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 16px 24px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  justify-content: center;
}
.brand-logo {
  height: 48px;
  width: auto;
  max-width: 220px;
  object-fit: contain;
  display: block;
}

.login-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: var(--shadow-lg);
}
.login-card h1 {
  font-size: 20px;
  margin: 0 0 20px 0;
  color: var(--ink);
}

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field span { font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.field input, .confirm-select, input[type="date"].filter-input, input[type="time"]#confirm-time-input {
  font-size: 16px;
  padding: 13px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--line);
  background: var(--cream);
  color: var(--ink);
  width: 100%;
  font-family: inherit;
}
.field input:focus, .confirm-select:focus {
  outline: none;
  border-color: var(--orange);
}

.form-error {
  background: #FDEDEA;
  color: var(--red);
  border: 1px solid #F5C2B8;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 13.5px;
  margin-bottom: 14px;
}

/* ---------------- Buttons ---------------- */
.btn {
  font-size: 15.5px;
  font-weight: 700;
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.08s ease, opacity 0.15s ease;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-block { width: 100%; }
.btn-large { padding: 17px 20px; font-size: 16.5px; }
.btn-primary { background: var(--orange); color: white; }
.btn-primary:hover { background: var(--orange-dark); }
.btn-secondary { background: var(--navy); color: white; }
.btn-ghost { background: transparent; color: var(--ink-soft); margin-top: 8px; }
.icon-btn {
  background: transparent;
  border: none;
  font-size: 20px;
  color: var(--ink-soft);
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
}
.logout-btn {
  background: rgba(255,255,255,0.12);
  border: 1.5px solid rgba(255,255,255,0.3);
  border-radius: 999px;
  color: white;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 14px;
  cursor: pointer;
  white-space: nowrap;
}
.logout-btn:active {
  background: rgba(255,255,255,0.22);
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.logout-btn.btn-secondary-topbar {
  background: transparent;
  border-color: rgba(255,255,255,0.5);
}
.link-btn {
  background: none; border: none; color: var(--orange-dark);
  font-weight: 700; font-size: 13.5px; cursor: pointer; padding: 4px 0;
}

/* ---------------- Topbar ---------------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px 20px;
  background: var(--navy);
  color: white;
  flex-shrink: 0;
}
.topbar.topbar-plain { justify-content: flex-start; gap: 12px; }
.topbar-eyebrow {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--orange);
}
.topbar h1 { font-size: 19px; margin: 2px 0 0 0; color: white; }
.topbar .icon-btn { color: rgba(255,255,255,0.8); }

/* ---------------- Content ---------------- */
.content { flex: 1; padding: 18px 18px 28px 18px; }
.content-center { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 6px; padding: 40px 28px; }

.section-label {
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--ink-soft);
  margin: 18px 4px 10px 4px;
}

/* ---------------- Type toggle (drop-off / pick-up) ---------------- */
.type-toggle {
  display: flex;
  background: var(--white);
  border-radius: var(--radius);
  padding: 5px;
  box-shadow: var(--shadow);
  margin-top: 4px;
}
.type-toggle-btn {
  flex: 1;
  border: none;
  background: transparent;
  padding: 13px 0;
  font-weight: 700;
  font-size: 15px;
  color: var(--ink-soft);
  border-radius: 10px;
  cursor: pointer;
}
.type-toggle-btn.active {
  background: var(--navy);
  color: white;
}

/* ---------------- Worker grid ---------------- */
.worker-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.worker-btn {
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 14px;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  box-shadow: var(--shadow);
  min-height: 76px;
  display: flex;
  align-items: center;
}
.worker-btn:active { background: #FFF1EA; border-color: var(--orange); }

.empty-hint {
  color: var(--ink-soft);
  font-size: 14.5px;
  text-align: center;
  padding: 30px 20px;
  line-height: 1.5;
}

.recent-strip {
  flex-shrink: 0;
  background: var(--white);
  border-top: 1px solid var(--line);
  padding: 12px 18px 18px 18px;
}
.recent-strip-label { font-size: 12px; font-weight: 700; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; }
.recent-strip-list { display: flex; gap: 8px; overflow-x: auto; }
.recent-chip {
  flex-shrink: 0;
  background: var(--cream);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  white-space: nowrap;
}
.recent-chip b { color: var(--ink); }

/* ---------------- Confirm screen ---------------- */
.confirm-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-top: 6px;
}
.confirm-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.confirm-row:last-child { border-bottom: none; }
.confirm-label {
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ink-soft);
  flex-shrink: 0;
  min-width: 60px;
}
.confirm-value { font-size: 16.5px; font-weight: 700; color: var(--ink); }
.confirm-select { flex: 1; min-width: 140px; }
.time-edit { flex: 1; min-width: 140px; }
#confirm-time-input { font-weight: 700; }

.confirm-card .confirm-row:has(.confirm-value) { justify-content: flex-start; }

#confirm-error { margin-top: 16px; }
#confirm-submit-btn { margin-top: 22px; }

/* ---------------- Success screen ---------------- */
.success-mark {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: var(--green);
  color: white;
  font-size: 34px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 10px;
}
#screen-success h1 { font-size: 21px; margin: 0; }
.success-detail { color: var(--ink-soft); font-size: 14.5px; margin: 4px 0 26px 0; }
#screen-success .btn { max-width: 280px; }

/* ---------------- Admin ---------------- */
#screen-admin-home { background: var(--cream); }
.admin-tabs {
  display: flex;
  background: var(--navy);
  padding: 0 12px;
  flex-shrink: 0;
  overflow-x: auto;
}
.admin-tab {
  background: none; border: none;
  color: rgba(255,255,255,0.55);
  font-weight: 700;
  font-size: 14px;
  padding: 14px 14px;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
}
.admin-tab.active { color: white; border-bottom-color: var(--orange); }

.admin-panel { display: none; }
.admin-panel.active { display: block; }

.filter-row {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.filter-input { font-size: 14px; padding: 10px 12px; min-width: 0; flex: 1; }
#logs-export-btn { flex-shrink: 0; width: 100%; margin-top: 4px; }

.table-wrap { overflow-x: auto; background: white; border-radius: var(--radius); box-shadow: var(--shadow); }
.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 760px; }
#timesheet-table { min-width: 0; width: 100%; }
#timesheet-table th:first-child, #timesheet-table td:first-child { width: 30%; }
.data-table th {
  text-align: left;
  padding: 12px 14px;
  background: var(--navy);
  color: white;
  font-weight: 700;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  position: sticky; top: 0;
}
.data-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
}
.data-table tr:last-child td { border-bottom: none; }
.badge { padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; }
.badge-drop { background: #E8F3EC; color: var(--green); }
.badge-pick { background: #FDEDEA; color: var(--orange-dark); }
.row-delete-btn {
  background: none; border: none; color: var(--red); font-size: 13px; font-weight: 700; cursor: pointer;
}

.inline-add-form {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.inline-add-form input, .inline-add-form select {
  font-size: 14.5px;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--line);
  background: white;
  flex: 1;
  min-width: 0;
}
.inline-add-form-wide { flex-wrap: wrap; }
.inline-add-form-wide input, .inline-add-form-wide select { flex: 1 1 140px; }
.inline-add-form .btn { flex-shrink: 0; }

.list-wrap { display: flex; flex-direction: column; gap: 8px; }
.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: white;
  border-radius: var(--radius-sm);
  padding: 13px 14px;
  box-shadow: var(--shadow);
}
.list-item-name { font-weight: 700; font-size: 15px; }
.list-item-sub { font-size: 12.5px; color: var(--ink-soft); margin-top: 2px; }
.list-item-actions { display: flex; gap: 14px; align-items: center; }
.role-pill { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.4px; }
.manager-permissions-wrap {
  width: 100%;
  background: var(--cream);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 4px;
}
.manager-permissions-wrap:not([hidden]) {
  display: block;
}
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
  color: var(--ink);
  padding: 7px 0;
  cursor: pointer;
}
.checkbox-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-width: 18px;
  accent-color: var(--orange);
  cursor: pointer;
  margin: 0;
  flex: 0 0 auto;
}
.checkbox-row span.checkbox-label-text {
  flex: 0 1 auto;
}
.checkbox-row-hint-block {
  font-size: 12px;
  color: var(--ink-soft);
  margin: 0 0 6px 0;
}
.manager-permission-pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  background: #EEE9DF;
  color: var(--ink-soft);
  padding: 2px 8px;
  border-radius: 999px;
  margin: 2px 4px 0 0;
}

.role-pill-admin { background: #1A2332; color: white; }
.role-pill-manager { background: var(--orange); color: white; }
.role-pill-user { background: #EEE9DF; color: var(--ink-soft); }
.employment-pill-btn {
  border: none;
  cursor: pointer;
  margin-top: 4px;
  display: inline-block;
}
.toggle-btn { background: none; border: none; font-size: 12.5px; font-weight: 700; color: var(--ink-soft); cursor: pointer; }
.reset-password-btn {
  background: none;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-soft);
  cursor: pointer;
}
.disable-btn, .enable-btn, .edit-permissions-btn, .edit-material-btn {
  border: none;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
}
.edit-material-btn { background: #EEF1F5; color: var(--navy); }
.disable-btn { background: #FDEDEA; color: var(--red); }
.enable-btn { background: #E8F3EC; color: var(--green); }
.edit-permissions-btn { background: #EEF1F5; color: var(--navy); }
.list-item-actions-wrap { flex-wrap: wrap; justify-content: flex-end; gap: 8px; row-gap: 8px; }
.disabled-tag {
  font-size: 10.5px;
  font-weight: 800;
  color: var(--red);
  background: #FDEDEA;
  padding: 2px 7px;
  border-radius: 999px;
  vertical-align: middle;
}
.toggle-btn.is-inactive { color: var(--red); }

/* ---------------- 24-hour time picker ---------------- */
.confirm-row-time { align-items: center; }
.time-picker {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: var(--cream);
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--line);
  height: 140px;
  flex: 1;
  overflow: hidden;
}
.time-picker-col {
  flex: 1;
  height: 100%;
  overflow: hidden;
  position: relative;
}
.time-picker-scroll {
  height: 100%;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.time-picker-scroll::-webkit-scrollbar { display: none; }
.time-picker-scroll-pad {
  height: 56px;
  flex-shrink: 0;
}
.time-picker-option {
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  scroll-snap-align: center;
  font-size: 17px;
  font-weight: 700;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}
.time-picker-option.selected {
  color: var(--ink);
  font-size: 22px;
}
.time-picker-colon {
  font-size: 22px;
  font-weight: 800;
  color: var(--ink);
  padding: 0 2px;
}
.time-picker-highlight {
  position: absolute;
  top: 50%;
  left: 8px;
  right: 8px;
  height: 36px;
  transform: translateY(-50%);
  background: rgba(255,107,53,0.10);
  border-top: 1.5px solid var(--orange);
  border-bottom: 1.5px solid var(--orange);
  pointer-events: none;
  border-radius: 4px;
}

/* ---------------- Worker lock state ---------------- */
.worker-btn {
  position: relative;
}
.worker-btn.locked {
  background: #EDEAE3;
  border-color: var(--line);
  color: var(--ink-soft);
  cursor: not-allowed;
}
.worker-btn.locked:active { background: #EDEAE3; border-color: var(--line); }
.worker-lock-icon {
  margin-left: auto;
  font-size: 15px;
  opacity: 0.6;
}
.worker-btn-inner {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 8px;
}

/* ---------------- Timesheet table extras ---------------- */
#timesheet-table { min-width: 0; width: 100%; }
#timesheet-table th, #timesheet-table td { padding: 11px 10px; font-size: 12.5px; }
#timesheet-table td.ot-cell { color: var(--orange-dark); font-weight: 700; }
.logged-at-flagged {
  color: var(--red);
  font-weight: 700;
  background: #FDEDEA;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
}

/* ---------------- Backup reminder modal ---------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26,35,50,0.55);
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
}
.modal-overlay:not([hidden]) {
  display: flex;
}
.modal-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 26px 22px;
  max-width: 360px;
  width: 100%;
  box-shadow: var(--shadow-lg);
}
.modal-card h2 {
  font-size: 18px;
  margin: 0 0 10px 0;
  color: var(--ink);
}
.modal-card p {
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.5;
  margin: 0 0 20px 0;
}
.modal-card .btn-ghost { margin-top: 8px; }

/* ---------------- User menu (Attendance / Material Request choice) ---------------- */
.menu-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 20px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
  cursor: pointer;
  text-align: left;
}
.menu-tile:active { background: #FFF1EA; border-color: var(--orange); }
.menu-tile[hidden] { display: none; }
.menu-tile-icon { font-size: 32px; margin-bottom: 6px; }
.menu-tile-label { font-size: 18px; font-weight: 800; color: var(--ink); }
.menu-tile-sub { font-size: 13.5px; color: var(--ink-soft); }

/* ---------------- Material unit display (auto-shown, not editable) ---------------- */
.material-unit-display {
  background: var(--cream);
  border: 1.5px dashed var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 14.5px;
  color: var(--ink-soft);
  margin-bottom: 16px;
}
.material-unit-display strong { color: var(--ink); font-size: 15.5px; }

/* ---------------- Admin sub-tabs (Pending / Completed) ---------------- */
.sub-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.sub-tab {
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 9px 18px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink-soft);
  cursor: pointer;
}
.sub-tab.active {
  background: var(--navy);
  border-color: var(--navy);
  color: white;
}

/* ---------------- Tab notification badge ---------------- */
.admin-tab { position: relative; }
.tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--red);
  color: white;
  font-size: 11px;
  font-weight: 800;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  margin-left: 6px;
  padding: 0 5px;
}

.complete-btn {
  background: var(--green);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: 7px 14px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}
.reject-btn {
  background: var(--red);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: 7px 14px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}
.deliver-btn {
  background: var(--orange);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: 7px 14px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}
.action-cell {
  display: flex;
  gap: 6px;
  white-space: nowrap;
}
.completed-tag {
  font-size: 12px;
  font-weight: 700;
  color: var(--green);
}

.material-list-wrap {
  margin-bottom: 6px;
}
.material-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 8px;
  box-shadow: var(--shadow);
}
.material-item-info { font-size: 14px; color: var(--ink); }
.material-item-info b { font-weight: 700; }
.material-item-remove {
  background: none;
  border: none;
  color: var(--red);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  margin-left: 10px;
}
.confirm-list-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 16px;
}

/* ---------------- My Requests (foreman status view) ---------------- */
.my-request-card {
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.my-request-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}
.my-request-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}
.my-request-site {
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: 2px;
}
.status-pill {
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.status-pill.pending  { background: #FFF8E1; color: #B45309; }
.status-pill.partial  { background: #EEF1F5; color: var(--navy); }
.status-pill.completed { background: #E8F3EC; color: var(--green); }
.status-pill.rejected { background: #FDEDEA; color: var(--red); }
.my-request-detail {
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 4px;
}
.my-request-comment {
  font-size: 13px;
  color: var(--ink);
  background: var(--cream);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin-top: 8px;
  font-style: italic;
}
.my-request-progress {
  display: flex;
  gap: 12px;
  margin-top: 8px;
  font-size: 13px;
}
.my-request-progress span { color: var(--ink-soft); }
.my-request-progress strong { color: var(--ink); }

/* ---------------- Permits tab ---------------- */
.permits-upload-card {
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  margin-bottom: 6px;
}
.permits-form .field { margin-bottom: 14px; }
.field-hint {
  font-size: 11px;
  color: var(--ink-soft);
  font-weight: 400;
}
.permit-progress {
  font-size: 13.5px;
  color: var(--orange);
  font-weight: 600;
  margin-bottom: 10px;
}
.permit-item {
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 12px;
}
.permit-icon {
  font-size: 28px;
  flex-shrink: 0;
}
.permit-info { flex: 1; min-width: 0; }
.permit-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.permit-meta {
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 3px;
}
.permit-actions { display: flex; gap: 8px; flex-shrink: 0; }
.permit-view-btn {
  background: var(--navy);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: 7px 13px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
.permit-delete-btn {
  background: #FDEDEA;
  color: var(--red);
  border: none;
  border-radius: var(--radius-sm);
  padding: 7px 13px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.permits-site-group-label {
  font-size: 11px;
  font-weight: 800;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 18px 0 8px;
}

.confirm-row-shift {
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}
.shift-toggle {
  display: flex;
  gap: 10px;
  width: 100%;
}
.shift-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 10px;
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--white);
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-soft);
  cursor: pointer;
}
.shift-btn.active {
  border-color: var(--orange);
  background: #FFF3EC;
  color: var(--orange);
}
.shift-icon { font-size: 18px; }

.auto-timeout-tag {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 800;
  color: var(--red);
  background: #FDEDEA;
  padding: 3px 8px;
  border-radius: 999px;
  margin: 2px 4px 2px 0;
  white-space: nowrap;
}
.edited-tag {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--navy);
  background: #EEF1F5;
  padding: 3px 8px;
  border-radius: 999px;
  margin: 2px 4px 2px 0;
  white-space: nowrap;
}
.row-edit-btn {
  background: #EEF1F5;
  color: var(--navy);
  border: none;
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--navy);
  color: white;
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  z-index: 999;
}

@media (min-width: 480px) {
  .login-wrap, #screen-success .btn { max-width: 380px; }
}
