:root{
  --bg:#F4F5F6; --surface:#FFFFFF;
  --text:#1A2432; --heading:#2D3B4E; --text-2:rgba(26,36,50,.6); --text-3:rgba(26,36,50,.5);
  --border:#D3D9E3; --divider:#EAEBED; --table-head:#F5F5F5;
  --primary:#00CF95; --primary-hover:#00B884; --primary-strong:#0A7357; --primary-soft:#D7F7E9; --active-soft:#EEFFF8;
  --warn:#B25E09; --warn-soft:#FFF4E5; --danger:#C62F2F; --danger-soft:#FDECEC;
  --info:#2457C5; --info-soft:#EAF1FF;
  --r:8px; --r-sm:4px;
  --shadow:0 8px 24px rgba(26,36,50,.12), 0 2px 6px rgba(26,36,50,.06);
}
*{box-sizing:border-box}
html,body{margin:0;height:100%}
body{font-family:Inter,system-ui,sans-serif;color:var(--text);background:var(--bg);font-size:14px;line-height:18px;-webkit-font-smoothing:antialiased}
button,input{font:inherit;color:inherit}
button{cursor:pointer}
a{color:inherit}
.ic{display:inline-block;flex:none;fill:currentColor;vertical-align:middle}
.ic.og{background:currentColor;-webkit-mask-size:contain;mask-size:contain;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-position:center;mask-position:center}

/* ---------- App chrome ---------- */
.app{min-height:100vh;display:grid;grid-template-columns:176px 1fr;grid-template-rows:72px 1fr}
.topbar{grid-column:1/-1;background:#fff;border:1px solid var(--bg);display:flex;align-items:center;justify-content:space-between;padding:0 24px}
.logo{display:flex;align-items:center;gap:8px;height:40px;text-decoration:none}
.logo-img{width:40px;height:40px;border-radius:50%;flex:none}
.logo-mark{width:40px;height:40px;border-radius:50%;background:var(--text);display:grid;place-items:center;color:#fff;font-weight:700}
.logo-text{color:var(--text)}
.logo-text b{display:block;font-size:20px;line-height:22px;font-weight:700;letter-spacing:-.3px}
.logo-text small{display:block;font-size:8px;line-height:10px;font-weight:600;letter-spacing:.8px}
.top-actions{display:flex;gap:8px;align-items:center;height:52px}
.hotel-switch{height:52px;display:flex;align-items:center;gap:8px;padding:8px 12px;border:1px solid var(--border);border-radius:var(--r);background:#fff;font-weight:500;min-width:210px}
.hotel-switch .grow{flex:1;text-align:left}
.icon-btn{width:44px;height:44px;display:grid;place-items:center;border:0;background:none;border-radius:var(--r)}
.icon-btn:hover{background:var(--bg)}
.avatar{width:28px;height:28px;border-radius:50%;background:var(--primary-soft);display:grid;place-items:center;font-size:11px;font-weight:600}

.side{background:#fff;border-right:1px solid var(--bg);padding:16px 8px;display:flex;flex-direction:column;justify-content:space-between}
.nav{display:flex;flex-direction:column;gap:8px}
.nav-item{display:flex;align-items:center;gap:8px;padding:8px;border-radius:var(--r-sm);color:var(--heading);font-size:12px;font-weight:500;border:0;background:none;text-align:left;width:100%}
.nav-item:hover{background:var(--bg)}
.nav-item.on{background:var(--primary-soft);font-weight:600}
.nav-item.on .ic{color:var(--primary-strong)}
.nav-item .grow{flex:1}

.main{padding:24px 24px 24px 24px}
.card{background:#fff;padding:24px;min-height:calc(100vh - 72px - 48px);display:flex;flex-direction:column;gap:24px}

/* ---------- Typography ---------- */
h1{font-size:20px;line-height:26px;font-weight:700;color:var(--heading);margin:0}
h2{font-size:16px;line-height:22px;font-weight:700;color:var(--heading);margin:0}
.sub{color:var(--text-2);margin:4px 0 0}
.small{font-size:12px;line-height:16px}
.muted{color:var(--text-2)}
.faint{color:var(--text-3)}

/* ---------- Buttons ---------- */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;height:40px;padding:0 16px;border-radius:var(--r);border:1px solid transparent;font-weight:500;white-space:nowrap;background:none}
.btn.lg{height:52px;padding:0 12px}
.btn.sm{height:32px;padding:0 12px;font-size:13px}
.btn.primary{background:var(--primary);color:var(--text)}
.btn.primary:hover{background:var(--primary-hover)}
.btn.secondary{background:#fff;border-color:var(--border)}
.btn.secondary:hover{background:var(--bg)}
.btn.ghost:hover{background:var(--bg)}
.btn.danger{background:var(--danger);color:#fff}
.btn:disabled{opacity:.45;cursor:not-allowed}
.btn.block{width:100%}
.link{background:none;border:0;padding:0;font-weight:600;text-decoration:underline;text-underline-offset:2px}

/* ---------- Page header & filters ---------- */
.page-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}
.filters{display:flex;gap:8px;flex-wrap:wrap}
.fchip{height:32px;padding:0 12px;border-radius:999px;border:1px solid var(--border);background:#fff;font-weight:500;font-size:13px;display:inline-flex;align-items:center;gap:6px}
.fchip .n{color:var(--text-2);font-weight:500}
.fchip.on{background:var(--text);border-color:var(--text);color:#fff}
.fchip.on .n{color:rgba(255,255,255,.7)}

/* ---------- Table ---------- */
.table{width:100%;display:flex;flex-direction:column}
.thead,.trow{display:grid;grid-template-columns:280px 144px 168px 144px 1fr;align-items:center}
.thead{background:var(--table-head);border-bottom:1px solid var(--divider);height:48px;font-weight:600;line-height:20px}
.thead>div,.trow>div{padding:4px 8px}
.trow{padding:16px 0;border-bottom:1px solid var(--divider);position:relative;transition:background .6s}
.trow:last-child{border-bottom:0}
.trow.new{background:var(--active-soft)}
.u-name{font-weight:500}
.u-mail{color:var(--text-3);font-weight:500;margin-top:4px}
.u-meta{color:var(--text-2);font-size:12px;line-height:16px;margin-top:4px}
.cell-actions{display:flex;justify-content:flex-end;align-items:center;gap:8px;position:relative}
.dots{width:32px;height:32px;border:0;background:none;border-radius:var(--r);display:grid;place-items:center}
.dots:hover,.dots.on{background:var(--bg)}
.role-custom{display:block;color:var(--text-2);font-size:12px;line-height:16px;margin-top:2px}

/* ---------- Status pill ---------- */
.pill{display:inline-flex;align-items:center;gap:6px;height:26px;padding:0 12px;border-radius:999px;font-weight:500;white-space:nowrap}
.pill.active{background:var(--active-soft)}
.pill.invited{background:var(--info-soft);color:#1D3F8F}
.pill.expired{background:var(--warn-soft);color:var(--warn)}
.pill .dot{width:6px;height:6px;border-radius:50%;background:currentColor}
.pill-meta{display:block;font-size:12px;line-height:16px;color:var(--text-2);margin-top:4px}
.pill-meta.warn{color:var(--warn)}

/* ---------- Menu ---------- */
.menu{position:absolute;top:36px;right:0;z-index:20;background:#fff;border:1px solid var(--divider);border-radius:var(--r);box-shadow:var(--shadow);min-width:220px;padding:6px}
.menu button{display:flex;align-items:center;gap:10px;width:100%;padding:8px 10px;border:0;background:none;border-radius:6px;text-align:left;font-weight:500}
.menu button:hover:not(:disabled){background:var(--bg)}
.menu button:disabled{opacity:.45;cursor:not-allowed}
.menu .danger{color:var(--danger)}
.menu hr{border:0;border-top:1px solid var(--divider);margin:6px 0}
.menu .note{padding:6px 10px;color:var(--text-2);font-size:12px;line-height:16px}

/* ---------- Empty state ---------- */
.empty{border:1px dashed var(--border);border-radius:var(--r);padding:32px;display:flex;gap:24px;align-items:center}
.empty .badge{width:56px;height:56px;border-radius:50%;background:var(--primary-soft);display:grid;place-items:center;flex:none}
.empty .grow{flex:1}
.empty ul{margin:8px 0 0;padding-left:18px;color:var(--text-2)}

/* ---------- Modal ---------- */
.scrim{position:fixed;inset:0;background:rgba(26,36,50,.45);display:grid;place-items:center;z-index:50;padding:24px}
.modal{background:#fff;border-radius:12px;box-shadow:var(--shadow);width:560px;max-width:100%;max-height:calc(100vh - 48px);display:flex;flex-direction:column}
.modal.sm{width:440px}
.m-head{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;padding:24px 24px 0}
.m-body{padding:20px 24px;overflow:auto;display:flex;flex-direction:column;gap:20px}
.m-foot{padding:16px 24px;border-top:1px solid var(--divider);display:flex;justify-content:flex-end;gap:8px;align-items:center}
.m-foot .grow{flex:1;color:var(--text-2);font-size:12px}
.field label.lbl{display:block;font-weight:600;margin-bottom:6px}
.field .hint{color:var(--text-2);font-size:12px;line-height:16px;margin-top:6px}
.input{width:100%;height:44px;border:1px solid var(--border);border-radius:var(--r);padding:0 12px;background:#fff}
.input:focus,.chips:focus-within{outline:2px solid var(--primary);outline-offset:-1px;border-color:transparent}
.input[readonly]{background:var(--bg);color:var(--text-2)}

/* chip input */
.chips{min-height:44px;border:1px solid var(--border);border-radius:var(--r);padding:6px;display:flex;flex-wrap:wrap;gap:6px;cursor:text;background:#fff}
.chips input{flex:1;min-width:120px;border:0;outline:0;height:30px;padding:0 6px;background:none}
.chip{display:inline-flex;align-items:center;gap:4px;height:30px;padding:0 4px 0 10px;border-radius:999px;background:var(--bg);font-weight:500}
.chip.err{background:var(--danger-soft);color:var(--danger)}
.chip.warn{background:var(--warn-soft);color:var(--warn)}
.chip button{width:22px;height:22px;border:0;background:none;border-radius:50%;display:grid;place-items:center;color:inherit}
.chip button:hover{background:rgba(26,36,50,.08)}
.issues{margin-top:8px;display:flex;flex-direction:column;gap:6px}
.issue{display:flex;gap:8px;align-items:flex-start;font-size:13px;line-height:18px}
.issue.err{color:var(--danger)} .issue.warn{color:var(--warn)}
.issue .link{color:var(--text)}

/* role cards */
.roles{display:flex;flex-direction:column;gap:8px}
.role{display:flex;gap:12px;padding:12px 14px;border:1px solid var(--border);border-radius:var(--r);cursor:pointer;background:#fff;text-align:left;width:100%}
.role:hover{border-color:#B7C0CE}
.role.on{border:2px solid var(--primary);padding:11px 13px;background:var(--active-soft)}
.radio{width:18px;height:18px;border-radius:50%;border:2px solid var(--border);flex:none;margin-top:1px;display:grid;place-items:center;background:#fff}
.role.on .radio{border-color:var(--text)}
.role.on .radio::after{content:"";width:8px;height:8px;border-radius:50%;background:var(--text)}
.role .rt{font-weight:600;display:flex;gap:8px;align-items:center}
.role .rd{color:var(--text-2);margin-top:2px}
.tag{font-size:11px;line-height:16px;font-weight:600;padding:0 6px;border-radius:4px;background:var(--bg);color:var(--text-2)}

.disclosure{border:1px solid var(--divider);border-radius:var(--r)}
.disclosure>button{width:100%;display:flex;align-items:center;gap:8px;padding:12px 14px;border:0;background:none;font-weight:600;text-align:left}
.disclosure>button .grow{flex:1}
.disclosure .rot{transition:transform .15s}
.disclosure.open .rot{transform:rotate(180deg)}
.access{padding:0 14px 12px;display:flex;flex-direction:column;gap:2px}
.check{display:flex;align-items:center;gap:10px;padding:8px 0;border-top:1px solid var(--divider)}
.check:first-child{border-top:0}
.check input{width:16px;height:16px;accent-color:var(--text)}
.check .grow{flex:1;display:flex;align-items:center;gap:8px}
.check.locked{color:var(--text-3)}

.notice{display:flex;gap:10px;padding:12px 14px;border-radius:var(--r);font-size:13px;line-height:18px}
.notice.warn{background:var(--warn-soft);color:#7A4106}
.notice.info{background:var(--info-soft);color:#1D3F8F}
.notice.ok{background:var(--active-soft)}
.scope{display:flex;align-items:center;gap:8px;color:var(--text-2);font-size:13px}
.scope b{color:var(--text);font-weight:600}

/* ---------- Toast ---------- */
.toast{position:fixed;left:50%;bottom:24px;transform:translateX(-50%);z-index:80;background:var(--text);color:#fff;border-radius:var(--r);padding:12px 16px;display:flex;gap:16px;align-items:center;box-shadow:var(--shadow);animation:up .2s ease-out;max-width:calc(100vw - 48px)}
.toast .ic{color:var(--primary)}
.toast button{background:none;border:0;color:var(--primary);font-weight:600;padding:0}
@keyframes up{from{transform:translate(-50%,12px);opacity:0}to{transform:translate(-50%,0);opacity:1}}

/* ---------- Standalone pages (email, accept) ---------- */
.standalone{min-height:100vh;display:flex;flex-direction:column;align-items:center;padding:48px 24px}
.standalone .logo{margin-bottom:32px}
.panel{background:#fff;border-radius:12px;box-shadow:0 1px 2px rgba(26,36,50,.06);width:480px;max-width:100%;padding:32px;display:flex;flex-direction:column;gap:20px}
.panel h1{font-size:24px;line-height:30px}
.invite-from{display:flex;gap:12px;align-items:center;padding:12px;border-radius:var(--r);background:var(--bg)}
.invite-from .avatar{width:40px;height:40px;font-size:14px}
.can{margin:0;padding:0;list-style:none;display:flex;flex-direction:column;gap:8px}
.can li{display:flex;gap:8px;align-items:flex-start}
.can .ic{color:var(--primary-strong)}
.pw{position:relative}
.pw button{position:absolute;right:8px;top:8px;height:28px;border:0;background:none;font-weight:600;font-size:12px;color:var(--text-2)}
.center{text-align:center}
.state-icon{width:56px;height:56px;border-radius:50%;display:grid;place-items:center;margin:0 auto}
.state-icon.warn{background:var(--warn-soft);color:var(--warn)}
.state-icon.err{background:var(--danger-soft);color:var(--danger)}
.state-icon.ok{background:var(--primary-soft);color:var(--primary-strong)}

.mail-client{width:720px;max-width:100%;background:#fff;border-radius:12px;overflow:hidden;box-shadow:0 1px 2px rgba(26,36,50,.06)}
.mail-bar{display:flex;align-items:center;gap:8px;padding:12px 20px;border-bottom:1px solid var(--divider);color:var(--text-2);font-size:13px}
.mail-head{padding:20px 24px;border-bottom:1px solid var(--divider)}
.mail-head h2{font-size:18px;line-height:24px}
.mail-from{display:flex;gap:10px;align-items:center;margin-top:12px;font-size:13px}
.mail-body{padding:32px 24px;background:var(--bg)}
.mail-card{background:#fff;border-radius:var(--r);max-width:520px;margin:0 auto;padding:32px;display:flex;flex-direction:column;gap:16px}
.mail-foot{max-width:520px;margin:16px auto 0;font-size:12px;line-height:16px;color:var(--text-2)}
.mail-foot code{word-break:break-all;color:var(--text)}

/* ---------- Member home ---------- */
.welcome{display:flex;gap:16px;align-items:flex-start;padding:16px 20px;border-radius:var(--r);background:var(--active-soft);border:1px solid #BDEFD9}
.welcome .grow{flex:1}
.welcome ul{margin:8px 0 0;padding-left:18px}
.stats{display:grid;grid-template-columns:repeat(3,1fr);gap:16px}
.stat{border:1px solid var(--divider);border-radius:var(--r);padding:16px}
.stat b{display:block;font-size:22px;line-height:28px;margin-top:4px}
.mock-table .thead,.mock-table .trow{grid-template-columns:1.2fr 1fr 1.6fr 1fr 1fr}
.proto-note{color:var(--text-2);font-size:12px}

/* ---------- Prototype controls ---------- */
.proto{position:fixed;right:16px;bottom:16px;z-index:90;font-size:12px}
.proto-toggle{height:36px;padding:0 14px;border-radius:999px;border:0;background:#5B3FD6;color:#fff;font-weight:600;box-shadow:var(--shadow);display:flex;align-items:center;gap:8px}
.proto-panel{position:absolute;right:0;bottom:44px;width:260px;background:#fff;border-radius:12px;box-shadow:var(--shadow);border:1px solid var(--divider);padding:12px;display:flex;flex-direction:column;gap:6px}
.proto-panel .t{font-weight:700;font-size:12px;color:#5B3FD6;letter-spacing:.4px;text-transform:uppercase;padding:4px 6px}
.proto-panel button{text-align:left;border:0;background:none;padding:8px 6px;border-radius:6px;font-weight:500;font-size:13px}
.proto-panel button:hover:not(:disabled){background:var(--bg)}
.proto-panel button:disabled{opacity:.4;cursor:not-allowed}
.proto-panel .d{padding:4px 6px;color:var(--text-2)}
.proto-panel hr{border:0;border-top:1px solid var(--divider);margin:4px 0}

/* ---------- Components page ---------- */
.comp{padding:40px;display:flex;flex-direction:column;gap:32px;max-width:1100px;margin:0 auto}
.comp section{background:#fff;border-radius:12px;padding:24px;display:flex;flex-direction:column;gap:16px}
.comp .row{display:flex;gap:16px;flex-wrap:wrap;align-items:flex-start}
.comp .lab{font-size:11px;color:var(--text-2);text-transform:uppercase;letter-spacing:.5px;margin-bottom:6px}
.comp .static{position:static;transform:none;animation:none}
.comp .menu{position:static}
.comp .modal{box-shadow:var(--shadow)}
.swatch{width:120px}
.swatch i{display:block;height:48px;border-radius:var(--r);border:1px solid var(--divider)}

/* ---------- Export sheet ---------- */
.export-sheet{display:flex;flex-direction:column;align-items:flex-start;gap:40px;padding:40px;background:transparent}
.exp{display:inline-block;padding:24px;box-sizing:content-box}
.exp>.table,.exp>.welcome+*,.exp>.empty{background:#fff}
.exp>.table{background:#fff}
.exp .scrim{position:static;background:none;padding:0;display:block}
.exp .modal{max-height:none}
.exp .roles .role{margin:0}
.exp .toast.static{position:static;transform:none;animation:none;display:inline-flex}
