/* ============================================
   TALLER VELOCIDAD & SERVICIO - Design System
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@500;600;700&family=DM+Sans:wght@300;400;500;600&display=swap');

/* ===== CSS Variables ===== */
:root {
  --primary: #FF6B00;
  --primary-dark: #cc5500;
  --primary-light: #FF8C38;
  --secondary: #1A1A2E;
  --surface: #ffffff;
  --surface-2: #F7F8FA;
  --surface-3: #EFF1F5;
  --border: #E2E6EC;
  --text-main: #1A1A2E;
  --text-muted: #6B7280;
  --text-light: #9CA3AF;
  --success: #10B981;
  --danger: #EF4444;
  --info: #3B82F6;
  --warning: #F59E0B;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 18px;

  --font-display: 'Rajdhani', sans-serif;
  --font-body: 'DM Sans', sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background-color: var(--surface-2);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
}

/* ===== Header ===== */
.site-header {
  background: var(--secondary);
  color: white;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 64px;
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header .logo-icon {
  font-size: 28px;
}

.site-header h1 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: white;
  flex: 1;
}

.site-header h1 span {
  color: var(--primary);
}

.header-badge {
  background: var(--primary);
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

/* ===== Main ===== */
main {
  flex: 1;
  padding: 24px 16px;
  max-width: 860px;
  margin: 0 auto;
  width: 100%;
}

/* ===== Page Title Bar ===== */
.page-title-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.page-title-bar h2 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: 0.3px;
}

.page-title-bar h2 span {
  color: var(--primary);
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
  text-decoration: none;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-primary:hover { background: var(--primary-dark); }

.btn-secondary {
  background: var(--secondary);
  color: white;
}
.btn-secondary:hover { background: #2d2d4e; }

.btn-success {
  background: var(--success);
  color: white;
}
.btn-success:hover { background: #059669; }

.btn-danger {
  background: var(--danger);
  color: white;
}
.btn-danger:hover { background: #DC2626; }

.btn-info {
  background: var(--info);
  color: white;
}
.btn-info:hover { background: #2563EB; }

.btn-ghost {
  background: var(--surface-3);
  color: var(--text-muted);
}
.btn-ghost:hover {
  background: var(--border);
  color: var(--text-main);
}

.btn-back {
  background: transparent;
  color: var(--text-muted);
  border: 1.5px solid var(--border);
  padding: 8px 14px;
  font-size: 13px;
}
.btn-back:hover {
  background: var(--surface-3);
  color: var(--text-main);
  box-shadow: none;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-block {
  width: 100%;
  justify-content: center;
}

.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

/* ===== Inputs ===== */
.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

input, textarea, select {
  display: block;
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--text-main);
  background: var(--surface);
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
  appearance: none;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.12);
}

input[readonly] {
  background: var(--surface-3);
  color: var(--text-muted);
  cursor: not-allowed;
}

textarea {
  resize: vertical;
  min-height: 90px;
}

.input-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.input-row input { flex: 1; }

/* ===== Search Bar ===== */
.search-bar {
  display: flex;
  gap: 10px;
  align-items: stretch;
  margin-bottom: 20px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 8px;
  box-shadow: var(--shadow-sm);
}

.search-bar input {
  border: none;
  background: transparent;
  box-shadow: none;
  padding: 8px 10px;
  font-size: 16px;
}

.search-bar input:focus {
  border: none;
  box-shadow: none;
}

.search-bar .btn {
  flex-shrink: 0;
}

/* ===== Cards ===== */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  padding: 20px;
  margin-bottom: 16px;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1.5px solid var(--surface-3);
}

.card-header h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
}

.card-header .card-icon {
  width: 34px;
  height: 34px;
  background: var(--primary);
  color: white;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
}

/* ===== Info Block (Cliente/Dueno) ===== */
.info-block {
  background: linear-gradient(135deg, #1A1A2E 0%, #16213E 100%);
  color: white;
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
}

.info-block-item strong {
  display: block;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--primary);
  margin-bottom: 2px;
}

.info-block-item span {
  font-size: 15px;
  font-weight: 500;
  color: white;
}

/* ===== Message / Alerts ===== */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.alert-success {
  background: #D1FAE5;
  color: #065F46;
  border-left: 4px solid var(--success);
}

.alert-error {
  background: #FEE2E2;
  color: #991B1B;
  border-left: 4px solid var(--danger);
}

.alert-info {
  background: #DBEAFE;
  color: #1E40AF;
  border-left: 4px solid var(--info);
}

.alert-warning {
  background: #FEF3C7;
  color: #92400E;
  border-left: 4px solid var(--warning);
}

/* ===== Table ===== */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  font-size: 14px;
}

thead {
  background: var(--secondary);
  color: white;
}

th {
  padding: 12px 14px;
  text-align: left;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  white-space: nowrap;
}

td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--surface-3);
  color: var(--text-main);
  vertical-align: middle;
}

tr:last-child td { border-bottom: none; }

tbody tr {
  cursor: pointer;
  transition: background 0.12s;
}

tbody tr:hover {
  background: rgba(255, 107, 0, 0.05);
}

/* ===== Sections ===== */
.section-label {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-label::after {
  content: '';
  flex: 1;
  height: 1.5px;
  background: var(--border);
}

/* ===== Historial Cards ===== */
.hist-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  border-left: 4px solid var(--primary);
  transition: box-shadow 0.15s;
}

.hist-card:hover {
  box-shadow: var(--shadow-md);
}

.hist-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  flex-wrap: wrap;
  gap: 8px;
}

.hist-card-date {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
}

.hist-card-km {
  background: var(--primary);
  color: white;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.hist-card-rows {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 8px;
}

.hist-card-field strong {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-light);
  margin-bottom: 2px;
}

.hist-card-field span {
  font-size: 14px;
  color: var(--text-main);
}

/* ===== Footer ===== */
.site-footer {
  background: var(--secondary);
  color: rgba(255,255,255,0.6);
  text-align: center;
  padding: 14px;
  font-size: 12px;
  margin-top: auto;
}

.site-footer span {
  color: var(--primary);
  font-weight: 600;
}

/* ===== Divider ===== */
.divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}

/* ===== Empty state ===== */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.empty-state .empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.5;
}

.empty-state p {
  font-size: 15px;
}

/* ===== Placa badge ===== */
.placa-badge {
  display: inline-block;
  background: var(--secondary);
  color: var(--primary);
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: 6px;
  letter-spacing: 2px;
  border: 2px solid var(--primary);
}

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

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
  main {
    padding: 16px 12px;
  }

  .site-header h1 {
    font-size: 17px;
  }

  .header-badge {
    display: none;
  }

  .page-title-bar h2 {
    font-size: 22px;
  }

  .btn {
    padding: 10px 14px;
    font-size: 13px;
  }

  .btn-group {
    gap: 6px;
  }

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

  th, td {
    padding: 9px 10px;
    font-size: 13px;
  }

  .card {
    padding: 14px;
  }

  .input-row {
    flex-direction: column;
  }

  .input-row .btn { width: 100%; justify-content: center; }
}

@media (max-width: 380px) {
  .info-block {
    grid-template-columns: 1fr;
  }
  
  .btn-group .btn {
    flex: 1;
    justify-content: center;
  }
}
