/* VehiculeApp - Design BLEU pro */
:root {
  --primary: #0a4ea8;
  --primary-dark: #073a82;
  --primary-light: #2b6fd8;
  --accent: #ff8a00;
  --bg: #f3f6fb;
  --card: #ffffff;
  --text: #0b1a33;
  --text-muted: #6b7a92;
  --border: #e3e8f0;
  --success: #15a34a;
  --danger: #e02424;
  --shadow: 0 6px 18px rgba(10,78,168,.08);
  --radius: 16px;
}
[data-theme="dark"] {
  --bg: #050b1a;
  --card: #0f1a30;
  --text: #e8eefb;
  --text-muted: #94a3b8;
  --border: #1c2742;
  --shadow: 0 6px 18px rgba(0,0,0,.5);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin:0; padding:0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, Inter, sans-serif;
  background: var(--bg);
  color: var(--text);
  padding-bottom: 84px;
  min-height: 100vh;
  transition: background .3s, color .3s;
  overscroll-behavior-y: contain;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }

.app-header {
  background: linear-gradient(135deg, var(--primary-light), var(--primary-dark));
  color: #fff;
  padding: 22px 18px 30px;
  border-radius: 0 0 24px 24px;
  position: relative;
  display:flex; align-items:center; gap:10px;
}
.app-header h1 { margin:0; font-size: 20px; font-weight:700; }
.app-header a { color:#fff; }
.app-header .back { width:38px;height:38px;border-radius:50%;background:rgba(255,255,255,.18);display:inline-flex;align-items:center;justify-content:center; }
.bell { width:38px;height:38px;border-radius:50%;background:rgba(255,255,255,.18);display:flex;align-items:center;justify-content:center;color:#fff; }

.account-card {
  background: linear-gradient(135deg, var(--primary-light), var(--primary-dark));
  color:#fff; border-radius: var(--radius);
  padding: 18px; margin: -18px 16px 16px;
  box-shadow: var(--shadow); animation: slideUp .4s ease;
}
.account-card .balance { font-size: 30px; font-weight: 800; }
.account-card .label { opacity:.85; font-size:11px; letter-spacing:.7px; text-transform:uppercase; }

.favoris {
  background: linear-gradient(135deg, var(--primary-light), var(--primary-dark));
  margin: 0; padding: 18px 16px 24px;
  border-radius: 0 0 24px 24px;
  color:#fff;
}
.favoris h3 { margin: 14px 0 10px; font-size:14px; font-weight:600; opacity:.95; }
.grid-actions { display:grid; grid-template-columns:repeat(4, 1fr); gap:10px; }
.grid-actions .item {
  background: rgba(255,255,255,.14);
  backdrop-filter: blur(8px);
  border-radius: 14px;
  padding: 14px 6px;
  text-align: center;
  color:#fff;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,.1);
  transition: transform .15s ease, background .2s;
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;
  min-height: 80px;
}
.grid-actions .item:active { transform: scale(.95); background: rgba(255,255,255,.25); }
.grid-actions .item svg { width:24px;height:24px; }

.section { padding: 16px; }
.section-title { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing:.7px; margin: 18px 0 8px; font-weight:700; }
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
  animation: fadeIn .3s ease;
}
.list-item {
  display:flex; align-items:center; gap:12px;
  padding: 14px 16px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}
.list-item:active { background: var(--bg); }
.list-item .ic-box {
  width:42px;height:42px;border-radius:12px;background: color-mix(in srgb, var(--primary) 12%, transparent);
  display:flex;align-items:center;justify-content:center;color:var(--primary);
  flex-shrink:0;
}
.list-item .meta { flex:1; min-width:0; }
.list-item .title { font-weight:600; font-size:14px; }
.list-item .desc { color:var(--text-muted); font-size:12px; margin-top:2px; }

.form-group { margin-bottom: 14px; }
.form-group label { display:block; font-size:13px; font-weight:600; margin-bottom:6px; color:var(--text); }
input[type=text], input[type=password], input[type=tel], input[type=number],
input[type=email], input[type=file], select, textarea {
  width: 100%; padding: 14px; border: 1px solid var(--border);
  border-radius: 12px; background: var(--card); color: var(--text);
  font-size: 15px; font-family: inherit;
  transition: border-color .2s, box-shadow .2s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 20%, transparent);
}
textarea { resize: vertical; min-height: 90px; }

.btn {
  position: relative;
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  width: 100%; padding: 15px;
  border: none; border-radius: 14px;
  background: var(--primary); color: #fff;
  font-size: 15px; font-weight: 700; letter-spacing:.5px;
  cursor: pointer;
  transition: transform .12s ease, opacity .2s, box-shadow .2s;
  box-shadow: 0 6px 14px color-mix(in srgb, var(--primary) 25%, transparent);
}
.btn:active { transform: scale(.97); }
.btn[disabled], .btn.is-loading { opacity:.85; pointer-events:none; }
.btn-primary { background: var(--primary); }
.btn-accent { background: var(--accent); box-shadow: 0 6px 14px rgba(255,138,0,.25); }
.btn-secondary { background: var(--card); color: var(--text); border:1px solid var(--border); box-shadow:none; }
.btn-danger { background: var(--danger); }
.spinner {
  width:18px;height:18px;border:2.5px solid rgba(255,255,255,.35);
  border-top-color:#fff; border-radius:50%;
  animation: spin .7s linear infinite; display:inline-block;
}
.btn.is-loading .label-txt { opacity:.7; }
@keyframes spin { to { transform: rotate(360deg); } }

.radio-group { display:flex; gap:10px; }
.radio-group label {
  flex:1; padding:14px; border:1px solid var(--border); border-radius:12px;
  background:var(--card); text-align:center; cursor:pointer; font-weight:600;
  transition: all .2s;
}
.radio-group input { display:none; }
.radio-group label:has(input:checked) {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 10%, transparent);
  color: var(--primary);
}

.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--card); border-top: 1px solid var(--border);
  display: flex; justify-content: space-around;
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
  z-index: 100;
  box-shadow: 0 -4px 16px rgba(0,0,0,.04);
}
.bottom-nav a {
  flex:1; text-align:center; color: var(--text-muted);
  font-size: 11px; padding: 6px 4px;
  display:flex;flex-direction:column;align-items:center;gap:3px;
  transition: color .2s;
}
.bottom-nav a svg { width:22px;height:22px; }
.bottom-nav a.active { color: var(--primary); font-weight:700; }

.settings-row {
  display:flex; align-items:center; gap:12px;
  padding:14px 16px; background: var(--card); margin-bottom:1px;
  color: var(--text); border-radius: 14px;
}
.settings-row .ic-box {
  width:38px;height:38px;border-radius:10px;
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  color: var(--primary);
  display:flex;align-items:center;justify-content:center;
}
.settings-row .label { flex:1; font-weight:600; font-size:14px; }

.switch { position:relative; width:46px; height:26px; display:inline-block; }
.switch input { opacity:0; width:0; height:0; }
.switch .slider {
  position:absolute; cursor:pointer; inset:0;
  background:#cbd5e1; border-radius:26px; transition:.3s;
}
.switch .slider:before {
  content:""; position:absolute; height:20px; width:20px; left:3px; top:3px;
  background:#fff; border-radius:50%; transition:.3s; box-shadow:0 1px 4px rgba(0,0,0,.2);
}
.switch input:checked + .slider { background: var(--primary); }
.switch input:checked + .slider:before { transform: translateX(20px); }

.badge { display:inline-block; padding:2px 8px; border-radius:8px; font-size:11px; font-weight:700; text-transform:uppercase; }
.badge.green { background:#dcfce7; color:#15803d; }
.badge.red { background:#fee2e2; color:#b91c1c; }
.badge.amber { background:#fef3c7; color:#92400e; }

.empty { text-align:center; padding:40px 20px; color:var(--text-muted); }
.empty .ic { font-size:48px; opacity:.5; margin-bottom:8px; }
.text-center { text-align:center; }
.mt-2 { margin-top:8px; } .mt-3 { margin-top:14px; }

#toast-container {
  position: fixed; top: 12px; left: 50%; transform: translateX(-50%);
  z-index: 9999; display:flex; flex-direction:column; gap:8px;
  width: calc(100% - 24px); max-width: 420px;
}
.toast {
  display:flex; align-items:center; gap:10px;
  background: var(--card); color: var(--text);
  padding: 12px 14px; border-radius: 12px;
  box-shadow: 0 12px 30px rgba(0,0,0,.18);
  animation: slideDown .3s ease;
  border-left: 4px solid var(--primary);
}
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.info { border-left-color: var(--primary); }

@keyframes slideDown { from { transform: translateY(-20px); opacity:0; } to { transform: translateY(0); opacity:1; } }
@keyframes slideUp { from { transform: translateY(20px); opacity:0; } to { transform: translateY(0); opacity:1; } }
@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }
.page-enter { animation: slideUp .35s ease; }

/* Camera */
.camera-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  background: #000;
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 12px;
}
.camera-frame video, .camera-frame img.snapshot {
  width: 100%; height: 100%; object-fit: cover; display:block;
  background:#000;
}
.camera-frame .scan-line {
  position:absolute; left:8%; right:8%; top:50%;
  height:2px; background: linear-gradient(90deg, transparent, #ff8a00, transparent);
  box-shadow: 0 0 12px #ff8a00;
  animation: scan 2s linear infinite;
}
@keyframes scan { 0%,100% { top: 12%; } 50% { top: 88%; } }
.camera-controls { display:flex; justify-content:center; gap:14px; align-items:center; margin: 8px 0; }
.shutter {
  width:64px;height:64px;border-radius:50%;
  background:#fff; border:4px solid var(--primary);
  cursor:pointer; box-shadow: 0 6px 18px rgba(0,0,0,.25);
  transition: transform .15s;
}
.shutter:active { transform: scale(.92); }
.shutter::after {
  content:""; display:block; width:46px;height:46px;border-radius:50%;
  background:var(--primary); margin:5px;
}
.cam-btn {
  width:46px;height:46px;border-radius:50%;
  border:none; background: var(--card); color: var(--text);
  display:flex;align-items:center;justify-content:center;
  box-shadow: var(--shadow); cursor:pointer;
}

/* Print POS receipt */
@media print {
  body { background:#fff; padding:0; }
  .noprint { display:none !important; }
}
.receipt {
  width: 80mm; max-width: 100%;
  margin: 0 auto; padding: 12px;
  font-family: 'Courier New', monospace;
  color: #000; background: #fff;
  font-size: 12px;
}
.receipt .center { text-align:center; }
.receipt h2 { margin: 4px 0; font-size:16px; letter-spacing:1px; }
.receipt .sep { border:none; border-top:1px dashed #000; margin: 8px 0; }
.receipt table { width:100%; font-size:11px; border-collapse:collapse; }
.receipt table th, .receipt table td { padding: 3px 2px; border-bottom:1px dotted #999; text-align:left; vertical-align:top; }
.receipt .row { display:flex; justify-content:space-between; margin: 2px 0; }
.receipt .total { font-weight:bold; font-size:13px; border-top:1px dashed #000; padding-top:6px; margin-top:6px; }
.receipt .footer-note { font-size:10px; text-align:center; margin-top:10px; }

@page { size: 80mm auto; margin: 4mm; }
