/* dex-admin stylesheet — served at /assets/admin.css (see admin/server.ts). */
*{margin:0;padding:0;box-sizing:border-box}
:root{--black:#202020;--creme:#F9F4EE;--pink:#EFADAE;--pinkd:#EAA0A5;--yellow:#FFF4C7;
      --card:#fff;--line:#ece3d5;--muted:#8a8578}
body{font-family:system-ui,-apple-system,"Segoe UI",sans-serif;background:#F4EEE4;color:#202020;
     line-height:1.5;min-height:100vh}
a{color:inherit}
/* layout: sidebar + content */
.layout{display:flex;min-height:100vh}
.sidebar{width:15rem;flex-shrink:0;background:#F9F4EE;border-right:1px solid #e4d9c8;
         padding:1.6rem 1.1rem;display:flex;flex-direction:column;position:sticky;top:0;height:100vh}
.brand{display:flex;align-items:center;gap:.6rem;margin:0 .4rem 2rem;font-family:Georgia,serif;
       font-style:italic;font-size:1.15rem}
.brand img{width:22px;height:22px}
.nav{display:flex;flex-direction:column;gap:.15rem; height: 100%; }
.nav a{display:flex;align-items:center;gap:.6rem;padding:.55rem .8rem;border-radius:9px;
       text-decoration:none;font-size:.92rem;color:#3a352e}
.nav a:hover{background:rgba(32,32,32,.05)}
.nav a.active{background:#202020;color:#F9F4EE}
.nav .spacer{flex:1}
.content{flex:1;padding:2.2rem 2.6rem;max-width:72rem; margin:0 auto; }
h1{font-family:Georgia,serif;font-style:italic;font-weight:500;font-size:2rem;margin-bottom:.2rem}
.sub{color:#8a8174;font-size:.95rem;margin-bottom:1.8rem}
h2{font-family:Georgia,serif;font-style:italic;font-weight:500;font-size:1.25rem;margin:.2rem 0 .9rem}
.accent{height:4px;width:3.5rem;background:#EFADAE;border-radius:99px;margin:.4rem 0 1.5rem}
/* cards + grid */
.grid{display:grid;gap:1.1rem}
.grid.stats{grid-template-columns:repeat(auto-fit,minmax(11rem,1fr));margin-bottom:1.4rem}
.grid.two{grid-template-columns:repeat(auto-fit,minmax(20rem,1fr))}
.card{background:#fff;border:1px solid #ece3d5;border-radius:14px;padding:1.3rem 1.4rem;
      box-shadow:0 1px 2px rgba(60,40,10,.03)}
.card h2{margin-top:0}
.card .head{display:flex;align-items:center;justify-content:space-between;margin-bottom:.9rem}
.card .head h2{margin:0}
.card .head a{font-size:.82rem;color:#a8755a;text-decoration:none}
.card .head a:hover{text-decoration:underline}
.stat{background:#fff;border:1px solid #ece3d5;border-radius:14px;padding:1.1rem 1.3rem}
.stat .n{font-family:Georgia,serif;font-size:2rem;line-height:1;margin-bottom:.3rem}
.stat .l{font-size:.8rem;color:#8a8174;text-transform:uppercase;letter-spacing:.04em}
.stat.alert .n{color:#c0392b}
/* tables */
table{width:100%;border-collapse:collapse;font-size:.9rem}
th,td{text-align:left;padding:.5rem .6rem;border-bottom:1px solid #f0e8db;vertical-align:middle}
th{font-weight:600;font-size:.74rem;text-transform:uppercase;letter-spacing:.03em;color:#9a9082}
tr:last-child td{border-bottom:0}
.card table{margin:-.3rem 0}
code{font-family:"SF Mono",Menlo,monospace;font-size:.82rem;background:rgba(32,32,32,.06);
     padding:.1em .4em;border-radius:4px}
code.slug{display:block;width:fit-content;margin-top:.2em;font-size:.72rem;
     background:rgba(32,32,32,.04);color:#9a9082}
.badge{display:inline-block;font-size:.72rem;padding:.12em .55em;border-radius:99px;font-weight:600;white-space:nowrap}
.badge.admin{background:#FFF4C7;color:#7a5b00}
.badge.sla{background:#EFADAE;color:#5a1f20}
.badge.trial{background:#e7e0d4;color:#666}
.ok{color:#2e7d32}
.notice{background:rgba(239,173,174,.18);border-left:3px solid #EFADAE;padding:.7rem 1rem;border-radius:0 8px 8px 0;margin-bottom:1rem;font-size:.9rem}
.notice.ok{background:#eef6ef;border-left-color:#4a7c59;color:#202020;margin-top:1.4rem}
.err{background:#fdecea;border-left:3px solid #c0392b;padding:.7rem 1rem;border-radius:0 8px 8px 0;margin-bottom:1rem;font-size:.9rem}
.muted{color:#9a9082;font-size:.86rem}
.empty{color:#9a9082;font-size:.9rem;padding:.4rem 0}
/* error chart */
.echart-filter{float:right;font-size:.82rem;color:#3a352e;border:1px solid #e4d9c8;border-radius:8px;
     background:#fff;padding:.35em .6em;cursor:pointer;max-width:16rem}
.echart-head{display:flex;align-items:center;justify-content:space-between;gap:1rem;margin-bottom:1rem}
.echart-head .navbtn{background:#fff;border:1px solid #e4d9c8;border-radius:8px;width:2rem;height:2rem;
     cursor:pointer;font-size:1rem;line-height:1;color:#3a352e}
.echart-head .navbtn:hover:not(:disabled){background:#f4eee4}
.echart-head .navbtn:disabled{opacity:.35;cursor:default}
.echart-head .month{font-family:Georgia,serif;font-style:italic;font-size:1.05rem;min-width:9rem;text-align:center}
.echart{display:flex;align-items:flex-end;gap:2px;height:120px;padding-top:.4rem;
     border-bottom:1px solid #ece3d5}
.echart .bar{flex:1;display:flex;flex-direction:column;justify-content:flex-end;align-items:center;
     cursor:pointer;position:relative;min-width:0}
.echart .bar .tip{position:absolute;bottom:calc(100% + 6px);left:50%;transform:translateX(-50%);
     background:#202020;color:#F9F4EE;font-size:.72rem;line-height:1.3;white-space:nowrap;
     padding:.35em .6em;border-radius:7px;pointer-events:none;opacity:0;transition:opacity .1s;
     z-index:5;text-align:center}
.echart .bar .tip b{color:#fff;font-weight:600}
.echart .bar .tip::after{content:"";position:absolute;top:100%;left:50%;transform:translateX(-50%);
     border:4px solid transparent;border-top-color:#202020}
.echart .bar:hover .tip{opacity:1}
.echart .bar .fill{width:100%;max-width:16px;margin:0 auto;background:#EFADAE;border-radius:3px 3px 0 0;
     min-height:0;transition:background .12s}
.echart .bar:hover .fill{background:#EAA0A5}
.echart .bar.sel .fill{background:#c0392b}
.echart .bar.empty0{cursor:default}
.echart .bar.empty0 .fill{background:#efe7da}
.echart .bar.empty0:hover .fill{background:#efe7da}
.echart-days{display:flex;gap:2px;margin-top:.25rem}
.echart-days span{flex:1;text-align:center;font-size:.6rem;color:#b3a998;min-width:0;overflow:hidden}
.echart-hint{font-size:.82rem;color:#9a9082;margin:.7rem 0 0}
.elist{margin-top:1rem}
.elist .day-h{font-family:Georgia,serif;font-style:italic;font-size:1rem;margin:.2rem 0 .6rem}
.sev{display:inline-block;font-size:.68rem;font-weight:600;padding:.1em .5em;border-radius:99px;text-transform:uppercase;letter-spacing:.03em}
.sev-warn{background:#FFF4C7;color:#7a5b00}
.sev-error{background:#fdecea;color:#c0392b}
.sev-crit{background:#c0392b;color:#fff}
/* fixed layout so columns don't jump between days */
.etable{table-layout:fixed}
.etable col.c-tenant{width:12rem}
.etable col.c-user{width:6rem}
.etable td{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;vertical-align:top}
.etable td:last-child{overflow:visible;overflow-wrap:anywhere;white-space:normal}
.etable td code{white-space:nowrap}
.btn{display:inline-block;background:#202020;color:#F9F4EE;border:0;border-radius:99px;
     padding:.7rem 1.6rem;font-size:1rem;cursor:pointer;text-decoration:none;font-family:inherit}
.btn:hover{background:#000}
.btn:disabled{opacity:.4;cursor:default}
.btn.ghost{background:#fff;color:#202020;border:1px solid #d9cdbb}
.btn.ghost:hover{background:#f4eee4}
/* registry write form */
.wcard{border-color:#e4d9c8}
.wcard>.wsummary{list-style:none;cursor:pointer;display:flex;align-items:center;gap:.55rem;
     user-select:none;outline:none}
.wcard>.wsummary::-webkit-details-marker{display:none}
.wcard>.wsummary h2{margin:0}
.wcard>.wsummary::before{content:"›";font-size:1.4rem;color:#a8755a;transition:transform .15s;line-height:1;display:inline-block}
.wcard[open]>.wsummary::before{transform:rotate(90deg)}
.wcard[open]>.wsummary{margin-bottom:.2rem}
.wform{display:flex;flex-direction:column;gap:.7rem;max-width:34rem}
.wform label{display:flex;flex-direction:column;gap:.25rem;font-size:.82rem;color:#8a8174;font-weight:600}
.wform input{font-family:inherit;font-size:.95rem;padding:.5rem .65rem;border:1px solid #e0d6c6;
     border-radius:8px;background:#fff;color:#202020}
.wform input:focus{outline:2px solid #EFADAE;outline-offset:0;border-color:#EFADAE}
.wform select{font-family:inherit;font-size:.95rem;padding:.5rem .65rem;border:1px solid #e0d6c6;
     border-radius:8px;background:#fff;color:#202020}
.wform select:focus{outline:2px solid #EFADAE;outline-offset:0;border-color:#EFADAE}
.wcheck{flex-direction:row !important;align-items:center;gap:.5rem !important;font-weight:500 !important}
.uedit{text-decoration:none;color:#a8755a;opacity:.55;font-size:.85rem}
.uedit:hover{opacity:1}
/* Tenants landing — one card per tenant, table of users inside */
.tcard{padding:0;margin-bottom:1rem;overflow:hidden}
.tcard-head{display:flex;flex-wrap:wrap;align-items:baseline;justify-content:space-between;gap:.5rem;
     padding:.8rem 1rem;background:#F9F4EE;border-bottom:1px solid #e4d9c8}
.tcard-head strong{font-size:1rem}
.tcard-stats{font-size:.8rem}
/* Fixed grid so every tenant card lines up with every other one. */
.tenants-table{width:100%;border-collapse:collapse;table-layout:fixed}
.tenants-table col.c-user{width:11rem}
.tenants-table col.c-sites{width:auto}
.tenants-table col.c-trial{width:10rem}
.tenants-table col.c-act{width:8.5rem}
.tenants-table col.c-do{width:3rem}
.tenants-table td{padding:.55rem 1rem;border-bottom:1px solid #f4ede2;font-size:.9rem;vertical-align:middle}
.tenants-table tr:last-child td{border-bottom:0}
/* Long names/site-lists must not blow the grid apart. */
.tenants-table td:first-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tenants-table td:nth-child(2){overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
/* The editor row spans all columns, so it opts out of the fixed cells. */
.tenants-table .edrow>td{white-space:normal;overflow:visible}
@media(max-width:900px){
  .tenants-table col.c-user{width:8rem}
  .tenants-table col.c-trial{width:8rem}
  .tenants-table col.c-act{width:6.5rem}
  .tenants-table td{padding:.5rem .6rem}
}
/* Site multiselect chips.
   NOTE the `.edbox .schip` selector: `.edbox label` sets flex-direction:column
   (for the stacked label+input fields) and is MORE specific than a bare
   `.schip`, which stacked the checkbox on top of its label. Keep the two-class
   selector or the chips fall apart again. */
.schips{display:flex;flex-wrap:wrap;gap:.3rem}
.edbox .schip{display:inline-flex;flex-direction:row;align-items:center;gap:.4rem;
     font-size:.78rem;font-weight:500;color:#4a453d;background:#fff;border:1px solid #e0d6c6;
     border-radius:7px;padding:.22rem .5rem .22rem .42rem;cursor:pointer;user-select:none;
     font-family:"SF Mono",Menlo,monospace;line-height:1.4}
.edbox .schip:hover:not(.off){border-color:#c9bca6;background:#fffdf9}
.edbox .schip:has(input:checked){background:#FFF4C7;border-color:#e8d98a;color:#3a352e}
.edbox .schip input{margin:0;cursor:pointer;width:.85rem;height:.85rem;flex-shrink:0}
.edbox .schip.off{opacity:.35;cursor:not-allowed}
.edbox .schip.off input{cursor:not-allowed}
.edfield{flex-basis:100%;display:flex;flex-direction:column;gap:.35rem}
.edlabel{font-size:.78rem;color:#8a8174;font-weight:600}
.edrow2{flex-basis:100%;display:flex;flex-wrap:wrap;align-items:flex-end;gap:.8rem}
.edsep{flex:1}
.edrotate{white-space:nowrap}
.tokenbox{flex-basis:100%;background:#FFF4C7;border:1px solid #e8d98a;border-radius:8px;padding:.7rem .9rem;margin-top:.2rem}
.tokenwarn{font-size:.8rem;font-weight:600;color:#7a6a1f;margin:0 0 .4rem}
.tokenval{font-family:"SF Mono",Menlo,monospace;font-size:.8rem;word-break:break-all;background:#fff;
     border:1px solid #e8d98a;border-radius:6px;padding:.35rem .5rem;display:inline-block}
.livechip{color:#2e7d32;font-weight:600;font-size:.82rem}
.warnchip{color:#c0392b;font-weight:600;font-size:.82rem}
.errchip{color:#c0392b;font-weight:600}
.acts{text-align:right;white-space:nowrap}
.edbtn{border:0;background:none;cursor:pointer;color:#a8755a;opacity:.55;font-size:.95rem;padding:.1rem .3rem}
.edbtn:hover{opacity:1}
.edrow>td{background:#fbf8f2;border-bottom:1px solid #e4d9c8}
.edbox{display:flex;flex-wrap:wrap;align-items:flex-end;gap:.8rem;padding:.3rem 0}
.edbox label{display:flex;flex-direction:column;gap:.25rem;font-size:.78rem;color:#8a8174;font-weight:600}
.edbox input[type=text],.edbox input:not([type]){font-family:inherit;font-size:.9rem;padding:.4rem .6rem;
     border:1px solid #e0d6c6;border-radius:8px;background:#fff;color:#202020;min-width:16rem}
.edbox input[name=trial]{min-width:8.5rem}
.edbox input:focus{outline:2px solid #EFADAE;outline-offset:0;border-color:#EFADAE}
.edbox .btn{padding:.45rem 1rem;font-size:.85rem}
.edbox .wmsg{flex-basis:100%;margin:0}
.eddetails{flex-basis:100%}
.eddetails summary{cursor:pointer;font-size:.78rem}
.eddetails .wdiff{margin-top:.4rem}
.wactions{display:flex;gap:.6rem;margin-top:.4rem}
.wactions .btn{padding:.55rem 1.2rem;font-size:.9rem}
.wmsg{font-size:.88rem;margin-top:.3rem;min-height:1.1em}
.wmsg.ok{color:#2e7d32}
.wmsg.bad{color:#c0392b}
.wdiff{margin-top:.6rem;background:#faf6f0;border:1px solid #ece3d5;border-radius:8px;
     padding:.7rem .9rem;font-family:"SF Mono",Menlo,monospace;font-size:.78rem;line-height:1.5;
     white-space:pre-wrap;overflow-x:auto;max-height:22rem;overflow-y:auto}
.center{min-height:90vh;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center}
@media(max-width:760px){.layout{flex-direction:column}.sidebar{width:auto;height:auto;position:static;
  flex-direction:row;align-items:center;border-right:0;border-bottom:1px solid #e4d9c8}
  .brand{margin:0 1.5rem 0 .4rem}.nav{flex-direction:row}.nav .spacer{display:none}.content{padding:1.4rem}}
.wcheck.revoke{font-size:.75rem;color:#a05a52;cursor:help}
.tenants-table col.c-seats{width:4.5rem}
.seats{font-size:.8rem;font-weight:600;color:#4a453d;cursor:help}
.seats.full{color:#a8755a}
