/* Extracted verbatim from the original index.html <style> block. */

* {
  font-family: 'Cairo', sans-serif;
}

body {
  background: #f0f4f8;
  min-height: 100vh;
}

/* Header */
.app-header {
  background: linear-gradient(135deg, #1a73e8, #0d47a1);
  color: #fff;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 4px 20px rgba(26, 115, 232, .35);
}

.app-header h4 {
  margin: 0;
  font-weight: 800;
  font-size: 1.15rem;
}

.app-header .sub {
  opacity: .8;
  font-size: .78rem;
}

/* Tabs */
.nav-tabs {
  border: none;
  gap: 3px;
  padding: 10px 0 0;
  background: #f0f4f8;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.nav-tabs::-webkit-scrollbar { display: none; }

.nav-tabs .nav-link {
  border: none;
  color: #64748b;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 8px 8px 0 0;
  transition: all .2s;
}
.nav-tabs .nav-link:hover {
  background: #e8f0fe;
  color: #1a73e8;
}
.nav-tabs .nav-link.active {
  background: #fff;
  color: #1a73e8;
  border-bottom: 3px solid #1a73e8;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, .07);
}

/* Card */
.card {
  border: none;
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .08);
}

/* KPI */
.kpi-card {
  border-radius: 16px;
  padding: 20px 22px;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.kpi-card::after {
  content: '';
  position: absolute;
  width: 80px; height: 80px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
  bottom: -20px; left: -20px;
}
.kpi-icon { font-size: 2rem; opacity: .9; }
.kpi-value { font-size: 1.9rem; font-weight: 800; line-height: 1.1; }
.kpi-label { font-size: .78rem; opacity: .82; }
.kpi-blue   { background: linear-gradient(135deg, #1a73e8, #1557b0); }
.kpi-red    { background: linear-gradient(135deg, #ea4335, #b71c1c); }
.kpi-amber  { background: linear-gradient(135deg, #f59e0b, #b45309); }
.kpi-green  { background: linear-gradient(135deg, #34a853, #1e7e34); }
.kpi-purple { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }

/* Dashboard alert table */
.tr-late { background: #fff5f5 !important; }
.tr-soon { background: #fffdf0 !important; }
.badge-late {
  background: #fee2e2; color: #dc2626;
  padding: 3px 12px; border-radius: 20px;
  font-size: .76rem; font-weight: 700;
}
.badge-soon {
  background: #fef9c3; color: #b45309;
  padding: 3px 12px; border-radius: 20px;
  font-size: .76rem; font-weight: 700;
}
.tr-info { background: #f8fafc !important; }
.badge-info {
  background: #e2e8f0; color: #475569;
  padding: 3px 12px; border-radius: 20px;
  font-size: .76rem; font-weight: 700;
}

.sec-title {
  font-size: 1.05rem; font-weight: 700; color: #1e293b;
  padding-bottom: 10px; border-bottom: 2px solid #e5e7eb;
  margin-bottom: 18px;
}

.table thead th {
  background: #f8fafc; color: #64748b;
  font-weight: 700; font-size: .78rem;
  text-transform: uppercase; letter-spacing: .4px;
  border-bottom: 2px solid #e5e7eb;
}
.table tbody tr:hover { background: #f8fafc; }

/* Ticket rows (Reports) */
.ticket-row {
  border: 1px solid #e5e7eb; border-radius: 12px;
  padding: 14px 18px; margin-bottom: 10px;
  background: #fff; display: flex;
  align-items: center; gap: 14px;
  transition: box-shadow .2s;
}
.ticket-row:hover { box-shadow: 0 4px 16px rgba(0, 0, 0, .1); }
.t-date { color: #64748b; font-size: .8rem; min-width: 88px; }
.t-car  { font-weight: 600; flex: 1; font-size: .92rem; }
.t-car small { color: #94a3b8; }
.t-badge {
  background: #e8f0fe; color: #1a73e8;
  padding: 3px 10px; border-radius: 20px;
  font-size: .76rem; white-space: nowrap;
}
.t-cost {
  font-weight: 800; color: #059669;
  font-size: 1rem; min-width: 85px; text-align: center;
}
.btn-view {
  background: #1a73e8; color: #fff; border: none;
  padding: 6px 14px; border-radius: 8px;
  font-size: .8rem; font-weight: 600;
  cursor: pointer; white-space: nowrap; transition: background .2s;
}
.btn-view:hover { background: #1557b0; }

.filter-bar {
  background: #fff; border-radius: 12px;
  padding: 14px 18px; margin-bottom: 14px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, .06);
}
.summary-bar {
  background: #1e293b; color: #fff;
  border-radius: 10px; padding: 12px 20px;
  display: flex; justify-content: space-between;
  align-items: center; margin-top: 14px;
}

.total-panel {
  background: linear-gradient(135deg, #e8f0fe, #d2e3fc);
  border-radius: 14px; padding: 18px 20px; text-align: center;
}
.total-panel .tv { font-size: 2rem; font-weight: 800; color: #1a73e8; }
.total-panel .labor-row {
  border-top: 1px dashed #93c5fd; margin-top: 12px; padding-top: 12px;
}

.plate {
  background: #1e293b; color: #f0f4f8;
  padding: 2px 10px; border-radius: 6px;
  font-weight: 700; font-size: .82rem; letter-spacing: 1px;
}

.loading {
  display: none; position: fixed; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 9999; background: #fff;
  padding: 25px; border-radius: 15px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, .2);
}
.overlay {
  display: none; position: fixed; top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, .38); z-index: 9998;
}
.toast-stack {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%); z-index: 10000;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.toast-item {
  padding: 11px 26px; border-radius: 10px;
  font-weight: 600; box-shadow: 0 4px 16px rgba(0, 0, 0, .2);
  transition: opacity .4s ease;
}

.grad-header {
  background: linear-gradient(135deg, #1a73e8, #1557b0);
  color: #fff;
}

@media (max-width: 768px) {
  .app-header { padding: 12px 14px; }
  .app-header h4 { font-size: 1rem; }
  .app-header .sub { font-size: 0.7rem; }
  .ticket-row { flex-wrap: wrap; gap: 10px; }
  .ticket-row .t-car { min-width: 100%; order: 1; }
  .ticket-row .t-date { order: 2; }
  .ticket-row .t-badge { order: 3; }
  .ticket-row .t-cost { order: 4; }
  .ticket-row .btn-view { width: 100%; order: 5; margin-top: 5px; }
  .ticket-row .d-flex { width: 100%; order: 6; }
  .summary-bar { flex-direction: column; align-items: center; gap: 8px; text-align: center; }
  .kpi-card { padding: 16px; }
  .sec-title { font-size: 0.95rem; }
}

@media print {
  /* Hide all application chrome and the page content behind the modal.
     The record detail is rendered inside #mainModal's .modal-content, which
     is a sibling of #appRoot, so hiding the app shell keeps only the
     record visible. */
  #appRoot,
  #overlay, #loader, .toast-stack, #loginRoot,
  .modal-backdrop {
    display: none !important;
  }

  /* Hide modal controls: the header close button and the footer row
     (Close / Edit / Correct / Print all carry no record information). */
  .modal-header .btn-close,
  .modal-footer {
    display: none !important;
  }

  /* Render the modal as clean flowing content for print:
     no backdrop, no shadow, no border, no vertical centering. */
  .modal {
    position: static !important;
    background: transparent !important;
  }
  .modal-dialog {
    transform: none !important;
    margin: 0 !important;
    max-width: 100% !important;
    background: transparent !important;
  }
  .modal-content {
    box-shadow: none !important;
    border: none !important;
    border-radius: 0 !important;
  }
}

/* Login form (added) */
.login-card {
  max-width: 420px; margin: 80px auto; padding: 32px;
  background: #fff; border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,.08);
}
.login-card h3 { color: #1e293b; font-weight: 800; }

/* Tab hidden state for role-based hiding */
.nav-item.hidden { display: none !important; }
