/* Coimbra OS · laranja da marca, chão claro e quente, títulos em Exo 2 */
:root{
  --bg:#FBF8F5;--card:#FFFFFF;--ink:#231F20;--muted:#5C5552;--line:#ECE5DF;--field:#D9D2CC;
  --brand:#F15A29;--primary:#C8410E;--primary-ink:#8F2D09;--soft:#FFF1EA;
  --late:#A3134A;--late-bg:#FDE7EF;--late-line:#E8799F;
  --blue:#1A5E9E;--blue-bg:#E6F0FA;--ok:#22602F;--ok-bg:#E3F2E6;--ok-strong:#2F7A3E;
  --warn:#5E3F00;--warn-bg:#FFF4D6;--gray-bg:#F1ECE7;
  --r:16px;--nav-h:72px;
}
*{box-sizing:border-box;min-width:0}
html,body{margin:0;background:var(--bg);color:var(--ink)}
body{font:16px/1.45 Inter,system-ui,-apple-system,Segoe UI,Roboto,sans-serif;-webkit-tap-highlight-color:transparent}
h1,h2,h3{font-family:'Exo 2',Inter,sans-serif;margin:0;line-height:1.15}
h1{font-size:24px}h2{font-size:18px}
a{color:#B83A0C}
button,input,select,textarea{font:inherit;color:inherit}
button{cursor:pointer}
:focus-visible{outline:3px solid #F39A6E;outline-offset:2px}
.muted{color:var(--muted)}.small{font-size:13px}.bold{font-weight:700}
.hidden{display:none!important}

/* layout */
.shell{min-height:100vh;display:flex}
.side{display:none}
.main{flex:1;min-width:0;display:flex;flex-direction:column;padding-bottom:calc(var(--nav-h) + env(safe-area-inset-bottom))}
.top{background:var(--card);border-bottom:1px solid var(--line);padding:calc(14px + env(safe-area-inset-top)) 12px 12px;display:flex;align-items:center;gap:6px;position:sticky;top:0;z-index:5}
.top.dark{background:var(--ink);color:#fff;border:0}
.top .title{flex:1;display:flex;flex-direction:column}
.icon-btn{width:44px;height:44px;border:0;background:transparent;border-radius:22px;display:flex;align-items:center;justify-content:center;color:inherit;position:relative;text-decoration:none}
.dot{position:absolute;top:5px;right:4px;min-width:18px;height:18px;padding:0 4px;border-radius:9px;background:var(--brand);color:var(--ink);font-size:11px;font-weight:700;display:flex;align-items:center;justify-content:center}
.page{padding:16px 20px 28px;display:flex;flex-direction:column;gap:16px;max-width:1200px;width:100%;margin:0 auto}
.nav{position:fixed;left:0;right:0;bottom:0;background:var(--card);border-top:1px solid var(--line);display:flex;padding:6px 6px calc(8px + env(safe-area-inset-bottom));z-index:10}
.nav a{flex:1;text-decoration:none;color:var(--muted);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;font-size:12px;font-weight:600;min-height:52px;position:relative}
.nav a.on{color:var(--primary);font-weight:700}
.nav .dot{top:2px;right:calc(50% - 22px)}
@media(min-width:900px){
  .side{display:flex;flex-direction:column;gap:4px;width:250px;flex:none;background:var(--ink);color:#fff;padding:22px 14px;position:sticky;top:0;height:100vh}
  .side img{width:110px;background:#fff;border-radius:12px;padding:8px;margin:0 8px 18px}
  .side a,.side button{display:flex;align-items:center;gap:10px;padding:12px;border-radius:10px;color:#E3DDD9;text-decoration:none;font-weight:600;background:none;border:0;text-align:left}
  .side a.on{background:#3A3436;color:#fff;font-weight:700}
  .side .spacer{flex:1}
  .side .who{padding:10px 12px;font-size:13px;color:#CFC8C4}
  .nav{display:none}
  .main{padding-bottom:0}
  .top{padding-top:14px}
}

/* blocos */
.card{background:var(--card);border:1px solid var(--line);border-radius:var(--r);padding:14px}
.card.late{border-color:var(--late-line);background:#FFF7FA}
.list{background:var(--card);border:1px solid var(--line);border-radius:var(--r);overflow:hidden}
.list>*{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:13px 14px;border-bottom:1px solid #F1ECE7;color:var(--ink);text-decoration:none}
.list>*:last-child{border-bottom:0}
.grid2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.kpis{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:12px}
.kpi{display:flex;flex-direction:column;gap:2px}
.kpi b{font-family:'Exo 2',sans-serif;font-size:30px;line-height:1.1}
.kpi.late{background:var(--late-bg);border-color:#F6B9CF}.kpi.late b,.kpi.late span{color:var(--late)}
.row{display:flex;align-items:center;gap:8px}.between{justify-content:space-between}.wrap{flex-wrap:wrap}
.col{display:flex;flex-direction:column;gap:6px}
.pill{display:inline-flex;align-items:center;padding:4px 10px;border-radius:999px;font-size:12px;font-weight:700;white-space:nowrap;background:var(--gray-bg);color:#4A4341}
.pill.late{background:var(--late-bg);color:var(--late)}.pill.blue{background:var(--blue-bg);color:var(--blue)}
.pill.ok{background:var(--ok-bg);color:var(--ok)}.pill.warn{background:var(--warn-bg);color:var(--warn)}.pill.brand{background:var(--soft);color:#A6380C}
.os-card{display:flex;flex-direction:column;gap:6px;text-decoration:none;color:var(--ink)}
.os-card .foot{display:flex;justify-content:space-between;gap:8px;padding-top:8px;border-top:1px solid #F1ECE7;font-size:13px;color:var(--muted)}
.banner{padding:12px 14px;border-radius:14px;font-size:14px;font-weight:600;display:flex;gap:10px;align-items:center}
.banner.late{background:var(--late-bg);color:#8E1240}.banner.warn{background:var(--warn-bg);color:var(--warn)}.banner.ok{background:var(--ok-bg);color:var(--ok)}

/* formulários */
label.f{display:flex;flex-direction:column;gap:6px;font-size:14px;font-weight:700}
.in{height:50px;border:1px solid var(--field);border-radius:12px;padding:0 14px;font-size:16px;background:#fff;width:100%}
textarea.in{height:auto;padding:12px 14px;resize:vertical}
select.in{padding:0 10px}
.btn{height:52px;border-radius:14px;border:0;background:var(--primary);color:#fff;font-weight:700;font-size:16px;display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:0 18px;text-decoration:none}
.btn.dark{background:var(--ink)}.btn.green{background:var(--ok-strong)}.btn.blue{background:#1F6FB8}
.btn.ghost{background:#fff;color:var(--ink);border:1px solid #B5ABA3}
.btn.small{height:44px;font-size:15px;border-radius:12px}
.btn[disabled]{opacity:.6;cursor:wait}
.chips{display:flex;gap:8px;overflow-x:auto;padding-bottom:2px}
.chip{flex:none;height:40px;padding:0 16px;border-radius:999px;border:1px solid var(--field);background:#fff;font-size:14px;font-weight:600}
.chip.on{background:var(--ink);color:#fff;border-color:var(--ink)}
.opt{min-height:48px;padding:8px 10px;border-radius:12px;border:1px solid var(--field);background:#fff;font-size:14px;font-weight:600}
.opt.on{background:var(--soft);color:var(--primary-ink);border:2px solid var(--primary)}
.switch{flex:none;width:52px;height:32px;border-radius:16px;border:0;padding:3px;display:flex;align-items:center;background:#B5ABA3;justify-content:flex-start}
.switch.on{background:var(--ok-strong);justify-content:flex-end}
.switch span{width:26px;height:26px;border-radius:13px;background:#fff;box-shadow:0 1px 2px rgba(0,0,0,.25)}
.switch[disabled]{opacity:.5}

/* fotos */
.photos{display:flex;gap:8px;overflow-x:auto}
.thumb{flex:none;width:84px;height:84px;border-radius:12px;background:#E4DCD5 center/cover no-repeat;border:0;padding:0;position:relative}
.thumb .x{position:absolute;top:4px;right:4px;width:26px;height:26px;border-radius:13px;border:0;background:var(--ink);color:#fff;font-size:14px}
.add-photo{flex:none;width:84px;height:84px;border-radius:12px;border:1px dashed #B5ABA3;background:#fff;font-size:12px;font-weight:600;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;color:var(--ink)}
.hero{width:100%;height:220px;border-radius:var(--r);background:#EFE9E3 center/contain no-repeat;border:1px dashed #CFC6BE;display:flex;align-items:center;justify-content:center;color:#6B6360;font-size:13px;font-weight:600}
.viewer{position:fixed;inset:0;background:rgba(20,17,18,.92);z-index:50;display:flex;align-items:center;justify-content:center;padding:20px}
.viewer img{max-width:100%;max-height:100%;border-radius:8px}
.viewer button{position:absolute;top:calc(16px + env(safe-area-inset-top));right:16px;background:#fff;border:0;border-radius:22px;width:44px;height:44px;font-size:20px}

/* setor (cartão escuro) */
.mine{background:var(--ink);color:#fff;border-radius:18px;padding:16px;display:flex;flex-direction:column;gap:12px}
.mine .t3{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.mine .t3 div{background:#3A3436;border-radius:12px;padding:10px;display:flex;flex-direction:column}
.mine .t3 span{font-size:12px;color:#CFC8C4}.mine .t3 b{font-size:17px}
.mine .btn.ghost{background:transparent;color:#fff;border-color:#6B6360}

/* linha do tempo */
.tl{display:flex;flex-direction:column}
.tl .s{display:flex;gap:12px}
.tl .rail{display:flex;flex-direction:column;align-items:center;width:24px}
.tl .d{width:24px;height:24px;border-radius:12px;display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:700;flex:none;background:#fff;color:#6B6360;border:1px solid #CFC6BE}
.tl .d.done{background:var(--ok-strong);color:#fff;border:0}
.tl .d.now{background:var(--primary);color:#fff;border:0;box-shadow:0 0 0 4px #FDD9C8}
.tl .d.skip{border-style:dashed}
.tl .ln{width:2px;flex:1;min-height:14px;background:#E4DCD5}.tl .ln.done{background:#9CC7A5}
.tl .tx{flex:1;padding-bottom:14px;display:flex;flex-direction:column;gap:2px}
.tl .nm{font-weight:600}.tl .nm.now{color:var(--primary);font-weight:700}.tl .nm.skip{color:#6B6360;text-decoration:line-through;font-weight:500}

/* chat */
.chat{display:flex;flex-direction:column;gap:12px;padding:16px;flex:1}
.msg{display:flex;flex-direction:column;gap:3px;max-width:80%;align-self:flex-start}
.msg.me{align-self:flex-end;align-items:flex-end}
.msg .b{padding:10px 12px;border-radius:16px;border-bottom-left-radius:4px;background:#fff;border:1px solid var(--line);white-space:pre-wrap;overflow-wrap:anywhere}
.msg.me .b{background:var(--ink);color:#fff;border:0;border-radius:16px;border-bottom-right-radius:4px}
.msg img{max-width:220px;border-radius:12px;display:block}
.sys{align-self:center;text-align:center;font-size:13px;color:var(--muted);padding:0 16px}
.composer{position:sticky;bottom:calc(var(--nav-h) + env(safe-area-inset-bottom));background:#fff;border-top:1px solid var(--line);padding:10px 12px;display:flex;gap:8px;align-items:center}
@media(min-width:900px){.composer{bottom:0}}
.composer .in{height:44px;border-radius:22px;background:var(--bg)}
.round{width:44px;height:44px;flex:none;border-radius:22px;border:1px solid var(--field);background:#fff;display:flex;align-items:center;justify-content:center}
.round.primary{background:var(--primary);border:0;color:#fff}

/* notificações */
.notif{display:flex;gap:12px;align-items:flex-start;padding:14px 20px;border-bottom:1px solid var(--line);text-decoration:none;color:var(--ink);background:var(--bg)}
.notif.new{background:#fff}
.notif .ic{width:40px;height:40px;border-radius:20px;flex:none;display:flex;align-items:center;justify-content:center;font-weight:700}

/* painel */
.bars{display:flex;flex-direction:column;gap:10px}
.bar{display:grid;grid-template-columns:96px minmax(0,1fr) 52px;gap:10px;align-items:center;font-size:14px}
.bar .tr{height:14px;border-radius:7px;background:var(--gray-bg)}
.bar .tr i{display:block;height:14px;border-radius:7px;background:#F39A6E}
.bar .tr i.hi{background:var(--primary)}
.bar b{text-align:right;white-space:nowrap}
.sectors{display:grid;grid-template-columns:repeat(auto-fill,minmax(118px,1fr));gap:8px}
.scroll{overflow-x:auto}
table{width:100%;border-collapse:collapse;font-size:14px}
th{text-align:left;color:var(--muted);font-size:13px;padding:8px 6px;border-bottom:1px solid var(--line)}
td{padding:10px 6px;border-bottom:1px solid #F1ECE7}

/* login */
.auth{min-height:100vh;display:flex;flex-direction:column;padding:56px 28px 28px;max-width:440px;margin:0 auto;gap:16px}
.auth img{width:170px;align-self:center}

.toast{position:fixed;left:50%;transform:translateX(-50%);bottom:calc(var(--nav-h) + 16px + env(safe-area-inset-bottom));background:var(--ink);color:#fff;padding:12px 16px;border-radius:12px;font-size:14px;font-weight:600;z-index:60;max-width:calc(100% - 32px);box-shadow:0 6px 24px rgba(0,0,0,.2)}
.toast.err{background:var(--late)}
.empty{padding:28px 16px;text-align:center;color:var(--muted)}
.spin{width:28px;height:28px;border:3px solid var(--line);border-top-color:var(--primary);border-radius:50%;animation:sp 1s linear infinite;margin:40px auto}
@keyframes sp{to{transform:rotate(360deg)}}
@media (prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important}}
