/* Pow Lee Crane Dashboard - app-specific styles */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body,
#root {
  width: 100%;
  max-width: 100%;
}

body {
  background: var(--color-grey-100);
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input, textarea, select {
  font-family: inherit;
  font-size: var(--text-base);
}

/* ============ APP SHELL ============ */
/* Sidebar + topbar stay put; only .content (inside .main) scrolls. Height/
   overflow-hidden are scoped to .app itself (not html/body/#root) so the
   pre-login pages (Login, etc.), which render outside .app, keep normal
   page scrolling on their own. */
.app {
  display: grid;
  grid-template-columns: 248px 1fr;
  height: 100vh;
  width: 100%;
  max-width: 100vw;
  overflow: hidden;
}

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

/* ============ SIDEBAR ============ */
.sidebar {
  background: var(--color-navy);
  color: var(--color-white);
  padding: 24px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 24px;
  border-right: 1px solid var(--color-navy-700);
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 8px 16px 8px;
  border-bottom: 1px solid var(--color-navy-700);
}

.sidebar__brand-mark {
  width: 36px;
  height: 36px;
  background: var(--color-yellow);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--color-navy);
  flex-shrink: 0;
}

.sidebar__brand-name {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.01em;
  font-size: 16px;
  line-height: 1.1;
}

.sidebar__brand-sub {
  font-size: 11px;
  color: rgba(255,255,255,0.55);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  margin-top: 2px;
}

.sidebar__group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar__group-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  padding: 8px 12px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  color: rgba(255,255,255,0.75);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  text-align: left;
  width: 100%;
  min-width: 0;
  position: relative;
}
.nav-item span { min-width: 0; overflow-wrap: break-word; }

.nav-item:hover {
  background: var(--color-navy-700);
  color: var(--color-white);
}

.nav-item--active {
  background: var(--color-yellow);
  color: var(--color-navy);
  font-weight: 600;
}

.nav-item--active:hover {
  background: var(--color-yellow);
  color: var(--color-navy);
}

.nav-item__badge {
  margin-left: auto;
  background: var(--color-danger);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

.nav-item--active .nav-item__badge {
  background: var(--color-navy);
  color: white;
}

.sidebar__footer {
  padding: 6px 12px 8px;
  border-bottom: 1px solid var(--color-navy-700);
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar__avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-yellow);
  color: var(--color-navy);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 11px;
  flex-shrink: 0;
}

.sidebar__user {
  flex: 1;
  min-width: 0;
}

.sidebar__user-name {
  font-size: 12px;
  font-weight: 600;
  color: white;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar__user-role {
  font-size: 10px;
  color: rgba(255,255,255,0.55);
}

/* ============ MAIN ============ */
.main {
  padding: 0;
  min-width: 0;
  max-width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.topbar {
  background: white;
  border-bottom: 1px solid var(--border-default);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  color: var(--color-navy);
}

.topbar__sub {
  color: var(--color-grey-500);
  font-size: 13px;
}

.topbar__search {
  flex: 1;
  max-width: 360px;
  margin-left: 24px;
  position: relative;
}

.topbar__search input {
  width: 100%;
  height: 40px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 0 12px 0 38px;
  font-size: 14px;
  background: var(--color-grey-50);
}
.topbar__search input:focus {
  outline: 2px solid var(--color-yellow);
  outline-offset: 0;
  border-color: var(--color-navy);
}

.topbar__search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-grey-500);
  pointer-events: none;
}

.topbar__mobile-search-btn {
  display: none;
}

.topbar__actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar__icon-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-grey-700);
  position: relative;
}

.topbar__icon-btn:hover { background: var(--color-grey-100); }

.topbar__icon-btn .dot {
  position: absolute;
  top: 8px;
  right: 9px;
  width: 8px;
  height: 8px;
  background: var(--color-danger);
  border-radius: 50%;
  border: 2px solid white;
}

.content {
  padding: 32px;
  min-width: 0;
  width: 100%;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

/* ============ CARDS ============ */
.card {
  background: white;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  min-width: 0;
  max-width: 100%;
}

.card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.card__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  color: var(--color-navy);
}

/* ============ STAT CARDS ============ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

.stat-card {
  background: white;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: all var(--duration-base) var(--ease-out);
}

.stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.stat-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.stat-card__icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--color-grey-100);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-navy);
}

.stat-card__icon--yellow {
  background: rgba(255,193,7,0.15);
  color: var(--color-yellow-700);
}

.stat-card__icon--green { background: rgba(34,197,94,0.12); color: var(--color-success); }
.stat-card__icon--red { background: rgba(239,68,68,0.12); color: var(--color-danger); }
.stat-card__icon--blue { background: rgba(59,130,246,0.12); color: var(--color-info); }

.stat-card__label {
  font-size: 13px;
  color: var(--color-grey-500);
  font-weight: 500;
  margin-bottom: 4px;
}

.stat-card__value {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 800;
  color: var(--color-navy);
  letter-spacing: -0.02em;
  line-height: 1;
  margin-bottom: 8px;
}

.stat-card__delta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
}

.stat-card__delta--up { color: var(--color-success); }
.stat-card__delta--down { color: var(--color-danger); }

/* Clickable stat card (Highest Earning Crane → Top 5) */
.stat-card--action {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  cursor: pointer;
  padding-bottom: 34px; /* room for the Top 5 affordance */
}
.stat-card--action:focus-visible { outline: 2px solid var(--color-yellow); outline-offset: 2px; }
.stat-card__more {
  position: absolute;
  right: 16px;
  bottom: 14px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--color-navy);
  opacity: 0.7;
  transition: opacity var(--duration-base) var(--ease-out), gap var(--duration-base) var(--ease-out);
}
.stat-card--action:hover .stat-card__more { opacity: 1; gap: 6px; }

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 14px;
  transition: all var(--duration-fast) var(--ease-out);
  white-space: nowrap;
}

.btn--primary {
  background: var(--color-yellow);
  color: var(--color-navy);
}
.btn--primary:hover { background: var(--color-yellow-600); }
.btn--primary:active { background: var(--color-yellow-700); }

.btn--navy {
  background: var(--color-navy);
  color: white;
}
.btn--navy:hover { background: var(--color-navy-700); }

.btn--ghost {
  background: white;
  color: var(--color-navy);
  border: 1px solid var(--border-default);
}
.btn--ghost:hover { background: var(--color-grey-50); border-color: var(--color-grey-300); }

.btn--danger {
  background: var(--color-danger);
  color: white;
}

.btn--success { background: var(--color-success); color: white; }

.btn--lg {
  height: 56px;
  padding: 0 24px;
  font-size: 16px;
  border-radius: var(--radius-md);
}

.btn--block { width: 100%; }

/* ============ QUICK ACTIONS ============ */
.qa-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

@media (max-width: 1100px) {
  .qa-grid { grid-template-columns: repeat(3, 1fr); }
}

.qa-btn {
  background: white;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  text-align: left;
  transition: all var(--duration-base) var(--ease-out);
  min-height: 110px;
}

.qa-btn:hover {
  border-color: var(--color-navy);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.qa-btn__icon {
  width: 36px;
  height: 36px;
  background: var(--color-yellow);
  color: var(--color-navy);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.qa-btn__icon--navy { background: var(--color-navy); color: white; }

.qa-btn__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  color: var(--color-navy);
}

.qa-btn__sub {
  font-size: 12px;
  color: var(--color-grey-500);
}

/* ============ TABLE ============ */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-grey-500);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-default);
  background: var(--color-grey-50);
}

.table td {
  padding: 16px;
  border-bottom: 1px solid var(--border-default);
  color: var(--color-grey-900);
}

.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--color-grey-50); }

.table-wrap {
  background: white;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  overflow: hidden;
  max-width: 100%;
}

/* ============ BADGES / STATUS ============ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.badge--gray { background: var(--color-grey-100); color: var(--color-grey-700); }
.badge--blue { background: rgba(59,130,246,0.12); color: var(--color-info); }
.badge--green { background: rgba(34,197,94,0.14); color: #15803d; }
.badge--yellow { background: rgba(255,193,7,0.18); color: #9a6500; }
.badge--orange { background: rgba(245,158,11,0.16); color: #b45309; }
.badge--red { background: rgba(239,68,68,0.12); color: var(--color-danger); }
.badge--navy { background: var(--color-navy); color: white; }
.badge--purple { background: rgba(168, 85, 247, 0.12); color: #7e22ce; }

.badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.badge--no-dot::before { display: none; }

/* ============ FORMS ============ */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px 24px;
}

.form-grid--full > * { grid-column: 1 / -1; }
.full { grid-column: 1 / -1; }
/* Field pairs that must stay side by side inside the narrow booking drawer.
   minmax(0,1fr) + min-width:0 stops wide selects forcing horizontal overflow;
   below 560px they stack like the rest of the form. */
.plc-pair-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.plc-pair-row > * { min-width: 0; }
@media (max-width: 560px) { .plc-pair-row { grid-template-columns: 1fr; } }

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-navy);
}

.field input,
.field select,
.field textarea {
  height: 42px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 0 12px;
  font-size: 14px;
  background: white;
  color: var(--color-grey-900);
  transition: border-color var(--duration-fast) var(--ease-out);
}

.field textarea {
  height: auto;
  padding: 12px;
  min-height: 90px;
  resize: vertical;
  line-height: 1.5;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 2px solid var(--color-yellow);
  outline-offset: 0;
  border-color: var(--color-navy);
}

.field__hint {
  font-size: 12px;
  color: var(--color-grey-500);
}

.radio-group {
  display: flex;
  gap: 8px;
}

.radio-chip {
  flex: 1;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  background: white;
  color: var(--color-navy);
  cursor: pointer;
}

.radio-chip--active {
  border-color: var(--color-navy);
  background: var(--color-navy);
  color: white;
}

.upload-zone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-md);
  padding: 32px;
  text-align: center;
  background: var(--color-grey-50);
  color: var(--color-grey-500);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}

.upload-zone:hover {
  border-color: var(--color-navy);
  color: var(--color-navy);
  background: white;
}

.upload-zone--filled {
  border-style: solid;
  border-color: var(--color-success);
  background: rgba(34,197,94,0.06);
  color: var(--color-grey-900);
}

/* ============ CAUTION STRIPE ============ */
.caution-stripe {
  height: 6px;
  background: repeating-linear-gradient(
    -45deg,
    var(--color-yellow) 0,
    var(--color-yellow) 14px,
    var(--color-navy) 14px,
    var(--color-navy) 28px
  );
}

/* ============ TOAST ============ */
.toast {
  position: fixed;
  top: 24px;
  right: 24px;
  background: var(--color-navy);
  color: white;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 1000;
  animation: slideIn 240ms var(--ease-out);
  max-width: 360px;
}

.toast--success {
  background: var(--color-success);
}
@media (max-width: 480px) {
  .toast { left: 16px; right: 16px; top: 16px; max-width: none; }
}

@keyframes slideIn {
  from { transform: translateX(20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ============ MY JOB (MOBILE) — normal page layout ============ */
.mjob-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.mjob-tab {
  position: relative;
  flex: 1;
  min-width: 150px;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: white;
  color: var(--color-grey-600);
  border: 2px solid var(--color-grey-200);
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
}

.mjob-tab--active {
  background: var(--color-navy);
  color: white;
  border-color: var(--color-navy);
  box-shadow: 0 2px 8px rgba(11, 31, 58, 0.22);
}

.mjob-tab__label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
}

.mjob-tab__sub { font-size: 13px; }

.mjob-tab__lock {
  position: absolute;
  top: 10px;
  right: 12px;
  opacity: 0.7;
}

/* Phone: keep all three day tabs in one tidy row instead of wrapping 2 + 1. */
@media (max-width: 560px) {
  .mjob-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
  .mjob-tab {
    flex: none;
    min-width: 0;
    padding: 10px 8px;
  }
  .mjob-tab__label { font-size: 10px; letter-spacing: 0.04em; }
  .mjob-tab__sub { font-size: 11px; }
  .mjob-tab__lock { top: 7px; right: 7px; }
}

.mjob-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr));
  gap: 16px;
}
.page:has(> .mjob-grid) { max-width: none; }

.mjob-card {
  background: white;
  border: 1px solid var(--border-default);
  border-radius: 14px;
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

/* ============ MOBILE FRAME (Completion page) ============ */
.phone-frame {
  width: 380px;
  background: var(--color-navy);
  border-radius: 44px;
  padding: 12px;
  box-shadow: var(--shadow-xl);
  margin: 0 auto;
}

.phone-frame__inner {
  background: white;
  border-radius: 32px;
  overflow: hidden;
  height: 760px;
  display: flex;
  flex-direction: column;
  position: relative;
}

.phone-status {
  background: white;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  font-size: 13px;
  font-weight: 700;
  color: var(--color-navy);
  flex-shrink: 0;
}

.phone-content {
  flex: 1;
  overflow-y: auto;
}

/* ============ TOGGLE ============ */
.toggle {
  width: 44px;
  height: 26px;
  background: var(--color-grey-300);
  border-radius: 999px;
  position: relative;
  transition: background var(--duration-fast) var(--ease-out);
  flex-shrink: 0;
  cursor: pointer;
  border: none;
}

.toggle::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  transition: transform var(--duration-fast) var(--ease-out);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.toggle--on {
  background: var(--color-navy);
}
.toggle--on::after {
  transform: translateX(18px);
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-default);
}

.toggle-row:last-child { border-bottom: none; }

/* ============ NOTIFICATION CARD ============ */
.notif-card {
  display: flex;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: white;
  margin-bottom: 8px;
  align-items: flex-start;
}

.notif-card--unread {
  border-left: 3px solid var(--color-yellow);
  background: rgba(255,193,7,0.04);
}

.notif-card__icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--color-grey-100);
  color: var(--color-navy);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.notif-card__icon--urgent { background: rgba(239,68,68,0.12); color: var(--color-danger); }
.notif-card__icon--info { background: rgba(59,130,246,0.12); color: var(--color-info); }
.notif-card__icon--success { background: rgba(34,197,94,0.12); color: var(--color-success); }

.notif-card__body { flex: 1; min-width: 0; }
.notif-card__title { font-weight: 600; color: var(--color-navy); font-size: 14px; }
.notif-card__msg { font-size: 13px; color: var(--color-grey-500); margin-top: 2px; line-height: 1.5; }
.notif-card__time { font-size: 12px; color: var(--color-grey-400); margin-top: 6px; }

/* ============ CHARTS ============ */
.chart-bar {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  height: 200px;
  padding: 12px 0;
}

.chart-bar__col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  height: 100%;
}

.chart-bar__bar-wrap {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  position: relative;
}

.chart-bar__bar {
  width: 100%;
  background: var(--color-navy);
  border-radius: 4px 4px 0 0;
  position: relative;
  transition: opacity var(--duration-fast) var(--ease-out);
}

.chart-bar__col:hover .chart-bar__bar { opacity: 0.85; }
.chart-bar__bar--accent { background: var(--color-yellow); }

.chart-bar__label {
  font-size: 11px;
  color: var(--color-grey-500);
  font-weight: 600;
}

/* Donut */
.donut {
  width: 180px;
  height: 180px;
  position: relative;
}

.donut svg { transform: rotate(-90deg); }

.donut__center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.donut__value {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 32px;
  color: var(--color-navy);
}

/* ============ SIGNATURE PAD ============ */
.sig-pad {
  width: 100%;
  height: 220px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--color-grey-50);
  cursor: crosshair;
  display: block;
  touch-action: none;
}

/* ============ MAPPING TABLE ============ */
.map-row {
  display: grid;
  grid-template-columns: 1fr 60px 1fr;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-default);
  font-size: 14px;
}

.map-row:last-child { border-bottom: none; }

.map-row__arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-yellow-700);
}

.map-row__source { font-weight: 600; color: var(--color-navy); }
.map-row__dest {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--color-grey-700);
  background: var(--color-grey-100);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  display: inline-block;
}

/* ============ LOGIN PAGE ============ */
.login {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

@media (max-width: 900px) {
  .login { grid-template-columns: 1fr; }
  .login__hero { display: none; }
}

.login__hero {
  background: var(--color-navy);
  color: white;
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.login__hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 90% 10%, rgba(255,193,7,0.12), transparent 50%),
    linear-gradient(180deg, transparent 60%, rgba(0,0,0,0.4));
  pointer-events: none;
}

.login__brand {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
}

.login__brand-mark {
  width: 44px;
  height: 44px;
  background: var(--color-yellow);
  color: var(--color-navy);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.login__brand-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
}

.login__hero-content {
  position: relative;
  z-index: 1;
}

.login__eyebrow {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-yellow);
  margin-bottom: 16px;
}

.login__hero h1 {
  font-size: 44px;
  color: white;
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-weight: 800;
  margin-bottom: 16px;
  max-width: 480px;
}

.login__hero p {
  color: rgba(255,255,255,0.7);
  max-width: 460px;
  font-size: 16px;
  line-height: 1.55;
}

.login__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  position: relative;
  z-index: 1;
  padding-top: 32px;
  border-top: 1px solid rgba(255,255,255,0.15);
}

.login__stat-num {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 28px;
  color: var(--color-yellow);
}

.login__stat-label {
  font-size: 12px;
  color: rgba(255,255,255,0.6);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
}

.login__form-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  background: white;
}

.login__form {
  width: 100%;
  max-width: 380px;
}

.login__form h2 {
  font-size: 28px;
  margin-bottom: 8px;
}

.login__form-sub {
  color: var(--color-grey-500);
  font-size: 14px;
  margin-bottom: 32px;
}

.role-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 24px;
}

.role-chip {
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-grey-700);
  text-align: center;
  cursor: pointer;
  background: white;
  transition: all var(--duration-fast) var(--ease-out);
}
.role-chip:hover { border-color: var(--color-navy); }
.role-chip--active {
  border-color: var(--color-navy);
  background: var(--color-navy);
  color: white;
}

/* ============ TWO-COL ============ */
.two-col {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

@media (max-width: 1100px) {
  .two-col { grid-template-columns: 1fr; }
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-title h2 {
  font-size: 20px;
  color: var(--color-navy);
}

.section-title__sub {
  font-size: 13px;
  color: var(--color-grey-500);
}

/* ============ TIMELINE ============ */
.timeline {
  position: relative;
  padding-left: 24px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--border-default);
}

.timeline-item {
  position: relative;
  padding-bottom: 18px;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -21px;
  top: 4px;
  width: 14px;
  height: 14px;
  background: white;
  border: 2px solid var(--color-grey-300);
  border-radius: 50%;
}

.timeline-item--done::before {
  background: var(--color-success);
  border-color: var(--color-success);
}

.timeline-item--current::before {
  background: var(--color-yellow);
  border-color: var(--color-yellow);
  box-shadow: 0 0 0 4px rgba(255,193,7,0.25);
}

.timeline-item__title { font-weight: 600; font-size: 14px; color: var(--color-navy); }
.timeline-item__time { font-size: 12px; color: var(--color-grey-500); margin-top: 2px; }

/* Class-based mobile fallback: mirrors the max-width:900px rules below but is
   driven by JS reading the device's real screen width (see plc-mobile-detect
   inline script in each page head). Protects against browsers that report a
   spoofed/desktop viewport width to CSS media queries (e.g. a "Desktop site"
   toggle) while the physical screen is a phone/tablet, which otherwise left
   the sidebar rendered inline instead of off-canvas and caused page-wide
   horizontal + vertical scrollbars. */
html.plc-mobile #root {
  overflow-x: hidden !important;
  max-width: 100vw !important;
}
html.plc-mobile .app { grid-template-columns: 1fr !important; }
html.plc-mobile .sidebar {
  position: fixed !important;
  z-index: 100;
  top: 0 !important;
  left: 0 !important;
  transform: translateX(-100%) !important;
  transition: transform 240ms var(--ease-out);
  width: 248px !important;
}
html.plc-mobile .sidebar--open { transform: translateX(0) !important; }
html.plc-mobile .content { padding: 16px !important; }
html.plc-mobile .topbar { padding: 12px 16px !important; flex-wrap: nowrap !important; }
html.plc-mobile .topbar__search { display: none !important; }
html.plc-mobile .topbar__mobile-search-btn { display: inline-flex !important; }
html.plc-mobile .topbar > div:not(.topbar__actions) { min-width: 0; flex: 1 1 auto; overflow: hidden; }
html.plc-mobile .topbar__title { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.plc-mobile .topbar__sub { display: none !important; }
html.plc-mobile .topbar__actions { flex-shrink: 0; gap: 4px !important; }

html, body { overscroll-behavior-x: none; touch-action: pan-y; }

/* MOBILE RESPONSIVE for shell */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform 240ms var(--ease-out);
    width: 248px;
  }
  .sidebar--open { transform: translateX(0); }
  .content { padding: 16px; }
  .topbar { padding: 12px 16px; flex-wrap: nowrap; }
  .topbar > div:not(.topbar__actions) { min-width: 0; flex: 1 1 auto; overflow: hidden; }
  .topbar__title { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar__sub { display: none; }
  .topbar__actions { flex-shrink: 0; gap: 4px; }
  .topbar__search { display: none; }
  .topbar__mobile-search-btn { display: inline-flex; }
  .topbar__search--mobile-open {
    display: block;
    position: absolute !important;
    left: 16px;
    right: 16px;
    top: calc(100% + 8px);
    z-index: 80;
    margin-left: 0;
    max-width: none;
    background: white;
    border-radius: var(--radius-md);
    box-shadow: 0 14px 36px rgba(11, 31, 58, 0.18);
  }
  .qa-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* App-wide table-to-card transform for phone/tablet.
   table-responsive.js supplies each cell's data-label from its column header. */
@media (max-width: 900px) {
  .plc-responsive-table-wrap {
    overflow-x: visible !important;
    overflow-y: visible !important;
  }

  table[data-plc-responsive-table="1"] {
    display: block;
    width: 100% !important;
    min-width: 0 !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    font-size: 13px;
  }

  table[data-plc-responsive-table="1"] thead {
    display: none !important;
  }

  table[data-plc-responsive-table="1"] tbody,
  table[data-plc-responsive-table="1"] tr,
  table[data-plc-responsive-table="1"] td {
    display: block;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  table[data-plc-responsive-table="1"] tr {
    margin: 10px 0;
    border: 1px solid var(--border-default);
    border-radius: 12px;
    background: var(--color-white);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
  }

  table[data-plc-responsive-table="1"] tr:hover td {
    background: transparent;
  }

  table[data-plc-responsive-table="1"] td {
    display: grid;
    grid-template-columns: minmax(92px, 38%) minmax(0, 1fr);
    align-items: start;
    gap: 12px;
    padding: 11px 14px !important;
    border-bottom: 1px solid var(--color-grey-100) !important;
    color: var(--color-grey-900);
    overflow-wrap: anywhere;
    text-align: right;
  }

  table[data-plc-responsive-table="1"] td:last-child {
    border-bottom: none !important;
  }

  table[data-plc-responsive-table="1"] td::before {
    content: attr(data-label);
    color: var(--color-grey-500);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-align: left;
  }

  table[data-plc-responsive-table="1"] td[data-label=""],
  table[data-plc-responsive-table="1"] td:not([data-label]) {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
  }

  table[data-plc-responsive-table="1"] td[data-label=""]::before,
  table[data-plc-responsive-table="1"] td:not([data-label])::before {
    content: none;
  }

  table[data-plc-responsive-table="1"] .plc-table-section-row {
    border-color: var(--color-navy);
    background: var(--color-navy);
  }

  table[data-plc-responsive-table="1"] .plc-table-section-row td {
    display: block;
    text-align: left;
    border-bottom: none !important;
    background: var(--color-navy) !important;
  }
}

.menu-btn {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  align-items: center;
  justify-content: center;
  color: var(--color-navy);
}
@media (max-width: 900px) {
  .menu-btn { display: flex; }
}

.scrim {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(11,31,58,0.5);
  z-index: 99;
}
.scrim--open { display: block; }

/* === Brand logo (real artwork) === */
.sidebar__brand {
  padding: 4px 4px 18px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  min-width: 0;
}
.sidebar__brand-logo {
  height: 44px;
  width: auto;
  display: block;
  flex-shrink: 0;
}
.sidebar__brand-title {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.4;
  color: rgba(255,255,255,0.85);
  max-width: 190px;
}

.login__brand {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 0;
}
.login__brand-logo {
  height: 56px;
  width: auto;
  display: block;
}
.login__brand-name {
  padding-left: 18px;
  border-left: 1px solid rgba(255,255,255,0.22);
  font-family: var(--font-display);
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-width: 340px;
}
.login__brand-en {
  display: block;
  width: 100%;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0.15em;
  color: rgba(255,255,255,0.78);
  text-transform: uppercase;
}
.login__brand-zh {
  display: block;
  width: 100%;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.22em;
  color: #fff;
}
@media (max-width: 600px) {
  .login__brand-logo { height: 44px; }
  .login__brand-name { padding-left: 14px; max-width: 200px; gap: 5px; }
  .login__brand-en { font-size: 10px; letter-spacing: 0.12em; }
  .login__brand-zh { font-size: 14px; letter-spacing: 0.18em; }
}

/* === PWA install banner === */
.install-banner {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 520px;
  background: white;
  border: 1px solid var(--border-default);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(11,31,58,0.18), 0 4px 8px rgba(11,31,58,0.08);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 200;
  animation: install-slide-up 280ms cubic-bezier(0.22,1,0.36,1) both;
}
@keyframes install-slide-up {
  from { transform: translate(-50%, 24px); opacity: 0; }
  to   { transform: translate(-50%, 0);    opacity: 1; }
}
.install-banner__icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--color-navy);
}
.install-banner__icon img { display: block; width: 100%; height: 100%; }
.install-banner__body { flex: 1; min-width: 0; }
.install-banner__title {
  font-weight: 700;
  font-size: 14px;
  color: var(--color-navy);
  line-height: 1.3;
}
.install-banner__sub {
  font-size: 12px;
  color: var(--color-grey-600);
  margin-top: 2px;
  line-height: 1.4;
}
.install-banner__actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.install-banner__close {
  background: transparent;
  border: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: var(--color-grey-500);
  cursor: pointer;
}
.install-banner__close:hover { background: var(--color-grey-100); color: var(--color-navy); }

@media (max-width: 480px) {
  .install-banner__sub { display: none; }
}

/* iOS install instructions modal */
.install-modal {
  position: fixed;
  inset: 0;
  background: rgba(11,31,58,0.6);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: install-fade-in 180ms ease both;
}
@keyframes install-fade-in { from { opacity: 0; } to { opacity: 1; } }
.install-modal__card {
  background: white;
  border-radius: 14px;
  padding: 20px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 20px 48px rgba(11,31,58,0.25);
  animation: install-modal-up 220ms cubic-bezier(0.22,1,0.36,1) both;
}

/* Searchable Workshop dropdowns live inside a scrolling modal. On narrow
   touch screens keep the option list in document flow so it cannot be clipped
   below the scroll viewport, and let the modal retain its current position. */
@media (max-width: 640px), (pointer: coarse) {
  .rm-editable-options {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    max-height: 210px !important;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
  .rm-form-scroll {
    overflow-anchor: auto;
  }
}
@keyframes install-modal-up { from { transform: translateY(8px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ------------------------------------------------------------------
   Booking drawer — slide-out side panel for New / Modify Booking
   ------------------------------------------------------------------ */
.wo-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11,31,58,0.45);
  z-index: 250;
  display: flex;
  justify-content: flex-end;
  animation: install-fade-in 180ms ease-out both;
}
.wo-drawer {
  background: #fff;
  /* Never wider than half the viewport on desktop; on phones it still needs
     nearly the full width to stay usable. */
  width: min(760px, 50vw);
  height: 100%;
  display: flex;
  flex-direction: column;
  box-shadow: -16px 0 48px rgba(11,31,58,0.22);
  animation: wo-drawer-in 280ms cubic-bezier(0.22,1,0.36,1) both;
}
@keyframes wo-drawer-in { from { transform: translateX(100%); } to { transform: translateX(0); } }
.wo-drawer__inner {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.wo-drawer__head {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-default, #e5e7eb);
  background: #fff;
}
.wo-drawer__close {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--color-navy, #0B1F3A);
  background: transparent;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 140ms ease;
}
.wo-drawer__close:hover { background: var(--color-grey-100, #f1f3f5); }
.wo-drawer__title {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-navy, #0B1F3A);
  flex: 1;
  min-width: 0;
}
.wo-drawer__head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.wo-drawer__body {
  flex: 1;
  overflow-y: auto;
  /* No bottom padding: the sticky action bar (.wo-drawer__actions) closes the
     scrollport. Sticky insets resolve against the padding box, so any
     padding-bottom here would park the bar above the drawer's bottom edge. */
  padding: 24px 28px 16px;
}
/* Drawer footer: a flex sibling of the scrolling body (like .wo-drawer__head),
   so it is pinned flush to the drawer's bottom edge with no gap under it.
   Kept compact — the buttons drop to regular height, not btn--lg. */
.wo-drawer__actions {
  flex-shrink: 0;
  z-index: 5;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  align-items: center;
  background: #fff;
  border-top: 1px solid var(--border-default);
  margin: 0;
  padding: 8px 28px;
}
.wo-drawer__inner > .wo-drawer__actions .btn { min-height: 40px; height: 40px; padding: 0 16px; font-size: 14px; }
@media (max-width: 640px) {
  .wo-drawer__actions { margin: 0; padding: 6px 16px; gap: 8px; }
  .wo-drawer__head { padding: 12px 16px; gap: 10px; }
  .wo-drawer__head-actions { gap: 6px; }
  .wo-drawer__title { font-size: 17px; }
  .wo-drawer__body { padding: 16px 16px 12px; }
}

.install-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.install-steps li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.install-steps__num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-navy);
  color: var(--color-yellow);
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.install-steps__title { font-weight: 600; font-size: 14px; color: var(--color-navy); line-height: 1.3; }
.install-steps__desc  { font-size: 13px; color: var(--color-grey-600); margin-top: 2px; line-height: 1.45; }


/* ============================================================
   iOS SAFE AREA + NO HORIZONTAL PAN  (iPhone notch / Dynamic Island)
   Pages use viewport-fit=cover + black-translucent status bar, so the
   app draws UNDER the iPhone status bar. Pad the top chrome by the real
   safe-area inset (0 on Android/desktop, so this is iPhone-only in effect)
   and lock the document against sideways panning/rubber-banding.
   ============================================================ */
html, body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  overscroll-behavior-x: none;
  -webkit-text-size-adjust: 100%;
}
body { position: relative; }
#root, .app, .content, .page { max-width: 100%; }
#root { overflow-x: hidden; }

/* Top chrome clears the notch / status bar */
.topbar {
  padding-top: calc(16px + env(safe-area-inset-top));
  padding-left: calc(32px + env(safe-area-inset-left));
  padding-right: calc(32px + env(safe-area-inset-right));
}
.sidebar { padding-top: calc(24px + env(safe-area-inset-top)); }

@media (max-width: 900px) {
  .topbar {
    padding-top: calc(12px + env(safe-area-inset-top));
    padding-left: calc(16px + env(safe-area-inset-left));
    padding-right: calc(16px + env(safe-area-inset-right));
  }
  .content { padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
}
html.plc-mobile .topbar {
  padding-top: calc(12px + env(safe-area-inset-top)) !important;
  padding-left: calc(16px + env(safe-area-inset-left)) !important;
  padding-right: calc(16px + env(safe-area-inset-right)) !important;
}
html.plc-mobile .content { padding-bottom: calc(16px + env(safe-area-inset-bottom)) !important; }
html.plc-mobile #root, html.plc-mobile .app { max-width: 100% !important; }

/* Fixed overlays respect the insets too */
.install-banner { bottom: calc(16px + env(safe-area-inset-bottom)); }
.toast { top: calc(24px + env(safe-area-inset-top)); }

/* Compact repair-ticket panel (R&M › Repair Tickets) — denser than the default
   table card so the open queue reads at a glance. */
.rm-compact .card__header{padding:9px 14px}
.rm-compact .card__title{font-size:14px}
.rm-compact .card__header .btn{padding:6px 11px;font-size:12px;gap:5px}
.rm-compact .table th{padding:8px 12px;font-size:10.5px}
.rm-compact .table td{padding:9px 12px;font-size:13px}
.rm-compact .status{padding:2px 7px;font-size:10.5px}
/* Phones: tighter header — title and action button stay on one row. */
@media (max-width: 640px){
  .rm-compact .card__header{padding:7px 10px;gap:6px;flex-wrap:nowrap;align-items:center}
  .rm-compact .card__title{font-size:12.5px;line-height:1.2}
  .rm-compact .card__header .btn{flex:0 0 auto;padding:5px 8px;font-size:11px;gap:3px;white-space:nowrap}
}

/* Compact repair-ticket rows (R&M › Repair Tickets) — one dense row per ticket,
   stacking cleanly on phones instead of a 7-column table. */
.rm-ticket{display:flex;align-items:flex-start;gap:10px;padding:9px 14px;border-bottom:1px solid var(--color-grey-100);cursor:pointer}
.rm-ticket:hover{background:var(--color-grey-50)}
.rm-ticket__main{flex:1;min-width:0}
.rm-ticket__top{display:flex;align-items:baseline;gap:8px;flex-wrap:wrap}
.rm-ticket__id{font-family:var(--font-mono,monospace);font-size:11px;color:var(--color-grey-500)}
.rm-ticket__machine{font-weight:600;font-size:13.5px;color:var(--color-navy)}
.rm-ticket__issue{font-size:13px;color:var(--color-grey-700);margin-top:1px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.approval-card__changes{display:flex;flex-wrap:wrap;gap:6px;margin-top:7px}
.approval-change{display:inline-flex;align-items:center;gap:4px;padding:5px 8px;border-radius:7px;background:var(--color-grey-100);color:var(--color-grey-700);font-size:12.5px;line-height:1.35}
.approval-change--primary{background:rgba(22,163,74,.10);color:#166534;font-weight:700}
.approval-card__changes--danger{color:var(--color-danger);font-weight:700;font-size:13px}
.approval-card__changes--muted{color:var(--color-grey-500);font-size:13px}
.approval-card__meta{margin-top:8px}
@media (max-width:640px){.approval-card{align-items:flex-start}.approval-card__changes{display:grid;grid-template-columns:1fr;width:100%}.approval-change{width:100%;box-sizing:border-box}.approval-card__meta{display:grid;gap:4px}}
.rm-ticket-photo{margin:0 0 18px;padding:12px;border:1px solid var(--color-grey-200);border-radius:10px;background:var(--color-grey-50)}
.rm-ticket-photo__heading{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:8px}
.rm-ticket-photo__empty{font-size:12.5px;color:var(--color-grey-500)}
.rm-ticket-photo__empty--error{color:var(--color-danger)}
.rm-ticket-photo__thumbnail-wrap{position:relative}
.rm-ticket-photo__gallery{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.rm-ticket-photo__gallery .rm-ticket-photo__thumbnail img{height:110px}
.rm-ticket-photo__thumbnail{display:block;width:100%;padding:0;border:1px solid var(--color-grey-200);border-radius:9px;background:white;overflow:hidden;cursor:pointer;text-align:left;color:var(--color-grey-600)}
.rm-ticket-photo__thumbnail img{display:block;width:100%;height:150px;object-fit:contain;background:var(--color-grey-100)}
.rm-ticket-photo__thumbnail span{display:block;padding:7px 10px;font-size:11.5px}
.rm-ticket-photo__thumbnail-delete{position:absolute;top:7px;right:7px;display:flex;align-items:center;justify-content:center;width:30px;height:30px;padding:0;border:1px solid rgba(220,38,38,.35);border-radius:50%;background:rgba(255,255,255,.94);color:var(--color-danger);cursor:pointer;box-shadow:0 2px 8px rgba(11,31,58,.16)}
.rm-ticket-photo__thumbnail-delete:hover{background:#fff1f2}
.rm-ticket-photo__thumbnail-delete:disabled{cursor:not-allowed;opacity:.55}
.rm-ticket-photo__preview{display:flex;align-items:center;gap:9px;padding:8px;background:white;border:1px solid var(--color-grey-200);border-radius:9px}
.rm-ticket-photo__preview img{width:48px;height:48px;object-fit:cover;border-radius:7px;flex-shrink:0}
.rm-ticket-photo__summary{display:flex;flex:1;min-width:0;flex-direction:column;font-size:12.5px;color:var(--color-navy)}
.rm-ticket-photo__summary span{font-size:11.5px;color:var(--color-grey-500);overflow-wrap:anywhere}
.rm-ticket-photo__actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:9px}
.rm-ticket-photo__delete{color:var(--color-danger);border-color:rgba(220,38,38,.3)}
.rm-edit-footer{padding:14px 22px;border-top:1px solid var(--color-grey-200);display:flex;gap:10px;justify-content:flex-end;background:var(--color-grey-50);border-radius:0 0 14px 14px;flex-wrap:wrap}
.rm-edit-footer__delete{margin-right:auto;color:var(--color-danger)}
@media (max-width:640px){
.rm-ticket-photo__thumbnail img{height:120px}
.rm-ticket-photo__gallery{grid-template-columns:repeat(2,minmax(0,1fr))}
.rm-ticket-photo__gallery .rm-ticket-photo__thumbnail img{height:96px}
  .rm-form-scroll{padding:14px 14px!important}
  .rm-edit-footer{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px;padding:10px 12px}
  .rm-edit-footer .btn{width:100%;min-width:0;height:42px;margin:0;justify-content:center;padding:0 8px;font-size:12.5px;white-space:normal;line-height:1.15;text-align:center}
  .rm-edit-footer__delete{grid-column:1;color:var(--color-danger)}
  .rm-edit-footer__cancel{grid-column:2}
  .rm-edit-footer__change{grid-column:1}
  .rm-edit-footer__done{grid-column:2}
  .rm-ticket-photo__actions{display:grid;grid-template-columns:1fr 1fr}
  .rm-ticket-photo__actions .btn{min-width:0;justify-content:center;padding:0 8px;font-size:12px}
}
.rm-ticket__meta{display:flex;gap:10px;flex-wrap:wrap;font-size:11.5px;color:var(--color-grey-500);margin-top:2px}
.rm-ticket__pills{display:flex;gap:5px;flex-wrap:nowrap;align-items:center;justify-content:flex-end;flex-shrink:0;max-width:none;white-space:nowrap}
@media (max-width:560px){.rm-ticket{flex-direction:column;gap:6px;padding:10px 12px}.rm-ticket__issue{white-space:normal}.rm-ticket__pills{max-width:100%;justify-content:flex-start;flex-wrap:wrap}}

/* History rows are read-only: same compact layout, no click affordance. */
.rm-ticket--static{cursor:default}
.rm-ticket--static:hover{background:transparent}

/* Leave Record: Balance / Records as side-by-side tabs */
.lv-tabs{display:flex;gap:6px;margin-bottom:14px;flex-wrap:wrap}
.lv-tab{display:inline-flex;align-items:center;gap:7px;height:38px;padding:0 16px;border:1px solid var(--border-default);border-radius:8px;background:white;color:var(--color-grey-600);font-size:13px;font-weight:600;cursor:pointer}
.lv-tab:hover{background:var(--color-grey-50)}
.lv-tab--on{background:var(--color-navy);border-color:var(--color-navy);color:white}
.lv-tab__count{font-size:11px;font-weight:700;padding:1px 7px;border-radius:99px;background:var(--color-grey-100);color:var(--color-grey-600)}
.lv-tab--on .lv-tab__count{background:rgba(255,255,255,.22);color:white}

/* R&M split view: both queues on desktop; one selectable pane on mobile. */
.rm-split{display:grid;grid-template-columns:1fr 1fr;gap:16px;align-items:start}
.rm-split .rm-pane{min-width:0}
.rm-split .rm-pane .card__body{max-height:calc(100vh - 300px);overflow-y:auto}
.rm-sticky .tab-bar.rm-tabs-mobile{display:none}
.rm-tabs-mobile .tab-btn{display:flex;align-items:center;gap:6px;white-space:nowrap;padding:8px 12px;font-size:13px;flex:1;justify-content:center}
.rm-tab-count{display:inline-grid;place-items:center;min-width:20px;height:18px;padding:0 5px;border-radius:999px;background:var(--color-grey-200,#e5e7eb);color:var(--color-grey-700,#374151);font-size:11px;font-weight:700}
.rm-tabs-mobile .tab-btn--active .rm-tab-count{background:var(--color-navy,#0B1F3A);color:#fff}
@media (max-width:900px){
  .rm-split{grid-template-columns:1fr}
  .rm-split .rm-pane{display:none}
  .rm-split .rm-pane.rm-pane--active{display:block}
  .rm-split .rm-pane .card__body{max-height:none;overflow-y:visible}
  .rm-sticky .tab-bar.rm-tabs-mobile{display:flex}
}
.rm-split .rm-pane .rm-ticket{flex-direction:column;align-items:stretch;gap:6px}
.rm-split .rm-pane .rm-ticket__main{width:100%;min-width:0}
.rm-split .rm-pane .rm-ticket__pills{flex-wrap:wrap;max-width:100%;justify-content:flex-start}
@media (max-width:900px){
  .rm-split .rm-pane .rm-ticket{flex-direction:row;align-items:flex-start}
  .rm-split .rm-pane .rm-ticket__main{width:auto}
}
/* Phone cards: reserve the first row for ticket details and move all work,
   status and approval controls to a full-width wrapping row underneath. */
@media (max-width:640px){
  .rm-split .rm-pane .rm-ticket{flex-direction:column;align-items:stretch;gap:8px}
  .rm-split .rm-pane .rm-ticket__main{width:100%;min-width:0}
  .rm-split .rm-pane .rm-ticket__issue{white-space:normal;overflow-wrap:anywhere}
  .rm-split .rm-pane .rm-ticket__pills{width:100%;max-width:100%;justify-content:flex-start;align-items:center;flex-wrap:wrap;white-space:normal;padding-top:2px}
  .rm-split .rm-pane .rm-ticket__pills > *{max-width:100%}
}
/* Progressive startup: keep useful content visible while background reads and
   session validation complete. Form controls pause briefly; navigation and
   already-rendered records stay usable/readable. */
.plc-progressive-status{margin:10px 16px;padding:9px 12px;border-radius:8px;background:#eef4fb;color:#526174;font-size:13px}
.plc-session-status{position:fixed;right:max(12px,env(safe-area-inset-right));bottom:max(12px,env(safe-area-inset-bottom));z-index:9997;display:flex;align-items:center;gap:8px;padding:9px 12px;border:1px solid #dbe3ed;border-radius:999px;background:rgba(255,255,255,.96);box-shadow:0 6px 20px rgba(11,31,58,.12);color:#334155;font-size:13px;font-weight:600}
.plc-session-status__dot{width:8px;height:8px;border-radius:50%;background:#d79b00;animation:plc-session-pulse 1s ease-in-out infinite alternate}
.plc-session-validating main form :is(button,input,select,textarea),.plc-session-validating main [data-perm*="edit"],.plc-session-validating main [data-perm*="create"],.plc-session-validating main [data-perm*="delete"]{pointer-events:none;opacity:.62}
.plc-route-skeleton{display:grid;gap:12px;padding:20px}.plc-route-skeleton span{display:block;height:72px;border-radius:12px;background:linear-gradient(90deg,#eef2f6 25%,#f8fafc 40%,#eef2f6 60%);background-size:300% 100%;animation:plc-skeleton 1.2s ease infinite}.plc-route-skeleton span:first-child{height:34px;width:42%}.plc-route-skeleton span:last-child{width:78%}@keyframes plc-skeleton{to{background-position:-100% 0}}
@keyframes plc-session-pulse{to{opacity:.35}}
