/* Patapuces — Espace pro */
:root {
  --ink: #1F3A33; --ink-2: #2C4E44; --paper: #F5EFE3; --bg: #F3F0EA; --card: #FFFFFF;
  --rust: #B4512D; --rust-dark: #8E3E22; --gold: #C99A3C;
  --text: #24211D; --muted: #756C60; --line: #E6E0D5; --danger: #B03A2E;
  --radius: 12px; --sb: 248px;
  --serif: "Fraunces", Georgia, serif; --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 16px rgba(31,58,51,.06);
}
*, *::before, *::after { box-sizing: border-box; }
body.pro { margin: 0; font: 15px/1.55 var(--sans); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--rust); }
h1, h2 { font-family: var(--serif); color: var(--ink); margin: 0; font-weight: 600; letter-spacing: -.01em; }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
.ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.muted { color: var(--muted); } .small { font-size: .88rem; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* Barre latérale */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sb); background: var(--ink); color: #D8D1C2;
  display: flex; flex-direction: column; padding: 1.2rem .9rem; z-index: 40; transition: transform .25s;
}
.sb-brand { display: flex; align-items: center; gap: .7rem; padding: .3rem .5rem 1.4rem; text-decoration: none; color: #fff; border-bottom: 1px solid rgba(255,255,255,.08); margin-bottom: 1rem; }
.sb-brand span { display: flex; flex-direction: column; line-height: 1.15; }
.sb-brand strong { font-family: var(--serif); font-size: 1.25rem; }
.sb-brand small { font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.sb-nav { display: grid; gap: .15rem; }
.sidebar a, .sidebar button {
  display: flex; align-items: center; gap: .75rem; padding: .65rem .75rem; border-radius: 9px;
  color: #D8D1C2; text-decoration: none; font: 500 .94rem var(--sans); background: none; border: 0; width: 100%; cursor: pointer; text-align: left;
  transition: background .15s, color .15s;
}
.sidebar a:hover, .sidebar button:hover { background: rgba(255,255,255,.07); color: #fff; }
.sidebar a.is-active { background: rgba(255,255,255,.12); color: #fff; box-shadow: inset 3px 0 0 var(--gold); }
.sidebar .badge { margin-left: auto; background: var(--rust); color: #fff; font-style: normal; font-size: .72rem; font-weight: 700; padding: .1rem .5rem; border-radius: 99px; }
.sb-foot { margin-top: auto; display: grid; gap: .15rem; border-top: 1px solid rgba(255,255,255,.08); padding-top: .8rem; }
.sb-foot form { margin: 0; }
.sb-overlay { display: none; }

.pro-main { margin-left: var(--sb); min-height: 100vh; }
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 1rem;
  padding: 1rem 2rem; background: rgba(243,240,234,.9); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.topbar h1 { font-size: 1.45rem; flex: 1; }
.sb-toggle { display: none; background: var(--card); border: 1px solid var(--line); border-radius: 9px; width: 40px; height: 40px; place-items: center; cursor: pointer; color: var(--ink); }
.who { display: flex; align-items: center; gap: .7rem; }
.who-text { display: flex; flex-direction: column; line-height: 1.2; }
.who-text small { color: var(--muted); font-size: .78rem; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--rust); color: #fff; display: grid; place-items: center; font-weight: 600; flex: none; }
.avatar.sm { width: 34px; height: 34px; font-size: .9rem; background: #E9E2D4; color: var(--ink); }
.pro-content { padding: 1.8rem 2rem 4rem; max-width: 1240px; }

@media (max-width: 960px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.is-open { transform: none; box-shadow: 20px 0 40px rgba(0,0,0,.2); }
  .sidebar.is-open + .sb-overlay { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 35; }
  .pro-main { margin-left: 0; }
  .sb-toggle { display: grid; }
  .topbar { padding: .8rem 1rem; }
  .topbar h1 { font-size: 1.2rem; }
  .who-text { display: none; }
  .pro-content { padding: 1.2rem 1rem 3rem; }
}

/* Boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem; padding: .7rem 1.2rem; border-radius: 9px;
  border: 1.5px solid transparent; font: 600 .92rem/1 var(--sans); cursor: pointer; text-decoration: none; transition: all .15s; white-space: nowrap;
}
.btn-primary { background: var(--rust); color: #fff; }
.btn-primary:hover { background: var(--rust-dark); color: #fff; }
.btn-ghost { background: var(--card); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink); color: var(--ink); }
.btn-danger { background: #FBEAE7; color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-sm { padding: .5rem .85rem; font-size: .85rem; }
.btn-block { width: 100%; padding: .9rem; }
.link-btn { background: none; border: 0; color: var(--muted); font: 500 .88rem var(--sans); cursor: pointer; text-decoration: underline; padding: 0; }
.link-btn:hover { color: var(--rust); }
.icon-action {
  width: 34px; height: 34px; display: inline-grid; place-items: center; border-radius: 8px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); cursor: pointer; transition: all .15s; text-decoration: none;
}
.icon-action:hover { background: var(--ink); color: #fff; border-color: var(--ink); }
.icon-action.danger:hover { background: var(--danger); border-color: var(--danger); }
.icon-action .ico { width: 16px; height: 16px; }

/* Panneaux */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem 1.5rem; margin-bottom: 1.5rem; box-shadow: var(--shadow); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.1rem; flex-wrap: wrap; }
.panel-head h2 { font-size: 1.2rem; }
.panel-head a { font-weight: 500; text-decoration: none; display: inline-flex; gap: .35rem; align-items: center; }
.panel-head form { margin: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; align-items: start; }
.grid-2 > .panel { margin-bottom: 0; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }

.alert { padding: .85rem 1.1rem; border-radius: 10px; margin-bottom: 1.2rem; font-weight: 500; border: 1px solid transparent; }
.alert-success { background: #E7F1EA; color: #1F5A41; border-color: #CFE3D6; }
.alert-error { background: #FBEAE7; color: #8C2A1C; border-color: #F2D2CC; }
.alert-info { background: #EAEEF6; color: #2E4372; border-color: #D5DDEE; }
.credential { display: grid; gap: .5rem; }
.credential code { font: 600 1.25rem ui-monospace, Menlo, monospace; background: #fff; padding: .5rem .8rem; border-radius: 8px; justify-self: start; cursor: copy; letter-spacing: .05em; }

/* Tableau de bord */
.welcome { display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; flex-wrap: wrap; background: var(--ink); color: #D8D1C2; border-radius: var(--radius); padding: 1.8rem 2rem; margin-bottom: 1.5rem; position: relative; overflow: hidden; }
.welcome::after { content: ""; position: absolute; right: -60px; bottom: -80px; width: 240px; height: 240px; border-radius: 50%; border: 36px solid rgba(201,154,60,.12); }
.welcome h2 { color: #fff; font-size: 1.6rem; margin-bottom: .2rem; }
.welcome p { margin: 0; }
.quick { display: flex; gap: .6rem; flex-wrap: wrap; position: relative; z-index: 1; }
.welcome .btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.3); }
.welcome .btn-ghost:hover { border-color: #fff; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
.stat { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 1rem; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem 1.3rem; text-decoration: none; color: var(--text); box-shadow: var(--shadow); transition: transform .15s; }
.stat:hover { transform: translateY(-2px); }
.stat-ico { grid-row: span 2; width: 46px; height: 46px; border-radius: 12px; background: #F4E9E2; color: var(--rust); display: grid; place-items: center; }
.stat-ico .ico { width: 22px; height: 22px; }
.stat strong { font: 700 1.7rem/1 var(--serif); color: var(--ink); }
.stat span:last-child { color: var(--muted); font-size: .88rem; }
@media (max-width: 760px) { .stats { grid-template-columns: 1fr; } }

.mini-list { list-style: none; margin: 0; padding: 0; }
.mini-list li { display: flex; align-items: center; gap: .9rem; padding: .7rem 0; border-top: 1px solid var(--line); }
.mini-list li:first-child { border-top: 0; }
.mini-list li.unread .mini-text strong::after { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--rust); margin-left: .45rem; vertical-align: middle; }
.mini-date { width: 46px; text-align: center; background: var(--paper); border-radius: 9px; padding: .35rem 0; font: 700 1.15rem/1 var(--serif); color: var(--ink); flex: none; }
.mini-date small { display: block; font: 600 .66rem var(--sans); text-transform: uppercase; color: var(--rust); margin-top: .2rem; }
.mini-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mini-text small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-text em { color: var(--danger); font-style: normal; }

/* Formulaires */
.stack { display: grid; gap: 1rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem 1.2rem; }
.span-2 { grid-column: 1 / -1; }
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } }
.field label { display: block; font-weight: 600; font-size: .86rem; margin-bottom: .35rem; color: var(--ink); }
.field label small { font-weight: 400; color: var(--muted); }
.field input, .field textarea, .field select, .search input, .transfer select {
  width: 100%; padding: .65rem .85rem; border: 1.5px solid var(--line); border-radius: 9px; background: #fff;
  font: inherit; color: var(--text); transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field textarea:focus, .field select:focus, .search input:focus { outline: none; border-color: var(--ink-2); box-shadow: 0 0 0 3px rgba(44,78,68,.14); }
.field textarea { resize: vertical; min-height: 80px; }
.form-actions { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.form-actions form { margin: 0; }
.form-panel { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(201,154,60,.12), var(--shadow); }
.inline-create { padding: 1.1rem; background: var(--paper); border-radius: 10px; margin-bottom: 1.2rem; align-items: end; }
.char-count { display: block; text-align: right; font-size: .76rem; color: var(--muted); margin-top: .2rem; }
.sticky-actions { position: sticky; bottom: 0; display: flex; gap: .6rem; padding: 1rem 0; background: linear-gradient(transparent, var(--bg) 30%); }

.switch { display: inline-flex; align-items: center; gap: .7rem; cursor: pointer; font-weight: 500; }
.switch input { position: absolute; opacity: 0; }
.switch-ui { width: 42px; height: 24px; border-radius: 99px; background: #D5CEC1; position: relative; transition: background .2s; flex: none; }
.switch-ui::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + .switch-ui { background: #3C8A62; }
.switch input:checked + .switch-ui::after { transform: translateX(18px); }
.switch input:focus-visible + .switch-ui { outline: 3px solid var(--gold); outline-offset: 2px; }

.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 2.8rem; }
.pw-toggle { position: absolute; right: .4rem; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--muted); cursor: pointer; padding: .4rem; }
.strength { height: 4px; background: var(--line); border-radius: 4px; margin-top: .4rem; overflow: hidden; }
.strength span { display: block; height: 100%; width: 0; transition: width .2s, background .2s; }

/* Barre d'outils, onglets, tableau */
.toolbar { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; margin-bottom: 1.1rem; }
.tabs { display: inline-flex; background: var(--bg); border-radius: 10px; padding: .25rem; }
.tabs a { padding: .5rem 1rem; border-radius: 8px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: .9rem; }
.tabs a span { font-weight: 500; opacity: .7; margin-left: .2rem; }
.tabs a.is-active { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.search { flex: 1; min-width: 200px; margin: 0; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; padding: .6rem .7rem; border-bottom: 1px solid var(--line); }
.table td { padding: .8rem .7rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table td small { color: var(--muted); }
.table tr:hover td { background: #FBF9F5; }
.table tr.is-muted td { opacity: .6; }
.table tr.editing td { background: var(--paper); }
.right { text-align: right; }
.actions { white-space: nowrap; }
.actions form { display: inline; margin: 0; }
.pill { display: inline-block; font-size: .76rem; font-weight: 600; padding: .2rem .6rem; border-radius: 99px; white-space: nowrap; }
.pill-ok { background: #E7F1EA; color: #1F5A41; }
.pill-off { background: #EFEBE4; color: var(--muted); }
.pill-warn { background: #FBF0DA; color: #7A5A12; }
.pill-admin { background: #F4E1D6; color: var(--rust-dark); }
.user-cell { display: flex; gap: .7rem; align-items: center; }
.you { font-style: normal; font-size: .72rem; background: var(--gold); color: #fff; padding: .05rem .4rem; border-radius: 4px; }
.purge { margin-top: 1rem; text-align: right; }
@media (max-width: 760px) {
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { border: 1px solid var(--line); border-radius: 10px; margin-bottom: .8rem; padding: .4rem .8rem; }
  .table td { border: 0; padding: .35rem 0; }
  .table td.right { text-align: left; padding-top: .6rem; }
}
.empty-pro { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.empty-pro > .ico { width: 40px; height: 40px; color: #CFC6B4; margin: 0 auto .8rem; }

/* Photos */
.back { display: inline-block; margin-bottom: 1rem; color: var(--muted); text-decoration: none; font-weight: 500; }
.dropzone {
  border: 2px dashed #D3C9B6; border-radius: var(--radius); padding: 2.2rem 1rem; text-align: center; background: #FCFAF6;
  display: flex; flex-direction: column; align-items: center; gap: .5rem; transition: all .2s; margin: 0;
}
.dropzone > .ico { width: 38px; height: 38px; color: var(--rust); }
.dropzone p { margin: 0; }
.dropzone small { color: var(--muted); }
.dropzone.is-over { border-color: var(--rust); background: #FBF1EC; transform: scale(1.01); }
.upload-progress { width: min(420px, 100%); margin-top: .8rem; }
.upload-progress .bar { height: 8px; background: var(--line); border-radius: 8px; overflow: hidden; }
.upload-progress .bar span { display: block; height: 100%; width: 0; background: var(--rust); transition: width .2s; }
.upload-progress p { font-size: .86rem; color: var(--muted); margin-top: .4rem; }
.pro-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
.pro-photo { margin: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; position: relative; transition: box-shadow .15s; }
.pro-photo:hover { box-shadow: var(--shadow); }
.pro-photo.is-cover { border-color: var(--gold); }
.pro-thumb { display: block; aspect-ratio: 4/3; background: var(--bg); }
.pro-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cover-badge { position: absolute; top: .5rem; right: .5rem; z-index: 2; background: var(--gold); color: #fff; font-size: .72rem; font-weight: 600; padding: .2rem .5rem; border-radius: 99px; display: flex; align-items: center; gap: .25rem; }
.cover-badge .ico { width: 12px; height: 12px; fill: currentColor; }
.pick { position: absolute; top: .5rem; left: .5rem; z-index: 2; cursor: pointer; }
.pick input { position: absolute; opacity: 0; }
.pick span { display: block; width: 24px; height: 24px; border-radius: 6px; background: rgba(255,255,255,.9); border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.25); }
.pick input:checked + span { background: var(--rust); border-color: var(--rust); }
.pick input:checked + span::after { content: "✓"; color: #fff; display: grid; place-items: center; font-size: .8rem; font-weight: 700; height: 100%; }
.caption-form { margin: 0; padding: .6rem .6rem 0; }
.caption-form input { width: 100%; border: 1px solid transparent; border-radius: 6px; padding: .4rem .5rem; font: inherit; font-size: .88rem; background: transparent; }
.caption-form input:hover { border-color: var(--line); }
.caption-form input:focus { outline: none; border-color: var(--ink-2); background: #fff; }
.caption-form.saved input { border-color: #3C8A62; }
.photo-tools { display: flex; gap: .3rem; padding: .5rem .6rem .7rem; align-items: center; flex-wrap: wrap; }
.photo-tools form { margin: 0; }
.photo-tools .transfer { flex: 1; min-width: 90px; }
.transfer select { padding: .35rem .4rem; font-size: .8rem; height: 34px; }
.bulk-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; background: var(--ink); color: #fff; padding: .6rem .8rem .6rem 1.1rem; border-radius: 10px; margin-bottom: 1rem; }
.pro-albums { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; }
.pro-album { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; display: grid; grid-template-columns: 1fr auto; background: #fff; transition: box-shadow .15s; }
.pro-album:hover { box-shadow: var(--shadow); }
.pro-album-cover { grid-column: 1 / -1; aspect-ratio: 16/10; background: var(--paper); display: grid; place-items: center; color: #CFC6B4; }
.pro-album-cover img { width: 100%; height: 100%; object-fit: cover; }
.pro-album-cover .ico { width: 36px; height: 36px; }
.pro-album-meta { padding: .8rem 1rem; display: flex; flex-direction: column; }
.pro-album-meta a { text-decoration: none; color: var(--ink); }
.pro-album-meta small { color: var(--muted); }
.pro-album-order { display: flex; gap: .3rem; align-items: center; padding-right: .7rem; }
.pro-album-order form { margin: 0; }
.danger-zone { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin: 1.5rem 0 0; padding: 1rem 1.1rem; border: 1px solid #F2D2CC; border-radius: 10px; background: #FFF8F6; }
.danger-zone div { display: flex; flex-direction: column; }
.danger-zone small { color: var(--muted); }
.head-actions { display: flex; gap: 1rem; }

/* Messages */
.mail-layout { display: grid; grid-template-columns: 340px 1fr; gap: 1.5rem; align-items: start; }
.mail-layout .panel { margin: 0; }
.mail-item { display: flex; align-items: center; gap: .8rem; width: 100%; text-decoration: none; color: var(--text); }
.mail-item time { font-size: .78rem; color: var(--muted); }
.mail-list li.is-current { background: var(--paper); margin: 0 -1.5rem; padding-inline: 1.5rem; }
.mail-head h2 { font-size: 1.4rem; margin-bottom: .5rem; }
.mail-head p { margin: 0 0 1rem; color: var(--muted); }
.mail-body { padding: 1.2rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 1.2rem; font-size: 1rem; line-height: 1.7; }
@media (max-width: 900px) { .mail-layout { grid-template-columns: 1fr; } }
.info-panel p { margin: .6rem 0 0; color: var(--muted); }
.info-panel h2 { font-size: 1.05rem; }

/* Connexion */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 2rem 1rem; background: var(--ink); background-image: radial-gradient(circle at 20% 20%, rgba(201,154,60,.15), transparent 40%), radial-gradient(circle at 80% 90%, rgba(180,81,45,.2), transparent 45%); }
.auth-card { width: min(420px, 100%); background: var(--card); border-radius: 16px; padding: 2.4rem 2.2rem; box-shadow: 0 30px 80px rgba(0,0,0,.3); }
.auth-brand { text-align: center; margin-bottom: 1.8rem; }
.auth-brand img { margin: 0 auto; }
.auth-brand p { margin: .6rem 0 0; text-transform: uppercase; letter-spacing: .2em; font-size: .74rem; font-weight: 600; color: var(--rust); }
.auth-foot { text-align: center; font-size: .86rem; color: var(--muted); margin: 1.4rem 0 0; }
.auth-back { display: block; text-align: center; margin-top: .8rem; font-size: .86rem; color: var(--muted); text-decoration: none; }
