/* Panel de bureau (PC / MacBook). Les couleurs et boutons viennent de style.css. */
body.pc { display: flex; height: 100vh; overflow: hidden; font-size: 14px; }

/* ---------- menu de gauche ---------- */
.side {
  width: 248px; flex: none; background: var(--panel); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 18px 12px 14px;
}
.side-brand { padding: 4px 10px 18px; display: flex; flex-direction: column; gap: 6px; }
.side-brand #company { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .3px; }
.side-brand #company:empty { display: none; }
#nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.nav-group {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: #5d6d84;
  padding: 16px 12px 6px;
}
.nav-group:first-child { padding-top: 4px; }
#nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px; color: var(--muted);
  text-decoration: none; cursor: pointer; font-weight: 600; position: relative; transition: background .15s, color .15s;
}
#nav a [data-ic] .ic { width: 19px; height: 19px; }
#nav a:hover { background: var(--panel-2); color: var(--text); }
#nav a.active { background: var(--accent-soft); color: #fff; }
#nav a.active::before {
  content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent);
}
#nav a.active [data-ic] { color: var(--accent); }
.nav-ext { margin-left: auto; opacity: .6; }
.nav-ext .ic { width: 14px !important; height: 14px !important; }
.nav-count { margin-left: auto; font-size: 11px; color: var(--muted); font-weight: 700; }
.nav-count.alert:not(:empty) { background: var(--bad); color: #fff; border-radius: 99px; padding: 1px 7px; }
.side-foot { border-top: 1px solid var(--line); padding: 14px 6px 0; display: flex; align-items: center; gap: 8px; }
.me { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.me > div { min-width: 0; }
.me #meName { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me #meRole { font-size: 12px; }
.avatar {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none;
  background: linear-gradient(135deg, var(--accent), #35c3ff); color: #fff; font-weight: 800;
}

/* ---------- en-tête ---------- */
.pc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pc-head { display: flex; align-items: center; gap: 20px; padding: 18px 32px; border-bottom: 1px solid var(--line); }
.pc-head > div:first-child { flex: 1; min-width: 0; }
.crumb { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; }
.pc-head h1 { margin: 2px 0 0; font-size: 24px; font-weight: 800; letter-spacing: -.4px; }
.pc-storm {
  display: flex; align-items: center; gap: 10px; font-size: 13px; min-width: 0;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 8px 14px;
}
.storm-ic { color: var(--accent); }
.pc-storm #stormName { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.pc-storm .progress { width: 140px; flex: none; }
.page { display: none; flex: 1; min-height: 0; flex-direction: column; overflow-y: auto; padding: 24px 32px 32px; }
.page.active { display: flex; }
.report.narrow { max-width: 880px; padding: 0; overflow: visible; }

/* ---------- barres d'outils ---------- */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar select { width: auto; flex: none; max-width: 210px; }
.toolbar .spacer, .bulk .spacer { flex: 1; }
.toolbar .muted { font-size: 13px; }
label.search {
  margin: 0; display: flex; align-items: center; gap: 8px; flex: 1 1 200px; max-width: 340px; color: var(--muted);
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px; padding: 0 10px; transition: border-color .15s, box-shadow .15s;
}
label.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
label.search input { border: 0; background: none; padding: 9px 0; box-shadow: none !important; }
label.search kbd { background: var(--panel-3); color: var(--muted); }
.btn kbd { margin-left: 2px; }
.bulk {
  display: flex; gap: 8px; align-items: center; padding: 8px 12px; margin-bottom: 12px; border-radius: 12px;
  background: var(--accent-soft); border: 1px solid rgba(26,140,255,.35); flex-wrap: wrap;
}
.bulk select { width: auto; padding: 5px 8px; }

/* ---------- tableaux ---------- */
.tbl-wrap { border: 1px solid var(--line); border-radius: 14px; overflow: auto; flex: 1; min-height: 120px; background: var(--panel); }
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; }
.tbl th {
  position: sticky; top: 0; z-index: 1; background: var(--panel); text-align: left; font-weight: 700; color: var(--muted);
  font-size: 11px; text-transform: uppercase; letter-spacing: .6px; padding: 12px 14px; border-bottom: 1px solid var(--line);
  white-space: nowrap; user-select: none;
}
.tbl th[data-sort] { cursor: pointer; }
.tbl th[data-sort]:hover, .tbl th.sorted { color: var(--text); }
.tbl th.sorted::after { content: " " attr(data-dir); font-size: 9px; color: var(--accent); }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr { cursor: pointer; transition: background .12s; }
.tbl tbody tr:hover td { background: rgba(255,255,255,.025); }
.tbl tbody tr.sel td { background: rgba(26,140,255,.09); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl .ck { width: 40px; padding-right: 0; }
.tbl .ck input { width: 16px; height: 16px; cursor: pointer; accent-color: var(--accent); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .sub { color: var(--muted); font-size: 12px; margin-top: 2px; max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbl .empty { cursor: default; }
.tbl .row-actions { text-align: right; white-space: nowrap; }
.tbl-foot { font-size: 12px; padding-top: 10px; }
.name-ic { display: inline-flex; align-items: center; gap: 8px; }
.name-ic .ic { color: var(--muted); }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 4px; vertical-align: middle; }
.warn-t { color: var(--warn); }
.small-t { font-size: 12px; margin-top: 4px; }

/* ---------- tableau de bord ---------- */
.cards { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; min-width: 0; }
.card-label {
  color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .6px; font-weight: 700;
  display: flex; align-items: center; gap: 10px;
}
.card-ic {
  width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex: none;
  background: var(--panel-3); color: var(--text);
}
.card-ic.blue, .tile-ic.blue { background: var(--accent-soft); color: #5cb2ff; }
.card-ic.green, .tile-ic.green { background: rgba(34,176,125,.15); color: #4fd3a0; }
.card-ic.violet, .tile-ic.violet { background: rgba(167,139,250,.15); color: #b9a4ff; }
.card-value { font-size: 30px; font-weight: 800; letter-spacing: -.5px; margin: 10px 0 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card.big .card-value { font-size: 22px; }
.progress.wide { max-width: none; margin: 6px 0 10px; }
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 18px 0; }
.action-tile {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; text-decoration: none; color: var(--text);
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; cursor: pointer;
  transition: border-color .15s, transform .15s, background .15s;
}
.action-tile:hover { border-color: var(--accent); background: var(--panel-2); transform: translateY(-1px); }
.action-tile b { font-size: 15px; margin-top: 10px; }
.action-tile small { color: var(--muted); font-size: 12px; }
.tile-ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--panel-3); }
.tile-ic .ic { width: 20px; height: 20px; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.box { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 16px 20px 18px; margin-bottom: 16px; }
.box h3 {
  margin: 0 0 10px; font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); font-weight: 700;
  display: flex; align-items: center; gap: 8px;
}
.box h3 .ic { width: 16px; height: 16px; }
.line-item { padding: 10px 0; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.line-item:last-child { border-bottom: 0; }
.line-item[data-cid] { cursor: pointer; display: block; }
.steps { color: var(--muted); padding-left: 20px; line-height: 1.8; }
.steps b { color: var(--text); }

/* ---------- fiche latérale ---------- */
.drawer { position: fixed; inset: 0; background: rgba(4,8,14,.55); z-index: 2000; display: flex; justify-content: flex-end; backdrop-filter: blur(2px); }
.drawer-card {
  width: 580px; max-width: 100vw; height: 100%; background: var(--panel); border-left: 1px solid var(--line);
  display: flex; flex-direction: column; box-shadow: -16px 0 48px rgba(0,0,0,.45); animation: slidein .2s ease-out;
}
@keyframes slidein { from { transform: translateX(40px); opacity: .5; } }
.drawer-head { display: flex; align-items: center; padding: 18px 24px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 0; font-size: 19px; font-weight: 800; letter-spacing: -.3px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer-scroll { flex: 1; overflow-y: auto; padding: 6px 24px 22px; }
.drawer-actions { display: flex; gap: 8px; padding: 14px 24px; border-top: 1px solid var(--line); background: var(--panel); }
.drawer-actions .spacer { flex: 1; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 12px; }
.mini-map { height: 270px; border-radius: 12px; border: 1px solid var(--line); margin-top: 8px; }
.mini-map.tall { height: 430px; }
.mini-map.drawing { cursor: crosshair; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.map-tools { display: flex; gap: 6px; margin-top: 12px; flex-wrap: wrap; }
.chip-btn.active { border-color: var(--accent); color: #fff; background: var(--accent-soft); }

/* ---------- accès spécial et journaux ---------- */
.pill.role-super { background: rgba(240,167,58,.18); color: #ffc66b; }
.pill.role-owner { background: var(--accent-soft); color: #8cc4ff; }
.pill.role-employee { background: var(--panel-3); color: var(--muted); }
.role-select { width: auto; padding: 5px 8px; font-size: 13px; }
.subtabs { display: flex; gap: 4px; margin-bottom: 16px; padding: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; width: fit-content; }
.subtabs button {
  display: inline-flex; align-items: center; gap: 8px; background: none; border: 0; border-radius: 9px; padding: 8px 14px;
  cursor: pointer; font-weight: 600; color: var(--muted); transition: background .15s, color .15s;
}
.subtabs button .ic { width: 16px; height: 16px; }
.subtabs button:hover { color: var(--text); }
.subtabs button.active { color: #fff; background: var(--panel-3); }
.subtabs button.active .ic { color: var(--accent); }
.log-cards { grid-template-columns: 1fr 1fr 1fr 2fr; margin-bottom: 16px; }
.log-cards .card-value { font-size: 26px; }
.log-cards .wide2 { grid-column: span 2; }
.ok-t { color: #4fd3a0; }
.bad-t { color: #ff8a8a; }
.pill.lvl-ok { background: rgba(34,176,125,.18); color: #4fd3a0; }
.pill.lvl-bad { background: rgba(239,86,86,.18); color: #ff8a8a; }
.pill.lvl-warn, .pill.warn-pill { background: rgba(240,167,58,.18); color: #ffc66b; }
.pill.lvl-info { background: var(--accent-soft); color: #8cc4ff; }
.tbl.logs td { font-size: 13px; }
.tbl.logs .nowrap { white-space: nowrap; }
.tbl tbody tr.row-bad td { background: rgba(239,86,86,.045); }
.tbl tbody tr.detail td { background: var(--bg); cursor: default; }
.tbl tr.detail pre { margin: 0; white-space: pre-wrap; word-break: break-word; font-size: 12px; max-height: 360px; overflow: auto; }
.ip-link { color: #5cb2ff; text-decoration: none; }
.ip-link:hover { text-decoration: underline; }
.server-log {
  flex: 1; min-height: 200px; margin: 0; overflow: auto; background: #070b10; border: 1px solid var(--line);
  border-radius: 14px; padding: 12px 14px; font: 12px/1.55 ui-monospace, Consolas, monospace; white-space: pre-wrap;
  word-break: break-word;
}

/* ---------- soumissions ---------- */
.q-stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-bottom: 14px; }
.q-stat { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; display: flex; flex-direction: column; }
.q-stat b { font-size: 24px; font-weight: 800; }
.q-stat span { font-size: 12px; color: var(--muted); }
.q-stat.ok b { color: #4fd3a0; } .q-stat.bad b { color: #ff8a8a; }
.drawer-card.wide { width: 760px; }
.q-lines { width: 100%; border-collapse: collapse; margin-top: 6px; table-layout: fixed; }
.q-lines td input, .q-lines td select { width: 100%; }
.q-lines td.num { padding-top: 12px; white-space: nowrap; }
.q-lines th { text-align: left; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; padding: 6px 4px; }
.q-lines td { padding: 4px; vertical-align: top; border-top: 1px solid var(--line); }
.q-lines td input, .q-lines td select { padding: 7px 8px; }
.q-lines .q-desc { margin-top: 4px; font-size: 12px; padding: 5px 8px; }

.q-totals { margin: 12px 0 0 auto; width: 280px; font-size: 13px; }
.q-totals > div { display: flex; justify-content: space-between; padding: 3px 0; color: var(--muted); }
.q-grand { color: var(--text) !important; font-size: 16px; border-top: 1px solid var(--line); margin-top: 4px; padding-top: 8px !important; }
.q-grand b { color: #5cb2ff; font-size: 20px; }
.q-fs { border: 0; padding: 0; margin: 0; min-width: 0; }
.q-fs:disabled { opacity: .75; }
.q-prev { display: flex; gap: 8px; align-items: center; background: var(--accent-soft); color: #8cc4ff; border-radius: 10px; padding: 8px 12px; margin-top: 10px; font-size: 13px; }
.q-h3 { margin: 16px 0 4px; font-size: 13px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.modal-card.wide { max-width: 820px; }
.rn-list { max-height: 50vh; overflow: auto; margin-top: 12px; border: 1px solid var(--line); border-radius: 12px; }
.contract-box { margin-top: 14px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.cb-title { display: flex; align-items: center; gap: 8px; font-weight: 700; margin-bottom: 6px; }
.cb-title .ic { color: var(--accent); }
.cb-line { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 13px; flex-wrap: wrap; }
.cb-line > span:first-child { width: 110px; color: var(--muted); }
.contract-box .btn { margin-top: 6px; }

@media (max-width: 1250px) {
  .q-stats { grid-template-columns: repeat(3, 1fr); }
  .cards, .quick { grid-template-columns: 1fr 1fr; }
  .cols { grid-template-columns: 1fr; }
  .log-cards { grid-template-columns: 1fr 1fr; }
}
