/* css/style.css */
:root {
    --bg-main: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --brand-dark: #0f172a;
    --brand-blue: #2563eb;
    --border-color: #e2e8f0;
    --radius-card: 16px;
    --radius-input: 10px;
    --shadow-soft: 0 4px 20px -2px rgba(0, 0, 0, 0.05);
}

* { box-sizing: border-box; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
body { background-color: var(--bg-main); margin: 0; padding: 12px; color: var(--text-primary); -webkit-font-smoothing: antialiased; }

.app-wrapper { max-width: 580px; margin: 0 auto; padding-bottom: 95px; }

/* Navbar Minimalista */
.navbar { display: flex; justify-content: space-between; align-items: center; padding: 14px 4px; margin-bottom: 8px; }
.nav-brand { display: flex; align-items: center; gap: 10px; }
.brand-logo { width: 38px; height: 38px; background: var(--brand-dark); color: #fff; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 15px; }
.nav-brand h1 { margin: 0; font-size: 16px; font-weight: 800; letter-spacing: -0.3px; }
.nav-brand p { margin: 2px 0 0 0; font-size: 11px; color: var(--text-secondary); }
.nav-actions { display: flex; gap: 6px; }

/* Bento Cards */
.bento-card { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: var(--radius-card); padding: 18px; margin-bottom: 14px; box-shadow: var(--shadow-soft); }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.card-head h2 { margin: 0; font-size: 16px; font-weight: 700; color: var(--text-primary); }
.step-tag { font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 800; color: var(--brand-blue); display: block; margin-bottom: 2px; }
.badge-correlativo { background: #f1f5f9; border: 1px solid var(--border-color); padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 700; }
.section-desc { font-size: 12px; color: var(--text-secondary); margin: 0 0 12px 0; }

/* Botones & Inputs */
.btn-pill { padding: 7px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; cursor: pointer; border: none; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.btn-ghost { background: #fff; border: 1px solid var(--border-color); color: var(--text-primary); }
.btn-solid-dark { background: var(--brand-dark); color: #fff; }
.btn-solid-green { background: #16a34a; color: #fff; }
.btn-text-link { background: none; border: none; color: var(--brand-blue); font-size: 12px; font-weight: 600; cursor: pointer; text-decoration: underline; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-group { display: flex; flex-direction: column; }
.form-group.full-width { grid-column: span 2; }
.form-group label { font-size: 12px; font-weight: 600; color: #334155; margin-bottom: 4px; }
.input-modern { width: 100%; padding: 10px 12px; border: 1px solid var(--border-color); border-radius: var(--radius-input); font-size: 14px; background: #fff; color: var(--text-primary); outline: none; transition: border-color 0.2s; }
.input-modern:focus { border-color: var(--brand-blue); }

.vehicle-specs-pills { display: flex; gap: 8px; margin-top: 10px; }
.vehicle-specs-pills span { background: #f8fafc; border: 1px solid var(--border-color); padding: 4px 10px; border-radius: 8px; font-size: 11px; color: var(--text-secondary); }
.vehicle-specs-pills strong { color: var(--text-primary); }

/* Cédula OCR */
.id-scanner-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.id-box { border: 1px dashed #cbd5e1; border-radius: 12px; padding: 10px; text-align: center; background: #f8fafc; }
.id-box-title { font-size: 11px; font-weight: 700; color: var(--text-secondary); display: block; margin-bottom: 6px; }
.id-preview { height: 90px; background: #fff; border-radius: 8px; border: 1px solid var(--border-color); display: flex; align-items: center; justify-content: center; font-size: 11px; color: #94a3b8; overflow: hidden; margin-bottom: 8px; }
.btn-modern-upload { background: #fff; border: 1px solid var(--border-color); padding: 7px; border-radius: 8px; font-size: 11px; font-weight: 600; cursor: pointer; display: block; }
.status-msg { font-size: 12px; color: var(--brand-blue); margin-top: 8px; font-weight: 500; }

/* Toggle Días / Horas */
.toggle-mode { display: flex; background: #f1f5f9; padding: 3px; border-radius: 10px; gap: 4px; }
.btn-toggle { flex: 1; padding: 8px; border: none; border-radius: 8px; font-size: 12px; font-weight: 600; background: transparent; color: var(--text-secondary); cursor: pointer; }
.btn-toggle.active { background: #fff; color: var(--text-primary); box-shadow: 0 2px 4px rgba(0,0,0,0.06); }

/* Tacómetro Fluido */
.tacometro-card { background: #f8fafc; border: 1px solid var(--border-color); border-radius: 14px; padding: 14px; text-align: center; touch-action: none; }
.gauge-title { font-size: 13px; font-weight: 700; display: block; margin-bottom: 4px; }
.gauge-metrics { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; padding: 0 10px; }
.metric-box { font-size: 13px; color: var(--text-secondary); }
.metric-box strong { color: var(--text-primary); font-size: 15px; margin-left: 4px; }
.metric-tag { background: #dbeafe; color: var(--brand-blue); padding: 4px 10px; border-radius: 12px; font-size: 11px; font-weight: 700; }

/* Checklist */
.checklist-container { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; max-height: 220px; overflow-y: auto; padding: 8px; border: 1px solid var(--border-color); border-radius: 10px; background: #f8fafc; }
.custom-checkbox { display: flex; align-items: center; gap: 8px; font-size: 12px; cursor: pointer; }
.custom-checkbox input { accent-color: var(--brand-dark); width: 15px; height: 15px; }

/* Fotos Ráfaga */
.photo-step-box { background: #f8fafc; border: 1px solid var(--border-color); border-radius: 12px; padding: 10px; margin-bottom: 10px; }
.step-header-flex { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.step-name { font-size: 12px; font-weight: 600; }
.count-badge { font-size: 10px; background: #e2e8f0; padding: 2px 8px; border-radius: 10px; font-weight: 700; }
.btn-fast-cam { background: var(--brand-dark); color: #fff; padding: 7px 12px; border-radius: 8px; font-size: 11px; font-weight: 600; cursor: pointer; display: inline-block; }
.mini-grid { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.mini-photo { width: 50px; height: 50px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border-color); }

/* Firmas */
.sig-wrapper { background: #f8fafc; border: 1px solid var(--border-color); border-radius: 12px; padding: 12px; }
.sig-header { display: flex; justify-content: space-between; align-items: center; font-size: 12px; font-weight: 600; margin-bottom: 8px; }
.canvas-box { border: 1px dashed #cbd5e1; border-radius: 8px; background: #ffffff; height: 130px; width: 100%; overflow: hidden; }
.canvas-box canvas { width: 100%; height: 100%; touch-action: none; }
.btn-clear-sig { background: none; border: none; color: #ef4444; font-size: 11px; font-weight: 600; cursor: pointer; margin-top: 6px; }

/* Botón Flotante Fijo */
.footer-sticky { position: fixed; bottom: 0; left: 0; right: 0; background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(10px); border-top: 1px solid var(--border-color); padding: 12px; display: flex; justify-content: center; z-index: 100; }
.btn-primary-action { background: var(--brand-dark); color: #ffffff; border: none; padding: 14px 20px; width: 100%; max-width: 580px; border-radius: 12px; font-size: 15px; font-weight: 700; cursor: pointer; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 4px 14px rgba(15, 23, 42, 0.2); }
.arrow-icon { font-size: 18px; }

/* Modales */
.modal-overlay { display: none; position: fixed; z-index: 500; left: 0; top: 0; width: 100%; height: 100%; background: rgba(15, 23, 42, 0.6); backdrop-filter: blur(4px); align-items: center; justify-content: center; }
.modal-panel { background: #fff; width: 92%; max-width: 460px; border-radius: 20px; padding: 20px; max-height: 85vh; overflow-y: auto; box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1); }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.modal-head h3 { margin: 0; font-size: 17px; font-weight: 700; }
.btn-close { background: none; border: none; font-size: 24px; cursor: pointer; color: var(--text-secondary); }
.active-card { border: 1px solid var(--border-color); border-radius: 12px; padding: 12px; margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center; }
.active-card p { margin: 2px 0; font-size: 12px; color: var(--text-secondary); }

/* Pantalla Completa de Firmas */
.fullscreen-signature-overlay { display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; background: #ffffff; flex-direction: column; }
.fs-sig-container { width: 100%; height: 100%; display: flex; flex-direction: column; padding: 14px; }
.fs-sig-topbar { display: flex; justify-content: space-between; align-items: center; padding-bottom: 10px; border-bottom: 1px solid var(--border-color); font-weight: 700; }
.fs-sig-buttons { display: flex; gap: 8px; }
.fs-canvas-holder { flex: 1; border: 2px dashed #94a3b8; border-radius: 14px; margin-top: 10px; overflow: hidden; background: #ffffff; }
#canvasModal { width: 100%; height: 100%; touch-action: none; }