/* ============================================================
   Palm Beach Truck Repair — Customer Portal Styles
   Layered on top of styles.css from the marketing site.
   ============================================================ */

body.portal-body {
  background: var(--pbtr-bg);
}

/* ============ DEMO BANNER ============ */
.demo-banner {
  background: var(--pbtr-accent);
  color: var(--pbtr-navy);
  text-align: center;
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .04em;
  padding: 6px 12px;
}

/* ============ LOGIN SCREEN ============ */
.login-screen {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--pbtr-navy) 0%, var(--pbtr-blue) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 16px;
  padding: 40px;
  box-shadow: 0 30px 80px rgba(0,0,0,.25);
}
.login-card .brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
  text-align: center;
}
.login-card .brand img { height: 60px; }
.login-card h1 {
  font-size: 1.4rem;
  margin: 0;
  text-align: center;
  color: var(--pbtr-navy);
}
.login-card .lead {
  text-align: center;
  color: var(--pbtr-muted);
  font-size: .95rem;
  margin: 6px 0 26px;
}
.login-error {
  background: #fee2e2;
  color: #991b1b;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: .9rem;
  margin-bottom: 14px;
  display: none;
}
.login-error.show { display: block; }
.demo-creds {
  margin-top: 22px;
  background: var(--pbtr-blue-light);
  border-radius: 8px;
  padding: 14px;
  font-size: .82rem;
  color: var(--pbtr-navy);
}
.demo-creds strong { color: var(--pbtr-blue); }
.demo-creds code {
  font-family: 'SF Mono', Monaco, Consolas, monospace;
  background: #fff;
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid var(--pbtr-border);
}

/* ============ APP SHELL ============ */
.app {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}
@media (max-width: 880px) {
  .app { grid-template-columns: 1fr; }
}

.sidebar {
  background: var(--pbtr-navy);
  color: rgba(255,255,255,.85);
  padding: 24px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
@media (max-width: 880px) {
  .sidebar { position: static; height: auto; }
}
.sidebar .brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.sidebar .brand img { height: 44px; filter: brightness(0) invert(1); }
.sidebar .brand .brand-name {
  color: #fff;
  font-weight: 800;
  font-size: 1rem;
  line-height: 1.1;
}
.sidebar .brand .brand-sub {
  font-size: .7rem;
  color: rgba(255,255,255,.55);
  text-transform: uppercase;
  letter-spacing: .12em;
}
.customer-info {
  background: rgba(255,255,255,.05);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 20px;
}
.customer-info .label {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: rgba(255,255,255,.55);
  margin-bottom: 6px;
}
.customer-info .name {
  color: #fff;
  font-weight: 700;
  font-size: .95rem;
  margin: 0 0 4px;
}
.customer-info .contact {
  font-size: .8rem;
  color: rgba(255,255,255,.7);
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
.side-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 8px;
  color: rgba(255,255,255,.78);
  text-decoration: none;
  font-weight: 600;
  font-size: .92rem;
  cursor: pointer;
  transition: all .15s ease;
}
.side-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.side-nav a.active { background: var(--pbtr-blue); color: #fff; }
.side-nav a svg { width: 18px; height: 18px; flex: 0 0 18px; }

.sidebar-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding-top: 18px;
  margin-top: 18px;
}
.sidebar-bottom a {
  display: flex; align-items: center; gap: 10px;
  color: rgba(255,255,255,.6); font-size: .85rem; text-decoration: none;
  padding: 8px 14px; border-radius: 6px;
}
.sidebar-bottom a:hover { color: #fff; background: rgba(255,255,255,.06); }

/* ============ MAIN CONTENT ============ */
.main {
  background: var(--pbtr-bg);
  padding: 0;
  min-height: 100vh;
  overflow-x: hidden;
}
.topbar-app {
  background: #fff;
  padding: 18px 32px;
  border-bottom: 1px solid var(--pbtr-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-app h2 {
  margin: 0;
  font-size: 1.4rem;
  color: var(--pbtr-navy);
}
.topbar-app .breadcrumb {
  font-size: .82rem;
  color: var(--pbtr-muted);
  text-transform: uppercase;
  letter-spacing: .12em;
  margin-bottom: 2px;
}
.topbar-app .right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.user-chip {
  background: var(--pbtr-blue-light);
  color: var(--pbtr-blue);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: .85rem;
  font-weight: 600;
}

.view {
  padding: 32px;
  max-width: 1280px;
  margin: 0 auto;
}
@media (max-width: 600px) { .view { padding: 20px 16px; } }

/* ============ STAT TILES ============ */
.tile-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 28px;
}
@media (max-width: 900px) { .tile-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px) { .tile-grid { grid-template-columns: 1fr; } }

.tile {
  background: #fff;
  border: 1px solid var(--pbtr-border);
  border-radius: 12px;
  padding: 22px 22px;
  box-shadow: 0 2px 6px rgba(11,37,69,.04);
}
.tile .tile-label {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--pbtr-muted);
  font-weight: 700;
  margin-bottom: 8px;
}
.tile .tile-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--pbtr-navy);
  line-height: 1.05;
}
.tile .tile-sub {
  margin-top: 6px;
  font-size: .82rem;
  color: var(--pbtr-muted);
}
.tile.accent .tile-value { color: var(--pbtr-blue); }

/* ============ PANEL / CARD ============ */
.panel {
  background: #fff;
  border: 1px solid var(--pbtr-border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 2px 6px rgba(11,37,69,.04);
}
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}
.panel-header h3 {
  margin: 0;
  font-size: 1.05rem;
  color: var(--pbtr-navy);
}
.panel-header .panel-action {
  font-size: .85rem;
  color: var(--pbtr-blue);
  font-weight: 600;
  cursor: pointer;
}

/* ============ TABLES ============ */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .92rem;
}
.data-table th {
  text-align: left;
  padding: 11px 14px;
  background: var(--pbtr-bg);
  color: var(--pbtr-navy);
  font-weight: 700;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  border-bottom: 1px solid var(--pbtr-border);
}
.data-table td {
  padding: 14px;
  border-bottom: 1px solid var(--pbtr-border);
  color: var(--pbtr-text);
}
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr.clickable { cursor: pointer; transition: background .15s; }
.data-table tbody tr.clickable:hover { background: var(--pbtr-bg); }

.status-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.status-active { background: #dcfce7; color: #166534; }
.status-shop { background: #fef3c7; color: #92400e; }
.status-down { background: #fee2e2; color: #991b1b; }

.due-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 700;
}
.due-soon { background: #fef3c7; color: #92400e; }
.due-overdue { background: #fee2e2; color: #991b1b; }
.due-ok { background: #dcfce7; color: #166534; }

/* ============ TRUCK GRID ============ */
.truck-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.truck-card {
  background: var(--pbtr-bg);
  border: 1px solid var(--pbtr-border);
  border-radius: 10px;
  padding: 16px;
  cursor: pointer;
  transition: all .15s;
}
.truck-card:hover {
  background: #fff;
  border-color: var(--pbtr-blue);
  transform: translateY(-2px);
  box-shadow: var(--pbtr-shadow);
}
.truck-card .unit {
  font-weight: 800;
  color: var(--pbtr-navy);
  font-size: 1.1rem;
}
.truck-card .desc {
  color: var(--pbtr-muted);
  font-size: .85rem;
  margin: 4px 0 12px;
}
.truck-card .meta {
  display: flex;
  justify-content: space-between;
  font-size: .82rem;
}
.truck-card .meta span:first-child { color: var(--pbtr-muted); }
.truck-card .meta span:last-child { color: var(--pbtr-navy); font-weight: 600; }

/* ============ ACTIVITY LIST ============ */
.activity-list { display: flex; flex-direction: column; gap: 0; }
.activity-row {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--pbtr-border);
}
.activity-row:last-child { border-bottom: 0; }
.activity-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--pbtr-blue-light);
  color: var(--pbtr-blue);
  display: flex; align-items: center; justify-content: center;
}
.activity-icon svg { width: 20px; height: 20px; }
.activity-row .title { color: var(--pbtr-navy); font-weight: 600; font-size: .95rem; }
.activity-row .sub { color: var(--pbtr-muted); font-size: .82rem; }
.activity-row .amount { color: var(--pbtr-navy); font-weight: 700; }

/* ============ VEHICLE DETAIL ============ */
.vehicle-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 14px;
}
.vehicle-header h2 { margin: 0 0 4px; color: var(--pbtr-navy); }
.vehicle-header .meta { color: var(--pbtr-muted); font-size: .92rem; }
.vehicle-back {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .88rem; color: var(--pbtr-blue); cursor: pointer;
  margin-bottom: 14px; font-weight: 600;
}
.vehicle-back:hover { color: var(--pbtr-blue-bright); }

.vehicle-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
@media (max-width: 700px) { .vehicle-stats { grid-template-columns: repeat(2, 1fr); } }
.vehicle-stats .tile { padding: 16px 18px; }
.vehicle-stats .tile-value { font-size: 1.4rem; }

/* ============ DROP ZONE ============ */
.dropzone {
  border: 2px dashed var(--pbtr-border);
  border-radius: 12px;
  padding: 32px;
  text-align: center;
  background: var(--pbtr-bg);
  color: var(--pbtr-muted);
  cursor: pointer;
  transition: all .15s;
}
.dropzone:hover, .dropzone.drag {
  border-color: var(--pbtr-blue);
  background: var(--pbtr-blue-light);
  color: var(--pbtr-blue);
}
.dropzone svg { width: 36px; height: 36px; margin-bottom: 8px; }
.dropzone .hint { font-size: .82rem; margin-top: 4px; }
.dropzone input[type="file"] { display: none; }

.file-list { margin-top: 18px; display: flex; flex-direction: column; gap: 8px; }
.file-row {
  display: grid;
  grid-template-columns: 38px 1fr auto auto;
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
  background: var(--pbtr-bg);
  border-radius: 8px;
}
.file-row .icon {
  width: 32px; height: 32px;
  background: #fff;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  color: var(--pbtr-blue);
}
.file-row .name { font-weight: 600; color: var(--pbtr-navy); font-size: .92rem; word-break: break-all; }
.file-row .meta { font-size: .78rem; color: var(--pbtr-muted); }
.file-row .size { font-size: .82rem; color: var(--pbtr-muted); }
.file-row .remove {
  background: none; border: 0;
  color: var(--pbtr-muted); cursor: pointer;
  padding: 6px; border-radius: 6px;
}
.file-row .remove:hover { background: #fee2e2; color: #991b1b; }
.file-row .remove svg { width: 16px; height: 16px; }

/* ============ CHARTS ============ */
.chart-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 18px;
  margin-bottom: 24px;
}
@media (max-width: 880px) { .chart-grid { grid-template-columns: 1fr; } }
.chart-wrap { position: relative; height: 280px; }

/* ============ EMPTY STATE ============ */
.empty {
  text-align: center;
  padding: 28px 20px;
  color: var(--pbtr-muted);
}
.empty svg { width: 36px; height: 36px; margin-bottom: 10px; opacity: .5; }
.empty .empty-title { font-weight: 600; color: var(--pbtr-navy); margin-bottom: 4px; }

/* ============ HIDDEN ============ */
.hidden { display: none !important; }

/* ============ MOBILE NAV TOGGLE ============ */
@media (max-width: 880px) {
  .sidebar { padding: 14px 18px; }
  .side-nav { flex-direction: row; flex-wrap: wrap; gap: 4px; flex: none; margin-top: 12px; }
  .side-nav a { font-size: .85rem; padding: 8px 12px; }
  .sidebar .brand { margin-bottom: 14px; padding-bottom: 14px; }
  .customer-info { margin-bottom: 12px; }
  .sidebar-bottom { display: none; }
}

/* ============ FORM ELEMENTS WITHIN PORTAL ============ */
.portal-input {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--pbtr-border);
  border-radius: 8px;
  font-size: .95rem;
  font-family: inherit;
  margin-bottom: 14px;
  background: #fff;
}
.portal-input:focus {
  outline: none;
  border-color: var(--pbtr-blue);
  box-shadow: 0 0 0 3px rgba(38,103,214,.15);
}
.portal-input-label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--pbtr-navy);
  font-size: .85rem;
}
