/* Paraphe — interface (CSS sans build, déploiement direct sur mutualisé) */
:root {
    --brand: #4F46E5; --brand-2: #EC4899; --brand-soft: #EEF2FF;
    --ink: #111827; --text: #374151; --muted: #6B7280; --line: #E5E7EB;
    --bg: #F6F7FB; --card: #FFFFFF; --danger: #DC2626; --ok: #059669;
    --radius: 14px; --shadow: 0 1px 2px rgba(17,24,39,.04), 0 8px 24px rgba(17,24,39,.06);
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 Inter, system-ui, sans-serif; color: var(--text); background: var(--bg); }
a { color: var(--brand); text-decoration: none; }
h1, h2, h3 { color: var(--ink); margin: 0; }
h1 { font: 700 26px/1.2 Ubuntu, Inter, sans-serif; }
h2 { font-size: 16px; font-weight: 600; margin-bottom: 14px; }
h2 small { color: var(--muted); font-weight: 400; margin-left: 6px; }
.muted { color: var(--muted); } .small { font-size: 13px; } .center { text-align: center; }
.right { text-align: right; } .nowrap { white-space: nowrap; } .inline { display: inline; }

/* Structure */
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar { background: #0F172A; color: #CBD5E1; padding: 22px 16px; display: flex; flex-direction: column; gap: 26px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; }
.brand-mark { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font: 700 20px Ubuntu, sans-serif; color: #fff;
    background: linear-gradient(135deg, var(--brand), var(--brand-2)); border: 3px solid #fff; box-shadow: 0 4px 14px rgba(79,70,229,.4); }
.brand-name { font: 700 21px Ubuntu, sans-serif; letter-spacing: .2px; }
.brand.big { justify-content: center; color: var(--ink); }
.brand.big .brand-mark { width: 56px; height: 56px; font-size: 28px; }
.brand.big .brand-name { font-size: 30px; }
.sidebar nav { display: flex; flex-direction: column; gap: 4px; }
.sidebar nav a { color: #CBD5E1; padding: 9px 12px; border-radius: 10px; font-weight: 500; }
.sidebar nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar nav a.active { background: linear-gradient(90deg, rgba(79,70,229,.9), rgba(236,72,153,.7)); color: #fff; }
.sidebar-foot { margin-top: auto; font-size: 13px; }
.sidebar-foot .user { display: block; color: #fff; font-weight: 600; margin-bottom: 2px; }
.sidebar-foot .user:hover, .sidebar-foot .user.active { color: #C7D2FE; }
.main { padding: 28px 32px 60px; max-width: 1400px; width: 100%; }
.main.narrow { max-width: 1100px; margin: 0 auto; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.head-actions { display: flex; gap: 8px; }

/* Composants */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 20px; }
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: #fff; color: var(--ink); padding: 9px 16px;
    border-radius: 10px; font: 600 14px Inter, sans-serif; cursor: pointer; transition: transform .1s, box-shadow .15s; }
.btn:hover { box-shadow: 0 4px 12px rgba(17,24,39,.08); transform: translateY(-1px); }
.btn.primary { background: linear-gradient(135deg, var(--brand), #7C3AED); color: #fff; border: 0; }
.btn.ghost { background: transparent; }
.btn.danger { background: #fff; color: var(--danger); border-color: #FECACA; }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn.wide { width: 100%; justify-content: center; }
button.link { background: none; border: 0; padding: 0; color: #94A3B8; cursor: pointer; font: inherit; }
.pill { display: inline-block; min-width: 28px; text-align: center; padding: 2px 9px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-weight: 600; font-size: 13px; }
.flash { background: #ECFDF5; border: 1px solid #A7F3D0; color: #065F46; padding: 12px 16px; border-radius: 10px; margin-bottom: 18px; }
.flash.error { background: #FEF2F2; border-color: #FECACA; color: #991B1B; }
.flash ul { margin: 6px 0 0; padding-left: 18px; }

/* Formulaires */
input, select, textarea { width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; font: 14px Inter, sans-serif; color: var(--ink); background: #fff; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(79,70,229,.25); border-color: var(--brand); }
input[type=color] { height: 40px; padding: 3px; }
input[type=checkbox], input[type=radio] { width: auto; }
input[type=range] { padding: 0; border: 0; }
label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; color: var(--text); }
label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; margin: 10px 0; }
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin-bottom: 12px; }
.form h2 { margin-top: 18px; }
.fields.single { grid-template-columns: 1fr; }
.form-actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.thumb { display: flex; align-items: center; gap: 10px; }
.thumb img { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.thumb.wide img { width: 120px; height: auto; }
.danger-zone { margin-top: 10px; }

/* Tableau de bord */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 20px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.stat-value { font: 700 32px Ubuntu, sans-serif; color: var(--ink); }
.stat-label { color: var(--muted); font-size: 13px; }
.stat.accent { background: linear-gradient(135deg, var(--brand), var(--brand-2)); border: 0; }
.stat.accent .stat-value, .stat.accent .stat-label { color: #fff; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-2 > .card { margin-bottom: 0; }
.grid-2 + .card, .grid-2 { margin-bottom: 20px; }
.row-item { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.row-item:last-child { border-bottom: 0; }
.bar-row { display: grid; grid-template-columns: 130px 1fr 40px; gap: 10px; align-items: center; padding: 5px 0; font-size: 14px; }
.bar { height: 10px; background: var(--brand-soft); border-radius: 999px; overflow: hidden; }
.bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-2)); border-radius: 999px; }
.bar-total { text-align: right; font-weight: 600; }

/* Clients */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.org-card { border-top: 4px solid var(--org); }
.org-logo { width: 64px; height: 64px; border-radius: 14px; display: grid; place-items: center; background: #F9FAFB; border: 1px solid var(--line); margin-bottom: 12px; overflow: hidden; }
.org-logo img { max-width: 100%; max-height: 100%; }
.org-logo span { font: 700 26px Ubuntu, sans-serif; color: var(--org); }
.org-card .actions { display: flex; gap: 8px; margin-top: 12px; }

/* Liste */
.filters { display: flex; gap: 10px; margin-bottom: 16px; }
.filters select { max-width: 240px; }
.table-wrap { padding: 0; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); padding: 12px 16px; border-bottom: 1px solid var(--line); }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }

/* Éditeur */
.editor { display: grid; grid-template-columns: minmax(380px, 1fr) minmax(420px, 1.1fr); gap: 22px; align-items: start; }
.editor-form details { border-bottom: 1px solid var(--line); padding: 12px 0; }
.editor-form details:first-child { padding-top: 0; }
.editor-form summary { cursor: pointer; font-weight: 700; color: var(--ink); margin-bottom: 10px; list-style: none; }
.editor-form summary::before { content: '▸'; display: inline-block; margin-right: 8px; color: var(--brand); transition: transform .15s; }
.editor-form details[open] summary::before { transform: rotate(90deg); }
.templates { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.tpl { cursor: pointer; }
.tpl input { position: absolute; opacity: 0; }
.tpl span { display: flex; flex-direction: column; gap: 3px; border: 2px solid var(--line); border-radius: 12px; padding: 10px 12px; height: 100%; font-weight: 500; }
.tpl small { color: var(--muted); font-weight: 400; font-size: 12px; }
.tpl input:checked + span { border-color: var(--brand); background: var(--brand-soft); }
.preview-pane { position: sticky; top: 20px; }
.mail-mock { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.mail-head { display: flex; gap: 6px; padding: 12px 14px; background: #F3F4F6; border-bottom: 1px solid var(--line); }
.mail-head span { width: 11px; height: 11px; border-radius: 50%; background: #F87171; }
.mail-head span:nth-child(2) { background: #FBBF24; } .mail-head span:nth-child(3) { background: #34D399; }
.mail-body { padding: 22px; }
.mail-text { margin: 0 0 14px; color: var(--text); font-family: Arial, sans-serif; font-size: 14px; }
#sig-preview { width: 100%; border: 0; min-height: 120px; display: block; }

/* Installation */
.share .copy-line { display: flex; gap: 10px; }
.sig-box { border: 1px dashed var(--line); border-radius: 10px; padding: 18px; background: #fff; overflow-x: auto; }
.code { margin-top: 12px; font: 12px/1.4 ui-monospace, Menlo, monospace; color: var(--muted); }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.tab { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 14px; cursor: pointer; font: 600 13px Inter, sans-serif; color: var(--text); }
.tab.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.tab-panel { display: none; } .tab-panel.active { display: block; }
.tab-panel li { margin-bottom: 6px; }

/* Connexion & page publique */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 20px;
    background: radial-gradient(circle at 20% 20%, #C7D2FE 0, transparent 40%), radial-gradient(circle at 80% 80%, #FBCFE8 0, transparent 40%), var(--bg); }
.login-card { width: 100%; max-width: 400px; background: #fff; padding: 34px; border-radius: 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 14px; }
.login-card .muted { text-align: center; margin: 0 0 6px; }
.public-page footer { padding: 20px; }

/* Pagination Laravel (simple-default) */
.pagination { display: flex; gap: 8px; list-style: none; padding: 0; }
.pagination li a, .pagination li span { display: inline-block; padding: 7px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }

/* Mobile */
@media (max-width: 1100px) { .editor { grid-template-columns: 1fr; } .preview-pane { position: static; order: -1; } }
@media (max-width: 800px) {
    .shell { grid-template-columns: 1fr; }
    .sidebar { position: static; height: auto; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 12px; padding: 12px 16px; }
    .sidebar nav { flex-direction: row; flex-wrap: wrap; }
    .sidebar-foot { margin: 0 0 0 auto; }
    .main { padding: 20px 16px 40px; }
    .stats, .grid-2, .templates { grid-template-columns: 1fr; }
    .filters, .share .copy-line { flex-direction: column; }
}
