:root{color-scheme:light;--bg:#f5f6f8;--panel:#fff;--line:#e2e5e9;--text:#16181d;--muted:#6b7280;--brand:#e30a1c;--amber:#9a6700;--red:#c1121f}
body{background:var(--bg);color:var(--text);font-family:"Inter Tight",Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
.boot{color:var(--muted)}
.auth-page{min-height:100vh;display:grid;place-items:center;padding:32px 20px;background:linear-gradient(145deg,#f8f9fb,#f2f3f6)}
.auth-shell{width:min(440px,100%)}
.auth-brand{display:flex;align-items:center;gap:12px;margin:0 0 20px;padding:0 4px}
.auth-brand>span:last-child{display:grid;line-height:1.15}.auth-brand strong{font-size:18px}.auth-brand small{color:var(--muted);font-size:12px}
.product-mark{width:42px;height:42px;display:grid;place-items:center;border-radius:12px;background:var(--brand);color:#fff;font-weight:900;letter-spacing:-.04em;box-shadow:0 8px 24px color-mix(in srgb,var(--brand) 22%,transparent)}
.product-logo{display:block;background:transparent;object-fit:contain}
.mark-capacity{border-radius:50% 12px 12px 50%}.mark-academy{border-radius:8px 18px 8px 18px;font-size:13px}.mark-secscan{clip-path:polygon(50% 0,94% 23%,86% 78%,50% 100%,14% 78%,6% 23%);border-radius:0}.mark-pulse{border-radius:50%;outline:3px solid color-mix(in srgb,var(--brand) 20%,transparent);outline-offset:3px}.mark-accounts{border-radius:10px}
.auth-card{background:#fff;border:1px solid var(--line);border-radius:18px;padding:26px;box-shadow:0 18px 55px #10182812}
.auth-heading{display:flex;gap:14px;align-items:flex-start;margin-bottom:24px}.auth-heading h1{font-size:24px;line-height:1.2;letter-spacing:-.03em;margin:1px 0 5px}.auth-heading p{color:var(--muted);margin:0}.auth-lock{width:34px;height:34px;flex:0 0 auto;border-radius:10px;display:grid;place-items:center;background:color-mix(in srgb,var(--brand) 9%,white);color:var(--brand);font-weight:800}
.auth-form{display:grid;gap:16px}.field{display:grid;gap:7px}.field label{color:#414650;font-size:12px;font-weight:700}.field input,.field select,.search{border:1px solid #d7dbe0;background:#fff;color:var(--text);border-radius:10px;padding:12px 13px;outline:none}.field input:focus,.search:focus{border-color:var(--brand);box-shadow:0 0 0 3px color-mix(in srgb,var(--brand) 10%,transparent)}
.button{border:1px solid var(--line);background:#fff;color:var(--text);padding:12px 15px;border-radius:10px;font-weight:750;cursor:pointer}.button.primary{display:flex;justify-content:center;gap:8px;background:var(--brand);color:#fff;border-color:var(--brand)}
.auth-identity{display:flex;justify-content:space-between;align-items:center;background:#f7f8fa;border:1px solid var(--line);border-radius:10px;padding:10px 12px;margin-bottom:16px}.auth-identity button{border:0;background:transparent;color:var(--brand);font-weight:700;cursor:pointer}
.recovery-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:0 0 18px}.recovery-grid code{padding:9px;background:#f7f8fa;border:1px solid var(--line);border-radius:8px;text-align:center}.security-grid{display:grid;grid-template-columns:repeat(2,minmax(0,620px));gap:16px}.security-panel{padding:24px}.security-panel form{display:grid;gap:14px}.security-panel h2{margin:0}.security-panel p{color:var(--muted)}
.auth-shell footer{text-align:center;color:#8a9099;font-size:11px;margin-top:16px}.error{color:#a4111c;background:#fff2f3;border:1px solid #ffd1d5;padding:11px 12px;border-radius:10px}.qr{background:#fff;border:1px solid var(--line)}.secret{background:#f7f8fa;color:#3d4148}
.shell{background:var(--bg)}.sidebar{background:#fff;border-color:var(--line)}.side-brand .product-mark{width:38px;height:38px}.side-brand b{color:var(--text)}.side-brand small,.topbar p,td small,.event small,.access small{color:var(--muted)}.nav button{color:#59616d}.nav button.active{background:#f1f2f4;color:var(--text)}.safe{background:#fff9e8;border-color:#f1dc9b;color:#765c00}.main{background:var(--bg)}
.global-header{height:62px;margin:-34px -34px 30px;padding:0 34px;background:#fff;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;gap:20px}.global-header .search{width:min(380px,45vw);padding:9px 11px}.global-user{display:flex;align-items:center;gap:10px}.global-user>span{width:34px;height:34px;display:grid;place-items:center;background:#f0f1f3;border-radius:50%;font-weight:800}.global-user div{display:grid}.global-user small{color:var(--muted);font-size:10px}
.card,.panel{background:#fff;border-color:var(--line);box-shadow:0 2px 10px #10182808}.mode{color:#9a0010;border-color:#f3b7bd;background:#fff2f3}.notice{border-color:#d9e0e8;background:#f8fafc;color:#4b5563}.search{color:var(--text)}th,td{border-color:#eceef1}th{color:#737a84}.badge{border-color:#dce0e5}.badge.active,.badge.existing{border-color:#bde6cc;color:#17723b;background:#effaf3}.badge.disabled{border-color:#f2c2c6;color:#aa202c}.badge.planned,.badge.desired{border-color:#f0d38c;color:#815d00}.app-chip{background:#f8f9fa;border-color:#dfe2e6;color:#59616d}.app-chip.existing,.app-chip.provisioned{color:#17723b;border-color:#bde6cc}.app-chip.planned,.app-chip.desired{color:#815d00;border-color:#f0d38c}.drawer-bg{background:#11182766}.drawer{background:#fff;border-color:var(--line)}.close{background:#f1f2f4;color:var(--text)}.access{border-color:var(--line)}.toggle{border:0}.policy{display:flex;align-items:center;gap:8px;margin:12px 0 6px;color:#4b5563;font-size:12px}
@media(max-width:850px){.auth-page{padding:18px 12px}.auth-card{padding:21px}.global-header{margin:-22px -14px 22px;padding:0 14px}.global-user div{display:none}.sidebar{padding:16px}.safe{font-size:10px}.nav{grid-template-columns:repeat(4,1fr);overflow:auto}.nav button{text-align:center;padding:9px 7px}.security-grid{grid-template-columns:1fr}.recovery-grid{grid-template-columns:1fr}}

/* Capacity-aligned application shell */
.shell{grid-template-columns:228px minmax(0,1fr);min-height:100vh;background:#f5f6f8}
.sidebar{z-index:30;padding:0 12px 18px;height:100vh;background:#fff;border-right:1px solid #e3e5e8}
.side-brand{height:56px;margin:0 4px 24px;gap:10px}.side-brand .product-mark{width:34px;height:34px;border-radius:9px;box-shadow:0 7px 18px #e30a1c24}.side-brand b{font-size:15px;letter-spacing:-.02em}.side-brand small{font-size:10px;margin-top:1px}
.nav{display:grid;gap:4px}.nav button{display:flex;align-items:center;gap:11px;min-height:40px;padding:8px 10px;border-radius:8px;font-size:13px;font-weight:650;transition:background .16s,color .16s}.nav button:hover{background:#f7f7f8;color:#1d2025}.nav button.active{background:#f1f2f4;color:#17191e;box-shadow:inset 3px 0 0 var(--brand)}
.nav-icon{width:24px;height:24px;display:grid;place-items:center;flex:0 0 auto;border:1px solid #dfe2e6;border-radius:7px;background:#fff;color:#737a84;font-size:8px;font-weight:900;letter-spacing:.04em}.nav button.active .nav-icon{border-color:#f1b9be;background:#fff3f4;color:#b80818}
.safe{left:12px;right:12px;bottom:18px;display:grid;gap:4px;padding:11px 12px;border-radius:10px;font-size:10px;line-height:1.45}.safe b{font-size:9px;letter-spacing:.08em}.safe span{display:block}
.main{padding:0 32px 32px;min-width:0;background:#f5f6f8}
.global-header{height:56px;margin:0 -32px 28px;padding:0 32px;position:sticky;top:0;z-index:20;background:#fff;border-bottom:1px solid #e3e5e8;box-shadow:0 1px 2px #10182805}
.header-start{display:flex;align-items:center;gap:10px;min-width:0}.global-search{width:min(390px,42vw);height:36px;display:flex;align-items:center;gap:7px;padding:0 11px;border:1px solid #dfe2e6;border-radius:9px;background:#f9fafb;color:#818792}.global-search:focus-within{border-color:#e30a1c;box-shadow:0 0 0 3px #e30a1c12;background:#fff}.global-search .search{width:100%;max-width:none;padding:0;border:0;background:transparent;box-shadow:none}.global-search .search:focus{border:0;box-shadow:none}.global-search>span{font-size:20px;line-height:1;transform:rotate(-15deg)}
.global-user>span{width:32px;height:32px;background:#f2f3f5;color:#24272d;font-size:12px}.global-user b{font-size:12px}.global-user small{font-size:9px}.menu-toggle,.mobile-nav-backdrop{display:none}
.topbar{margin-bottom:24px}.topbar h1{font-size:30px;line-height:1.15;letter-spacing:-.04em}.topbar p{max-width:780px;font-size:13px}.mode{padding:7px 10px;font-size:9px;letter-spacing:.04em}
.metrics{gap:10px;margin-bottom:14px}.card{border-radius:13px}.metric{min-height:102px;padding:15px 16px}.metric span{font-size:9px}.metric b{font-size:28px;line-height:1.1;margin-top:8px}.panel{border-radius:13px}.panel-head{min-height:56px;padding:13px 16px}.panel-head h2{font-size:14px}.panel-head .search{height:36px;padding:8px 11px}th,td{padding:12px 14px}.drawer{box-shadow:-18px 0 55px #10182816}

@media(max-width:900px){
  .shell{display:block}.sidebar{position:fixed;inset:0 auto 0 0;width:260px;transform:translateX(-102%);transition:transform .2s ease;box-shadow:18px 0 44px #11182718}.shell.nav-open .sidebar{transform:translateX(0)}
  .mobile-nav-backdrop{position:fixed;inset:0;z-index:25;border:0;background:#11182766}.shell.nav-open .mobile-nav-backdrop{display:block}
  .side-brand{margin-bottom:20px}.nav{grid-template-columns:1fr;overflow:visible}.nav button{text-align:left;padding:8px 10px}.safe{position:absolute;margin:0;font-size:10px}
  .main{padding:0 16px 24px}.global-header{height:60px;margin:0 -16px 22px;padding:0 16px}.menu-toggle{width:34px;height:34px;display:grid;place-content:center;gap:4px;border:1px solid #dfe2e6;border-radius:9px;background:#fff}.menu-toggle span{width:15px;height:1.5px;display:block;background:#343840;border-radius:2px}.global-search{width:min(330px,55vw)}.global-user div{display:none}
  .metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.topbar{flex-direction:column}.mode{white-space:normal}.security-grid{grid-template-columns:1fr}
}
@media(max-width:560px){.auth-page{padding:18px 12px}.auth-card{padding:21px}.auth-brand{margin-bottom:15px}.global-search{width:auto;flex:1}.global-search .search{font-size:12px}.global-user{display:none}.topbar h1{font-size:27px}.metrics{grid-template-columns:1fr 1fr}.metric{min-height:92px}.panel-head{align-items:stretch;flex-direction:column;gap:10px}.panel-head .search{max-width:none;width:100%}.recovery-grid{grid-template-columns:1fr}}
.topbar .button { flex: 0 0 auto; }

.user-drawer { width: min(720px, 100vw); overflow-x: hidden; }
.user-drawer form { min-width: 0; }
.user-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding: 20px 24px; border-bottom: 1px solid #e4e7ec; }
.user-form-grid label, .access-level { display: grid; gap: 6px; min-width: 0; color: #344054; font-size: 12px; font-weight: 700; }
.user-form-grid input, .access-level select { width: 100%; min-width: 0; box-sizing: border-box; border: 1px solid #d0d5dd; border-radius: 8px; background: #fff; padding: 10px 11px; color: #101828; font: inherit; }
.drawer-section-title { padding: 20px 24px 8px; }
.drawer-section-title h3 { margin: 0 0 4px; font-size: 15px; }
.drawer-section-title p { margin: 0; color: #667085; font-size: 12px; }
.service-access { min-width: 0; margin: 0; border: 1px solid #e4e7ec; border-radius: 10px; padding: 14px; }
.service-access-main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(150px, 0.45fr); align-items: center; gap: 16px; }
.service-check { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.service-check input { margin-top: 3px; }
.service-check span { display: grid; gap: 3px; min-width: 0; }
.service-check b, .service-check small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.service-check small { color: #667085; font-weight: 400; }
.service-access .policy { margin-top: 12px; }
.drawer-actions { position: sticky; bottom: 0; display: flex; justify-content: space-between; gap: 12px; padding: 16px 24px; border-top: 1px solid #e4e7ec; background: rgba(255,255,255,.96); backdrop-filter: blur(8px); }
.danger-button { border: 1px solid #fda29b !important; background: #fff !important; color: #b42318 !important; }
.muted { color: #98a2b3; font-size: 12px; }

@media (max-width: 640px) {
  .user-form-grid, .service-access-main { grid-template-columns: 1fr; }
  .user-form-grid, .drawer-section-title, .drawer-actions { padding-left: 16px; padding-right: 16px; }
  .drawer-actions { flex-direction: column-reverse; }
  .drawer-actions .button { width: 100%; }
  .service-check b, .service-check small { white-space: normal; overflow-wrap: anywhere; }
  .table-wrap { overflow-x: visible; }
  .table-wrap table { width: 100%; min-width: 0 !important; table-layout: fixed; }
  .table-wrap th:nth-child(2), .table-wrap td:nth-child(2),
  .table-wrap th:nth-child(4), .table-wrap td:nth-child(4),
  .table-wrap th:nth-child(6), .table-wrap td:nth-child(6) { display: none; }
  .table-wrap th:first-child { width: 46%; }
  .table-wrap th:nth-child(3) { width: 18%; }
  .table-wrap th:nth-child(5) { width: 36%; }
  .table-wrap td { min-width: 0; overflow-wrap: anywhere; }
  .table-wrap td:first-child small { white-space: normal; overflow-wrap: anywhere; }
  .table-wrap .apps { flex-wrap: wrap; }
}
