/* Console Sanabot — mise en page bureau */
body { background: #eef2f7; }
.shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.side { background: #0f1f4d; color: #cbd5e1; padding: 1rem .75rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .brand { color: #fff; font-weight: 800; font-size: 1.1rem; padding: .25rem .5rem 1rem; display: flex; align-items: center; gap: .5rem; }
.side .brand small { display: block; font-weight: 500; font-size: .72rem; color: #94a3b8; }
.side a { display: flex; align-items: center; gap: .6rem; color: #cbd5e1; text-decoration: none; padding: .55rem .7rem; border-radius: 10px; font-size: .92rem; font-weight: 500; }
.side a:hover { background: rgba(255,255,255,.07); color: #fff; }
.side a.on { background: #1e40af; color: #fff; }
.side .grp { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: #64748b; margin: 1rem .7rem .35rem; font-weight: 700; }
.top { background: #fff; border-bottom: 1px solid var(--line); padding: .7rem 1.25rem; display: flex; align-items: center; gap: 1rem; position: sticky; top: 0; z-index: 10; }
.top h1 { font-size: 1.15rem; margin: 0; flex: 1; }
.top select { width: auto; min-height: 38px; padding: .35rem .6rem; }
.content { padding: 1.25rem; max-width: 1400px; }
.menu-btn { display: none; }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 50; left: -270px; width: 260px; transition: left .2s; }
  .side.open { left: 0; box-shadow: 0 0 40px rgba(0,0,0,.4); }
  .menu-btn { display: inline-flex; }
  .content { padding: .9rem; }
}
.section-title { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin: 1.25rem 0 .6rem; }
.section-title h2 { margin: 0; }
.brief { background: linear-gradient(135deg, #0f1f4d, #1e40af); color: #fff; border-radius: 18px; padding: 1.25rem; }
.brief h2 { color: #fff; }
.brief .kpi { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.15); color: #fff; box-shadow: none; }
.brief .kpi .l { color: #cbd5e1; }
.legend { display: flex; gap: .8rem; flex-wrap: wrap; font-size: .8rem; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: .3rem; vertical-align: middle; }
.chart-bars { display: flex; align-items: flex-end; gap: 3px; height: 120px; padding-top: .5rem; }
.chart-bars div { flex: 1; background: #93c5fd; border-radius: 4px 4px 0 0; position: relative; min-height: 2px; }
.chart-bars div i { position: absolute; bottom: 0; left: 0; right: 0; background: var(--urgent); border-radius: 4px 4px 0 0; }
.switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #cbd5e1; border-radius: 99px; cursor: pointer; transition: .15s; }
.switch span::before { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .15s; }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::before { transform: translateX(20px); }
.switch input:disabled + span { opacity: .4; cursor: not-allowed; }

/* Constructeur de modules */
.builder { display: grid; grid-template-columns: 220px 1fr 340px; gap: 1rem; align-items: start; }
@media (max-width: 1200px) { .builder { grid-template-columns: 1fr; } .builder .palette { position: static !important; } }
.palette { position: sticky; top: 70px; }
.palette .pi { display: flex; align-items: center; gap: .55rem; padding: .55rem .7rem; background: #fff; border: 1px dashed #94a3b8; border-radius: 10px; margin-bottom: .4rem; cursor: grab; font-size: .9rem; font-weight: 600; user-select: none; }
.palette .pi:active { cursor: grabbing; }
.palette .pi.block { border-style: solid; border-color: #c7d2fe; background: #eef2ff; }
.canvas { min-height: 300px; }
.fcard { background: #fff; border: 1.5px solid var(--line); border-radius: 12px; padding: .65rem .8rem; margin-bottom: .45rem; display: flex; gap: .6rem; align-items: flex-start; cursor: pointer; }
.fcard:hover { border-color: #93c5fd; }
.fcard.sel { border-color: var(--navy-2); box-shadow: 0 0 0 3px rgba(30,64,175,.12); }
.fcard.section { background: #eef2ff; border-color: #c7d2fe; }
.fcard .handle { cursor: grab; color: #94a3b8; font-size: 1.1rem; padding-top: .1rem; }
.fcard .ft { font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.fcard .fl { font-weight: 600; }
.fcard .fx { display: flex; gap: .2rem; }
.fcard .fx button { background: none; border: 0; cursor: pointer; font-size: .95rem; padding: .15rem .3rem; border-radius: 6px; }
.fcard .fx button:hover { background: #f1f5f9; }
.drop { height: 10px; border-radius: 6px; margin: 2px 0; transition: height .1s, background .1s; }
.drop.over { height: 40px; background: #dbeafe; border: 2px dashed #3b82f6; }
.canvas.empty-drop { border: 2px dashed #cbd5e1; border-radius: 14px; padding: 2rem; text-align: center; color: var(--muted); }
.props { position: sticky; top: 70px; max-height: calc(100vh - 90px); overflow-y: auto; }
.props .field { margin-bottom: .7rem; }
.props label.lbl { font-size: .85rem; }
.props input, .props select, .props textarea { min-height: 38px; padding: .45rem .6rem; font-size: .9rem; border-radius: 10px; }
.optrow { display: grid; grid-template-columns: 1fr 90px 60px 30px; gap: .3rem; margin-bottom: .3rem; }
.optrow input { min-height: 34px; padding: .35rem .5rem; font-size: .85rem; }
.rcard { background: #fff; border: 1px solid var(--line); border-left: 5px solid #94a3b8; border-radius: 12px; padding: .9rem; margin-bottom: .75rem; }
.rcard.urgent { border-left-color: var(--urgent); } .rcard.alerte { border-left-color: var(--alerte); } .rcard.attention { border-left-color: #eab308; } .rcard.info { border-left-color: #3b82f6; }
.condrow { display: grid; grid-template-columns: 1.4fr 1fr 1fr 32px; gap: .35rem; margin-bottom: .35rem; }
.condrow select, .condrow input { min-height: 36px; padding: .35rem .5rem; font-size: .85rem; }
.phone { width: 380px; max-width: 100%; margin: 0 auto; border: 10px solid #0f172a; border-radius: 36px; background: var(--bg); height: 720px; overflow-y: auto; padding: 1rem .8rem; }
.iconbtn { background: none; border: 0; cursor: pointer; padding: .2rem .35rem; border-radius: 6px; font-size: 1rem; }
.iconbtn:hover { background: #f1f5f9; }
.pill-tabs { display: flex; gap: .35rem; flex-wrap: wrap; margin-bottom: 1rem; }
.pill-tabs button { border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: .45rem .9rem; font: inherit; font-weight: 600; font-size: .88rem; cursor: pointer; color: var(--ink-2); }
.pill-tabs button.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.dirty-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--gold); margin-left: .35rem; }

@media print {
  body { background: #fff; }
  .side, .top, .no-print, #toast { display: none !important; }
  .shell { display: block; }
  .content { padding: 0; max-width: none; }
  .fiche { page-break-after: always; box-shadow: none; border: 0; }
  table.t td, table.t th { border: 1px solid #cbd5e1; }
  a { color: inherit; text-decoration: none; }
}

/* Pyramide sanitaire */
.pyr-node.lvl2{margin-left:1.4rem}.pyr-node.lvl3{margin-left:1.4rem}.pyr-node.off{opacity:.55}
.pyr-row{display:flex;align-items:center;gap:.45rem;padding:.4rem .2rem;border-bottom:1px solid var(--line);flex-wrap:wrap}
.pyr-tg{width:28px;height:28px;display:inline-flex;align-items:center;justify-content:center;border:0;background:transparent;cursor:pointer;color:inherit;border-radius:6px}
.pyr-tg:hover{background:var(--bg)}.pyr-act{margin-left:auto;display:flex;gap:.3rem}

.print-only{display:none}
@media print{.side,.top,.no-print,.toasts{display:none!important}.shell{display:block!important}.content{padding:0!important}.print-only{display:block}.card{box-shadow:none;border:1px solid #ccc;break-inside:avoid}}
