*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #f5f5f2;
  --surface: #ffffff;
  --primary: #1a3a5c;
  --primary-light: #2c5f8a;
  --accent: #e07b2a;
  --text: #1a1a1a;
  --text-muted: #666;
  --border: #ddd;
  --radius: 10px;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
}
body { font-family: system-ui, sans-serif; background: var(--bg); color: var(--text); font-size: 15px; }

/* Auth */
.auth-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.auth-card { background: var(--surface); padding: 2.5rem; border-radius: var(--radius); box-shadow: var(--shadow); width: 100%; max-width: 380px; }
.auth-logo { font-size: 2.5rem; text-align: center; margin-bottom: .5rem; }
.auth-card h1 { text-align: center; font-size: 1.5rem; color: var(--primary); margin-bottom: .25rem; }
.auth-subtitle { text-align: center; color: var(--text-muted); margin-bottom: 1.5rem; font-size: .9rem; }

/* Navbar */
.navbar { background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: space-between; padding: .9rem 1.5rem; }
.nav-brand { font-weight: 600; font-size: 1.1rem; }
.nav-brand a { color: #fff; text-decoration: none; }

/* Layout */
.container { max-width: 900px; margin: 0 auto; padding: 2rem 1.5rem; }
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.page-header h2 { font-size: 1.4rem; color: var(--primary); }
.breadcrumb { font-size: .85rem; color: var(--text-muted); text-decoration: none; display: block; margin-bottom: .25rem; }
.breadcrumb:hover { color: var(--primary); }

/* Grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem; display: flex; align-items: center; gap: 1rem; }
.card-link { text-decoration: none; color: inherit; transition: transform .15s, box-shadow .15s; }
.card-link:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,0.12); }
.card-icon { font-size: 2rem; }
.card-body h3 { font-size: 1rem; color: var(--primary); margin-bottom: .25rem; }
.card-meta { font-size: .8rem; color: var(--text-muted); }

/* Visits */
.visits-list { display: flex; flex-direction: column; gap: .75rem; }
.visit-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem 1.25rem; }
.visit-meta { display: flex; align-items: center; justify-content: space-between; margin-bottom: .5rem; }
.visit-date { font-size: .85rem; color: var(--text-muted); }
.visit-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.transcript { margin-top: .75rem; background: #f9f9f7; border-left: 3px solid var(--border); padding: .75rem 1rem; font-size: .85rem; line-height: 1.6; border-radius: 0 6px 6px 0; white-space: pre-wrap; max-height: 200px; overflow-y: auto; }

/* Badges */
.badge { font-size: .75rem; font-weight: 600; padding: .25rem .65rem; border-radius: 20px; text-transform: uppercase; letter-spacing: .03em; }
.badge-pending, .badge-transcription, .badge-analyse, .badge-rapport { background: #fff3cd; color: #856404; }
.badge-done { background: #d1e7dd; color: #0f5132; }
.badge-error { background: #f8d7da; color: #842029; }

/* Progress */
.progress-bar { background: #eee; border-radius: 20px; height: 8px; overflow: hidden; margin-top: .5rem; position: relative; }
.progress-fill { height: 100%; border-radius: 20px; background: var(--accent); width: 60%; animation: pulse 1.5s ease-in-out infinite; }
.progress-label { font-size: .8rem; color: var(--text-muted); margin-top: .35rem; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .5; } }

/* Forms */
.field { margin-bottom: 1rem; }
.field label { display: block; font-size: .85rem; font-weight: 500; margin-bottom: .4rem; color: var(--text-muted); }
.field input, .field textarea { width: 100%; border: 1.5px solid var(--border); border-radius: 7px; padding: .6rem .8rem; font-size: .95rem; font-family: inherit; outline: none; transition: border-color .15s; }
.field input:focus, .field textarea:focus { border-color: var(--primary-light); }

/* File drop */
.file-drop { border: 2px dashed var(--border); border-radius: 8px; padding: 1.5rem; text-align: center; cursor: pointer; color: var(--text-muted); font-size: .9rem; transition: border-color .15s, background .15s; }
.file-drop:hover { border-color: var(--primary-light); background: #f0f5ff; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: .4rem; padding: .55rem 1.1rem; border-radius: 7px; font-size: .9rem; font-weight: 500; cursor: pointer; border: none; text-decoration: none; transition: opacity .15s, transform .1s; }
.btn:hover { opacity: .88; }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-ghost { background: transparent; color: var(--text-muted); border: 1.5px solid var(--border); }
.btn-full { width: 100%; justify-content: center; margin-top: .5rem; }
.btn-sm { padding: .35rem .8rem; font-size: .82rem; }

/* Modal */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 100; align-items: center; justify-content: center; }
.modal-overlay.open { display: flex; }
.modal { background: var(--surface); border-radius: var(--radius); padding: 1.75rem; width: 100%; max-width: 460px; box-shadow: 0 8px 32px rgba(0,0,0,.18); }
.modal h3 { font-size: 1.1rem; color: var(--primary); margin-bottom: 1.2rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: .6rem; margin-top: 1.2rem; }

/* Misc */
.alert { padding: .7rem 1rem; border-radius: 7px; margin-bottom: 1rem; font-size: .9rem; }
.alert-error { background: #f8d7da; color: #842029; }
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--text-muted); }
.empty-state p { margin-bottom: 1rem; }
.text-muted { color: var(--text-muted); font-size: .9rem; }
.text-error { color: #842029; font-size: .85rem; margin-top: .4rem; }
