:root {
  --green: #0b6b4f;
  --green-dark: #08513c;
  --green-soft: #e7f2ee;
  --gold: #c9a14a;
  --gold-soft: #f7efdc;
  --ink: #1d2a25;
  --muted: #64736d;
  --line: #dfe5e2;
  --bg: #f5f7f6;
  --card: #ffffff;
  --red: #b42318;
  --red-soft: #fdecea;
  --amber: #b54708;
  --amber-soft: #fef4e6;
  --radius: 8px;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0; font-weight: 600; }
h2 { font-size: 16px; margin: 0 0 12px; font-weight: 600; }
h3 { font-size: 14px; margin: 0 0 8px; font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nowrap { white-space: nowrap; }

/* layout */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 228px; flex-shrink: 0; background: #fff; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.sidebar .brand { padding: 18px 12px 10px 18px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sidebar .brand img { width: 140px; display: block; }
.nav-toggle { border: 1px solid var(--line); background: #fff; color: var(--green); border-radius: 8px;
  width: 34px; height: 34px; display: grid; place-items: center; cursor: pointer; flex-shrink: 0; padding: 0; }
.nav-toggle:hover { background: var(--green-soft); }
.sidebar nav .soon { display: block; padding: 6px 10px; color: #a3aca7; font-size: 13px; cursor: default; }
.sidebar nav .soon em { font-style: normal; font-size: 10px; text-transform: uppercase; letter-spacing: .05em;
  background: #f0f2f1; border-radius: 8px; padding: 1px 6px; margin-left: 4px; }
.sidebar { transition: width .15s ease; }
/* hidden menu: the sidebar disappears, a slim top bar keeps the button and the logo */
.nav-closed .sidebar { display: none; }
.topbar { display: none; align-items: center; gap: 14px; margin: -10px 0 18px; padding-bottom: 12px;
  border-bottom: 1px solid var(--line); }
.topbar img { height: 34px; display: block; }
.nav-closed .topbar { display: flex; }
.app-name { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--gold, #c9a14a); }
.sidebar .logo { display: block; text-decoration: none; }
.sidebar .logo .app-name { display: block; margin-top: 6px; text-align: center; }
.login-app { text-align: center; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #c9a14a;
  margin: -12px 0 20px; font-size: 13px; }
.login-app span { color: var(--muted); font-weight: 400; letter-spacing: 0; text-transform: none; }
.sidebar nav { padding: 10px 8px; flex: 1; overflow-y: auto; }
.sidebar nav .group { font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); padding: 14px 10px 4px; }
.sidebar nav a { display: block; padding: 7px 10px; border-radius: 6px; color: var(--ink); }
.sidebar nav a:hover { background: var(--green-soft); text-decoration: none; }
.sidebar nav a.active { background: var(--green); color: #fff; }
.sidebar .me { border-top: 1px solid var(--line); padding: 12px 18px; font-size: 13px; }
.sidebar .me form { display: inline; }
.main { flex: 1; min-width: 0; padding: 24px 28px 60px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-bottom: 18px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); margin-top: 4px; }

/* cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; margin-bottom: 18px; }
.card.flush { padding: 0; overflow: hidden; }
.card.flush > h2 { padding: 16px 18px 0; }
.grid { display: grid; gap: 18px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.grid.kpis { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 18px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.kpi .label { color: var(--muted); font-size: 12px; }
.kpi .value { font-size: 22px; font-weight: 600; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi.alert .value { color: var(--red); }

/* tables */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { font-size: 12px; font-weight: 600; color: var(--muted); background: #fafbfa; white-space: nowrap; }
th a { color: var(--muted); }
th a.sorted { color: var(--ink); }
tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #fafcfb; }
tr.red td { background: var(--red-soft) !important; }
tr.red td:first-child { box-shadow: inset 3px 0 0 var(--red); }
tfoot td { font-weight: 600; background: #fafbfa; border-top: 1px solid var(--line); }
.table-wrap { overflow-x: auto; }
.empty { padding: 28px; text-align: center; color: var(--muted); }

/* forms */
label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search],
input[type=datetime-local], input[type=date], input[type=tel], input:not([type]), select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid #cbd5d0; border-radius: 6px; font: inherit;
  background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--green-soft); border-color: var(--green); }
input[type=color] { width: 60px; height: 36px; border: 1px solid #cbd5d0; border-radius: 6px; padding: 2px; }
textarea { min-height: 70px; resize: vertical; }
.field { margin-bottom: 14px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 400; color: var(--ink); font-size: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 16px; }
.form-actions { display: flex; gap: 10px; margin-top: 8px; }
.inline-form { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.inline-form .field { margin-bottom: 0; }
.req::after { content: " *"; color: var(--red); }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px 4px; margin: 0 0 16px; }
legend { font-weight: 600; padding: 0 6px; }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 6px;
  border: 1px solid var(--green); background: var(--green); color: #fff; font: inherit; font-weight: 600;
  cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--green-dark); text-decoration: none; }
.btn.secondary { background: #fff; color: var(--green); }
.btn.secondary:hover { background: var(--green-soft); }
.btn.danger { background: #fff; color: var(--red); border-color: #f1b8b2; }
.btn.danger:hover { background: var(--red-soft); }
.btn.small { padding: 4px 9px; font-size: 12px; font-weight: 500; }
.link-btn { background: none; border: none; color: var(--green); cursor: pointer; font: inherit; padding: 0; }
.link-btn.danger { color: var(--red); }

/* badges & pills */
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px;
  background: var(--green-soft); color: var(--green-dark); white-space: nowrap; }
.badge.gold { background: var(--gold-soft); color: #7a5a14; }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.amber { background: var(--amber-soft); color: var(--amber); }
.badge.grey { background: #eef1f0; color: var(--muted); }
/* one colour per user space: Bureau green (default), Client yellow, Agent maritime blue, Surveillance purple, Dépôt orange */
.badge.space-client { background: var(--gold-soft); color: #7a5a14; }
.badge.space-agent { background: #e3eefb; color: #1d4f91; }
.badge.space-surveyor { background: #efe8fa; color: #5b2d91; }
.badge.space-depot { background: #ffdcb8; color: #8f3d00; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.phases { display: flex; gap: 3px; }
.phases span { width: 22px; height: 8px; border-radius: 3px; background: #e3e8e6; }
.phases span.started { background: var(--gold); }
.phases span.complete { background: var(--green); }

/* flash */
.test-banner { padding: 8px 14px; border-radius: 6px; margin-bottom: 14px; background: #1d4f91; color: #fff; font-weight: 600; text-align: center; }
.flash { padding: 10px 14px; border-radius: 6px; margin-bottom: 14px; border: 1px solid; }
.flash.success { background: var(--green-soft); border-color: #b9d9cd; color: var(--green-dark); }
.flash.error { background: var(--red-soft); border-color: #f1b8b2; color: var(--red); }

/* tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 10px 14px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.active { color: var(--green); border-bottom-color: var(--green); font-weight: 600; }

/* toolbar */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar input[type=search] { width: 260px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.seg a { padding: 7px 12px; color: var(--muted); background: #fff; }
.seg a.active { background: var(--green); color: #fff; }
.seg a:hover { text-decoration: none; }

/* pagination */
.pagination { display: flex; gap: 6px; align-items: center; padding: 12px 16px; color: var(--muted); }

/* import file */
.phase { margin-bottom: 18px; }
.phase-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px;
  border-bottom: 1px solid var(--line); background: #fafbfa; }
.phase-head h3 { margin: 0; }
summary.phase-head { cursor: pointer; list-style: none; }
summary.phase-head::-webkit-details-marker { display: none; }
details.phase:not([open]) .phase-head { border-bottom: none; }
.step { display: grid; grid-template-columns: 26px 1fr auto; gap: 12px; padding: 12px 16px;
  border-bottom: 1px solid var(--line); align-items: start; }
.step:last-child { border-bottom: none; }
.step.done .title { color: var(--muted); }
.step .status-ico { width: 20px; height: 20px; border-radius: 50%; border: 2px solid #c3ccc8; margin-top: 1px; }
.step.doing .status-ico { border-color: var(--gold); background: var(--gold-soft); }
.step.done .status-ico { border-color: var(--green); background: var(--green); position: relative; }
.step.done .status-ico::after { content: ""; position: absolute; left: 5px; top: 2px; width: 5px; height: 9px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.step.na .status-ico { border-style: dashed; }
.step.overdue .title::after { content: "En retard"; margin-left: 8px; font-size: 11px; color: var(--red);
  background: var(--red-soft); padding: 1px 6px; border-radius: 999px; font-weight: 600; }
.step .meta { font-size: 12px; color: var(--muted); margin-top: 3px; }
.step .docs { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px; }
.step details { margin-top: 6px; }
.step details summary { cursor: pointer; color: var(--green); font-size: 12px; }
.step .actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.lane { font-size: 11px; padding: 1px 7px; border-radius: 999px; background: #eef1f0; color: var(--muted); margin-left: 6px; }

/* key/value */
dl.kv { display: grid; grid-template-columns: 190px 1fr; gap: 8px 14px; margin: 0; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; }

/* login */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: linear-gradient(160deg, #f5f7f6 0%, var(--green-soft) 100%); }
.login .card { width: 100%; max-width: 380px; padding: 30px; }
.login img { width: 210px; display: block; margin: 0 auto 22px; }

@media (max-width: 860px) {
  .layout { flex-direction: column; }
  .sidebar, .nav-closed .sidebar { width: 100%; height: auto; position: static; }
  .sidebar nav { display: flex; flex-wrap: wrap; }
  .sidebar nav .group { width: 100%; }
  .main { padding: 16px; }
  dl.kv { grid-template-columns: 1fr; }
}
.link-btn.small { font-size: 12px; }

.btn[disabled] { opacity: .45; cursor: not-allowed; }
.call { margin-bottom: 18px; }
.call-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); background: #fafbfa; }
.call-head h3 { margin: 0; font-size: 15px; }
.shift { padding: 10px 18px; margin: -8px 0 18px; border-left: 3px dashed var(--gold); color: var(--muted); font-size: 13px; }

/* import stages */
.stage-bar { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; margin-bottom: 18px; background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.stage-bar .stage { padding: 12px 14px; border-right: 1px solid var(--line); color: var(--ink); position: relative; }
.stage-bar .stage:last-child { border-right: none; }
.stage-bar .stage:hover { background: var(--green-soft); text-decoration: none; }
.stage-bar .stage .n { display: block; font-size: 24px; font-weight: 600; color: var(--green); }
.stage-bar .stage .l { font-size: 12px; color: var(--muted); }
.stage-bar .stage.alert .n { color: var(--red); }
.stage-bar .stage:not(:last-child)::after { content: "›"; position: absolute; right: -6px; top: 50%; transform: translateY(-50%);
  color: #b9c4bf; background: #fff; font-size: 16px; line-height: 1; z-index: 1; }
@media (max-width: 860px) { .stage-bar { grid-template-columns: 1fr 1fr; } }

.imp { min-width: 150px; white-space: nowrap; }
.phases span { width: 14px; }
td .lane { white-space: nowrap; }

/* dashboards */
.dash-tabs { display:flex; gap:4px; border-bottom:2px solid #e3e8e5; margin:0 0 16px; }
.dash-tabs a { padding:8px 18px; color:#46524c; text-decoration:none; font-weight:600; border-bottom:3px solid transparent; margin-bottom:-2px; }
.dash-tabs a.on { color:#0b6b4f; border-bottom-color:#0b6b4f; }
.dash-tabs a:hover { color:#0b6b4f; }
.docchips { display:flex; flex-wrap:wrap; gap:3px; margin-bottom:4px; max-width:260px; }
.chip { font-size:11px; padding:1px 6px; border-radius:10px; white-space:nowrap; }
.chip.ok { background:#e3f2ea; color:#0b6b4f; }
.chip.ko { background:#fbe5e2; color:#a8321f; }
.pipeline { display:flex; flex-wrap:wrap; gap:12px 32px; }
.pipeline div { display:flex; flex-direction:column; }
.pipeline strong { font-size:20px; }
select.warn { border-color:#c9a14a; background:#fff8e8; }
.inline-form select { min-width: 150px; }
table.rights th.c, table.rights td.c { text-align: center; width: 110px; }
table.rights td.changed { background: #fff8e8; }
table.rights input[type=checkbox] { width: 18px; height: 18px; }
table.rights input[type=checkbox], input[type=checkbox] { accent-color: var(--green); }
input:disabled, select:disabled, textarea:disabled { background: #f1f3f2; color: #8a948f; cursor: not-allowed; }
table.rights tr.grp td { background: var(--green-soft); font-weight: 700; color: var(--green); font-size: 12px;
  text-transform: uppercase; letter-spacing: .05em; padding-top: 8px; padding-bottom: 8px; }
.sidebar nav .locked { display: block; padding: 7px 10px; color: #b5bdb9; cursor: not-allowed; }
.closing { gap: 14px; }
.close-box { border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; }
.close-box.ok { border-color: #9fd0b8; background: #f3faf6; }
.close-box h3 { margin: 0 0 4px; font-size: 15px; }
.qty-form { display: inline-flex; gap: 4px; align-items: center; }
.qty-form input { width: 100px; text-align: right; padding: 4px 6px; }
.silo { padding: 12px 18px; border-top: 1px solid var(--line); background: #fbfcfb; }
.silo h4 { margin: 0 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
table.compact td { padding: 4px 8px; }
.tariff-versions { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 14px; padding: 14px 18px; }
.tariff { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; opacity: .75; }
.tariff.current { opacity: 1; border-color: #9fd0b8; background: #f7fbf9; }
.tariff-head { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; flex-wrap: wrap; }
table.scale td { padding: 2px 6px; }
.tariff-form { margin-top: 10px; }
.kpi .per-t { font-size: 15px; font-weight: 600; color: var(--ink); margin-top: 2px; }
/* surveyor portal (tablet / phone) */
.call-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.call-card-head { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.post-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.weigh-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; align-items: end; }
input.big { font-size: 18px; padding: 10px 12px; letter-spacing: .03em; }
.plate { font-family: ui-monospace, Menlo, monospace; font-size: 15px; letter-spacing: .04em; }
.bar { height: 8px; background: #e6ece9; border-radius: 4px; overflow: hidden; width: 120px; display: inline-block; vertical-align: middle; margin-right: 6px; }
.bar span { display: block; height: 100%; background: var(--green); }
.red-text { color: #b42318; font-weight: 600; }
.weigh-form input, .weigh-form select { width: 100%; }
tr.correction td { background: #fffaf0; color: #7a5b16; padding-top: 4px; padding-bottom: 4px; }
.inline-details { display: inline-block; margin-left: 8px; }
.days { display:flex; gap:8px; flex-wrap:wrap; }
.bar.hatched { background: repeating-linear-gradient(45deg, #e6ece9, #e6ece9 4px, #f4f7f5 4px, #f4f7f5 8px); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; margin-bottom: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; }
.daybars { display: flex; align-items: flex-end; gap: 6px; overflow-x: auto; padding-top: 8px; min-height: 190px; }
.daybar { display: flex; flex-direction: column; align-items: center; min-width: 26px; }
.daybar .stack { width: 22px; display: flex; flex-direction: column-reverse; border-radius: 3px 3px 0 0; overflow: hidden; }
.daybar .lbl { font-size: 10px; color: var(--muted); margin-top: 4px; }

/* Portal dashboards: today / yesterday */
.day-pair .day-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 6px; }
.day-pair .day-cols > div + div { border-left: 1px solid var(--line); padding-left: 12px; }
.day-pair .value { margin-top: 0; }
.day-pair .muted-value { color: var(--muted); }
.grid.kpis.wide { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
tr.total td { background: var(--bg, #f6f7f4); border-top: 2px solid var(--line); }
.grid.pairs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 900px) { .grid.pairs { grid-template-columns: 1fr; } }
.grid-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 14px; }
.row-form { display: inline; margin: 0; }
tr.tranche-row td { background: #fafbfa; border-top: 0; padding-top: 6px; padding-bottom: 6px; }
.nav-count { display: inline-block; min-width: 18px; padding: 0 6px; border-radius: 9px; background: var(--gold); color: #fff; font-size: 11px; font-weight: 600; text-align: center; margin-left: 4px; }
.inbox-split { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.inbox-split .viewer { position: sticky; top: 12px; height: calc(100vh - 40px); border: 1px solid var(--line); border-radius: var(--radius); background: #fff; overflow: hidden; }
.inbox-split .viewer iframe, .inbox-split .viewer img { width: 100%; height: 100%; border: 0; object-fit: contain; }
.inbox-split .viewer pre { margin: 0; padding: 16px; white-space: pre-wrap; font-size: 13px; height: 100%; overflow: auto; }
@media (max-width: 1000px) { .inbox-split { grid-template-columns: 1fr; } .inbox-split .viewer { position: static; height: 70vh; } }
.check-list { list-style: none; margin: 0; padding: 0; }
.check-list li { padding: 8px 16px; border-top: 1px solid var(--line); font-size: 13px; }
.check-list li.erreur { background: var(--red-soft); color: var(--red); }
.check-list li.attention { background: var(--amber-soft); color: var(--amber); }
.check-list li.ok { color: var(--green); }
dl.fields { display: grid; grid-template-columns: 170px 1fr; gap: 6px 12px; margin: 0; padding: 12px 16px; font-size: 13px; }
dl.fields dt { color: var(--muted); }
dl.fields dd { margin: 0; }
tr.group-row td { background: var(--green-soft); color: var(--green-dark); font-size: 13px; padding-top: 6px; padding-bottom: 6px; }
.refaction-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; padding: 6px 0; border-bottom: 1px solid var(--line); }
.refaction-row .ref-product { min-width: 150px; padding-bottom: 10px; font-weight: 600; }
.refaction-row .field { flex: 1; min-width: 110px; margin-bottom: 4px; }
.flash-inline.error { color: var(--red); font-weight: 600; }
.sidebar nav .group.foldable { cursor: pointer; user-select: none; display: flex; justify-content: space-between; align-items: center; }
.sidebar nav .group.foldable::after { content: ""; width: 7px; height: 7px; margin-right: 4px; border-right: 2px solid var(--green);
  border-bottom: 2px solid var(--green); transform: rotate(45deg) translate(-2px, -2px); transition: transform .15s; }
.sidebar nav .group.foldable.folded::after { transform: rotate(-45deg); }
.sidebar nav .group.foldable:hover { color: var(--ink); }

/* ------------------------------------------------------------------ tablets
   Field profiles (surveyors, depot guards, weighers) work on tablets: body.field gets a compact top bar instead of
   the side menu, finger-size fields and buttons, scrollable tables. Any touch screen gets the finger-size controls. */
@media (max-width: 1100px) {
  .card.flush { overflow-x: auto; }
  .card.flush > table { min-width: 640px; }
}
@media (pointer: coarse) {
  input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], input[type=tel],
  input[type=datetime-local], input[type=date], input:not([type]), select { min-height: 46px; font-size: 17px; }
  .btn { min-height: 44px; padding: 10px 16px; }
  .btn.small { min-height: 38px; padding: 8px 12px; font-size: 14px; }
  .tabs a { padding: 14px 18px; font-size: 15px; }
  .link-btn { min-height: 36px; }
  input[type=checkbox], input[type=radio] { width: 22px; height: 22px; }
  td, th { padding: 12px; }
}
/* compact top bar: field profiles on a tablet or phone only (touch screen or narrow window); a PC keeps the side menu */
@media (pointer: coarse), (max-width: 1100px) {
  body.field .layout { flex-direction: column; }
  body.field .sidebar, .nav-closed body.field .sidebar { display: flex; flex-direction: row; align-items: center; width: 100%;
    height: auto; position: sticky; top: 0; z-index: 20; border-right: none; border-bottom: 1px solid var(--line);
    gap: 10px; padding: 0 12px; }
  body.field .sidebar .brand { border: none; padding: 8px 0; }
  body.field .sidebar .brand img { width: 92px; }
  body.field .sidebar .brand .app-name { margin-top: 2px; font-size: 9px; }
  body.field .sidebar .nav-toggle, body.field .topbar { display: none !important; }
  body.field .sidebar nav { display: flex; flex: 1; gap: 4px; padding: 8px 0; overflow-x: auto; white-space: nowrap; }
  body.field .sidebar nav a { padding: 12px 16px; font-size: 15px; }
  body.field .sidebar .me { border: none; padding: 6px 0; text-align: right; white-space: nowrap; font-size: 12px; }
  body.field .sidebar .me .muted { display: none; }
  body.field .main { padding: 16px 16px 60px; }
  body.field input.big { font-size: 22px; min-height: 52px; }
  body.field .refresh-note { font-size: 12px; color: var(--muted); }
}
@media (max-width: 700px) {
  body.field .sidebar { flex-wrap: wrap; }
  body.field .sidebar nav { order: 3; width: 100%; flex-basis: 100%; }
}

/* menu sections: bold titles, visible fold arrows */
.sidebar nav .group { font-weight: 700; color: var(--ink); font-size: 11.5px; border-top: 1px solid var(--line); margin-top: 6px; }
.sidebar nav .group:first-child { border-top: none; margin-top: 0; }
/* fold / unfold every section of the menu */
.sidebar nav .nav-fold-all { display: block; margin: 0 0 4px auto; padding: 2px 6px; border: 0; background: none;
  color: var(--green); font: inherit; font-size: 11.5px; cursor: pointer; }
.sidebar nav .nav-fold-all:hover { text-decoration: underline; }
.sidebar nav .nav-fold-all + .group { border-top: none; margin-top: 0; }
.btn:disabled, .btn[disabled] { opacity: .45; cursor: not-allowed; pointer-events: auto; }
.flash.warning { background: var(--amber-soft); border-color: #f5c99a; color: var(--amber); }
/* client reception points */
.rp { padding: 12px 16px; border-top: 1px solid var(--line); }
.rp.muted { opacity: .6; }
.rp-products { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; }
.rp-products label { display: flex; gap: 4px; align-items: center; white-space: nowrap; }
.rp-hours { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 6px 10px; }
.rp-hours > div { display: flex; flex-direction: column; gap: 2px; }
.rp-hours input { width: 100%; font-size: 12.5px; }
@media (max-width: 900px) { .rp-hours { grid-template-columns: repeat(2, 1fr); } }
tr.pinned td { background: var(--amber-soft); }
/* version of Alizé, under the menu button, on the line of the app name */
.sidebar .brand { position: relative; }
.app-version { position: absolute; right: 12px; bottom: 11px; width: 34px; text-align: center; white-space: nowrap;
  font-size: 9.5px; color: #a3aca7; letter-spacing: .02em; display: flex; justify-content: center; }

/* VEDI purchase confirmation: values changed by VEDI since the import team's validation; new VEDI purchases */
.vedi-changed, tr.vedi-changed td { background: var(--amber-soft) !important; color: var(--amber); font-weight: 600; }
tr.new-contract td { background: var(--gold-soft) !important; }
tr.new-contract td:first-child { box-shadow: inset 3px 0 0 var(--gold); }
dialog.card::backdrop { background: rgba(0, 0, 0, .35); }

/* popups (vessel tender, GGF banks) */
dialog.popups { max-width: 520px; border: 0; border-radius: 10px; padding: 18px 20px; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
dialog.popups .popup-item { padding: 10px 0; border-bottom: 1px solid var(--line); }
dialog.popups .popup-item:last-of-type { border-bottom: 0; }
dialog.popups .popup-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.closing-points { border-left: 4px solid var(--amber); background: var(--amber-soft); padding: 10px 14px; margin-bottom: 12px; border-radius: 6px; }
.closing-points ul { margin: 6px 0; padding-left: 18px; }
.card.shares-locked { border-left: 4px solid var(--amber); background: var(--amber-soft); padding: 10px 14px; }
dialog.popups .popup-item.urgent { border-left: 4px solid var(--red, #b42318); padding-left: 10px; color: var(--red, #b42318); }
/* final documents checklist (import file, "Réception des documents") */
.final-docs { display: flex; gap: 32px; flex-wrap: wrap; margin: 6px 0 2px; }
.final-docs ul { list-style: none; margin: 0; padding: 0; min-width: 240px; }
.final-docs li { padding: 2px 0; }
.final-docs .mark { display: inline-block; width: 18px; color: var(--muted); font-weight: 700; }
.final-docs li.ok .mark { color: var(--green); }
.final-docs li.na { color: var(--muted); }
.bl-control { margin: 10px 0 4px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); }
.bl-control.ok { background: var(--green-soft); border-color: #b9d9cd; }
.bl-control.warn { background: var(--amber-soft); border-color: #f5c99a; }
.bl-control .bl-problems { margin: 6px 0; padding-left: 18px; color: var(--amber); font-weight: 600; }
.bl-control details { margin-top: 6px; }
.bl-control table { background: #fff; }
.bl-control .bl-fix { margin-top: 4px; }
.bl-control .bl-fix summary { cursor: pointer; color: var(--green); }
/* client statement (décompte), printable */
.statement { background: #fff; color: #111; max-width: 820px; padding: 24px 28px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; }
.statement .st-top { display: flex; align-items: flex-end; justify-content: space-between; }
.statement .st-date { margin-left: auto; text-align: right; }
.statement .st-logo { width: 170px; display: block; }
.statement .st-title { text-align: center; margin: 18px 0; font-size: 17px; }
.statement table { width: 100%; border-collapse: collapse; }
.statement .st-head td { padding: 3px 4px; border: 0; }
.statement .st-head .st-gap td { padding-top: 14px; padding-bottom: 8px; }
.statement .st-body { border: 1px solid #555; }
.statement .st-body td { padding: 4px 6px; border: 0; }
.statement .st-sec td { font-weight: 700; border-top: 1px solid #555; padding-top: 6px; }
.statement .st-port { margin-left: 90px; }
.statement .st-total td { font-weight: 700; padding-bottom: 8px; }
.statement .st-total td.num, .statement .st-body td.num { text-align: right; white-space: nowrap; }
.statement .st-balance td { border-top: 1px solid #555; font-size: 16px; font-weight: 700; padding: 10px 6px; }
@media print {
  .no-print, .flash, .sidebar, .topbar, .nav, aside { display: none !important; }
  .layout { display: block; min-height: 0; }
  .main { padding: 0 !important; margin: 0 !important; }
  .statement { border: 0; border-radius: 0; max-width: none; }
}
/* décompte: one A4 page on letterhead paper (the page has no margin: see statement_sheet.html); the blank space
   for the letterhead is inside the sheet */
@media print {
  html, body { background: #fff !important; }
  .statement { padding: 38mm 16mm 26mm; break-inside: avoid; }
  .statement .st-title { margin: 12px 0; }
}
.agent-call { border-top: 1px solid var(--line); padding: 8px 0 4px; }
.agent-docs { margin: 10px 0 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: #fafbfa; }
.agent-dash td { vertical-align: top; }
.agent-docs-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
