:root {
    --bg: #f8fafc;
    --panel: #ffffff;
    --text: #0f172a;
    --muted: #64748b;
    --border: #e2e8f0;
    --primary: #2563eb;
    --danger: #dc2626;
    --busy: #cbd5e1;
    --mine: #16a34a;
}

* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--text); background: var(--bg); }
h1 { font-size: 1.5rem; margin: 0 0 .25rem; }
h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 0 0 .5rem; }
h3 { margin: 0; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: .8rem; margin: .5rem 0; }

.btn { display: inline-block; padding: .45rem .8rem; border: 1px solid var(--border); border-radius: 6px; background: var(--panel); color: var(--text); text-decoration: none; cursor: pointer; font: inherit; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.danger { color: var(--danger); }
.btn.small { padding: .25rem .5rem; font-size: .8rem; margin-top: .35rem; }

input, select, textarea { width: 100%; padding: .4rem .5rem; border: 1px solid var(--border); border-radius: 6px; font: inherit; background: #fff; }
label { display: block; font-size: .85rem; color: var(--muted); }
label input, label select, label textarea { margin-top: .2rem; color: var(--text); }
.stack > * + * { margin-top: .6rem; }
.row { display: flex; gap: .5rem; align-items: center; }
.row > * { flex: 1; }
.row > .btn { flex: 0 0 auto; margin-top: 0; }
.actions { display: flex; gap: .5rem; align-items: center; }
.spacer { flex: 1; }

.flash { padding: .75rem 1rem; background: #fef3c7; border-bottom: 1px solid #fcd34d; }
.landing { max-width: 32rem; margin: 15vh auto; padding: 0 16px; text-align: center; }

/* Dashboard conseiller */
.layout { display: grid; grid-template-columns: 320px 1fr; min-height: 100vh; }
.sidebar { background: var(--panel); border-right: 1px solid var(--border); padding: 1rem; overflow-y: auto; max-height: 100vh; position: sticky; top: 0; }
.sidebar header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 1rem; }
.sidebar section { margin-bottom: 1.5rem; }
.main { padding: 1rem; min-width: 0; }

.calendars, .links { list-style: none; padding: 0; margin: 0; }
.calendars li { display: flex; align-items: center; justify-content: space-between; padding: .15rem 0; }
.calendars li.profile { margin-top: .5rem; font-weight: 600; font-size: .85rem; }
.calendars label { display: flex; align-items: center; gap: .4rem; color: var(--text); cursor: pointer; }
.calendars input { width: auto; margin: 0; }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; flex: 0 0 auto; }
.target { border: 0; background: none; cursor: pointer; color: var(--border); font-size: 1rem; }
.target.on { color: var(--primary); }

.links li { padding: .6rem 0; border-top: 1px solid var(--border); }
.links input { font-size: .75rem; }

dialog { border: 1px solid var(--border); border-radius: 10px; padding: 1.25rem; width: min(480px, calc(100vw - 32px)); }
dialog::backdrop { background: rgb(15 23 42 / .35); }

.status { position: fixed; bottom: 1rem; left: 50%; transform: translateX(-50%); padding: .6rem 1rem; border-radius: 8px; background: var(--text); color: #fff; opacity: 0; pointer-events: none; transition: opacity .2s; }
.status.visible { opacity: 1; }
.status.error { background: var(--danger); }

/* FullCalendar */
.fc .fc-event.transparent { opacity: .55; }
.fc .fc-bg-event.busy { background: var(--busy); opacity: .9; }
.fc .fc-bg-event.busy .fc-event-title { color: #334155; font-style: normal; font-size: .75rem; }
.fc .fc-event.mine { background: var(--mine); border-color: var(--mine); }
.fc .fc-event.preview { background: var(--primary); border-color: var(--primary); opacity: .7; }
.fc .fc-timegrid-slot:hover { background: #eff6ff; }

/* Vue client */
.client { max-width: 1100px; margin: 0 auto; padding: 1rem 16px; }
.client-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.legend { list-style: none; display: flex; gap: 1rem; padding: 0; margin: 0; font-size: .85rem; }
.legend li { display: flex; align-items: center; gap: .35rem; }
.swatch.free { background: #fff; border: 1px solid var(--border); }
.swatch.busy { background: var(--busy); }
.swatch.mine { background: var(--mine); }

@media (max-width: 800px) {
    .layout { grid-template-columns: 1fr; }
    .sidebar { position: static; max-height: none; border-right: 0; border-bottom: 1px solid var(--border); }
    .main { padding: .5rem; }
}
