:root {
  --brand: #18d1d6;
  --brand-dark: #07969d;
  --ink: #14252b;
  --muted: #64747b;
  --line: #d8e8eb;
  --bg: #f5fbfc;
  --card: #ffffff;
  --danger: #b42318;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: var(--bg);
  overflow-x: hidden;
}
a { color: var(--brand-dark); text-decoration: none; }
.shell { min-height: 100vh; display: flex; }
.side {
  width: 250px;
  background: #102a30;
  color: #fff;
  padding: 18px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand { display: flex; gap: 10px; align-items: center; font-weight: 700; margin-bottom: 24px; }
.brand img { width: 38px; height: 38px; object-fit: contain; }
.nav a {
  display: block;
  color: #dff8fa;
  padding: 11px 12px;
  border-radius: 8px;
  margin: 3px 0;
}
.nav a.active, .nav a:hover { background: rgba(24, 209, 214, .18); color: #fff; }
.main { flex: 1; min-width: 0; }
.topbar {
  height: 64px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 22px;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.pwa-reset-button {
  background: #e11919;
  color: #fff;
}
.pwa-reset-button:disabled {
  opacity: .7;
  cursor: wait;
}
.network-status {
  background: #fff3cd;
  color: #7a4b00;
  border-bottom: 1px solid #f5d57b;
  padding: 10px 14px;
  font-weight: 700;
  text-align: center;
}
.content { padding: 22px; max-width: 1280px; margin: 0 auto; }
.login {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 420px;
  background: #09252c url('img/background.png') center/cover no-repeat;
}
.login-copy { color: #fff; padding: 8vw; align-self: end; }
.login-copy h1 { font-size: 44px; margin: 0 0 12px; }
.login-card {
  background: rgba(255,255,255,.96);
  margin: 6vw;
  padding: 32px;
  border-radius: 8px;
  align-self: center;
}
.download-strip {
  display: grid;
  gap: 10px;
  margin: 18px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #e8f6f7;
}
.download-strip .btn,
.app-download-actions .btn,
.app-download-actions button {
  text-align: center;
}
.grid { display: grid; gap: 16px; }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}
.metric { font-size: 28px; font-weight: 700; margin-top: 8px; }
.muted { color: var(--muted); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn, button {
  border: 0;
  background: var(--brand);
  color: #073238;
  font-weight: 700;
  padding: 10px 14px;
  border-radius: 7px;
  cursor: pointer;
  display: inline-block;
}
.btn.secondary { background: #e8f6f7; color: var(--brand-dark); }
.btn.danger { background: #fee4e2; color: var(--danger); }
input, select, textarea {
  width: 100%;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
}
label { display: block; font-weight: 700; margin: 10px 0 6px; }
.form-help { margin: 6px 0 10px; color: var(--muted); font-size: 13px; }
table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; }
th, td { border-bottom: 1px solid var(--line); text-align: left; padding: 11px; vertical-align: top; }
th { background: #e8f6f7; font-size: 13px; }
.notice { background: #e8f6f7; border: 1px solid var(--line); padding: 12px; border-radius: 8px; margin-bottom: 16px; }
.error { background: #fee4e2; color: var(--danger); border-color: #fecdca; }
.badge { padding: 3px 8px; background: #eef9fa; border-radius: 99px; font-size: 12px; }
.otp-code {
  display: inline-block;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 2px;
  padding: 5px 8px;
  border-radius: 7px;
  background: #fff3cd;
  color: #7a4b00;
}
.hidden { display: none !important; }
.mobile-app {
  max-width: 760px;
  margin: 0 auto;
}
.app-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #073238;
  color: #fff;
  border-radius: 8px;
  padding: 18px;
  margin-bottom: 16px;
}
.app-hero img {
  width: 58px;
  height: 58px;
  object-fit: contain;
  background: #fff;
  border-radius: 8px;
  padding: 6px;
}
.app-hero h1 { margin: 0 0 4px; font-size: 24px; }
.app-hero p { margin: 0; color: #d8eeee; }
.app-actions {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}
.app-tabs {
  z-index: 12;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  padding: 8px 0;
  background: #f6fbfb;
}
.staff-app-body .app-tabs {
  position: sticky;
  top: 132px;
}
.app-tabs button {
  min-height: 42px;
  padding: 8px 4px;
  border-radius: 7px;
  background: #e8f6f7;
  color: var(--brand-dark);
  font-size: 13px;
}
.app-tabs a {
  min-height: 42px;
  padding: 8px 4px;
  border-radius: 7px;
  background: #e8f6f7;
  color: var(--brand-dark);
  font-size: 13px;
  display: grid;
  place-items: center;
  text-align: center;
  font-weight: 700;
}
.app-tabs button.active,
.app-tabs a.active {
  background: #073238;
  color: #fff;
}
.app-tab-panel {
  display: none;
}
.app-tab-panel.active {
  display: block;
}
.app-primary {
  background: var(--brand);
  color: #073238;
  text-align: center;
}
.app-card,
.running-panel,
.local-trip {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 14px;
}
.app-card h3,
.running-panel h3 {
  margin: 0 0 10px;
  font-size: 18px;
}
.running-panel {
  border-color: #8fe4e8;
  box-shadow: 0 10px 28px rgba(7, 50, 56, .08);
}
.running-panel .ride-route,
.local-trip .ride-route {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 4px;
}
.ride-meta {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.empty-state {
  color: var(--muted);
  background: #f6fbfb;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 14px;
}
.ride-app textarea {
  min-height: 82px;
  resize: vertical;
}
.ride-app input[type="file"] {
  padding: 8px;
}
.ride-app .actions {
  margin-top: 12px;
}
.local-trip {
  display: grid;
  gap: 10px;
}
.local-trip .actions {
  margin-top: 0;
}
.camera-capture {
  display: grid;
  gap: 8px;
}
.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.choice-grid label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}
.choice-grid input {
  width: auto;
}
.ride-select-list {
  display: grid;
  gap: 6px;
  max-height: 220px;
  overflow: auto;
}
.ride-select-list label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  font-weight: 400;
}
.ride-choice {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  overflow: hidden;
}
.ride-choice label {
  border: 0;
  border-radius: 0;
}
.ride-review {
  border-top: 1px solid var(--line);
  padding: 0 10px 10px 34px;
}
.ride-review summary {
  cursor: pointer;
  color: var(--brand-dark);
  font-weight: 700;
  padding: 8px 0;
}
.review-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  font-size: 13px;
}
.review-grid p {
  margin: 0;
}
.ride-select-list input {
  width: auto;
  margin-top: 2px;
}
.nested-tool {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.compact-tool {
  padding: 10px 0 0;
}
.compact-tool summary {
  cursor: pointer;
  font-weight: 800;
  color: var(--teal-dark);
  list-style-position: inside;
}
.compact-tool form {
  margin-top: 10px;
}
.nested-tool h3 {
  margin: 0 0 8px;
}
.photo-preview {
  width: 100%;
  max-height: 180px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.camera-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(7, 50, 56, .78);
  display: grid;
  place-items: center;
  padding: 18px;
}
.camera-sheet {
  width: min(680px, 100%);
  background: #fff;
  border-radius: 8px;
  padding: 14px;
}
.camera-sheet video {
  width: 100%;
  max-height: 70vh;
  background: #000;
  border-radius: 8px;
}
.report-card {
  color: #172b2f;
}
.report-header {
  display: flex;
  align-items: center;
  gap: 16px;
  border-bottom: 2px solid var(--line);
  padding-bottom: 14px;
  margin-bottom: 14px;
}
.report-header img {
  width: 120px;
  max-height: 54px;
  object-fit: contain;
}
.report-header h2,
.report-header p {
  margin: 0;
}
.identity-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0 18px;
}
.identity-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #f9fcfc;
}
.report-table {
  font-size: 12px;
}
.report-table th,
.report-table td {
  padding: 8px;
}
.vendor-bill .actions form {
  margin: 0;
}
.bill-note {
  margin-top: 18px;
  text-align: center;
  font-weight: 700;
}
.tax-invoice {
  width: 210mm;
  min-height: 297mm;
  margin: 0 auto;
  padding: 14mm 13mm;
  background: #fff;
  color: #111;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 10.5px;
  line-height: 1.35;
}
.tax-invoice h1,
.tax-invoice h2,
.tax-invoice h3,
.tax-invoice p {
  margin: 0;
}
.invoice-head {
  display: grid;
  grid-template-columns: 1.3fr .8fr;
  gap: 18px;
  align-items: start;
  padding-bottom: 12px;
  border-bottom: 1px solid #cfcfcf;
}
.invoice-company {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.invoice-company img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}
.invoice-company h1 {
  font-size: 18px;
  font-weight: 700;
}
.invoice-title {
  text-align: right;
}
.invoice-title h2 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
}
.invoice-section {
  padding: 10px 0;
  border-bottom: 1px solid #e2e2e2;
}
.duplicate-copy {
  margin: 8px 0 0;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #555;
}
.invoice-section h3 {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.invoice-details {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px 16px;
}
.invoice-details strong,
.summary-lines span {
  display: block;
  color: #555;
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
}
.invoice-details span {
  display: block;
}
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.summary-lines p,
.totals-box p {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}
.invoice-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10.5px;
  border-radius: 0;
}
.invoice-table th {
  background: #f5f5f5;
  border-top: 1px solid #d7d7d7;
  border-bottom: 1px solid #d7d7d7;
  color: #111;
  font-size: 10px;
  text-transform: uppercase;
}
.invoice-table td,
.invoice-table th {
  padding: 6px 5px;
  border-bottom: 1px solid #ededed;
}
.invoice-table .amount {
  text-align: right;
}
.totals {
  display: grid;
  grid-template-columns: 1fr 78mm;
  gap: 18px;
  align-items: start;
}
.totals-box {
  font-size: 10.5px;
}
.totals-box .grand {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid #cfcfcf;
  font-size: 14px;
  font-weight: 700;
}
.amount-words {
  display: block !important;
  margin-top: 8px !important;
}
.amount-words span,
.amount-words strong {
  display: block;
}
.invoice-footer {
  display: grid;
  grid-template-columns: 1fr 70mm;
  gap: 18px;
  padding-top: 14px;
}
.signature {
  text-align: center;
}
.signature span {
  display: block;
  height: 34px;
}
.org-logo-preview {
  max-width: 220px;
  max-height: 120px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}
.mini-form {
  display: grid;
  gap: 6px;
  min-width: 150px;
}
.mini-form label {
  margin: 0;
  font-size: 12px;
}
.mini-form input[type="checkbox"] {
  width: auto;
}
.mini-form .choice-grid {
  grid-template-columns: 1fr;
  gap: 4px;
  margin: 8px 0;
}
.mini-form .choice-grid label {
  padding: 6px;
  font-size: 12px;
}
.staff-app-body {
  background: #d9f7f8;
}
.staff-app-body .shell {
  display: block;
  width: min(430px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  background: #f6fbfb;
  box-shadow: 0 0 0 1px rgba(7, 50, 56, .08), 0 20px 60px rgba(7, 50, 56, .18);
}
.staff-app-body .side {
  position: sticky;
  top: 0;
  z-index: 20;
  width: 100%;
  height: auto;
  padding: max(10px, env(safe-area-inset-top)) 12px 10px;
  border-right: 0;
}
.staff-app-body .brand {
  justify-content: center;
  margin-bottom: 10px;
}
.staff-app-body .nav {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}
.staff-app-body .nav a {
  min-height: 44px;
  display: grid;
  place-items: center;
  text-align: center;
  font-size: 12px;
  padding: 8px 4px;
}
.staff-app-body .main {
  min-width: 0;
}
.staff-app-body .topbar {
  height: auto;
  min-height: 58px;
  padding: 12px 14px;
  gap: 10px;
}
.staff-app-body .topbar .btn,
.staff-app-body .topbar button {
  min-height: 44px;
}
.staff-app-body .topbar-actions {
  flex-wrap: nowrap;
}
.staff-app-body .content {
  padding: 12px max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  max-width: none;
}
.vendor-app-body .vendor-content {
  padding-top: 0;
}
.staff-app-body .mobile-app {
  max-width: none;
}
.staff-app-body .grid.cols-2,
.staff-app-body .grid.cols-4 {
  grid-template-columns: 1fr;
}
.staff-app-body .app-hero {
  margin-bottom: 12px;
}
.staff-app-body .app-tabs {
  top: 118px;
}
.vendor-app-body .vendor-bill .app-tabs {
  position: static;
  top: auto;
  z-index: auto;
  margin: 0 0 8px;
  padding: 10px 0 8px;
  background: var(--bg);
}
.vendor-app-body .vendor-bill .card {
  margin-top: 0;
}
.staff-app-body table {
  display: block;
  overflow-x: auto;
}
@media (max-width: 850px) {
  .shell { display: block; }
  .side { position: static; width: 100%; height: auto; }
  .nav { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; }
  .login { grid-template-columns: 1fr; }
  .login-copy { display: none; }
  .grid.cols-4, .grid.cols-2 { grid-template-columns: 1fr; }
  .content { padding: 14px; }
  .topbar { height: auto; min-height: 58px; padding: 12px 14px; }
  .app-hero { align-items: flex-start; }
  .app-hero h1 { font-size: 21px; }
  .identity-grid { grid-template-columns: 1fr; }
  table { display: block; overflow-x: auto; }
}
@media print {
  @page { size: A4 portrait; margin: 8mm; }
  .side, .topbar, .no-print { display: none !important; }
  html, body { width: 210mm; background: #fff; }
  body { margin: 0; }
  .staff-app-body .shell { width: 100%; box-shadow: none; margin: 0; background: #fff; }
  .content { max-width: none; padding: 0; }
  .card { border: 0; padding: 0; box-shadow: none; }
  .report-card { font-size: 11px; }
  .identity-grid { grid-template-columns: repeat(4, 1fr); }
  .report-table { font-size: 9px; }
  .report-table th, .report-table td { padding: 4px; }
  .vendor-bill.mobile-app { max-width: none; }
  .tax-invoice {
    width: 194mm;
    min-height: auto;
    margin: 0;
    padding: 0;
    font-size: 10px;
  }
  .invoice-section { padding: 8px 0; }
  .invoice-table { display: table; overflow: visible; }
  .invoice-table th,
  .invoice-table td { padding: 5px 4px; }
  .signature span { height: 28px; }
}
