/* Kermaint — panel utilisateur */
body.panel { background: var(--bg); }
.app { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }

/* Sidebar */
.sidebar {
  background: #fff; border-right: 1px solid var(--line);
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; padding: 16px 12px 18px;
}
.sidebar .logo { padding: 2px 8px 0; }
.org { padding: 24px 12px 18px; margin: 0 0 12px; border-bottom: 1px solid var(--line); }
.org small { display: block; color: var(--ink-2); font-size: 12.5px; }
.org strong { font-size: 14.5px; font-weight: 600; }
.nav { display: grid; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 12px; border-radius: 4px;
  font-size: 14.5px; color: var(--ink-2); font-weight: 500;
}
.nav a svg { width: 18px; height: 18px; flex: none; }
.nav a:hover { background: var(--bg); color: var(--ink); }
.nav a.active { background: var(--brand-50); color: var(--brand); font-weight: 600; }
.sidebar-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 14px; }
.sidebar-foot .nav { margin-bottom: 18px; }
.plan-box { padding: 0 12px; font-size: 13px; }
.plan-box .row { display: flex; justify-content: space-between; font-weight: 600; }
.plan-box .row span:last-child { font-weight: 500; color: var(--ink-2); }
.bar { height: 4px; border-radius: 4px; background: var(--line); margin: 8px 0 14px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--brand); }
.plan-box small { color: var(--ink-2); font-size: 11.5px; }

/* Topbar */
.main { min-width: 0; }
.topbar {
  height: 63px; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 24px; padding: 0 32px;
  position: sticky; top: 0; z-index: 10;
}
.crumbs { font-size: 13.5px; color: var(--ink-2); display: flex; gap: 12px; }
.crumbs b { color: var(--ink); font-weight: 500; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 28px; font-size: 13.5px; color: var(--ink-2); }
.top-actions a { display: inline-flex; gap: 8px; align-items: center; }
.top-actions svg { width: 15px; height: 15px; }
.icon-btn { background: none; border: 0; padding: 4px; color: var(--ink-2); position: relative; }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn .badge { position: absolute; top: 2px; right: 2px; width: 7px; height: 7px; border-radius: 50%; background: var(--red); border: 2px solid #fff; }
.user { display: flex; align-items: center; gap: 12px; padding-left: 24px; border-left: 1px solid var(--line); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--bg); border: 1px solid var(--line); display: grid; place-items: center; font-size: 12px; font-weight: 600; color: var(--ink); }
.user b { display: block; color: var(--ink); font-weight: 600; font-size: 13.5px; line-height: 1.3; }
.user small { font-size: 12.5px; }

/* Content */
.content { padding: 32px; max-width: 1180px; }
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.page-head .hello { font-size: 13.5px; color: var(--ink-2); }
.page-head h1 { font-size: 25px; font-weight: 600; margin-top: 10px; }
.page-head p { font-size: 13.5px; color: var(--ink-2); margin-top: 8px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; }
.select-btn { display: inline-flex; align-items: center; gap: 10px; height: 36px; padding: 0 16px; background: #fff; border: 1px solid var(--line); border-radius: 4px; font-size: 13.5px; font-weight: 500; }
.select-btn svg { width: 16px; height: 16px; }
.content .btn-primary { height: 36px; padding: 0 18px; font-size: 13.5px; }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 26px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 20px 18px; }
.kpi-top { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--ink-2); }
.kpi strong { display: block; font-size: 25px; font-weight: 600; margin-top: 16px; letter-spacing: -.01em; }
.kpi small { display: block; font-size: 11.5px; color: var(--ink-2); margin-top: 12px; }
.kpi small.warn { color: var(--amber); }

.grid-2 { display: grid; grid-template-columns: 1fr 276px; gap: 28px; margin-top: 30px; padding-bottom: 30px; border-bottom: 1px solid var(--line); }
.block-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.block-head h2 { font-size: 15px; font-weight: 600; }
.legend { display: flex; gap: 16px; font-size: 11.5px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 9px; height: 9px; border-radius: 2px; background: var(--brand); }
.legend i.c { background: #c3c7c7; }

.chart { margin-top: 14px; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart .grid line { stroke: var(--line); }
.chart text { font-family: var(--font); font-size: 9.5px; fill: var(--ink-2); }
.chart rect.p { fill: var(--brand); }
.chart rect.c { fill: #c3c7c7; }
.chart rect:hover { opacity: .8; }
.chart-note { font-size: 11.5px; color: var(--ink-2); display: flex; gap: 8px; align-items: center; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.chart-note svg { width: 12px; height: 12px; }
.tooltip { position: fixed; pointer-events: none; background: var(--ink); color: #fff; font-size: 12px; padding: 6px 10px; border-radius: 4px; opacity: 0; transition: opacity .1s; z-index: 100; }

.alerts { list-style: none; padding: 0; margin: 14px 0 0; }
.alerts li { display: grid; grid-template-columns: 7px 1fr; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.alerts li:last-child { border-bottom: 0; }
.alerts .dot { margin-top: 7px; }
.alerts b { font-size: 13px; font-weight: 600; display: block; }
.alerts small { font-size: 12px; color: var(--ink-2); }
.count { font-size: 12px; color: var(--ink-2); }

.orders { margin-top: 28px; }
.orders .block-head h2 span { color: var(--ink-2); font-weight: 500; margin-left: 8px; font-size: 13px; }
.search { position: relative; width: 224px; }
.search svg { position: absolute; left: 11px; top: 50%; width: 15px; height: 15px; transform: translateY(-50%); color: var(--ink-2); }
.search input { height: 36px; padding: 0 12px 0 34px; border: 1px solid var(--line); border-radius: 4px; width: 100%; font: inherit; font-size: 13px; background: #fff; }
.table-wrap { overflow-x: auto; margin-top: 16px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 720px; }
th { text-align: left; font-weight: 500; color: var(--ink-2); background: #eef0f0; padding: 10px 12px; font-size: 12.5px; }
th:first-child { border-radius: 4px 0 0 4px; } th:last-child { border-radius: 0 4px 4px 0; }
td { padding: 16px 12px; border-bottom: 1px solid var(--line); }
td:first-child { font-weight: 600; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 500; padding: 3px 8px; border-radius: 3px; }
.status::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.status.urgent { background: var(--red-50); color: var(--red); }
.status.progress { background: #f4ecdf; color: var(--amber); }
.status.planned { background: #e8ecee; color: #4b5a63; }
.status.done { background: var(--green-50); color: var(--brand); }
.more { background: none; border: 0; padding: 4px 6px; color: var(--ink-2); font-weight: 700; letter-spacing: 1px; }

.menu-btn { display: none; }

@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 250px; z-index: 40; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 40px rgba(0,0,0,.15); }
  .app.nav-open .sidebar { transform: none; }
  .menu-btn { display: block; }
  .topbar { padding: 0 16px; gap: 12px; }
  .crumbs span:first-child, .crumbs span:nth-child(2), .top-actions > a, .user > div { display: none; }
  .user { padding-left: 12px; }
  .top-actions { gap: 12px; }
  .content { padding: 24px 16px; }
  .page-head .actions { margin-left: 0; width: 100%; }
  .orders .block-head { flex-wrap: wrap; }
  .search { width: 100%; }
}
@media (max-width: 480px) {
  .kpis { grid-template-columns: 1fr 1fr; gap: 8px; }
  .kpi { padding: 14px; }
  .kpi strong { font-size: 21px; }
}
