*{box-sizing:border-box}
html,body{height:100%;margin:0;overflow:hidden}
body{font-family:'IBM Plex Sans',system-ui,sans-serif;color:#1B2430;background:#F5F7FA}
a{color:#1D5FAE}a:hover{color:#154886}
.shell{display:flex;height:100vh;width:100vw}
.side{flex:none;width:232px;height:100vh;overflow:hidden;background:#13355F;padding:20px 14px;display:flex;flex-direction:column;gap:4px}
.brand{display:flex;align-items:center;gap:10px;padding:4px 8px 20px;color:#fff}
.brand img{width:40px;height:40px;border-radius:8px;background:#fff;padding:2px}
.brand b{font-size:16px}.brand small{display:block;color:#AFC3DE;font-size:12px}
.nav{display:flex;align-items:center;gap:10px;padding:10px 12px;border-radius:8px;color:#D6E2F3;text-decoration:none;font-size:14px;font-weight:500}
.nav:hover{color:#fff;background:rgba(255,255,255,.08)}.nav-on{background:rgba(255,255,255,.14);color:#fff}
.nav-off{opacity:.5;cursor:default}.nav-off:hover{background:none;color:#D6E2F3}
main{flex:1;min-width:0;height:100vh;display:flex;flex-direction:column;overflow:hidden}
.top{flex:none;display:flex;flex-wrap:wrap;gap:12px;align-items:center;justify-content:space-between;padding:14px 28px;border-bottom:1px solid #E2E6EC;background:#fff}
.top h1{margin:0;font-size:22px;font-weight:700}.top p{margin:4px 0 0;color:#5B6675;font-size:14px}
.body{flex:1;min-height:0;overflow:auto;padding:20px 28px;display:flex;flex-direction:column;gap:20px}
.card{background:#fff;border:1px solid #E2E6EC;border-radius:10px;padding:20px}
.h2{margin:0 0 12px;font-size:16px;font-weight:600}
.lbl{display:block;font-size:12px;font-weight:600;letter-spacing:.04em;text-transform:uppercase;color:#5B6675;margin-bottom:6px}
.pill{display:inline-block;font-size:12px;font-weight:600;padding:3px 10px;border-radius:999px;white-space:nowrap}
.p-blue{background:#E3EDF9;color:#174F92}.p-or{background:#FDEBDD;color:#9A4A0C}.p-gray{background:#EDF0F3;color:#3E4855}.p-green{background:#E2F3E8;color:#1D6B3A}
.btn{display:inline-flex;align-items:center;gap:8px;min-height:40px;padding:0 16px;border-radius:8px;font:600 14px 'IBM Plex Sans',sans-serif;border:1px solid #E2E6EC;background:#fff;color:#1B2430;cursor:pointer;text-decoration:none}
.btn-p{background:#1D5FAE;color:#fff;border-color:#1D5FAE}.btn-o{background:#E8731A;color:#fff;border-color:#E8731A}
.btn[disabled]{opacity:.5;cursor:not-allowed}.btn-s{min-height:32px;padding:0 10px;font-size:13px}
input,select,textarea{width:100%;min-height:36px;border:1px solid #CBD2DB;border-radius:8px;padding:6px 10px;font:14px 'IBM Plex Sans',sans-serif;color:#1B2430;background:#fff}
input:disabled,textarea:disabled{background:#F1F3F6;color:#5B6675}
textarea{min-height:90px;resize:vertical}
.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:16px}
table{border-collapse:collapse;width:100%;font-size:14px}
th{text-align:left;font-size:12px;color:#5B6675;font-weight:600;padding:10px 8px;border-bottom:1px solid #E2E6EC;background:#FAFBFC}
td{padding:10px 8px;border-bottom:1px solid #E2E6EC;vertical-align:top}
.stat{font-size:32px;font-weight:700;margin:6px 0 2px}
.banner{flex:none;background:#E3EDF9;color:#174F92;padding:8px 28px;font-size:14px;font-weight:600}
.row{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.muted{color:#5B6675;font-size:13px}

.nav .badge{margin-left:auto;background:#E8731A;color:#fff;border-radius:999px;font-size:11px;font-weight:700;padding:1px 7px}
.cols3{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}
@media (max-width:1100px){.cols3{grid-template-columns:1fr}}
dialog{border:1px solid #E2E6EC;border-radius:12px;padding:20px;width:min(440px,92vw);box-shadow:0 12px 40px rgba(19,53,95,.25)}
dialog::backdrop{background:rgba(19,53,95,.45)}
dialog h3{margin:0 0 12px}.stack{display:grid;gap:10px}
.btn-danger{background:#B3261E;color:#fff;border-color:#B3261E}
.menu{position:relative;display:inline-block}.menu>summary{list-style:none}.menu>summary::-webkit-details-marker{display:none}
.menu-list{position:absolute;right:0;z-index:20;min-width:210px;background:#fff;border:1px solid #E2E6EC;border-radius:10px;box-shadow:0 8px 24px rgba(19,53,95,.18);padding:6px;display:grid}
.menu-list button{text-align:left;background:none;border:0;padding:9px 10px;border-radius:8px;font:500 14px 'IBM Plex Sans',sans-serif;cursor:pointer;color:#1B2430}
.menu-list button:hover{background:#EEF2F7}
.split{flex:1;min-height:0;display:flex}
.pane{min-height:0;overflow:auto}

/* v2.1 header: icon tile + crumb line + title + subtitle, buttons on the right */
.top{padding:12px 28px}
.hd{display:flex;gap:14px;align-items:center;min-width:0}
.hd-ic{width:46px;height:46px;border-radius:12px;background:#E3EDF9;color:#1D5FAE;display:flex;align-items:center;justify-content:center;flex:none}
.hd h1{margin:0;font-size:22px;font-weight:700}.hd p{margin:0;color:#5B6675;font-size:14px}
.crumb-line{font-size:12px;color:#5B6675;margin-bottom:2px}.crumb-line a{color:#5B6675;text-decoration:none}.crumb-line a:hover{color:#1D5FAE}.crumb-line b{color:#1D5FAE;font-weight:600}
/* Actions menu: orange button, coloured items */
.menu>summary.btn{background:#E8731A;color:#fff;border-color:#E8731A}
.menu-list{width:250px;border-radius:12px;padding:8px;gap:6px;box-shadow:0 12px 32px rgba(19,53,95,.2)}
.menu-list .mi{display:block;text-align:left;padding:10px 12px;border-radius:8px;font:600 14px 'IBM Plex Sans',sans-serif;border:1px solid transparent;text-decoration:none;cursor:pointer;width:100%}
.mi-g{background:#EDF8F0;color:#1D6B3A;border-color:#BFE3CA}.mi-b{background:#EAF1FB;color:#174F92;border-color:#C4D7F0}.mi-a{background:#FFF7E0;color:#7A5A00;border-color:#F0DFA5}.mi-r{background:#FCEDEB;color:#9B2C22;border-color:#F1C7C2}.mi-n{background:#fff;color:#1B2430;border-color:#E2E6EC}
.p-red{background:#FBE9E7;color:#9B2C22}.p-amber{background:#FFF4D6;color:#7A5A00}
/* mail list + conversation */
.mailitem{display:flex;gap:8px;padding:12px 14px;border-bottom:1px solid #E2E6EC;border-left:3px solid transparent;text-decoration:none;color:#1B2430;cursor:pointer;width:100%;background:none;text-align:left;font:inherit;border-top:0;border-right:0}
.mailitem:hover{background:#F5F7FA}.mailitem.on{background:#E8F0FB;border-left-color:#1D5FAE}
.dot{width:8px;height:8px;border-radius:50%;background:#1D5FAE;flex:none;margin-top:7px}.dot-off{width:8px;flex:none}
.msgcard{border:1px solid #E2E6EC;border-radius:12px;background:#fff;margin-bottom:12px}
.msgcard.last{border:2px solid #BBD2F0}.msgcard>summary{display:block;padding:12px 16px;cursor:pointer}
.msgcard .mbody{padding:0 16px 14px;border-top:1px solid #E2E6EC}
iframe.mailframe{width:100%;height:420px;border:0;background:#fff;margin-top:10px}
.listhead{padding:12px 14px;display:grid;gap:10px;border-bottom:1px solid #E2E6EC}
.grid5{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:16px}
@media (max-width:1100px){.grid5{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* the hidden attribute must win over display:grid / inline-block set by classes (it did not: all dialog sections showed at once) */
[hidden]{display:none !important}

/* ---- v3: calmer type, tiles, Planner tabs, sync card ---- */
body{font-weight:400}
.hd h1{font-weight:600}.top h1{font-weight:600}
.h2{font-size:15px;font-weight:600}
.lbl{font-size:11px;font-weight:600;letter-spacing:.05em}
.pill{font-weight:500}
.stat{font-size:26px;font-weight:600;margin:4px 0 0}
.clamp{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere}
.wrapany{overflow-wrap:anywhere}
.tile{background:#fff;border:1px solid #E2E6EC;border-radius:12px;padding:16px;display:flex;flex-direction:column;gap:8px;min-width:0}
.tile .t{font-size:15px;font-weight:600;min-width:0}
.tile .done{text-decoration:line-through;color:#5B6675}
.tile-note{padding:8px 10px;border-radius:8px;font-size:13px;white-space:pre-wrap}
.tile-hold{background:#FFF7E0}.tile-rej{background:#FCEDEB}
.tile-foot{display:flex;justify-content:flex-end;margin-top:2px}
.tiles{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;align-items:start}
@media (max-width:1100px){.tiles{grid-template-columns:1fr}}
.menu-up .menu-list{top:auto;bottom:38px}
.menu.up .menu-list{top:auto;bottom:38px}.menu:not(.up) .menu-list{top:38px;bottom:auto}
.tabbar{flex:none;display:flex;gap:4px;border-bottom:1px solid #E2E6EC;padding:0 28px;background:#fff;overflow-x:auto}
.tabbar a{padding:12px 16px;text-decoration:none;color:#5B6675;font-size:14px;border-bottom:3px solid transparent;font-weight:500;white-space:nowrap}
.tabbar a:hover{color:#1D5FAE}.tabbar a.on{color:#1D5FAE;border-bottom-color:#1D5FAE;font-weight:600}
.dayrow{display:block;padding:9px 14px;border-bottom:1px solid #EEF1F5;border-left:3px solid transparent;text-decoration:none;color:#1B2430}
.dayrow:hover{background:#F5F7FA}.dayrow.on{background:#E8F0FB;border-left-color:#1D5FAE}
.sync{margin:8px 4px 0;padding:12px;border-radius:10px;background:rgba(255,255,255,.08);color:#D6E2F3;font-size:12px;line-height:1.5}
.sync .st{display:flex;align-items:center;gap:6px;color:#fff;font-weight:600}
.sdot{display:inline-block;width:8px;height:8px;border-radius:50%;background:#E8B84A}.sdot.on{background:#5BD08A}
.sync .em{overflow-wrap:anywhere}.sync .mt{color:#AFC3DE;margin-top:2px}
.nav{font-weight:500}
.crumb-line b{font-weight:600}

/* ---- v4: sub-points, missed deadlines ---- */
.p-dark{background:#B3261E;color:#fff}
.bar{height:6px;border-radius:99px;background:#E6EAF0;overflow:hidden}.bar>i{display:block;height:100%;background:#1D5FAE}
.subrow{display:flex;align-items:center;gap:8px;padding:7px 0;border-top:1px solid #EEF1F5;font-size:13px}
.subrow .chip{min-width:96px;text-align:center}
.tile-missed{border-color:#E8A59F}
.banner-red{flex:none;background:#FCEDEB;color:#9B2C22;padding:10px 28px;font-size:14px;display:flex;gap:12px;align-items:center;flex-wrap:wrap}
.menu-sm summary{min-height:26px !important;padding:0 8px !important}
.menu-sm .menu-list{width:220px}
.menu-sm>summary.btn{background:#fff;color:#1B2430;border-color:#D5DBE3}
.sync .em{font-size:11.5px}
