/* Fil — the look of the validated mock-up (A266), served by Fil itself.
   No web font, no CDN: the stack below falls back on the system's. */

:root {
  --bg: #fafaf9;
  --card: #ffffff;
  --line: #e7e5e4;
  --soft: #f5f5f4;
  --ink: #1c1917;
  --text: #44403c;
  --text-2: #57534e;
  --muted: #78716c;
  --faint: #a8a29e;
  --ring: #d6d3d1;
  --amber: #b45309;
  --amber-ink: #92400e;
  --amber-bg: #fffbeb;
  --amber-line: #fde68a;
  --green: #15803d;
  --green-ink: #166534;
  --green-bg: #f0fdf4;
  --client-ink: #3f6212;
  --client-bg: #f7fee7;
  --error-bg: #fef2f2;
  --error-ink: #991b1b;
  --font: "IBM Plex Sans", -apple-system, "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 15px; }
a { color: var(--text-2); }
a:hover { color: var(--ink); }
h1, h2, p { margin: 0; }
button { font-family: inherit; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.grow { flex: 1; }
.muted { color: var(--muted); }

.solo { max-width: 520px; margin: 40px auto; padding: 0 16px; display: flex; flex-direction: column; gap: 14px; }
.solo h1 { font-size: 24px; color: var(--ink); }
.messages { margin: 0; padding-left: 18px; }
.btn { font-size: 14px; padding: 10px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--card);
       cursor: pointer; min-height: 44px; color: var(--ink); }
a.btn { display: inline-flex; align-items: center; text-decoration: none; }
.dev-accounts { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.plain-form p { display: flex; flex-direction: column; gap: 4px; }

/* -- the frame --------------------------------------------------------- */

.app { display: flex; min-height: 100vh; }
.side { flex: none; width: 220px; background: var(--card); border-right: 1px solid var(--line); padding: 20px 14px;
        display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; }
.brand { padding: 4px 12px 18px; }
.brand-name { font-size: 22px; font-weight: 700; color: var(--ink); letter-spacing: -0.02em; }
.brand-sub { font-size: 12px; color: var(--muted); }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; text-decoration: none;
            font-size: 14px; color: var(--text-2); min-height: 44px; }
.nav-item[aria-current="page"] { background: var(--soft); color: var(--ink); font-weight: 600; }
.nav-count { margin-left: auto; font-size: 12px; font-weight: 600; color: #fff; background: var(--ink);
             border-radius: 999px; padding: 1px 8px; }
.who { display: flex; align-items: center; gap: 10px; padding: 12px; border-top: 1px solid var(--line); cursor: pointer;
       list-style: none; min-height: 58px; color: var(--muted); }
.who::-webkit-details-marker, .avatar-phone::-webkit-details-marker { display: none; }
.who-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.who-name { font-size: 14px; font-weight: 600; color: var(--ink); }
.who-role { font-size: 12px; color: var(--muted); }
.avatar { flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--ink); color: #fff;
          display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; }

/* The profile menu: above the person in the side bar, under the avatar on the telephone. */
.profile { position: relative; }
.menu { position: absolute; z-index: 30; left: 0; right: 0; bottom: 100%; margin-bottom: 6px; background: var(--card);
        border: 1px solid var(--line); border-radius: 10px; padding: 6px; box-shadow: 0 8px 24px rgba(28, 25, 23, 0.12);
        display: flex; flex-direction: column; gap: 2px; }
.menu form { margin: 0; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 8px 10px; border: 0;
             border-radius: 8px; background: none; font-size: 14px; color: var(--text-2); text-decoration: none;
             text-align: left; cursor: pointer; }
.menu-item:hover, .menu-item[aria-current="page"] { background: var(--soft); color: var(--ink); }
.menu-who { padding: 6px 10px 8px; font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--soft); margin-bottom: 4px; }
.menu-who b { color: var(--ink); }
.link-button { background: none; border: 0; padding: 8px 0; font-size: 13px; color: var(--text-2); cursor: pointer;
               text-decoration: underline; min-height: 36px; }

.main { flex: 1; min-width: 0; padding: 28px 32px 48px; }
.page { max-width: 980px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.head { display: flex; flex-direction: column; gap: 18px; }
.head-row { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.head-row .scope, .head-row .readonly { margin-left: auto; }
.head h1 { font-size: 26px; font-weight: 700; color: var(--ink); letter-spacing: -0.01em; }
.date { font-size: 14px; color: var(--muted); margin-top: 2px; }
.brand-phone, .avatar-phone, .phone { display: none; }

.scope { display: inline-flex; background: var(--soft); border-radius: 10px; padding: 3px; }
.scope a { font-size: 14px; color: var(--text-2); padding: 8px 14px; border-radius: 8px; text-decoration: none;
           min-height: 40px; display: inline-flex; align-items: center; gap: 5px; }
.scope a[aria-current="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(28, 25, 23, 0.08); }
.readonly { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }

.progress { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px;
            display: flex; align-items: center; gap: 16px; }
.progress-said { font-size: 14px; color: var(--ink); }
.progress-left { font-size: 13px; color: var(--text-2); white-space: nowrap; }
.bar { flex: 1; height: 8px; background: var(--soft); border-radius: 999px; overflow: hidden; }
.bar > div { height: 100%; background: var(--green); }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips a { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; padding: 7px 12px; border-radius: 999px;
           background: var(--card); color: var(--text); border: 1px solid var(--line); text-decoration: none; min-height: 36px; }
.chips a span { font-weight: 600; opacity: 0.8; }
.chips a[aria-current="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }

.banner { display: flex; align-items: center; gap: 10px; background: var(--amber-bg); border: 1px solid var(--amber-line);
          border-radius: 10px; padding: 12px 16px; font-size: 14px; color: var(--amber-ink); }
.banner svg { flex: none; }
.banner-error { background: var(--error-bg); border-color: #fecaca; color: var(--error-ink); }
.banner-done { background: var(--green-bg); border-color: #bbf7d0; color: var(--green-ink); }

/* -- the cards and the entries ---------------------------------------- */

.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; }
.card h2 { font-size: 16px; font-weight: 600; color: var(--ink); }
.count { font-size: 12px; font-weight: 600; color: var(--text-2); background: var(--soft); border-radius: 999px; padding: 1px 8px; }
.count-green { color: var(--green-ink); background: var(--green-bg); }
.empty p { padding: 18px 16px; color: var(--muted); }

.row { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 14px; align-items: start;
       padding: 14px 16px; border-top: 1px solid var(--soft); position: relative; }
.row.asking { background: #fcfcfb; }
.row.aside { background: var(--bg); }
.row.aside .l1 { color: var(--text-2); }
.lead form { margin: 0; }
.circle { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--ring); background: var(--card);
          cursor: pointer; padding: 0; display: flex; align-items: center; justify-content: center; color: var(--text-2); }
.circle:hover:not(:disabled) { border-color: var(--muted); }
.circle[aria-expanded="true"] { border-color: var(--ink); }
.circle.is-moved { background: var(--line); }
.circle.is-checking { border-color: var(--line); cursor: default; }
.circle.is-green { border: 0; background: var(--green); color: #fff; cursor: default; }
.circle.is-seen { border: 0; background: none; color: var(--muted); cursor: default; }
span.circle { display: flex; }
.spin { display: inline-flex; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation: none; } }

.body { min-width: 0; }
.l1 { font-size: 15px; line-height: 1.4; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
      padding-block: 2px; margin-block: -2px; }
.num { font-weight: 600; font-variant-numeric: tabular-nums; }
.rest { color: var(--text); }
.sep { color: var(--faint); white-space: pre; }
.l2 { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin-top: 2px; flex-wrap: wrap; }
.l3 { font-size: 14px; line-height: 1.45; margin-top: 4px; }
.why { color: var(--text-2); }
.why.amber { color: var(--amber); font-weight: 600; }
.arrow { color: var(--faint); }
.gesture { color: var(--ink); }
/* 24 px to click on the desk, taken back by the margin: the line keeps its 21 px, and nothing moves. */
.num-link { color: var(--ink); text-decoration: underline; text-decoration-color: var(--ring); text-underline-offset: 3px;
            display: inline-flex; align-items: center; gap: 4px; min-height: 24px; margin-block: -1.5px; }
.num-link:hover { text-decoration-color: var(--ink); }
.num-link svg { color: var(--muted); }

.note { margin-top: 8px; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text); background: var(--soft);
        border-radius: 6px; padding: 6px 10px; }
.note svg { flex: none; }
.note-verification_en_cours { background: none; padding: 0; color: var(--text-2); }
.note-vert { background: none; padding: 0; color: var(--green-ink); }
.note-inchange { background: var(--amber-bg); color: var(--amber-ink); }
.earlier { margin-top: 6px; font-size: 13px; color: var(--muted); }

/* -- the cases of a « Selon le cas » line ------------------------------ */

.cases { margin-top: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: var(--card);
         box-shadow: 0 4px 16px rgba(28, 25, 23, 0.08); }
.grab, .ctx, .backdrop { display: none; }
.q { font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 8px; }
.case-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.case-list form { margin: 0; }
.case { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 1px solid var(--line);
        border-radius: 8px; background: var(--card); font-size: 14px; text-align: left; cursor: pointer; color: var(--text-2); min-height: 44px; }
.case:hover { border-color: var(--muted); }
.case-text { flex: 1; min-width: 0; }
.case-text b { color: var(--ink); }
.case input { flex: none; margin: 2px 0 0; width: 18px; height: 18px; accent-color: var(--ink); }
.then { display: block; margin-top: 3px; font-size: 12px; font-weight: 600; color: var(--text-2); }
.then-verifies { color: var(--green-ink); }
.cases-of { font-size: 12px; color: var(--muted); margin-top: 4px; }
.validate-form { display: flex; justify-content: flex-end; margin: 10px 0 0; }
.undo { display: flex; align-items: center; gap: 8px; }
.undo form { margin: 0 0 0 auto; }
.label { font-size: 11px; font-weight: 600; color: var(--text-2); border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; }
.cancel-form { display: flex; justify-content: flex-end; margin: 8px 0 0; }
.cancel { font-size: 13px; color: var(--text-2); background: none; border: 0; padding: 6px 8px; cursor: pointer; min-height: 36px; }

/* -- « Comptes » -------------------------------------------------------- */

.account-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 16px; padding: 4px 16px 18px; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field-wide { grid-column: 1 / -1; }
.field label { font-size: 13px; font-weight: 600; color: var(--ink); }
.field input, .field select { font: inherit; font-size: 15px; min-height: 44px; padding: 8px 10px; border: 1px solid var(--ring);
                              border-radius: 8px; background: var(--card); color: var(--ink); width: 100%; }
.hint { font-size: 12px; color: var(--muted); line-height: 1.4; }
.field-actions { display: flex; align-items: flex-end; }
.account-form .field-actions { grid-column: 1 / -1; justify-content: flex-end; }
.btn-primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.acct { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px 14px; padding: 14px 16px; border-top: 1px solid var(--soft); }
.acct-off { background: var(--bg); }
.acct-off .acct-l1 b { color: var(--text-2); }
.acct-main { flex: 1; min-width: 0; }
.acct-l1 { font-size: 15px; color: var(--ink); }
.acct-l2 { font-size: 14px; color: var(--text); margin-top: 2px; overflow-wrap: anywhere; }
.acct-l3 { font-size: 13px; color: var(--muted); margin-top: 2px; }
.label-off { color: var(--error-ink); border-color: #fecaca; }
.acct-edit { flex: none; max-width: 100%; }
.acct-edit > summary { list-style: none; display: inline-flex; align-items: center; }
.acct-edit > summary::-webkit-details-marker { display: none; }
.acct-edit[open] { flex-basis: 100%; }
.acct-forms { display: flex; flex-direction: column; gap: 12px; margin-top: 10px; padding: 12px; border: 1px solid var(--line);
              border-radius: 10px; background: var(--card); }
.acct-forms form { margin: 0; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.acct-forms .acct-role { flex-direction: row; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.acct-role .field { flex: 1 1 160px; }
.footnote { font-size: 13px; color: var(--muted); }

/* -- « Traités aujourd'hui » ------------------------------------------- */

.done-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; text-decoration: none; color: var(--ink); min-height: 48px; }
.done-title { font-size: 16px; font-weight: 600; }
.done-note { font-size: 13px; color: var(--muted); }
.done-row { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--soft); font-size: 14px; }
.done-icon { flex: none; display: flex; color: var(--green); }
.done-icon-moved { color: var(--muted); }
.done-what { flex: 1; min-width: 0; color: var(--ink); }
.done-said { color: var(--green-ink); text-align: right; }
.done-said-moved { color: var(--text-2); }
.done-empty { padding: 10px 16px 16px; font-size: 14px; color: var(--muted); border-top: 1px solid var(--soft); }

/* -- the telephone ----------------------------------------------------- */

@media (max-width: 800px) {
  .side { display: none; }
  .desk { display: none; }
  .brand-phone, .avatar-phone, .phone { display: initial; }
  .profile-phone { display: block; flex: none; }
  .avatar-phone { display: flex; width: 44px; height: 44px; cursor: pointer; list-style: none; }
  .profile-phone .menu { left: auto; right: 0; bottom: auto; top: 100%; margin: 6px 0 0; width: 240px; }
  .main { padding: 0 0 32px; }
  .page { gap: 12px; }
  .head { gap: 12px; background: var(--card); border-bottom: 1px solid var(--line); padding: 14px 16px 12px; }
  .head-row { flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
  .titles { flex: 1; min-width: 0; }
  .brand-phone { font-size: 13px; font-weight: 700; color: var(--ink); }
  .head h1 { font-size: 22px; }
  .date { font-size: 13px; margin-top: 0; }
  .head-row .scope, .head-row .readonly { margin-left: 0; order: 3; flex-basis: 100%; }
  .scope { display: flex; }
  .scope a { flex: 1; justify-content: center; min-height: 44px; }
  .progress { border: 0; padding: 0; border-radius: 0; gap: 10px; font-size: 13px; }
  .bar { height: 6px; }
  .chips { flex-wrap: nowrap; overflow-x: auto; padding: 0 12px; scrollbar-width: none; }
  .chips a { flex: none; min-height: 44px; }
  .banner, .alerts { margin: 0 12px; }
  .alerts { display: flex; flex-direction: column; gap: 8px; }
  .alerts .banner { margin: 0; }
  .page > .card { margin: 0 12px; }
  .card-head { padding: 12px 16px; }
  .card h2 { font-size: 15px; }

  .row { grid-template-columns: 44px minmax(0, 1fr); gap: 12px; }
  .circle { width: 44px; height: 44px; }
  .l1 { white-space: normal; overflow: visible; }
  .num { display: block; font-size: 15px; }
  .rest { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .rest > .sep:first-child { display: none; }
  .num-link { min-height: 44px; margin-block: 0; }
  .account-form { grid-template-columns: minmax(0, 1fr); }
  .account-form .btn-primary { width: 100%; }
  .acct { gap: 10px; }
  .acct-edit { flex-basis: 100%; }
  .acct-forms .btn { width: 100%; }
  .footnote { margin: 0 16px; }
  .done-row { flex-wrap: wrap; }
  .done-said { width: 100%; text-align: left; padding-left: 30px; }

  .asking { background: var(--card); }
  .cases { position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; margin: 0; border: 0; border-radius: 16px 16px 0 0;
           padding: 10px 16px 28px; box-shadow: 0 -8px 24px rgba(28, 25, 23, 0.16); max-height: 85vh; overflow-y: auto; }
  .grab { display: block; width: 40px; height: 4px; border-radius: 999px; background: var(--ring); margin: 0 auto 14px; }
  .ctx { display: block; font-size: 13px; color: var(--muted); }
  .q { font-size: 18px; font-weight: 700; margin: 2px 0 14px; }
  .case-list { gap: 8px; }
  .case { flex-direction: column; align-items: flex-start; gap: 6px; padding: 12px 14px; border-radius: 10px; font-size: 15px; }
  label.case { flex-direction: row; align-items: flex-start; }
  .validate { width: 100%; min-height: 44px; }
  .cancel-form { margin-top: 12px; }
  .cancel { display: block; width: 100%; padding: 12px 0; font-size: 15px; background: var(--soft); border-radius: 10px; min-height: 44px; }
  .backdrop { display: block; position: fixed; z-index: 10; inset: 0; background: rgba(28, 25, 23, 0.32); }
}
