:root{
  --bg:#f4f6fb;
  --surface:#ffffff;
  --ink:#111827;
  --muted:#6b7280;
  --line:#e5e7eb;
  --brand:#111827;
  --brand-2:#2563eb;
  --soft-blue:#eff6ff;
  --soft-green:#ecfdf5;
}
*{box-sizing:border-box}
body{background:var(--bg);color:var(--ink);font-family:Inter,system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif}
.app-navbar{background:linear-gradient(135deg,#111827,#1f2937);box-shadow:0 12px 30px rgba(15,23,42,.18)}
.brand-mark{width:34px;height:34px;border-radius:12px;background:#fff;color:#111827;display:inline-flex;align-items:center;justify-content:center;font-weight:800;font-size:.8rem}
.navbar .nav-link{border-radius:12px;padding:.55rem .8rem}
.navbar .nav-link.active,.navbar .nav-link:hover{background:rgba(255,255,255,.12)}
.user-chip{color:#fff;background:rgba(255,255,255,.12);padding:.38rem .75rem;border-radius:999px;font-size:.85rem;font-weight:600;text-transform:capitalize}
.page-shell{padding:1.25rem 0 2rem}
.page-title{font-weight:800;letter-spacing:-.04em;margin:0}
.page-subtitle{color:var(--muted);margin:.25rem 0 0}
.card,.app-card{background:var(--surface);border:1px solid var(--line);border-radius:22px;box-shadow:0 12px 30px rgba(15,23,42,.055)}
.app-card{padding:1rem}
@media(min-width:768px){.app-card{padding:1.35rem}}
.stat-card{position:relative;overflow:hidden;min-height:125px}
.stat-card:after{content:"";position:absolute;right:-28px;bottom:-38px;width:110px;height:110px;border-radius:50%;background:rgba(37,99,235,.08)}
.stat-label{color:var(--muted);font-size:.86rem;font-weight:700;text-transform:uppercase;letter-spacing:.04em}
.stat-value{font-size:2rem;font-weight:850;letter-spacing:-.05em;margin-top:.45rem}
.form-label{font-weight:700;font-size:.88rem;color:#374151}
.form-control,.form-select{border-radius:14px;border-color:#d9dee8;padding:.72rem .9rem}
.form-control:focus,.form-select:focus{border-color:#2563eb;box-shadow:0 0 0 .18rem rgba(37,99,235,.12)}
.btn{border-radius:14px;font-weight:700}
.btn-lgx{font-size:1.06rem;padding:.95rem 1rem;border-radius:16px}
.table{margin-bottom:0}.table td,.table th{vertical-align:middle}.table thead th{color:#6b7280;font-size:.78rem;text-transform:uppercase;letter-spacing:.05em;border-bottom:1px solid var(--line)}
.driver-card{border-radius:24px;border:1px solid var(--line);box-shadow:0 14px 32px rgba(15,23,42,.08);position:relative;overflow:hidden}
.driver-card:before{content:"";position:absolute;left:0;top:0;bottom:0;width:7px;background:#2563eb}
.driver-title{font-size:1.35rem;font-weight:850;letter-spacing:-.03em;margin:0}
.driver-meta{font-size:.95rem;color:var(--muted)}
.driver-data{background:#f8fafc;border:1px solid #e5e7eb;border-radius:18px;padding:.85rem;margin:.9rem 0}
.driver-data b{display:block;color:#374151;font-size:.75rem;text-transform:uppercase;letter-spacing:.05em;margin-bottom:.2rem}
.signature{background:#fff;border:2px dashed #cbd5e1;border-radius:18px;width:100%;height:230px;touch-action:none}
.login-wrap{min-height:100vh;display:flex;align-items:center;background:radial-gradient(circle at top left,#dbeafe,transparent 32%),linear-gradient(135deg,#f8fafc,#eef2ff)}
.login-panel{border-radius:28px;padding:1.4rem}.login-brand{width:54px;height:54px;border-radius:18px;background:#111827;color:#fff;display:flex;align-items:center;justify-content:center;font-weight:850;margin-bottom:1rem}
.small-muted{font-size:.85rem;color:#6c757d}.soft-section{background:#f8fafc;border:1px solid #e5e7eb;border-radius:18px;padding:1rem}.section-title{font-size:1rem;font-weight:800;margin:0 0 .75rem}
.empty-state{text-align:center;background:#fff;border:1px dashed #cbd5e1;border-radius:22px;padding:2rem;color:#6b7280}.empty-state h5{color:#111827;font-weight:800}.empty-icon{width:58px;height:58px;border-radius:20px;background:#eff6ff;margin:0 auto 1rem}
.mobile-action-bar{position:sticky;bottom:0;background:rgba(244,246,251,.94);backdrop-filter:blur(8px);padding:.75rem;border-top:1px solid var(--line);z-index:20}
.map-preview{border:1px solid #dbe3ee;border-radius:18px;overflow:hidden;background:#eef2f7;box-shadow:0 8px 22px rgba(15,23,42,.08)}
.map-preview iframe{display:block;width:100%;height:220px;border:0}
.app-logo{height:34px;width:auto;background:#fff;border-radius:10px;padding:3px}
@media(max-width:768px){.hide-mobile{display:none!important}.btn-mobile{width:100%;margin-bottom:.5rem}.page-title{font-size:1.65rem}.driver-title{font-size:1.2rem}.app-card{border-radius:18px}.container{padding-left:14px;padding-right:14px}}
@media(min-width:992px){.container-xl{max-width:1180px}}

/* Mejoras v7: firma digital y vista previa de ubicación */
.signature-panel{background:#f8fafc;border:1px solid #e2e8f0;border-radius:20px;padding:1rem}
.signature{display:block;min-height:250px;height:250px;background:#fff;border:2px dashed #94a3b8;border-radius:16px;cursor:crosshair;touch-action:none;user-select:none;-webkit-user-select:none}
.signature:focus{outline:3px solid rgba(37,99,235,.18);border-color:#2563eb}
.signature-viewer{min-height:220px;display:flex;align-items:center;justify-content:center;background:#f8fafc;border:1px solid #e2e8f0;border-radius:18px;padding:1rem}
.signature-viewer img{display:block;max-width:100%;max-height:320px;object-fit:contain}
.map-preview{min-height:250px;position:relative}
.map-preview iframe{height:260px}
.map-loading,.map-error{min-height:250px;color:#64748b;background:linear-gradient(135deg,#f8fafc,#eef2f7)}
.location-heading{font-size:.92rem}
@media(max-width:575.98px){
  .signature-panel{padding:.75rem}
  .signature{height:42vh;min-height:260px}
  .modal-footer .btn{width:100%}
  .map-preview iframe,.map-loading,.map-error{height:240px;min-height:240px}
}

/* Ajustes v8: trazo de firma visible en tiempo real */
.signature{
  background-color:#fff!important;
  border:2px solid #64748b!important;
  box-shadow:inset 0 0 0 1px #e2e8f0,0 8px 24px rgba(15,23,42,.08);
  overscroll-behavior:contain;
  -webkit-tap-highlight-color:transparent;
}
.signature:active{border-color:#111827!important}
