:root {
  --blue-900: #0a0a0a;
  --blue-800: #111111;
  --blue-700: #151515;
  --blue-600: #1b1b1b;
  --blue-500: #f0c300;
  --blue-400: #ffd44a;
  --cyan: #ffd44a;
  --teal: #46e4c2;
  --lime: #ffe27a;
  --amber: #ffd44a;
  --red: #ff6b6b;
  --ink: #f5f1db;
  --muted: #cbbf8c;
  --card: #101010;
  --shadow: 0 20px 40px rgba(0, 0, 0, 0.55);
  --status-done-bg: #25d6b2;
  --status-done-text: #042019;
  --status-working-bg: #f2c24b;
  --status-working-text: #3b2600;
  --status-looking-bg: #59a8ff;
  --status-looking-text: #0a2240;
  --status-waiting-bg: #ff6b6b;
  --status-waiting-text: #3a0b0b;
  --status-inshop-bg: #36b37e;
  --status-inshop-text: #052517;
  --status-yard-bg: #8e73ff;
  --status-yard-text: #1a0f3a;
  --status-driving-bg: #7fd6ff;
  --status-driving-text: #06233a;
  --status-unpaid-bg: #ff8a8a;
  --status-unpaid-text: #3a0b0b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Source Sans 3", sans-serif;
  font-size: 14px;
  line-height: 1.35;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 10%, rgba(255, 212, 74, 0.2), transparent 45%),
    radial-gradient(circle at 80% 20%, rgba(255, 212, 74, 0.08), transparent 55%),
    linear-gradient(135deg, #0a0a0a 0%, #121212 55%, #0c0c0c 100%);
}

.app {
  display: grid;
  grid-template-columns: 190px 1fr;
  min-height: 100vh;
}

.sidebar {
  background:
    linear-gradient(180deg, #0b0b0b 0%, #161616 100%),
    url("logo-beverly.svg") no-repeat;
  background-position: center 12px, top;
  background-size: 120px auto, cover;
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 16px 12px;
  gap: 18px;
}

.brand-title {
  font-family: "Oswald", sans-serif;
  font-size: 18px;
  letter-spacing: 1px;
  color: var(--amber);
}

.brand-sub {
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
}

.brand-logo {
  width: 100px;
  height: auto;
  margin-bottom: 8px;
  filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.6));
  display: block;
  clip-path: inset(2px 0 0 0);
}

.nav {
  display: grid;
  gap: 12px;
}

.nav-link {
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  padding: 9px 12px;
  border-radius: 12px;
  font-family: "Oswald", sans-serif;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.nav-link.active,
.nav-link:hover {
  background: linear-gradient(135deg, #f0c300 0%, #ffd44a 100%);
  color: #1a1400;
  transform: translateX(4px);
}

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

.user-info {
  display: grid;
  gap: 6px;
  font-size: 14px;
}

.user-label {
  color: rgba(255, 255, 255, 0.8);
}

.ghost-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 11px;
}

.primary-btn {
  background: linear-gradient(135deg, #f0c300 0%, #ffd44a 100%);
  color: #1a1400;
  border: none;
  padding: 8px 12px;
  border-radius: 12px;
  font-family: "Oswald", sans-serif;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
}

.main {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  animation: fadeIn 0.6s ease;
}

.header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  background: rgba(12, 12, 12, 0.94);
  padding: 18px 20px;
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.header h1 {
  font-family: "Oswald", sans-serif;
  margin: 0 0 6px;
  font-size: 20px;
}

.subtitle {
  margin: 0;
  color: var(--muted);
}

.legend {
  text-align: left;
}

.legend-title {
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--cyan);
}

.legend-items {
  display: grid;
  gap: 6px;
  justify-items: start;
}

.legend-pill {
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  cursor: grab;
  user-select: none;
}

.legend.compact .legend-title {
  font-size: 12px;
  margin-bottom: 6px;
}

.legend.compact .legend-items {
  gap: 4px;
}

.legend.compact .legend-pill {
  padding: 2px 8px;
  font-size: 9px;
}

.legend-pill:active {
  cursor: grabbing;
}

.legend-pill.done {
  background: var(--status-done-bg);
  color: var(--status-done-text);
}

.legend-pill.working {
  background: var(--status-working-bg);
  color: var(--status-working-text);
}

.legend-pill.looking {
  background: var(--status-looking-bg);
  color: var(--status-looking-text);
}

.legend-pill.waiting {
  background: var(--status-waiting-bg);
  color: var(--status-waiting-text);
}

.legend-pill.inshop {
  background: var(--status-inshop-bg);
  color: var(--status-inshop-text);
}

.legend-pill.yard {
  background: var(--status-yard-bg);
  color: var(--status-yard-text);
}

.legend-pill.driving {
  background: var(--status-driving-bg);
  color: var(--status-driving-text);
}

.legend-pill.unpaid {
  background: var(--status-unpaid-bg);
  color: var(--status-unpaid-text);
}

.page {
  display: none;
}

.page.active {
  display: block;
  animation: slideUp 0.4s ease;
}

.admin-only.hidden {
  display: none;
}

.table-wrap {
  background: rgba(12, 12, 12, 0.94);
  border-radius: 18px;
  box-shadow: var(--shadow);
  overflow: auto;
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1200px;
}

.report-table th {
  background: #1a1a1a;
  color: #ffe27a;
  font-family: "Oswald", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 8px 10px;
  position: sticky;
  top: 0;
  font-size: 11px;
  white-space: nowrap;
}

.report-table td {
  padding: 6px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  vertical-align: top;
  font-size: 12px;
}

.admin-table .report-table th,
.admin-table .report-table td {
  text-align: center;
  vertical-align: middle;
}

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

.report-table tr:hover td {
  background: rgba(255, 212, 74, 0.12);
}

.status-badge {
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  display: inline-block;
}

.status-badge.looking {
  background: rgba(143, 212, 255, 0.2);
  color: var(--cyan);
}

.status-badge.working {
  background: rgba(247, 200, 69, 0.2);
  color: var(--amber);
}

.status-badge.waiting {
  background: rgba(255, 107, 107, 0.2);
  color: var(--red);
}

.status-badge.done {
  background: rgba(70, 228, 194, 0.2);
  color: var(--teal);
}

.status-badge.unpaid {
  background: rgba(255, 107, 107, 0.35);
  color: #ffb6b6;
}

.card {
  background: rgba(12, 12, 12, 0.94);
  border-radius: 18px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.card-header h2 {
  font-family: "Oswald", sans-serif;
  margin: 0 0 6px;
}

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

label {
  display: grid;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: #dbe6ff;
}

input,
select,
textarea {
  border-radius: 10px;
  border: 1px solid rgba(255, 212, 74, 0.25);
  padding: 6px 8px;
  font-size: 12px;
  font-family: inherit;
  background: rgba(18, 18, 18, 0.8);
  color: var(--ink);
}

input:disabled {
  opacity: 0.85;
  cursor: not-allowed;
  border: none;
  background: transparent;
  box-shadow: none;
}

textarea {
  resize: vertical;
}

.span-2 {
  grid-column: span 2;
}

.form-actions {
  margin-top: 16px;
}

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

.done-controls {
  margin-top: 12px;
  margin-bottom: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  justify-content: center;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

.report-controls {
  margin-bottom: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  justify-content: flex-start;
}

.report-controls label {
  min-width: 200px;
}

.unclaimed-row {
  background: linear-gradient(
    90deg,
    rgba(255, 212, 74, 0.16),
    rgba(255, 212, 74, 0.04)
  );
  box-shadow: inset 0 0 0 1px rgba(255, 212, 74, 0.25);
}

.unclaimed-row .status-trigger,
.unclaimed-row .row-input,
.unclaimed-row .note-input,
.unclaimed-row .date-start-input {
  border-color: rgba(255, 212, 74, 0.4);
  box-shadow: 0 0 0 1px rgba(255, 212, 74, 0.12);
}

.done-controls label {
  min-width: 200px;
}

.done-controls input {
  width: 200px;
}

.claims-controls {
  margin-top: 12px;
  margin-bottom: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  justify-content: flex-start;
}

.claims-controls label {
  min-width: 220px;
}

.empty-row td {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 16px 12px;
}

.done-date-row td {
  background: linear-gradient(90deg, rgba(255, 212, 74, 0.18), rgba(255, 212, 74, 0.02));
  color: #ffe27a;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 11px;
  padding: 10px 12px;
}

.admin-card h3 {
  margin: 0 0 10px;
  font-family: "Oswald", sans-serif;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-top: 16px;
}

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

.stats {
  display: grid;
  gap: 10px;
}

.stat {
  display: flex;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
}

.stat-label {
  color: var(--muted);
  font-size: 13px;
}

.stat-value {
  font-weight: 600;
  color: var(--cyan);
}

.admin-table {
  margin-top: 12px;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
}

.modal.hidden {
  display: none;
}

.modal-card {
  background: rgba(12, 12, 12, 0.98);
  width: min(720px, 92vw);
  border-radius: 18px;
  padding: 24px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 212, 74, 0.2);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-body {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-top: 12px;
}

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

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

.auth-note {
  font-size: 14px;
  color: var(--muted);
  padding: 8px 0;
}

.hidden {
  display: none;
}

.action-btn {
  border: none;
  border-radius: 8px;
  padding: 4px 6px;
  font-size: 11px;
  cursor: pointer;
  margin-right: 6px;
}

.action-btn:hover,
.note-btn:hover {
  filter: brightness(1.15);
}

.action-btn.claim {
  background: linear-gradient(135deg, #f0c300 0%, #ffd44a 100%);
  color: #1a1400;
}

.action-btn.unclaim {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.action-btn.back {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.action-btn.save {
  background: rgba(70, 228, 194, 0.2);
  color: var(--teal);
}

.action-btn.delete {
  background: rgba(255, 107, 107, 0.2);
  color: #ffd5d5;
}

.row-input {
  width: 110px;
}

.estimate-input {
  width: 70px;
}

.note-input {
  width: 170px;
}

.truck-cell {
  display: grid;
  gap: 0;
  min-width: 90px;
}

.truck-id {
  font-weight: 600;
  font-size: 12px;
}

.trailer-id {
  font-size: 12px;
  color: var(--muted);
}

.status-input {
  width: 130px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 5px 8px;
  font-size: 12px;
  cursor: pointer;
}

.status-picker {
  position: relative;
  display: inline-block;
}

.status-trigger {
  width: 140px;
  text-align: left;
  background: transparent;
}

.status-menu {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 4;
  background: #101010;
  border-radius: 10px;
  padding: 6px;
  min-width: 160px;
  box-shadow: 0 10px 22px rgba(5, 10, 25, 0.35);
  display: none;
  max-height: 260px;
  overflow-y: auto;
}

.status-picker.open .status-menu {
  display: grid;
  gap: 6px;
}

.status-option {
  border: none;
  border-radius: 999px;
  padding: 6px 10px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
}

.status-option.active {
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.35);
}

.status-option.looking {
  background: var(--status-looking-bg);
  color: var(--status-looking-text);
}

.status-option.working {
  background: var(--status-working-bg);
  color: var(--status-working-text);
}

.status-option.waiting {
  background: var(--status-waiting-bg);
  color: var(--status-waiting-text);
}

.status-option.inshop {
  background: var(--status-inshop-bg);
  color: var(--status-inshop-text);
}

.status-option.yard {
  background: var(--status-yard-bg);
  color: var(--status-yard-text);
}

.status-option.driving {
  background: var(--status-driving-bg);
  color: var(--status-driving-text);
}

.status-option.done {
  background: var(--status-done-bg);
  color: var(--status-done-text);
}

.status-option.unpaid {
  background: var(--status-unpaid-bg);
  color: var(--status-unpaid-text);
}

.status-input.drop-target {
  outline: 2px dashed rgba(143, 212, 255, 0.8);
  outline-offset: 2px;
}

.status-input.looking {
  background: var(--status-looking-bg);
  color: var(--status-looking-text);
}

.status-input.working {
  background: var(--status-working-bg);
  color: var(--status-working-text);
}

.status-input.waiting {
  background: var(--status-waiting-bg);
  color: var(--status-waiting-text);
}

.status-input.inshop {
  background: var(--status-inshop-bg);
  color: var(--status-inshop-text);
}

.status-input.yard {
  background: var(--status-yard-bg);
  color: var(--status-yard-text);
}

.status-input.driving {
  background: var(--status-driving-bg);
  color: var(--status-driving-text);
}

.status-input.done {
  background: var(--status-done-bg);
  color: var(--status-done-text);
}

.status-input.unpaid {
  background: var(--status-unpaid-bg);
  color: var(--status-unpaid-text);
}

.status-input option {
  background: #2f6bdc;
  color: #0b1a3a;
  font-weight: 600;
}

.status-input option:hover,
.status-input option:checked {
  background: #8fd4ff;
  color: #0a2b49;
}

.status-input.custom {
  background: rgba(255, 255, 255, 0.12);
  color: var(--ink);
}



.note-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--ink);
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  max-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.photo-cell {
  min-width: 120px;
}

.photo-manage {
  background: rgba(255, 255, 255, 0.12);
  color: var(--ink);
  padding: 4px 6px;
  font-size: 10px;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 6px;
}

.photo-item {
  display: grid;
  gap: 8px;
  justify-items: center;
  padding: 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
}

.photo-thumb {
  width: 100%;
  height: 90px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
}

.photo-empty {
  color: var(--muted);
  font-size: 13px;
}

.photo-add-btn input {
  display: none;
}

.modal-body.single {
  grid-template-columns: 1fr;
}

.note-modal-card {
  width: min(980px, 94vw);
  max-height: 88vh;
  display: grid;
  grid-template-rows: auto 1fr;
}

#note-modal.note-reason-only #note-content,
#note-modal.note-reason-only .note-history {
  display: none;
}

#note-modal .modal-body {
  max-height: 70vh;
  overflow-y: auto;
}

#note-content {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(255, 212, 74, 0.25);
  padding: 12px;
  background: rgba(18, 18, 18, 0.8);
  color: var(--ink);
  font-family: inherit;
  min-height: 180px;
  font-size: 14px;
}

.note-history {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

.note-history-title {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.note-history-list {
  max-height: 280px;
  overflow-y: auto;
  display: grid;
  gap: 8px;
}

.note-history-item {
  border-radius: 10px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.06);
}

.note-history-meta {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
}

.note-history-text {
  font-size: 12px;
  white-space: pre-wrap;
}

.note-history-empty {
  font-size: 12px;
  color: var(--muted);
}

.photo-modal-card {
  width: min(900px, 92vw);
}

#photo-preview {
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 12px;
  background: rgba(18, 18, 18, 0.8);
  border: 1px solid rgba(255, 212, 74, 0.25);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    transform: translateY(10px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

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

  .sidebar {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
  }

  .sidebar-footer {
    width: 100%;
  }

  .header {
    flex-direction: column;
    align-items: flex-start;
  }

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

  .span-2 {
    grid-column: span 1;
  }
}
.photo-actions {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.ghost-btn.danger {
  border-color: rgba(255, 107, 107, 0.5);
  color: #ffb6b6;
}

.th-stack {
  display: inline-block;
  line-height: 1.1;
  text-align: center;
}

