*{box-sizing:border-box}html{font-family:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",Arial,sans-serif;background:#f4f7f8;color:#17353d}body{margin:0;min-height:100vh;background:linear-gradient(180deg,#f7fafb,#f1f6f7)}[hidden]{display:none!important}button,input,select,textarea{font:inherit}.auth-page{overflow:hidden}.login-screen{min-height:100vh;display:grid;place-items:center;padding:24px}.login-card{width:min(430px,100%);background:#fff;border:1px solid #dce8ea;border-radius:28px;padding:34px;box-shadow:0 30px 80px rgba(22,62,72,.12)}.logo{display:flex;align-items:center;gap:11px}.logo>span{display:grid;place-items:center;width:42px;height:42px;border-radius:14px;background:linear-gradient(145deg,#1faab4,#256c7c);color:#fff;font-weight:900}.logo div{display:grid}.logo small{color:#779097}.eyebrow{margin:22px 0 6px;font-size:11px;letter-spacing:.12em;color:#31818c;font-weight:900}.login-card h1{margin:0 0 22px;font-size:38px}.login-card label{display:grid;gap:6px;margin:12px 0;color:#47636b;font-weight:700}.login-card input{border:1px solid #d2e1e4;border-radius:13px;padding:12px 13px;outline:0}.login-card input:focus{border-color:#35a1ac;box-shadow:0 0 0 4px rgba(53,161,172,.09)}.login-card>button,.primary,.button{border:0;border-radius:13px;padding:11px 15px;background:#176f7a;color:#fff;font-weight:800;cursor:pointer}.login-card>button{width:100%;margin-top:7px}.login-card>button:disabled,.primary:disabled{opacity:.55;cursor:wait}.message{min-height:20px;color:#a24646}.admin-app{display:grid;grid-template-columns:230px 1fr;min-height:100vh}.sidebar{position:sticky;top:0;height:100vh;background:#102f37;color:#dcecef;padding:22px 15px;display:flex;flex-direction:column}.sidebar .logo{padding:4px 7px 18px}.sidebar .logo>span{background:#2fa7b2}.sidebar .logo small{color:#8fb1b8}.sidebar nav{display:grid;gap:5px;margin-top:14px}.sidebar nav button{border:0;background:transparent;color:#9fc0c6;text-align:left;border-radius:12px;padding:11px 13px;font-weight:750;cursor:pointer}.sidebar nav button:hover,.sidebar nav button.active{background:#1a4650;color:#fff}.sidebar footer{margin-top:auto;padding:14px 8px;border-top:1px solid rgba(255,255,255,.08);display:grid;gap:8px}.sidebar .link{border:0;background:transparent;color:#86b7bf;padding:0;text-align:left;cursor:pointer}.workspace{min-width:0}.topbar{display:flex;justify-content:space-between;align-items:center;padding:28px clamp(24px,4vw,52px) 8px}.topbar .eyebrow{margin:0 0 5px}.topbar h1{margin:0;font-size:34px}.health{padding:8px 12px;border-radius:999px;background:#e7f6ef;color:#28775d;font-size:12px;font-weight:800}.content{padding:20px clamp(24px,4vw,52px) 60px}.stats{display:grid;grid-template-columns:repeat(4,1fr);gap:13px}.stat,.card{background:#fff;border:1px solid #dce8ea;border-radius:20px;box-shadow:0 10px 32px rgba(27,70,80,.055)}.stat{padding:18px}.stat small{color:#799097;font-weight:700}.stat strong{display:block;font-size:29px;margin-top:7px}.card{padding:22px;margin-top:16px}.card h2{margin:0 0 5px}.muted{color:#789097}.row{display:flex;align-items:center;gap:12px;padding:12px 0;border-top:1px solid #edf2f3}.row:first-child{border-top:0}.grow{flex:1;min-width:0}.row small{display:block;color:#82979d;margin-top:3px}.badge{display:inline-flex;border-radius:999px;padding:4px 8px;background:#edf6f7;color:#2e7480;font-size:11px;font-weight:800}.badge.offline{background:#f6eeee;color:#9b5454}.actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.secondary,.danger{border:0;border-radius:12px;padding:9px 12px;cursor:pointer;font-weight:800}.secondary{background:#edf4f5;color:#42666e}.danger{background:#fff0f0;color:#a13e3e}.button{text-decoration:none;display:inline-block}.grid{display:grid;gap:12px}.grid.two{grid-template-columns:1fr 1fr}.grid.three{grid-template-columns:repeat(3,1fr)}.card label,.dialog-card label{display:grid;gap:6px;color:#4c6870;font-weight:700}.card input,.card select,.card textarea,.dialog-card input,.dialog-card select,.dialog-card textarea{border:1px solid #d4e2e4;border-radius:12px;padding:10px 12px;background:#fff;outline:0}.card textarea,.dialog-card textarea{min-height:110px;resize:vertical}.app-mode{display:flex;align-items:center;gap:9px}.app-mode select{min-width:110px}.notice{margin:14px clamp(24px,4vw,52px) 0;padding:12px 14px;border-radius:13px;background:#fff2dd;color:#805d23}.loading{padding:50px;text-align:center;color:#789197}.empty{padding:24px;text-align:center;color:#82969c}.toast{position:fixed;left:50%;bottom:28px;transform:translateX(-50%);background:#153d45;color:white;padding:10px 16px;border-radius:999px;box-shadow:0 15px 40px rgba(0,0,0,.2);z-index:50}dialog{border:0;border-radius:20px;padding:0;box-shadow:0 30px 90px rgba(15,41,48,.25);max-width:min(720px,calc(100vw - 30px))}dialog::backdrop{background:rgba(11,28,33,.35)}.dialog-card{padding:24px;min-width:min(620px,calc(100vw - 30px));position:relative}.dialog-close{position:absolute;right:16px;top:14px;border:0;background:transparent;color:#6e878d;font-size:28px;cursor:pointer}.permission-grid{border:1px solid #dce8ea;border-radius:14px;padding:14px;margin:16px 0;display:grid;grid-template-columns:repeat(3,1fr);gap:10px}.permission-grid legend{padding:0 7px;color:#47636b;font-weight:800}.permission-grid label,.check-row{display:flex;align-items:center;gap:8px!important;font-weight:700}.permission-grid input,.check-row input{width:auto}.smtp-grid{display:grid;grid-template-columns:2fr .7fr 1fr;gap:12px}.smtp-actions{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-top:14px}.user-summary{display:flex;gap:6px;flex-wrap:wrap;margin-top:5px}.user-summary .badge{font-size:10px}@media(max-width:1000px){.stats{grid-template-columns:repeat(2,1fr)}.grid.three,.permission-grid{grid-template-columns:1fr 1fr}.smtp-grid{grid-template-columns:1fr 1fr}}@media(max-width:760px){.admin-app{display:block}.sidebar{position:static;height:auto;padding:12px}.sidebar .logo,.sidebar footer{display:none}.sidebar nav{display:flex;overflow:auto;margin:0}.sidebar nav button{white-space:nowrap}.topbar{padding:22px 16px 6px}.content{padding:14px 14px 45px}.stats{grid-template-columns:1fr 1fr;gap:8px}.grid.two,.grid.three,.permission-grid,.smtp-grid{grid-template-columns:1fr}.row{align-items:flex-start}.actions{justify-content:flex-start}.dialog-card{min-width:min(100%,calc(100vw - 30px))}}

/* App Hub / Workspace — progressive UI layer; existing application behavior remains in platform.js. */
body.hub-ui{--hub-navy:#081a35;--hub-blue:#2563eb;--hub-cyan:#0ba7c4;--hub-ink:#10233f;--hub-muted:#66758a;--hub-bg:#f5f8fc;--hub-line:#dde7f2;background:var(--hub-bg);color:var(--hub-ink)}
body.hub-ui .admin-app{grid-template-columns:218px minmax(0,1fr);background:var(--hub-bg)}
body.hub-ui .sidebar{background:linear-gradient(180deg,#07162d 0%,#0b2142 100%);padding:24px 14px;border-right:1px solid rgba(255,255,255,.05)}
body.hub-ui .sidebar .logo{padding:3px 8px 24px;gap:12px}
body.hub-ui .sidebar .logo>span{width:40px;height:40px;border-radius:12px;background:linear-gradient(145deg,var(--hub-blue),var(--hub-cyan));box-shadow:0 10px 30px rgba(11,167,196,.2)}
body.hub-ui .sidebar .logo b{letter-spacing:-.02em}body.hub-ui .sidebar .logo small{color:#82a0c4}
body.hub-ui .hub-nav-label{padding:0 12px 8px;color:#6885aa;font-size:10px;letter-spacing:.16em;font-weight:900}
body.hub-ui .sidebar nav{gap:7px;margin-top:8px}
body.hub-ui .sidebar nav button{position:relative;padding:11px 12px 11px 40px;border:1px solid transparent;border-radius:11px;color:#9bb0ca;font-weight:750}
body.hub-ui .sidebar nav button::before{content:attr(data-icon);position:absolute;left:13px;top:50%;transform:translateY(-50%);display:grid;place-items:center;width:18px;height:18px;color:#6fc4df;font-size:15px}
body.hub-ui .sidebar nav button:hover{background:rgba(255,255,255,.055);color:#fff;border-color:rgba(255,255,255,.04)}
body.hub-ui .sidebar nav button.active{background:linear-gradient(135deg,rgba(37,99,235,.24),rgba(11,167,196,.12));border-color:rgba(111,196,223,.18);color:#fff}
body.hub-ui .hub-source-app{display:none!important}
body.hub-ui .sidebar footer{color:#a6bad1}body.hub-ui .sidebar .link{color:#7fbcd1}
body.hub-ui .workspace{background:radial-gradient(circle at 90% 0,rgba(37,99,235,.07),transparent 26%),var(--hub-bg)}
body.hub-ui .topbar{position:sticky;top:0;z-index:20;min-height:88px;padding:20px clamp(22px,3.5vw,48px);background:rgba(248,251,255,.9);border-bottom:1px solid rgba(221,231,242,.85);backdrop-filter:blur(18px)}
body.hub-ui .topbar>div:first-of-type{min-width:0}body.hub-ui .topbar .eyebrow{color:#52719a;font-size:10px;letter-spacing:.17em}body.hub-ui .topbar h1{font-size:30px;letter-spacing:-.035em;color:var(--hub-ink)}
body.hub-ui .health{background:#e9f8f2;color:#147156;border:1px solid #d5efe5}
body.hub-ui .hub-back{align-self:center;border:1px solid var(--hub-line);border-radius:11px;background:#fff;color:#36526f;padding:9px 12px;font-weight:800;cursor:pointer;margin-right:14px;box-shadow:0 5px 16px rgba(30,67,111,.04)}
body.hub-ui .hub-back span{margin-right:5px;color:var(--hub-blue)}
body.hub-ui .content{width:min(1340px,100%);padding:28px clamp(22px,3.5vw,48px) 64px}
body.hub-ui .stat,body.hub-ui .card{border-color:var(--hub-line);box-shadow:0 10px 30px rgba(32,73,124,.055)}
body.hub-ui .stats{gap:12px}body.hub-ui .stat{position:relative;padding:16px 17px;border-radius:16px;overflow:hidden}body.hub-ui .stat::before{content:"";position:absolute;left:0;top:0;bottom:0;width:3px;background:linear-gradient(var(--hub-blue),var(--hub-cyan))}
body.hub-ui .stat small{color:#75869a;font-size:11px}body.hub-ui .stat strong{margin-top:5px;color:#142b4a;font-size:25px;letter-spacing:-.03em}
body.hub-ui .card{border-radius:18px;padding:22px}body.hub-ui .card h2{color:#142b4a;letter-spacing:-.02em}body.hub-ui .muted{color:var(--hub-muted)}
body.hub-ui .primary,body.hub-ui .button{background:linear-gradient(135deg,var(--hub-blue),#187eaf);border-radius:11px;box-shadow:0 8px 20px rgba(37,99,235,.14)}
body.hub-ui .secondary{background:#edf3fa;color:#38556f}
body.hub-ui input:focus,body.hub-ui select:focus,body.hub-ui textarea:focus{border-color:#85aaf2!important;box-shadow:0 0 0 3px rgba(37,99,235,.09)}
body.hub-ui .hub-app-section{padding:0;margin-top:24px;background:transparent;border:0;box-shadow:none}
body.hub-ui .hub-app-section>h2{font-size:24px;margin-bottom:4px}body.hub-ui .hub-app-section>.muted{margin-top:0;margin-bottom:16px;max-width:720px}
body.hub-ui .hub-app-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}
body.hub-ui .hub-app-card{min-height:188px;display:grid;grid-template-columns:52px minmax(0,1fr);grid-template-rows:auto 1fr auto;gap:0 14px;padding:20px;border:1px solid var(--hub-line)!important;border-radius:18px;background:#fff;box-shadow:0 10px 28px rgba(31,71,119,.045);transition:transform .16s ease,box-shadow .16s ease,border-color .16s ease}
body.hub-ui .hub-app-card:hover{transform:translateY(-2px);border-color:#c7d9ed!important;box-shadow:0 18px 42px rgba(31,71,119,.09)}
body.hub-ui .hub-app-icon{grid-row:1/3;display:grid;place-items:center;width:48px;height:48px;border-radius:14px;background:linear-gradient(145deg,#edf4ff,#e9faff);color:var(--hub-blue);border:1px solid #dbe9fb;font-size:19px;font-weight:900}
body.hub-ui .hub-app-card .grow{align-self:start}body.hub-ui .hub-app-card .grow b{display:block;color:#102847;font-size:17px;margin-top:2px}body.hub-ui .hub-app-card .grow small{font-size:11px;line-height:1.45}
body.hub-ui .hub-app-description{margin-top:8px!important;color:#51677f!important;font-size:12px!important;line-height:1.45!important}
body.hub-ui .hub-app-card .hub-status{grid-column:1;grid-row:3;justify-self:start;align-self:end;margin-top:18px}
body.hub-ui .hub-app-action{grid-column:2;grid-row:3;justify-self:end;align-self:end;margin-top:18px;background:#eef4fb;color:#28526f;border:1px solid #e0eaf5;padding:9px 11px}
body.hub-ui .hub-app-action:hover{background:#e5effa}
body.hub-ui .hub-activity-card{margin-top:26px}
body.hub-ui .hub-workspace{position:relative}
body.hub-ui .workspace-subnav{display:flex;gap:5px;padding:5px;margin:0 0 18px;border:1px solid var(--hub-line);border-radius:14px;background:rgba(255,255,255,.82);box-shadow:0 8px 24px rgba(32,73,124,.04);overflow-x:auto;scrollbar-width:none}
body.hub-ui .workspace-subnav::-webkit-scrollbar{display:none}body.hub-ui .workspace-subnav button{border:0;background:transparent;color:#6a7c91;border-radius:10px;padding:9px 13px;font-weight:800;font-size:12px;white-space:nowrap;cursor:pointer}
body.hub-ui .workspace-subnav button:hover{background:#f0f5fb;color:#334e69}body.hub-ui .workspace-subnav button.active{background:#102b50;color:#fff;box-shadow:0 5px 14px rgba(16,43,80,.14)}
body.hub-ui .hub-overview-card,body.hub-ui .hub-contact-card{margin-top:16px}
body.hub-ui .hub-overview-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:18px}body.hub-ui .hub-overview-heading .eyebrow{margin:0 0 5px;color:#58789e}body.hub-ui .hub-overview-heading h2{font-size:23px;margin:0 0 6px}
body.hub-ui .workspace-quick-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px;margin-top:22px}
body.hub-ui .workspace-quick-grid button{min-width:0;text-align:left;border:1px solid #e0e9f4;border-radius:14px;background:#fbfdff;padding:15px;cursor:pointer;transition:.15s ease}
body.hub-ui .workspace-quick-grid button:hover{background:#f3f8ff;border-color:#cdddf0;transform:translateY(-1px)}body.hub-ui .workspace-quick-grid button>span{display:grid;place-items:center;width:30px;height:30px;border-radius:9px;background:#eaf3ff;color:var(--hub-blue);font-weight:900;margin-bottom:12px}body.hub-ui .workspace-quick-grid b{display:block;color:#173353;margin-bottom:4px}body.hub-ui .workspace-quick-grid small{display:block;color:#718196;font-size:11px;line-height:1.4}
body.hub-ui .hub-contact-count{display:flex;align-items:baseline;gap:10px;margin-top:24px;padding:17px;border:1px solid #e0e9f4;border-radius:14px;background:#f8fbff}body.hub-ui .hub-contact-count strong{font-size:30px;color:var(--hub-blue)}body.hub-ui .hub-contact-count span{color:#66798f;font-weight:700}
body.hub-ui #cvLayoutControl{border-color:#d5e2f2;background:linear-gradient(135deg,#fff,#f6faff)}
body.hub-ui #cvLayoutControl select{min-width:230px}
@media(max-width:1120px){body.hub-ui .hub-app-grid{grid-template-columns:repeat(2,minmax(0,1fr))}body.hub-ui .workspace-quick-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:820px){body.hub-ui .admin-app{display:block}body.hub-ui .sidebar{position:sticky;top:0;z-index:30;height:auto;padding:10px 12px;background:#081a35}body.hub-ui .sidebar .logo,body.hub-ui .sidebar footer{display:none}body.hub-ui .sidebar nav{display:flex;margin:0;overflow:auto}body.hub-ui .sidebar nav .hub-nav-label{display:none}body.hub-ui .sidebar nav button{flex:0 0 auto;padding:9px 12px 9px 34px;white-space:nowrap}body.hub-ui .topbar{top:51px;min-height:74px;padding:14px 16px}body.hub-ui .topbar h1{font-size:25px}body.hub-ui .content{padding:18px 14px 46px}body.hub-ui .hub-back{margin-right:8px;padding:8px 9px}body.hub-ui .workspace-quick-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:620px){body.hub-ui .hub-app-grid{grid-template-columns:1fr}body.hub-ui .hub-app-card{min-height:166px}body.hub-ui .workspace-quick-grid{grid-template-columns:1fr 1fr}body.hub-ui .hub-overview-heading{display:grid}body.hub-ui .hub-overview-heading .button{justify-self:start}body.hub-ui .stats{grid-template-columns:1fr 1fr}body.hub-ui .stat{padding:13px}body.hub-ui .stat strong{font-size:21px}body.hub-ui .topbar .health{display:none}}

/* UI/UX audit hardening — additive only; preserves Control Center behavior. */
body.hub-ui button,body.hub-ui .button,body.hub-ui select{min-height:44px}
body.hub-ui input:not([type="checkbox"]):not([type="radio"]){min-height:44px}
body.hub-ui :where(button,a,input,select,textarea):focus-visible{outline:3px solid rgba(37,99,235,.3);outline-offset:2px}
body.hub-ui input[name$="_ar"],body.hub-ui textarea[name$="_ar"]{direction:rtl;text-align:right}
body.hub-ui .sidebar nav,body.hub-ui .workspace-subnav{scroll-snap-type:x proximity;overscroll-behavior-inline:contain}
body.hub-ui .sidebar nav button,body.hub-ui .workspace-subnav button{scroll-snap-align:start}
@media(max-width:820px){body.hub-ui .sidebar{padding:8px 12px}body.hub-ui .sidebar nav{scrollbar-width:none;-webkit-overflow-scrolling:touch}body.hub-ui .sidebar nav::-webkit-scrollbar{display:none}body.hub-ui .topbar{top:60px}}
@media(prefers-reduced-motion:reduce){body.hub-ui *,body.hub-ui *::before,body.hub-ui *::after{scroll-behavior:auto!important;transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!important}body.hub-ui .hub-app-card:hover,body.hub-ui .workspace-quick-grid button:hover{transform:none}}
