/* Objets Nomades — Style mobile-first */
* { margin: 0; padding: 0; box-sizing: border-box; }

body { font-family: 'Source Sans 3', 'Segoe UI', system-ui, sans-serif; background: #fafaf9; color: #1e293b; }

.app { max-width: 480px; margin: 0 auto; min-height: 100vh; }

/* Header */
.header { background: linear-gradient(135deg, #1e3a2f, #2d5a3f); color: white; padding: 16px 20px 14px; }
.header-inner { display: flex; justify-content: space-between; align-items: center; }
.logo { display: flex; align-items: center; gap: 10px; }
.logo-icon { font-size: 24px; }
.logo-text { font-size: 20px; font-weight: 700; letter-spacing: -0.5px; }
.subtitle { margin: 6px 0 0; font-size: 13px; opacity: 0.8; }
.back-btn, .header-btn { background: rgba(255,255,255,0.15); border: none; color: white; padding: 8px 14px; border-radius: 8px; font-size: 13px; cursor: pointer; text-decoration: none; font-weight: 500; }
.header-actions { display: flex; gap: 6px; }

/* Main */
.main { padding: 0 16px 32px; }

/* Scan banner */
.scan-banner { display: flex; align-items: center; gap: 14px; background: #f0fdf4; border: 2px dashed #86efac; border-radius: 12px; padding: 14px 16px; margin: 16px 0; }

/* Search */
.search-form { margin: 0 0 12px; }
.search-input { width: 100%; padding: 12px 16px; border: 1.5px solid #e2e8f0; border-radius: 10px; font-size: 15px; outline: none; background: white; }

/* Filters */
.filter-row { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.filter-btn { padding: 7px 12px; border: 1.5px solid #e2e8f0; border-radius: 20px; font-size: 12px; background: white; color: #64748b; font-weight: 500; text-decoration: none; }
.filter-btn.active { background: #1e3a2f; color: white; border-color: #1e3a2f; }

/* Object cards */
.object-list { display: flex; flex-direction: column; gap: 8px; }
.object-card { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: white; border: 1.5px solid #e2e8f0; border-radius: 12px; text-decoration: none; color: inherit; }
.object-card.has-alert { border-color: #8b5cf6; border-width: 2px; }
.obj-emoji { font-size: 32px; flex-shrink: 0; }
.obj-photo { width: 48px; height: 48px; object-fit: cover; border-radius: 10px; flex-shrink: 0; }
.obj-photo-large { width: 100px; height: 100px; object-fit: cover; border-radius: 16px; }
.obj-info { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.obj-name { font-weight: 600; font-size: 15px; }
.obj-meta { font-size: 12px; color: #94a3b8; }
.obj-alert { font-size: 11px; color: #7c3aed; margin-top: 2px; }
.empty { text-align: center; color: #94a3b8; padding: 32px; font-style: italic; }

/* Status badges */
.status-badge, .status-badge-lg { padding: 4px 10px; border-radius: 12px; font-size: 11px; font-weight: 600; flex-shrink: 0; }
.status-badge-lg { font-size: 13px; padding: 4px 12px; border-radius: 16px; }
.dispo { background: #d1fae5; color: #065f46; }
.prete { background: #fef3c7; color: #92400e; }
.circule { background: #dbeafe; color: #1e40af; }

/* Regime badge */
.regime-badge { padding: 4px 12px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.regime-badge.classique { background: #f0fdf4; color: #065f46; }
.regime-badge.circulant { background: #ede9fe; color: #6d28d9; }
.badge-row { display: flex; gap: 6px; justify-content: center; margin-top: 8px; }

/* Object header */
.obj-header { text-align: center; padding: 24px 0 16px; }
.obj-title { margin: 8px 0 2px; font-size: 22px; font-weight: 700; }
.obj-id { font-size: 13px; color: #94a3b8; }

/* Holder card */
.holder-card { background: #fffbeb; border: 1.5px solid #fde68a; border-radius: 12px; padding: 16px; margin-bottom: 16px; }
.holder-label { font-size: 12px; color: #92400e; font-weight: 500; }
.holder-name { margin: 4px 0 0; font-size: 18px; font-weight: 700; color: #78350f; }
.holder-tel { margin: 4px 0 0; font-size: 13px; color: #64748b; }
.holder-garantie { margin: 6px 0 0; font-size: 13px; color: #92400e; }

/* Gauge */
.gauge { border-radius: 14px; padding: 16px; margin-bottom: 16px; border-width: 2px; border-style: solid; }
.gauge-green { background: #d1fae5; border-color: #10b981; }
.gauge-yellow { background: #fef3c7; border-color: #f59e0b; }
.gauge-red { background: #fee2e2; border-color: #ef4444; }
.gauge-purple { background: #ede9fe; border-color: #8b5cf6; }
.gauge-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.gauge-header h3 { margin: 0; font-size: 14px; font-weight: 700; }
.gauge-bar { background: rgba(255,255,255,0.6); border-radius: 8px; height: 24px; position: relative; overflow: hidden; margin-bottom: 10px; }
.gauge-fill { position: absolute; left: 0; top: 0; height: 100%; background: currentColor; border-radius: 8px; }
.gauge-numbers { display: flex; gap: 8px; }
.gauge-num { flex: 1; background: rgba(255,255,255,0.5); border-radius: 8px; padding: 8px 10px; text-align: center; }
.gauge-num .big { font-size: 20px; font-weight: 800; display: block; }
.gauge-num .label { font-size: 11px; }
.gauge-note { margin: 8px 0 0; font-size: 12px; }

/* Solicitations */
.sol-card { background: #faf5ff; border: 2px solid #c084fc; border-radius: 12px; padding: 14px; margin-bottom: 16px; }
.sol-card h3 { margin: 0 0 8px; font-size: 14px; font-weight: 700; color: #7c3aed; }
.sol-item { padding: 6px 0; border-bottom: 1px solid #e9d5ff; }
.sol-name { font-size: 14px; font-weight: 600; }
.sol-date { font-size: 12px; color: #64748b; margin: 2px 0 0; }

/* Obligations */
.obligations-card { background: white; border: 1.5px solid #e2e8f0; border-radius: 12px; padding: 16px; margin-bottom: 16px; }
.obligations-card h3 { margin: 0 0 12px; font-size: 15px; font-weight: 700; color: #334155; }
.obl-row { display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid #f1f5f9; }
.obl-icon { font-size: 20px; }
.obl-row p { margin: 0; font-size: 13px; color: #64748b; }

/* Buttons */
.action-group { display: flex; flex-direction: column; gap: 10px; margin-bottom: 24px; }
.btn { display: block; width: 100%; padding: 14px; border: none; border-radius: 12px; font-size: 15px; font-weight: 600; cursor: pointer; text-align: center; text-decoration: none; }
.btn-primary { background: #1e3a2f; color: white; padding: 16px; font-size: 16px; font-weight: 700; }
.btn-green { background: #10b981; }
.btn-secondary { background: #3b82f6; color: white; }
.btn-return { background: white; color: #1e3a2f; border: 2px solid #1e3a2f; }
.btn-solliciter { background: #7c3aed; color: white; }
.btn-ghost { background: transparent; color: #64748b; border: 1.5px solid #e2e8f0; }

/* Forms */
.form-header { text-align: center; padding: 24px 0 8px; }
.form-header h2 { margin: 8px 0 4px; font-size: 20px; font-weight: 700; }
.form-subtitle { font-size: 14px; color: #64748b; }
.form-section { margin: 16px 0; }
.label { display: block; font-size: 13px; font-weight: 600; color: #475569; margin: 12px 0 6px; }
.input { width: 100%; padding: 14px 16px; border: 1.5px solid #e2e8f0; border-radius: 10px; font-size: 16px; outline: none; background: white; }
.pin-input { text-align: center; font-size: 32px; font-weight: 800; letter-spacing: 12px; font-family: monospace; }

/* Toggle buttons */
.toggle-row { display: flex; gap: 6px; flex-wrap: wrap; }
.toggle-btn { flex: 1; padding: 12px 8px; border: 1.5px solid #e2e8f0; border-radius: 10px; font-size: 13px; font-weight: 600; background: white; cursor: pointer; color: #64748b; text-align: center; min-width: 70px; }
.toggle-btn input { display: none; }
.toggle-btn:has(input:checked) { background: #f0fdf4; border-color: #22c55e; color: #065f46; }

/* Info boxes */
.info-box { border-radius: 10px; padding: 14px; margin: 12px 0; font-size: 13px; }
.info-box p { margin: 4px 0; }
.info-box.blue { background: #f0f9ff; border: 1.5px solid #bae6fd; }
.info-box.green { background: #f0fdf4; border: 1.5px solid #86efac; }
.info-box.yellow { background: #fef3c7; border: 1.5px solid #fbbf24; }
.info-box.purple { background: #f5f3ff; border: 1.5px solid #c4b5fd; color: #6d28d9; }

/* Alerts */
.alert { padding: 12px; border-radius: 8px; margin: 12px 0; font-size: 14px; }
.alert-error { background: #fee2e2; color: #991b1b; }

/* Confirmation */
.confirm-recap { background: #f0fdf4; border: 2px solid #10b981; border-radius: 14px; padding: 20px; margin-bottom: 16px; }
.confirm-recap h3 { margin: 0 0 12px; font-size: 16px; text-align: center; color: #065f46; }
.confirm-obj { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.confirm-obj-name { margin: 0; font-weight: 700; font-size: 16px; }
.confirm-obj-regime { margin: 2px 0 0; font-size: 13px; color: #64748b; }
.confirm-details { background: white; border-radius: 10px; padding: 12px; margin-bottom: 8px; }
.confirm-details p { margin: 4px 0; font-size: 14px; }
.confirm-obligations { font-size: 13px; margin-top: 8px; }
.confirm-obligations p { margin: 4px 0; }
.confirm-code-display { background: #eff6ff; border: 2px solid #3b82f6; border-radius: 14px; padding: 20px; text-align: center; margin-bottom: 16px; }
.confirm-code-display p { margin: 4px 0; font-size: 14px; color: #1e40af; }
.big-code { margin: 16px 0 8px; font-size: 48px; font-weight: 900; letter-spacing: 12px; color: #1e3a2f; font-family: monospace; }
.small { font-size: 12px; color: #64748b; }
.confirm-input-section { text-align: center; margin: 16px 0; }
.error-text { color: #dc2626; font-size: 13px; }

/* History */
.history-section h3 { margin: 0 0 12px; font-size: 15px; font-weight: 700; color: #334155; }
.history-item { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid #f1f5f9; align-items: flex-start; }
.h-icon { font-size: 18px; }
.h-text { font-size: 14px; font-weight: 500; }
.h-date { margin: 2px 0 0; font-size: 12px; color: #94a3b8; }

/* Admin stats */
.stats-row { display: flex; gap: 10px; margin: 16px 0; }
.stat-card { flex: 1; background: #f1f5f9; border-radius: 12px; padding: 14px; text-align: center; }
.stat-number { display: block; font-size: 28px; font-weight: 800; color: #1e293b; }
.stat-label { font-size: 12px; color: #64748b; }
.mini-stat { flex: 1 1 30%; background: #f8fafc; border-radius: 8px; padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; }
.admin-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: white; border: 1.5px solid #e2e8f0; border-radius: 10px; margin-bottom: 8px; text-decoration: none; color: inherit; }

/* Footer */
.footer { text-align: center; padding: 20px; font-size: 12px; color: #94a3b8; }
.footer a { color: #64748b; }
