/* WOTTT 04.55.2 r15 — Elegant Settings & Administration.
   Presentation-only CSS. No API, branch, membership, credentials, provider,
   SLA, routing, templates or user preference behavior is changed.
   Existing forms and approval/reconciliation controls remain authoritative. */

.settings-shell {
 --st-blue:#5b86ec;--st-violet:#8e72cf;--st-teal:#2f9f8b;
 --st-amber:#cf9148;--st-rose:#cf6a75;
 --st-border:color-mix(in srgb,var(--line) 91%,var(--st-blue));
 --st-shadow:0 8px 24px rgba(36,64,106,.055);
 grid-template-columns:54px 205px minmax(0,1fr);
 width:100%;max-width:100%;height:100dvh;min-height:0;
}
.settings-shell .sw-nav {
 background:linear-gradient(180deg,color-mix(in srgb,var(--st-blue) 4%,var(--surface)),var(--surface) 50%);
 border-right:1px solid var(--st-border);padding:18px 12px;
 min-width:0;min-height:0;
}
.settings-shell .sw-nav-title {
 font-size:15px;font-weight:780;letter-spacing:-.28px;margin:3px 10px 18px;
 color:var(--text);
}
.settings-shell .sw-nav nav{gap:5px}
.settings-shell .sw-nav button {
 position:relative;min-width:0;padding:10px 11px;border-radius:11px;
 font-size:12px;font-weight:570;line-height:1.3;
 transition:background-color .15s ease,color .15s ease;
}
.settings-shell .sw-nav button .ui-icon {width:16px;height:16px;flex:none}
.settings-shell .sw-nav button:not(.active):hover{background:color-mix(in srgb,var(--st-blue) 7%,var(--surface));color:var(--text)}
.settings-shell .sw-nav button.active {
 color:#366bd3;
 background:color-mix(in srgb,var(--st-blue) 10%,var(--surface));
 font-weight:760;
}
.settings-shell .sw-nav button.active::before {
 content:"";position:absolute;left:0;top:19%;height:62%;width:3px;
 border-radius:6px;background:linear-gradient(var(--st-blue),var(--st-violet));
}
.settings-shell button:focus-visible,.settings-shell a:focus-visible,
.settings-shell input:focus-visible,.settings-shell select:focus-visible,
.settings-shell textarea:focus-visible {
 outline:2px solid var(--st-blue);outline-offset:2px;
}
.settings-shell .sw-main {
 width:100%;min-width:0;min-height:0;overflow:hidden;
 background:linear-gradient(180deg,color-mix(in srgb,var(--st-blue) 3%,var(--bg)),var(--bg) 38%);
 grid-template-rows:auto auto minmax(0,1fr);
}
.settings-shell .sw-top {
 position:relative;align-items:center;flex-wrap:wrap;
 padding:19px 24px 17px;gap:10px;
 border-bottom:1px solid var(--st-border);
}
.settings-shell .sw-top h1 {
 position:relative;padding-left:15px;font-size:24px;font-weight:780;
 letter-spacing:-.65px;line-height:1.2;color:var(--text);
}
.settings-shell .sw-top h1::before {
 content:"";position:absolute;left:0;top:2px;bottom:1px;width:5px;
 border-radius:8px;background:linear-gradient(180deg,var(--st-blue),var(--st-violet));
}
.settings-shell .sw-top p{font-size:12px;line-height:1.5;margin:7px 0 0;color:var(--muted)}
.settings-shell .sw-top-meta{font-size:11px}
.settings-shell .sw-controls {
 padding:12px 24px;min-height:64px;gap:10px;
 background:color-mix(in srgb,var(--st-blue) 2%,var(--surface));
 border-color:var(--st-border);
}
.settings-shell .sw-controls select{min-width:min(245px,100%);font-weight:650}
.settings-shell .sw-scroll{min-width:0;min-height:0;padding:20px 24px 32px;overscroll-behavior:contain}
.settings-shell .sw-body{gap:18px;min-width:0}
.settings-shell .sw-hero,.settings-shell .sw-panel,.settings-shell .sw-stat {
 border-radius:15px;border-color:var(--st-border);
 box-shadow:var(--st-shadow);min-width:0;
}
.settings-shell .sw-hero {
 position:relative;isolation:isolate;overflow:hidden;align-items:center;
 min-height:130px;padding:24px 26px;
 background:linear-gradient(108deg,color-mix(in srgb,var(--st-blue) 11%,var(--surface)),var(--surface) 65%);
}
.settings-shell .sw-hero::after {
 content:"";position:absolute;z-index:-1;right:-35px;top:-65px;
 width:210px;height:210px;border-radius:50%;
 background:color-mix(in srgb,var(--st-violet) 8%,transparent);
}
.settings-shell .sw-hero .eyebrow{color:#547ce3;font-size:10px;font-weight:800;letter-spacing:.11em}
.settings-shell .sw-hero h2{font-size:23px;font-weight:790;letter-spacing:-.55px;margin:7px 0 3px}
.settings-shell .sw-hero p{font-size:12px}
.settings-shell .sw-status {
 display:inline-flex;align-items:center;justify-content:center;
 white-space:normal;line-height:1.35;font-weight:740;
 font-size:10px;padding:6px 11px;
}
.settings-shell .sw-stat-grid{gap:12px}
.settings-shell .sw-stat {
 --metric:var(--st-blue);
 position:relative;isolation:isolate;overflow:hidden;
 min-height:112px;display:flex;flex-direction:column;justify-content:center;
 padding:16px 19px;background:var(--surface);
 border-left:4px solid var(--metric);
}
.settings-shell .sw-stat::before {
 content:"";position:absolute;z-index:-1;right:-33px;top:-48px;
 width:108px;height:108px;border-radius:50%;
 background:color-mix(in srgb,var(--metric) 11%,transparent);
}
.settings-shell .sw-stat-grid>.sw-stat:nth-child(4n+2){--metric:var(--st-violet)}
.settings-shell .sw-stat-grid>.sw-stat:nth-child(4n+3){--metric:var(--st-teal)}
.settings-shell .sw-stat-grid>.sw-stat:nth-child(4n+4){--metric:var(--st-amber)}
.settings-shell .sw-stat span {
 font-size:10px;font-weight:760;letter-spacing:.025em;color:var(--muted);
}
.settings-shell .sw-stat strong {
 color:var(--text);font-size:24px;line-height:1.2;font-weight:800;
 overflow-wrap:anywhere;letter-spacing:-.45px;margin:7px 0 3px;
}
.settings-shell .sw-stat small{font-size:10px;line-height:1.4}
.settings-shell .sw-two{gap:16px;grid-template-columns:repeat(2,minmax(0,1fr))}
.settings-shell .sw-panel{padding:20px 21px;background:var(--surface)}
.settings-shell .sw-panel>header {
 align-items:center;gap:12px;flex-wrap:wrap;
 padding:1px 0 15px;margin-bottom:17px;
 border-bottom:1px solid var(--st-border);
}
.settings-shell .sw-panel>header h2{font-size:16px;font-weight:780;letter-spacing:-.3px;color:var(--text)}
.settings-shell .sw-panel>header p{font-size:11px;line-height:1.55;max-width:860px;margin-top:5px}
.settings-shell .sw-panel>header>div{min-width:0}
.settings-shell .sw-kv{gap:10px;grid-template-columns:repeat(2,minmax(0,1fr))}
.settings-shell .sw-kv>div {
 background:color-mix(in srgb,var(--st-blue) 3%,var(--surface-2));
 border:1px solid var(--st-border);
 border-radius:10px;padding:13px 15px;min-width:0;
}
.settings-shell .sw-kv dt{font-size:10px;font-weight:670;color:var(--muted)}
.settings-shell .sw-kv dd{font-size:12px;line-height:1.45;margin-top:5px;overflow-wrap:anywhere}
.settings-shell .sw-hours>div{padding:9px 4px;font-size:12px;gap:12px}
.settings-shell .sw-hours>div:last-child{border-bottom:0}
.settings-shell .sw-hours strong{font-weight:690}
.settings-shell .sw-holidays{grid-template-columns:repeat(auto-fit,minmax(min(100%,290px),1fr));gap:11px}
.settings-shell .sw-holidays article{
 border:1px solid var(--st-border);border-radius:11px;
 background:var(--surface-2);padding:14px;flex-wrap:wrap;
}
.settings-shell .sw-holidays article strong{font-size:12px}
.settings-shell .sw-holidays article span{font-size:10px;margin-top:5px}
.settings-shell .sw-table{min-width:0}
.settings-shell .sw-table-head{background:color-mix(in srgb,var(--st-blue) 4%,var(--surface-2));border-radius:9px 9px 0 0}
.settings-shell .sw-table-head,.settings-shell .sw-table-row{padding:13px 12px;gap:10px;font-size:11px}
.settings-shell .sw-table-row:nth-child(odd){background:color-mix(in srgb,var(--st-blue) 2%,var(--surface))}
.settings-shell .sw-table-row:last-child{border-bottom:0}
.settings-shell .sw-team{gap:10px}
.settings-shell .sw-team article,.settings-shell .sw-routing-members>article {
 border-radius:12px;border:1px solid var(--st-border);padding:16px;
 gap:14px;background:var(--surface);
 box-shadow:0 4px 14px rgba(42,73,115,.035);
}
.settings-shell .sw-team article:nth-child(even){background:color-mix(in srgb,var(--st-violet) 3%,var(--surface))}
.settings-shell .sw-person{min-width:0;gap:13px}
.settings-shell .sw-person .avatar{
 display:grid;place-items:center;flex:none;
 width:46px;height:46px;border-radius:14px;
 background:color-mix(in srgb,var(--st-blue) 13%,var(--surface));
 color:#4874d4;border:1px solid color-mix(in srgb,var(--st-blue) 22%,var(--line));
 font-weight:800;font-size:15px;
}
.settings-shell .sw-person>div{min-width:0;overflow-wrap:anywhere}
.settings-shell .sw-person strong{font-size:13px;font-weight:750}
.settings-shell .sw-person span,.settings-shell .sw-role span{font-size:11px;line-height:1.5;overflow-wrap:anywhere}
.settings-shell .sw-person small,.settings-shell .sw-role small{font-size:10px;line-height:1.5}
.settings-shell .sw-role strong{font-size:12px}
.settings-shell .sw-role-grid,.settings-shell .sw-branch-grid,.settings-shell .sw-channel-grid{gap:13px}
.settings-shell .sw-role-grid article,.settings-shell .sw-branch-grid article,.settings-shell .sw-channel-grid>article {
 border-radius:12px;padding:17px;border:1px solid var(--st-border);
 background:var(--surface);min-width:0;
}
.settings-shell .sw-role-grid article{border-top:3px solid var(--st-violet)}
.settings-shell .sw-role-grid article strong,.settings-shell .sw-branch-grid article strong{font-size:13px;line-height:1.4}
.settings-shell .sw-role-grid article span,.settings-shell .sw-branch-grid article span{font-size:11px;line-height:1.6}
.settings-shell .sw-role-grid article small{font-size:10px}
.settings-shell .sw-branch-grid article{border-top:3px solid var(--st-teal)}
.settings-shell .sw-branch-grid article.active{border-color:color-mix(in srgb,var(--st-blue) 45%,var(--line));border-top:3px solid var(--st-blue)}
.settings-shell .sw-branch-grid article em{font-size:10px;padding:5px 8px}
.settings-shell .sw-channel-admin>header{margin-bottom:15px}
.settings-shell .sw-channel-health-summary{gap:12px;margin-bottom:17px}
.settings-shell .sw-meta-compatibility{
 border-radius:11px;padding:14px;
 border-color:color-mix(in srgb,var(--st-blue) 15%,var(--line));
 background:color-mix(in srgb,var(--st-blue) 4%,var(--surface));font-size:11px;
}
.settings-shell .sw-meta-compatibility strong{font-size:11px;color:var(--text)}
.settings-shell .sw-admin-account-grid{gap:15px}
.settings-shell .sw-channel-admin-card {
 border:1px solid var(--st-border);border-radius:14px;padding:19px;
 background:var(--surface);min-width:0;overflow-wrap:anywhere;
 box-shadow:0 4px 15px rgba(38,74,111,.045);
}
.settings-shell .sw-channel-admin-card:nth-child(3n+1){border-top:3px solid var(--st-blue)}
.settings-shell .sw-channel-admin-card:nth-child(3n+2){border-top:3px solid var(--st-violet)}
.settings-shell .sw-channel-admin-card:nth-child(3n){border-top:3px solid var(--st-teal)}
.settings-shell .sw-health-grid{gap:10px}
.settings-shell .sw-channel-activity{gap:0}
.settings-shell .sw-channel-grid>article{border-top:3px solid var(--st-teal)}
.settings-shell .sw-channel-head strong{font-size:13px;font-weight:760}
.settings-shell .sw-accounts>div{padding-top:10px;gap:12px;flex-wrap:wrap}
.settings-shell .sw-account-row{padding:11px 0}
.settings-shell .sw-account-actions{gap:8px}
.settings-shell .sw-channel-security-note,
.settings-shell .sw-protected,.settings-shell .sw-protected-note,
.settings-shell .sw-routing-note{
 border:1px solid color-mix(in srgb,var(--st-blue) 18%,var(--line));
 border-radius:11px;background:color-mix(in srgb,var(--st-blue) 4%,var(--surface));
 padding:13px 15px;font-size:11px;line-height:1.55;
}
.settings-shell .sw-routing-summary{border-radius:12px;padding:17px;background:color-mix(in srgb,var(--st-teal) 5%,var(--surface))}
.settings-shell .sw-routing-summary>div{gap:5px}
.settings-shell .sw-routing-summary strong{font-size:18px;letter-spacing:-.25px}
.settings-shell .sw-routing-members-head{padding:15px 2px 5px}
.settings-shell .sw-reply-template-list{gap:12px}
.settings-shell .sw-reply-template-list>article{
 border:1px solid var(--st-border);border-left:3px solid var(--st-violet);
 border-radius:12px;padding:17px;background:var(--surface);
}
.settings-shell .sw-reply-template-list>article.inactive{border-left-color:var(--muted)}
.settings-shell .sw-reply-template-title{flex-wrap:wrap;gap:8px}
.settings-shell .sw-reply-template-title strong{font-size:13px}
.settings-shell .sw-reply-template-main p{font-size:11px;line-height:1.65}
.settings-shell .sw-reply-template-meta{gap:8px}
.settings-shell .sw-panel.profile{max-width:none}
.settings-shell .sw-panel.embedded .appearance-panel,
.settings-shell .sw-panel.embedded .activity-center{max-width:none;width:100%}
.settings-shell .sw-action-error,.settings-shell .sw-action-notice,
.settings-shell .sw-pending,.settings-shell .sw-warning{border-radius:11px;padding:14px;font-size:12px;line-height:1.55}
.settings-shell .sw-warning{border-color:color-mix(in srgb,var(--warning) 48%,var(--line))}
.settings-shell .sw-scope{font-size:10px;line-height:1.6;padding:7px 2px;color:var(--muted)}
.settings-shell .sw-empty{font-size:12px;line-height:1.5;padding:24px}
.settings-shell .sw-membership-form label{font-size:12px}
.settings-shell .sw-membership-form h3{font-size:16px}
.settings-shell .sw-membership-form>p{font-size:12px}
.settings-shell .sw-membership-form input,
.settings-shell .sw-membership-form textarea,
.settings-shell .sw-membership-form select{min-width:0;border-radius:9px}
/* Confirmation dialogs can be portalled outside Settings; scope through their existing form IDs. */
.action-dialog:has(#settings-membership-form),
.action-dialog:has(#settings-branch-details-form),
.action-dialog:has(#settings-business-hours-form),
.action-dialog:has(#settings-holiday-form),
.action-dialog:has(#settings-sla-form),
.action-dialog:has(#settings-channel-form),
.action-dialog:has(#settings-routing-form),
.action-dialog:has(#settings-reply-template-form),
.action-dialog:has(#settings-reply-template-retire-form),
.action-dialog:has(#settings-profile-form),
.action-dialog:has(.sw-credential-form){border-radius:16px}
/* Do not disguise destructive or provider-credential warnings as normal notices. */
.action-dialog .sw-warning,.action-dialog .sw-action-error,
.settings-shell .sw-action-error{border-color:color-mix(in srgb,var(--danger) 36%,var(--line));}
.settings-shell button.danger,.action-dialog button.danger{color:var(--danger)}
.settings-shell button:disabled,.action-dialog button:disabled{cursor:not-allowed;opacity:.55}

/* Preserve legible accent text against dark workspace surfaces. */
html[data-theme="dark"] .settings-shell .sw-nav button.active,
html[data-theme="dark"] .settings-shell .sw-person .avatar,
html[data-theme="dark"] .settings-shell .sw-hero .eyebrow {color:#a9c2ff}
html[data-theme="dark"] .settings-shell .sw-stat {
  box-shadow:0 7px 22px rgba(0,0,0,.14);
}

@media(max-width:1180px){
 .settings-shell{grid-template-columns:54px 174px minmax(0,1fr)}
 .settings-shell .sw-two{grid-template-columns:1fr}
 .settings-shell .sw-stat-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
 .settings-shell .sw-role-grid,.settings-shell .sw-branch-grid,.settings-shell .sw-channel-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
 .settings-shell .sw-admin-account-grid{grid-template-columns:1fr}
}
@media(max-width:780px){
 .settings-shell{grid-template-columns:54px minmax(0,1fr);grid-template-rows:auto minmax(0,1fr)}
 .settings-shell .sw-nav{grid-column:2;grid-row:1;overflow:auto;padding:8px 12px;border-right:0;border-bottom:1px solid var(--st-border)}
 .settings-shell .sw-nav-title{display:none}
 .settings-shell .sw-nav nav{display:flex;gap:4px;min-width:max-content}
 .settings-shell .sw-nav button{width:auto;white-space:nowrap;padding:9px 11px}
 .settings-shell .sw-nav button.active::before{left:8px;top:auto;bottom:0;height:3px;width:calc(100% - 16px)}
 .settings-shell .sw-main{grid-column:2;grid-row:2;min-width:0;min-height:0;max-height:calc(100dvh - 53px)}
 .settings-shell .sw-top{padding:13px 14px 12px}
 .settings-shell .sw-top h1{font-size:20px}
 .settings-shell .sw-top-meta{font-size:10px}
 .settings-shell .sw-controls{padding:9px 14px;min-height:54px}
 .settings-shell .sw-controls select{min-width:0;width:100%;max-width:330px}
 .settings-shell .sw-scroll{padding:14px 13px 24px}
 .settings-shell .sw-hero{padding:19px;min-height:112px}
 .settings-shell .sw-hero h2{font-size:19px}
 .settings-shell .sw-role-grid,.settings-shell .sw-branch-grid,.settings-shell .sw-channel-grid{grid-template-columns:1fr}
 .settings-shell .sw-panel{padding:16px}
 .settings-shell .sw-kv{grid-template-columns:1fr}
 .settings-shell .sw-channel-health-summary,.settings-shell .sw-health-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
 .settings-shell .sw-team article,.settings-shell .sw-routing-members>article{grid-template-columns:1fr}
 .settings-shell .sw-role{text-align:left}
 .settings-shell .sw-manage{justify-self:start}
 .settings-shell .sw-table{overflow:auto}
 .settings-shell .sw-table-head,.settings-shell .sw-table-row{min-width:660px}
}
@media(max-width:490px){
 .settings-shell .sw-top{align-items:flex-start}
 .settings-shell .sw-top-meta{width:100%}
 .settings-shell .sw-controls{align-items:stretch}
 .settings-shell .sw-stat-grid,.settings-shell .sw-channel-health-summary,.settings-shell .sw-health-grid{grid-template-columns:1fr}
 .settings-shell .sw-hero{align-items:flex-start;flex-wrap:wrap}
 .settings-shell .sw-panel>header{align-items:flex-start}
 .settings-shell .sw-form-actions{flex-wrap:wrap;justify-content:stretch}
 .settings-shell .sw-form-actions>button{flex:1}
 .settings-shell .sw-channel-admin-card{padding:15px}
 .settings-shell .sw-reply-template-list>article{grid-template-columns:1fr}
 .settings-shell .sw-reply-template-actions{justify-content:flex-start}
}
@media(prefers-reduced-motion:reduce){
 .settings-shell .sw-nav button{transition:none}
}
