/* =============================================
   Anywhere Port Douglas — Book Rides Online
   Shared Stylesheet
   ============================================= */

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

:root {
  --red:      #c0392b;
  --blue:     #2980b9;
  --navy:     #2c3e50;
  --green:    #27ae60;
  --orange:   #e67e22;
  --yellow:   #f39c12;
  --gray:     #95a5a6;
  --light:    #ecf0f1;
  --white:    #fff;
  --sidebar-w: 192px;
  --header-h:  52px;
}

body { font-family: Arial, Helvetica, sans-serif; font-size: 13px; background: #f4f6f8; color: #333; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- LAYOUT ---- */
.layout { display: flex; min-height: 100vh; }

/* ---- SIDEBAR ---- */
.sidebar {
  width: var(--sidebar-w);
  background: var(--navy);
  color: #ccc;
  min-height: 100vh;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}
.sidebar-logo {
  padding: 14px 16px;
  background: rgba(0,0,0,.2);
  display: flex; align-items: center; gap: 8px;
  font-size: 15px; font-weight: bold; color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.sidebar-logo span { font-size: 22px; }
.sidebar nav { flex: 1; overflow-y: auto; padding: 8px 0; }
.sidebar nav a, .sidebar nav .nav-group-title {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 16px;
  color: #bdc3c7;
  font-size: 13px;
  cursor: pointer;
  transition: background .15s;
}
.sidebar nav a:hover, .sidebar nav a.active { background: rgba(255,255,255,.1); color: #fff; text-decoration: none; }
.sidebar nav a.active { border-left: 3px solid var(--red); }
.nav-sub { padding-left: 24px; border-left: 2px solid rgba(255,255,255,.1); margin-left: 16px; }
.nav-sub a { padding: 6px 16px; font-size: 12px; }
.nav-group-title { font-size: 12px; color: #95a5a6; text-transform: uppercase; letter-spacing: .5px; padding: 10px 16px 4px; pointer-events: none; }

/* ---- MAIN AREA ---- */
.main-wrap { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

/* ---- TOP BAR ---- */
.topbar {
  height: var(--header-h);
  background: var(--navy);
  color: #fff;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px;
  border-bottom: 1px solid rgba(0,0,0,.2);
}
.topbar-title { font-size: 15px; font-weight: bold; }
.topbar-user { font-size: 13px; color: #bdc3c7; display: flex; align-items: center; gap: 8px; }
.topbar-user a { color: #bdc3c7; }

/* ---- PAGE CONTENT ---- */
.content { flex: 1; padding: 20px; overflow-y: auto; }

/* ---- PAGE HEADING ---- */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.page-title { font-size: 20px; font-weight: bold; color: var(--red); }
.page-actions { display: flex; gap: 8px; }

/* ---- TABS ---- */
.tabs { display: flex; border-bottom: 1px solid #ddd; margin-bottom: 20px; gap: 2px; }
.tab-btn {
  padding: 8px 16px; border: 1px solid #ddd; border-bottom: none;
  background: #f9f9f9; cursor: pointer; font-size: 13px; color: var(--blue);
  border-radius: 3px 3px 0 0;
}
.tab-btn.active { background: #fff; color: var(--red); font-weight: bold; border-color: #ddd; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---- CARDS / STAT BOXES ---- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat-card {
  background: #fff; border: 1px solid #ddd; border-radius: 4px; padding: 16px;
  text-align: center;
}
.stat-card .stat-num { font-size: 28px; font-weight: bold; color: var(--navy); }
.stat-card .stat-label { font-size: 12px; color: var(--gray); margin-top: 4px; }
.stat-card.red .stat-num { color: var(--red); }
.stat-card.green .stat-num { color: var(--green); }
.stat-card.blue .stat-num { color: var(--blue); }

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 12px; border-radius: 3px; border: 1px solid transparent;
  font-size: 13px; cursor: pointer; font-family: inherit; white-space: nowrap;
  transition: opacity .15s;
}
.btn:hover { opacity: .85; text-decoration: none; }
.btn-primary   { background: var(--blue);   color: #fff; }
.btn-success   { background: var(--green);  color: #fff; }
.btn-danger    { background: var(--red);    color: #fff; }
.btn-warning   { background: var(--orange); color: #fff; }
.btn-secondary { background: #95a5a6;       color: #fff; }
.btn-sm { padding: 3px 8px; font-size: 12px; }
.btn-outline-primary { background: #fff; color: var(--blue); border-color: var(--blue); }
.btn-icon { background: none; border: none; cursor: pointer; padding: 4px 6px; font-size: 14px; }
.btn-icon:hover { opacity: .7; }

/* ---- TABLES ---- */
.table-wrap { background: #fff; border: 1px solid #ddd; border-radius: 4px; overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  background: #fff; padding: 10px 8px; text-align: left;
  border-bottom: 2px solid #ddd; font-weight: bold; color: var(--blue);
  cursor: pointer; white-space: nowrap;
}
thead th:hover { color: var(--red); }
tbody td { padding: 8px; border-bottom: 1px solid #f0f0f0; vertical-align: top; }
tbody tr:hover { background: #f8f9fa; }
tbody tr:last-child td { border-bottom: none; }
.table-controls {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border-bottom: 1px solid #eee; background: #fff;
}
.table-controls label { font-size: 13px; color: #555; }
.table-controls select { padding: 3px 6px; font-size: 13px; }
.table-search { display: flex; align-items: center; gap: 6px; }
.table-search input { padding: 4px 8px; border: 1px solid #ddd; border-radius: 3px; font-size: 13px; width: 200px; }
.table-footer { padding: 8px 12px; font-size: 12px; color: #777; background: #fff; border-top: 1px solid #eee; display: flex; justify-content: space-between; align-items: center; }
.pagination { display: flex; gap: 4px; }
.pagination button { padding: 3px 8px; font-size: 12px; border: 1px solid #ddd; background: #fff; cursor: pointer; border-radius: 2px; }
.pagination button.active { background: var(--blue); color: #fff; border-color: var(--blue); }
.pagination button:disabled { color: #ccc; cursor: default; }

/* ---- DATE RANGE BAR ---- */
.date-range-bar {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 12px; flex-wrap: wrap;
}
.date-range-bar label { font-size: 13px; }
.date-range-bar input[type=date] { padding: 4px 8px; border: 1px solid #ddd; border-radius: 3px; font-size: 13px; }

/* ---- FORMS ---- */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 13px; margin-bottom: 4px; font-weight: bold; color: #555; }
.form-control {
  width: 100%; padding: 6px 10px; border: 1px solid #ccc; border-radius: 3px;
  font-size: 13px; font-family: inherit;
}
.form-control:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 2px rgba(41,128,185,.2); }
select.form-control { height: 32px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.form-inline { display: flex; align-items: center; gap: 8px; }
.form-section { background: #fff; border: 1px solid #ddd; border-radius: 4px; padding: 16px; margin-bottom: 16px; }
.form-section-title { font-size: 14px; font-weight: bold; color: var(--red); margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid #eee; }
.checkbox-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid #f0f0f0; }
.checkbox-row:last-child { border-bottom: none; }
.checkbox-row label { font-size: 13px; }
.checkbox-row small { display: block; color: #777; font-size: 11px; margin-top: 2px; max-width: 600px; }

/* ---- MODALS ---- */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.5); z-index: 1000;
  align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
  background: #fff; border-radius: 6px; width: 560px; max-width: 95vw;
  max-height: 90vh; overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0,0,0,.3);
}
.modal-header {
  padding: 14px 18px; background: #f9f9f9; border-bottom: 1px solid #ddd;
  display: flex; align-items: center; justify-content: space-between;
  border-radius: 6px 6px 0 0;
}
.modal-title { font-size: 16px; font-weight: bold; }
.modal-close { background: none; border: none; font-size: 20px; cursor: pointer; color: #999; line-height: 1; }
.modal-close:hover { color: #333; }
.modal-body { padding: 18px; }
.modal-footer { padding: 12px 18px; border-top: 1px solid #eee; display: flex; justify-content: flex-end; gap: 8px; }

/* ---- BADGES / STATUS ---- */
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 3px;
  font-size: 11px; font-weight: bold; text-transform: uppercase;
}
.badge-quoted    { background: #f39c12; color: #fff; }
.badge-scheduled { background: #2980b9; color: #fff; }
.badge-complete  { background: #2c3e50; color: #fff; }
.badge-pending   { background: #e67e22; color: #fff; }
.badge-cancelled { background: #c0392b; color: #fff; }
.badge-active    { background: #27ae60; color: #fff; }
.badge-inactive  { background: #95a5a6; color: #fff; }
.badge-driver    { background: #3498db; color: #fff; }
.badge-owner     { background: #8e44ad; color: #fff; }

/* ---- TOAST ---- */
#toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast {
  padding: 12px 18px; border-radius: 4px; color: #fff;
  font-size: 13px; min-width: 240px; max-width: 360px;
  box-shadow: 0 4px 12px rgba(0,0,0,.2);
  animation: slideIn .3s ease;
}
.toast-success { background: var(--green); }
.toast-error   { background: var(--red); }
.toast-info    { background: var(--blue); }
.toast-warning { background: var(--orange); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ---- CALENDAR ---- */
.calendar-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.calendar-nav h2 { font-size: 16px; }
.cal-view-btns { display: flex; gap: 4px; }
.cal-view-btns button { padding: 4px 10px; font-size: 12px; border: 1px solid #ddd; background: #fff; cursor: pointer; }
.cal-view-btns button.active { background: var(--blue); color: #fff; border-color: var(--blue); }
.calendar-grid { width: 100%; border-collapse: collapse; }
.calendar-grid th { background: #f5f5f5; padding: 8px; text-align: center; border: 1px solid #ddd; font-size: 12px; }
.calendar-grid td { width: 14.28%; border: 1px solid #ddd; padding: 4px; vertical-align: top; min-height: 80px; }
.cal-day-num { font-size: 12px; color: #888; margin-bottom: 4px; }
.cal-event {
  background: var(--blue); color: #fff; font-size: 11px; padding: 2px 4px;
  border-radius: 2px; margin-bottom: 2px; cursor: pointer; line-height: 1.3;
}
.cal-event:hover { opacity: .85; }
.cal-today { background: #fffde7; }

/* ---- MAP PLACEHOLDER ---- */
.map-container {
  background: #e8f4f8; border: 1px solid #ddd; border-radius: 4px;
  flex: 1; min-height: 400px; position: relative; overflow: hidden;
}
.map-container img { width: 100%; height: 100%; object-fit: cover; }
.map-placeholder { display: flex; align-items: center; justify-content: center; height: 100%; font-size: 18px; color: #aaa; }

/* ---- RESERVATION ROW ---- */
.res-group-date {
  background: #3d6b99; color: #fff; padding: 6px 10px; font-size: 13px; font-weight: bold;
}
.res-row-left { font-size: 12px; color: #888; }
.res-row-num { font-weight: bold; color: var(--blue); font-size: 13px; }
.res-row-dba { font-size: 11px; color: #555; }
.res-time { font-size: 12px; }
.res-time .pickup-time { font-weight: bold; }
.res-passenger { color: var(--red); font-weight: bold; }
.res-passenger small { color: #555; font-weight: normal; }
.res-location { font-size: 12px; }
.res-flight { background: #555; color: #fff; font-size: 11px; padding: 1px 5px; border-radius: 2px; display: inline-block; margin-top: 2px; }
.vehicle-badge { background: #555; color: #fff; font-size: 11px; padding: 2px 6px; border-radius: 2px; display: inline-block; }
.driver-badge { font-size: 11px; color: #555; margin-top: 2px; }
.driver-badge .check { color: var(--green); }

/* ---- SIDEBAR MAP PANEL ---- */
.track-layout { display: flex; gap: 12px; height: calc(100vh - 120px); }
.track-driver-list { width: 240px; flex-shrink: 0; background: #fff; border: 1px solid #ddd; border-radius: 4px; overflow-y: auto; }
.track-driver-list h3 { padding: 10px 12px; border-bottom: 1px solid #eee; font-size: 13px; background: #f5f5f5; }
.track-driver-item { display: flex; align-items: center; justify-content: space-between; padding: 6px 12px; border-bottom: 1px solid #f5f5f5; font-size: 13px; color: var(--blue); cursor: pointer; }
.track-driver-item:hover { background: #f0f4f8; }
.track-offline { color: #e74c3c; }

/* ---- INFO BOX ---- */
.info-box { background: #f0f4f8; border-left: 4px solid var(--blue); padding: 12px 14px; border-radius: 0 4px 4px 0; margin-bottom: 16px; font-size: 13px; }
.info-box.warning { border-color: var(--orange); background: #fef9f0; }
.info-box.danger  { border-color: var(--red);    background: #fdf0f0; }
.info-box ul { padding-left: 18px; margin-top: 6px; }
.info-box li { margin-bottom: 3px; }

/* ---- SECTION HEADING ---- */
.section-title { font-size: 15px; font-weight: bold; color: var(--red); margin-bottom: 4px; }
.section-desc  { font-size: 12px; color: #666; margin-bottom: 14px; }

/* ---- VEHICLE TYPE CARD ---- */
.vtype-card { background: #fff; border: 1px solid #ddd; border-radius: 4px; padding: 12px; display: flex; gap: 12px; align-items: flex-start; }
.vtype-img { width: 100px; height: 70px; object-fit: cover; border-radius: 3px; background: #eee; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 28px; }
.vtype-info { flex: 1; }
.vtype-name { font-weight: bold; font-size: 14px; }
.vtype-cap { font-size: 12px; color: #666; }

/* ---- PRICING TABLE ---- */
.pricing-section { background: #fff; border: 1px solid #ddd; border-radius: 4px; margin-bottom: 12px; overflow: hidden; }
.pricing-section-header { background: #555; color: #fff; padding: 8px 12px; font-size: 13px; font-weight: bold; display: flex; justify-content: space-between; }
.pricing-table { width: 100%; border-collapse: collapse; }
.pricing-table th { background: #f5f5f5; padding: 8px; font-size: 12px; border-bottom: 1px solid #ddd; text-align: left; }
.pricing-table td { padding: 7px 8px; border-bottom: 1px solid #f5f5f5; font-size: 12px; }

/* ---- PAYROLL ---- */
.payroll-driver-header { color: var(--red); font-size: 15px; font-weight: bold; margin: 16px 0 6px; }
.payroll-total-row { background: #f0f7f0; font-weight: bold; }

/* ---- INVOICE ---- */
.invoice-preview { background: #fff; border: 1px solid #ddd; padding: 30px; max-width: 700px; }
.invoice-header { display: flex; justify-content: space-between; margin-bottom: 24px; }
.invoice-to h3 { font-size: 14px; margin-bottom: 6px; }
.invoice-details { text-align: right; }
.invoice-details h2 { font-size: 22px; color: var(--navy); margin-bottom: 6px; }
.invoice-table th { background: var(--navy); color: #fff; padding: 8px 10px; font-size: 13px; }
.invoice-table td { padding: 8px 10px; border-bottom: 1px solid #eee; font-size: 13px; }
.invoice-total { display: flex; justify-content: flex-end; margin-top: 12px; }
.invoice-total table td { padding: 4px 12px; }
.invoice-grand { font-weight: bold; font-size: 15px; }

/* ---- PUBLIC BOOKING FORM ---- */
.booking-hero {
  background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
  color: #fff; padding: 60px 20px; text-align: center;
}
.booking-hero h1 { font-size: 36px; margin-bottom: 10px; }
.booking-hero p  { font-size: 16px; opacity: .85; }
.booking-form-card { background: #fff; border-radius: 8px; padding: 28px; max-width: 720px; margin: -30px auto 30px; box-shadow: 0 4px 20px rgba(0,0,0,.15); }
.step-indicator { display: flex; justify-content: center; gap: 0; margin-bottom: 24px; }
.step { padding: 8px 20px; background: #eee; color: #888; font-size: 13px; position: relative; }
.step.active { background: var(--blue); color: #fff; }
.step.done   { background: var(--green); color: #fff; }
.step:not(:last-child)::after {
  content: ''; position: absolute; right: -10px; top: 0;
  width: 0; height: 100%; border-left: 10px solid transparent;
}
.vehicle-option { border: 2px solid #ddd; border-radius: 6px; padding: 14px; cursor: pointer; transition: all .2s; display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.vehicle-option:hover, .vehicle-option.selected { border-color: var(--blue); background: #f0f7ff; }
.vehicle-option img { width: 80px; height: 55px; object-fit: cover; border-radius: 3px; background: #eee; }
.vehicle-option-info h3 { font-size: 14px; margin-bottom: 3px; }
.vehicle-option-price { font-size: 16px; font-weight: bold; color: var(--green); }

/* ---- CUSTOMER PORTAL ---- */
.portal-header { background: var(--navy); color: #fff; padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; }
.portal-nav { display: flex; gap: 12px; }
.portal-nav a { color: #bdc3c7; font-size: 13px; }
.portal-nav a.active, .portal-nav a:hover { color: #fff; }

/* ---- DRIVER APP ---- */
.driver-header { background: var(--navy); color: #fff; padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; }
.driver-trip-card { background: #fff; border: 1px solid #ddd; border-radius: 6px; padding: 14px; margin-bottom: 10px; }
.driver-trip-card h3 { font-size: 14px; font-weight: bold; margin-bottom: 6px; }
.driver-status-btn { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.driver-earnings { background: var(--navy); color: #fff; border-radius: 8px; padding: 16px; text-align: center; margin-bottom: 16px; }
.driver-earnings h2 { font-size: 28px; }

/* ---- CHART BARS ---- */
.chart-bar-wrap { display: flex; align-items: flex-end; gap: 8px; height: 160px; padding: 0 4px; }
.chart-bar-col { display: flex; flex-direction: column; align-items: center; flex: 1; height: 100%; justify-content: flex-end; }
.chart-bar { background: var(--blue); width: 100%; border-radius: 3px 3px 0 0; transition: height .4s; }
.chart-bar-label { font-size: 10px; color: #888; margin-top: 4px; }
.chart-bar-val { font-size: 11px; color: #555; margin-bottom: 3px; }

/* ---- STAR ---- */
.star { color: #ddd; cursor: pointer; font-size: 16px; }
.star.filled { color: #e74c3c; }

/* ---- MISC ---- */
.text-red  { color: var(--red); }
.text-blue { color: var(--blue); }
.text-green { color: var(--green); }
.text-gray { color: var(--gray); }
.mt-8  { margin-top: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.flex  { display: flex; }
.flex-center { display: flex; align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.bold  { font-weight: bold; }
.small { font-size: 11px; }
.nowrap { white-space: nowrap; }

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .form-row { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---- PRINT ---- */
@media print {
  .sidebar, .topbar, .page-actions, .no-print { display: none !important; }
  .content { padding: 0; }
}
