/*
|--------------------------------------------------------------------------
| AGS Admin - CRM Shell v13 (v1.6.2.4)
|--------------------------------------------------------------------------
| Salesforce-inspired desktop shell: brand + global search on the left,
| operational tools on the right, and a persistent workspace tab strip below.
| All existing AGS functions stay reachable: search remains clickable, Timer keeps
| direct controls, the topbar grid opens modules, and + in the tab strip opens clients.
*/
[x-cloak] { display: none !important; }

:root {
    --ags-ui-blue: #2563eb;
    --ags-ui-blue-strong: #1d4ed8;
    --ags-ui-blue-soft: #eff6ff;
    --ags-ui-ink: #17324d;
    --ags-ui-muted: #64748b;
    --ags-ui-line: #dbe4ef;
    --ags-ui-line-soft: #e8eef5;
    --ags-ui-hover: #f5f8fc;
    --ags-ui-canvas: #f6f8fb;
    --ags-ui-green: #16a34a;
}

.fi-topbar {
    background: rgba(255, 255, 255, .985) !important;
    border-bottom: 1px solid var(--ags-ui-line) !important;
    box-shadow: 0 2px 10px rgba(15, 23, 42, .045) !important;
    backdrop-filter: blur(12px);
}

.fi-topbar .fi-logo {
    background: transparent !important;
    border-radius: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
}

.fi-dropdown-panel {
    background: #fff !important;
    color: var(--ags-ui-ink) !important;
    border: 1px solid var(--ags-ui-line) !important;
    border-radius: 12px !important;
    box-shadow: 0 16px 42px rgba(15, 23, 42, .14), 0 2px 7px rgba(15, 23, 42, .05) !important;
    padding: 0 !important;
    overflow: hidden !important;
}

.fi-dropdown-panel .fi-dropdown-list {
    padding: 7px !important;
}

.fi-dropdown-panel .fi-dropdown-list-item {
    background: transparent !important;
    color: #334155 !important;
    border-radius: 8px !important;
    opacity: 1 !important;
}

.fi-dropdown-panel .fi-dropdown-list-item .fi-dropdown-list-item-label,
.fi-dropdown-panel .fi-dropdown-list-item .fi-icon,
.fi-dropdown-panel .fi-dropdown-list-item svg {
    color: inherit !important;
    opacity: 1 !important;
    stroke: currentColor !important;
}

.fi-dropdown-panel .fi-dropdown-list-item:hover,
.fi-dropdown-panel .fi-dropdown-list-item:focus,
.fi-dropdown-panel .fi-dropdown-list-item:focus-visible {
    background: var(--ags-ui-hover) !important;
    color: #0f3f75 !important;
}

/* -----------------------------------------------------------------------
| Desktop topbar
| --------------------------------------------------------------------- */
@media (min-width: 1024px) {
    .fi-topbar {
        display: flex !important;
        align-items: center !important;
        min-height: 4.2rem !important;
        padding-inline: clamp(.9rem, 1.7vw, 1.85rem) !important;
        gap: 1rem !important;
    }

    .fi-topbar-start {
        display: flex !important;
        align-items: center !important;
        gap: clamp(1rem, 2vw, 2.2rem) !important;
        flex: 1 1 auto !important;
        min-width: 0 !important;
        margin: 0 !important;
    }

    .fi-topbar-start > a {
        display: inline-flex !important;
        align-items: center !important;
        flex: 0 0 auto !important;
    }

    /* The old six navigation dropdowns are intentionally removed from the
       desktop chrome. Every permitted module remains available from the
       dedicated Module button in the topbar. */
    .fi-topbar-nav-groups {
        display: none !important;
    }

    .fi-topbar-end {
        display: flex !important;
        align-items: center !important;
        justify-content: flex-end !important;
        flex: 0 0 auto !important;
        min-width: 0 !important;
        width: auto !important;
        margin: 0 !important;
        gap: .45rem !important;
        position: static !important;
    }
}

/* Global search next to logo. */
.ags-top-search {
    display: flex;
    align-items: center;
    gap: .55rem;
    width: clamp(16rem, 22vw, 21rem);
    min-width: 0;
    min-height: 2.45rem;
    padding: .38rem .5rem .38rem .72rem;
    border: 1px solid var(--ags-ui-line);
    border-radius: .62rem;
    background: #fff;
    color: #52657d;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .025);
    transition: border-color .15s ease, box-shadow .15s ease;
}

.ags-top-search:focus-within {
    border-color: #93b4f7;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .10);
}

.ags-top-search-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    flex: 0 0 1.25rem;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: .3rem;
    background: transparent;
    color: #73869f;
    cursor: pointer;
}

.ags-top-search-submit:hover,
.ags-top-search-submit:focus-visible {
    background: #eff6ff;
    color: #1d4ed8;
    outline: 0;
}

.ags-top-search-submit svg {
    width: .95rem;
    height: .95rem;
}

.ags-top-search-input {
    min-width: 0;
    width: 100%;
    border: 0 !important;
    outline: 0 !important;
    background: transparent !important;
    color: #17324d !important;
    padding: 0 !important;
    font-size: .76rem;
    line-height: 1.2rem;
    box-shadow: none !important;
}

.ags-top-search-input::placeholder {
    color: #7f8fa5;
    opacity: 1;
}

.ags-top-search-kbd {
    flex: 0 0 auto;
    border: 1px solid #e4eaf1;
    border-radius: .35rem;
    background: #f8fafc;
    color: #8a99ad;
    padding: .12rem .3rem;
    font-size: .58rem;
    line-height: 1;
    font-family: inherit;
    box-shadow: inset 0 -1px 0 rgba(15, 23, 42, .04);
}

/* Tools after timer. */
.ags-topbar-tools {
    display: flex;
    align-items: center;
    gap: .42rem;
}

.ags-topbar-icon-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.28rem;
    height: 2.28rem;
    flex: 0 0 2.28rem;
    border: 1px solid transparent;
    border-radius: .58rem;
    background: transparent;
    color: #64748b;
    text-decoration: none;
    transition: background .15s ease, color .15s ease, border-color .15s ease, transform .15s ease;
}

.ags-topbar-icon-btn:hover,
.ags-topbar-icon-btn:focus-visible {
    background: #f4f7fb;
    border-color: #e2e8f0;
    color: #1f4f83;
    outline: 0;
}

.ags-topbar-icon-btn svg {
    width: 1.08rem;
    height: 1.08rem;
}

.ags-topbar-modules {
    border-color: #dfe6ee;
    background: #fff;
    color: #536b85;
}

.ags-topbar-modules:hover,
.ags-topbar-modules:focus-visible {
    border-color: #aec4df;
    background: #f6f9fd;
    color: #174f8c;
}

.ags-topbar-create {
    border-color: #1e5bd5;
    background: #1464dc;
    color: #fff;
    box-shadow: 0 3px 8px rgba(37, 99, 235, .18);
}

.ags-topbar-create:hover,
.ags-topbar-create:focus-visible {
    background: #0f56c7;
    border-color: #0f56c7;
    color: #fff;
    transform: translateY(-1px);
}

.ags-topbar-badge {
    position: absolute;
    right: -.2rem;
    top: -.28rem;
    min-width: 1rem;
    height: 1rem;
    padding: 0 .2rem;
    border: 2px solid #fff;
    border-radius: 999px;
    background: #dc2626;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .51rem;
    line-height: 1;
    font-weight: 850;
}

.ags-topbar-user-meta {
    display: grid;
    gap: .02rem;
    min-width: 8.7rem;
    max-width: 12rem;
    margin-left: .28rem;
    padding-left: .88rem;
    border-left: 1px solid var(--ags-ui-line-soft);
    text-align: right;
    line-height: 1.15;
}

.ags-topbar-user-meta strong,
.ags-topbar-user-meta span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ags-topbar-user-meta strong {
    color: #233a55;
    font-size: .7rem;
    font-weight: 800;
}

.ags-topbar-user-meta span {
    color: #8090a5;
    font-size: .57rem;
    font-weight: 650;
}

.fi-topbar-end .fi-user-menu-trigger {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: .2rem !important;
    width: 2.72rem !important;
    height: 2.35rem !important;
    padding: .12rem .22rem .12rem .12rem !important;
    border: 1px solid transparent !important;
    border-radius: .62rem !important;
}

.fi-topbar-end .fi-user-menu-trigger::after {
    content: "";
    width: .34rem;
    height: .34rem;
    flex: 0 0 .34rem;
    margin-top: -.12rem;
    border-right: 1.4px solid #7b8ca1;
    border-bottom: 1.4px solid #7b8ca1;
    transform: rotate(45deg);
}

.fi-topbar-end .fi-user-menu-trigger:hover {
    background: #f4f7fb !important;
    border-color: #e2e8f0 !important;
}

.fi-topbar-end .fi-user-menu-trigger .fi-avatar {
    width: 1.85rem !important;
    height: 1.85rem !important;
}

/* Topbar dropdown content. */
.ags-topbar-menu {
    width: min(21rem, calc(100vw - 2rem));
    background: #fff;
}

.ags-topbar-menu-heading {
    display: grid;
    gap: .15rem;
    padding: .8rem .9rem .72rem;
    border-bottom: 1px solid #edf1f5;
    background: #fbfcfe;
}

.ags-topbar-menu-heading strong {
    color: #17324d;
    font-size: .77rem;
    font-weight: 850;
}

.ags-topbar-menu-heading span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #8190a4;
    font-size: .64rem;
}

.ags-topbar-menu-list {
    display: grid;
    gap: .12rem;
    padding: .42rem;
    max-height: min(29rem, 70vh);
    overflow-y: auto;
}

.ags-topbar-menu-item {
    display: flex;
    align-items: center;
    gap: .62rem;
    min-height: 2.35rem;
    padding: .5rem .6rem;
    border-radius: .52rem;
    color: #40536a;
    text-decoration: none;
    font-size: .7rem;
    font-weight: 700;
}

.ags-topbar-menu-item:hover {
    background: #f4f7fb;
    color: #174f8c;
}

.ags-topbar-menu-item svg {
    width: 1rem;
    height: 1rem;
    flex: 0 0 auto;
    color: #6783a3;
}

.ags-topbar-menu-item > strong {
    margin-left: auto;
    color: #17324d;
    font-size: .71rem;
}

.ags-attention-menu-dot {
    width: .48rem;
    height: .48rem;
    flex: 0 0 .48rem;
    border-radius: 999px;
    background: #3b82f6;
}

.ags-attention-menu-danger .ags-attention-menu-dot { background: #e11d48; }
.ags-attention-menu-warning .ags-attention-menu-dot { background: #f59e0b; }
.ags-attention-menu-info .ags-attention-menu-dot { background: #3b82f6; }

.ags-topbar-menu-empty {
    padding: 1rem .75rem;
    color: #8795a8;
    text-align: center;
    font-size: .68rem;
}

/* -----------------------------------------------------------------------
| Workspace tabs below topbar
| --------------------------------------------------------------------- */
.ags-client-workspaces {
    position: sticky !important;
    top: var(--fi-topbar-height, 4rem) !important;
    z-index: 27 !important;
    width: 100%;
    border-bottom: 1px solid var(--ags-ui-line) !important;
    background: rgba(250, 251, 253, .985) !important;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 7px rgba(15, 23, 42, .025) !important;
}

.ags-client-workspaces-inner {
    display: flex !important;
    align-items: center !important;
    gap: .38rem !important;
    width: 100% !important;
    min-height: 2.75rem !important;
    padding: .32rem clamp(.8rem, 1.8vw, 1.75rem) !important;
}

.ags-client-workspaces-tabs {
    display: flex !important;
    align-items: center !important;
    gap: .22rem !important;
    min-width: 0 !important;
    overflow-x: auto !important;
    scrollbar-width: thin;
    padding: .02rem 0 !important;
}

.ags-client-workspace-tab {
    display: inline-flex !important;
    align-items: center !important;
    min-width: 0 !important;
    flex: 0 0 auto !important;
    overflow: hidden !important;
    border: 1px solid transparent !important;
    border-radius: .5rem !important;
    background: transparent !important;
    color: #55667c !important;
    box-shadow: none !important;
    transition: border-color .15s ease, background .15s ease, box-shadow .15s ease, color .15s ease !important;
}

.ags-client-workspace-tab:hover {
    border-color: #dce5ef !important;
    background: #fff !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .035) !important;
}

.ags-client-workspace-tab.is-active {
    border-color: #9ab9f6 !important;
    background: #fff !important;
    color: #1557ba !important;
    box-shadow: inset 0 -2px 0 #2563eb, 0 1px 3px rgba(15, 23, 42, .04) !important;
}

.ags-dashboard-workspace-tab {
    background: #f4f6f9 !important;
    border-color: #edf1f5 !important;
}

.ags-dashboard-workspace-tab.is-active {
    background: #fff !important;
    border-color: #cbd9ec !important;
    color: #284f7c !important;
    box-shadow: inset 0 -2px 0 #6f8ba9 !important;
}

.ags-client-workspace-link {
    display: inline-flex !important;
    align-items: center !important;
    gap: .34rem !important;
    min-width: 0 !important;
    max-width: 15rem !important;
    padding: .35rem .18rem .35rem .52rem !important;
    color: inherit !important;
    text-decoration: none !important;
    font-size: .68rem !important;
    line-height: 1.15 !important;
    font-weight: 760 !important;
}

.ags-client-workspace-link svg {
    width: .86rem !important;
    height: .86rem !important;
    flex: 0 0 auto !important;
}

.ags-client-workspace-link > span:not(.ags-client-workspace-live) {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

.ags-client-workspace-live {
    display: inline-block !important;
    width: .42rem !important;
    height: .42rem !important;
    flex: 0 0 .42rem !important;
    border-radius: 999px !important;
    background: #16a34a !important;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, .12) !important;
}

.ags-client-workspace-active-label {
    display: inline-flex !important;
    align-items: center !important;
    padding: .08rem .28rem !important;
    border-radius: 999px !important;
    background: #ecfdf3 !important;
    color: #15803d !important;
    font-size: .5rem !important;
    font-weight: 850 !important;
    line-height: 1.15 !important;
    text-transform: uppercase !important;
    letter-spacing: .025em !important;
}

.ags-client-workspace-close {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 1.45rem !important;
    height: 1.45rem !important;
    margin-right: .13rem !important;
    border: 0 !important;
    border-radius: .38rem !important;
    background: transparent !important;
    color: #99a6b6 !important;
    font-size: .82rem !important;
    line-height: 1 !important;
    cursor: pointer !important;
}

.ags-client-workspace-close:hover {
    background: #f2f5f8 !important;
    color: #b42335 !important;
}

.ags-workspace-add {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.05rem;
    height: 2.05rem;
    flex: 0 0 2.05rem;
    border: 1px solid #dfe6ee;
    border-radius: .48rem;
    background: #fff;
    color: #6f8095;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .025);
}

.ags-workspace-add:hover,
.ags-workspace-add:focus-visible {
    border-color: #a9c2ec;
    background: #eff6ff;
    color: #1d4ed8;
    outline: 0;
}

.ags-workspace-add svg {
    width: .92rem;
    height: .92rem;
}

.ags-workspace-add-wrap {
    position: relative;
    display: inline-flex;
    flex: 0 0 auto;
}

.ags-client-picker {
    position: absolute;
    z-index: 80;
    left: 0;
    top: calc(100% + .48rem);
    width: min(23rem, calc(100vw - 1.5rem));
    max-height: min(34rem, 76vh);
    overflow: hidden;
    border: 1px solid var(--ags-ui-line);
    border-radius: .72rem;
    background: #fff;
    color: var(--ags-ui-ink);
    box-shadow: 0 18px 46px rgba(15, 23, 42, .16), 0 2px 7px rgba(15, 23, 42, .05);
}

.ags-client-picker-head {
    display: grid;
    gap: .12rem;
    padding: .78rem .85rem .66rem;
    border-bottom: 1px solid #edf1f5;
    background: #fbfcfe;
}

.ags-client-picker-head strong {
    color: #17324d;
    font-size: .78rem;
    font-weight: 850;
}

.ags-client-picker-head span {
    color: #8392a6;
    font-size: .62rem;
    line-height: 1.35;
}

.ags-client-picker-search {
    display: flex;
    align-items: center;
    gap: .48rem;
    margin: .62rem;
    padding: .45rem .58rem;
    border: 1px solid #dfe6ee;
    border-radius: .55rem;
    background: #fff;
}

.ags-client-picker-search:focus-within {
    border-color: #93b4f7;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .09);
}

.ags-client-picker-search svg {
    width: .9rem;
    height: .9rem;
    flex: 0 0 auto;
    color: #7c8fa7;
}

.ags-client-picker-search input {
    width: 100%;
    min-width: 0;
    border: 0 !important;
    outline: 0 !important;
    background: transparent !important;
    color: #17324d !important;
    padding: 0 !important;
    font-size: .7rem;
    box-shadow: none !important;
}

.ags-client-picker-results {
    display: grid;
    gap: .35rem;
    max-height: min(26rem, 60vh);
    overflow-y: auto;
    padding: 0 .5rem .55rem;
}

.ags-client-picker-group {
    min-width: 0;
}

.ags-client-picker-group h4 {
    margin: .35rem .4rem .2rem;
    color: #8a98aa;
    font-size: .56rem;
    font-weight: 850;
    letter-spacing: .055em;
    text-transform: uppercase;
}

.ags-client-picker-item {
    display: flex;
    align-items: center;
    gap: .55rem;
    width: 100%;
    min-height: 2.55rem;
    padding: .45rem .5rem;
    border: 0;
    border-radius: .52rem;
    background: transparent;
    color: #40536a;
    text-align: left;
    cursor: pointer;
}

.ags-client-picker-item:hover,
.ags-client-picker-item:focus-visible {
    background: #f3f7fc;
    color: #174f8c;
    outline: 0;
}

.ags-client-picker-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.8rem;
    height: 1.8rem;
    flex: 0 0 1.8rem;
    border-radius: .5rem;
    background: #eef5ff;
    color: #3b6fb6;
}

.ags-client-picker-icon svg {
    width: .9rem;
    height: .9rem;
}

.ags-client-picker-copy {
    display: grid;
    gap: .08rem;
    min-width: 0;
}

.ags-client-picker-copy strong,
.ags-client-picker-copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ags-client-picker-copy strong {
    color: #29435f;
    font-size: .68rem;
    font-weight: 800;
}

.ags-client-picker-copy small {
    color: #8a98aa;
    font-size: .58rem;
}

.ags-client-picker-empty {
    padding: 1rem .65rem;
    color: #8998aa;
    text-align: center;
    font-size: .65rem;
}

.ags-module-launcher {
    width: min(46rem, calc(100vw - 2rem));
    max-height: min(34rem, 76vh);
    overflow: hidden;
    background: #fff;
}

.ags-module-launcher-head {
    display: grid;
    gap: .13rem;
    padding: .8rem .9rem .7rem;
    border-bottom: 1px solid #edf1f5;
    background: #fbfcfe;
}

.ags-module-launcher-head strong {
    color: #17324d;
    font-size: .78rem;
    font-weight: 850;
}

.ags-module-launcher-head span {
    color: #8694a7;
    font-size: .63rem;
}

.ags-module-launcher-grid {
    display: grid;
    grid-template-columns: .92fr 1.18fr .9fr;
    gap: .7rem;
    align-items: start;
    max-height: min(29rem, 68vh);
    overflow-y: auto;
    padding: .72rem;
}

.ags-module-launcher-column {
    display: grid;
    align-content: start;
    gap: .72rem;
    min-width: 0;
}

.ags-module-launcher-group {
    display: grid;
    align-content: start;
    gap: .1rem;
    min-width: 0;
    padding: 0;
    margin: 0;
}

.ags-module-launcher-group h4 {
    margin: 0 0 .22rem .35rem;
    color: #8a98aa;
    font-size: .56rem;
    font-weight: 850;
    letter-spacing: .055em;
    text-transform: uppercase;
}

.ags-module-launcher-item {
    display: flex;
    align-items: center;
    gap: .48rem;
    min-height: 2rem;
    padding: .38rem .46rem;
    border-radius: .46rem;
    color: #40536a;
    text-decoration: none;
    font-size: .66rem;
    font-weight: 700;
}

.ags-module-launcher-item:hover {
    background: #f3f7fc;
    color: #175292;
}

.ags-module-launcher-item svg {
    width: .9rem;
    height: .9rem;
    flex: 0 0 auto;
    color: #6c84a0;
}

.ags-module-launcher-item em {
    margin-left: auto;
    padding: .08rem .28rem;
    border-radius: 999px;
    background: #eef4fb;
    color: #43698f;
    font-size: .54rem;
    font-style: normal;
    font-weight: 800;
}

.ags-module-launcher-item.is-child {
    padding-left: 1.2rem;
    color: #607087;
    font-weight: 650;
}

.ags-client-workspaces-status {
    display: inline-flex;
    align-items: center;
    gap: .34rem;
    min-width: 0;
    max-width: 18rem;
    margin-left: auto;
    padding-left: .65rem;
    border-left: 1px solid #e4eaf1;
    color: #718198;
    font-size: .61rem;
    white-space: nowrap;
}

.ags-client-workspaces-status strong {
    max-width: 10rem;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #3a4f67;
    font-size: .63rem;
}

.ags-client-workspaces-status.is-paused {
    color: #94a3b8;
}

/* -----------------------------------------------------------------------
| Responsive shell
| --------------------------------------------------------------------- */
@media (max-width: 1380px) and (min-width: 1024px) {
    .ags-top-search { width: 14rem; }
    .ags-topbar-user-meta { min-width: 7.2rem; max-width: 8.5rem; }
    .ags-client-workspaces-status { max-width: 13rem; }
    .ags-client-workspaces-status strong { max-width: 7rem; }
}

@media (max-width: 1180px) and (min-width: 1024px) {
    .ags-top-search { width: 11.5rem; }
    .ags-top-search-kbd,
    .ags-topbar-user-meta { display: none !important; }
    .ags-client-workspaces-status { display: none; }
}

@media (max-width: 1023px) {
    .ags-module-launcher-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ags-module-launcher-column:last-child { grid-column: 1 / -1; grid-template-columns: repeat(2, minmax(0, 1fr)); }

    .ags-top-search {
        width: min(15rem, 42vw);
        min-height: 2.25rem;
    }

    .ags-top-search-kbd,
    .ags-topbar-user-meta {
        display: none;
    }

    .ags-topbar-tools {
        gap: .18rem;
    }

    .ags-topbar-icon-btn {
        width: 2.1rem;
        height: 2.1rem;
        flex-basis: 2.1rem;
    }

    .ags-client-workspaces-inner {
        padding-inline: .55rem !important;
    }
}

@media (max-width: 760px) {
    .ags-top-search { width: min(9rem, 32vw); padding-inline: .42rem; gap: .35rem; }
    .ags-top-search-kbd { display: none; }
    .ags-topbar-tools { gap: .12rem; }
    .ags-topbar-icon-btn { width: 2rem; height: 2rem; flex-basis: 2rem; }
    .ags-client-workspace-link { max-width: 10rem !important; }
    .ags-client-workspace-active-label { display: none !important; }
    .ags-client-workspaces-status { display: none; }
    .ags-module-launcher-grid, .ags-module-launcher-column:last-child { grid-template-columns: 1fr; }
    .ags-module-launcher-column:last-child { grid-column: auto; }
}

@media (max-width: 540px) {
    .ags-top-search { width: 6.8rem; }
    .ags-top-search-input { font-size: .68rem; }
    .ags-client-workspace-link { max-width: 8rem !important; font-size: .64rem !important; }
    .ags-module-launcher-head span, .ags-client-picker-head span { display: none; }
}

/* Dark mode remains usable even though v1.6.2.4 is visually optimized for the
   approved light CRM theme. */
.dark .ags-top-search,
.dark .ags-client-workspace-tab.is-active,
.dark .ags-dashboard-workspace-tab,
.dark .ags-workspace-add,
.dark .ags-topbar-menu,
.dark .ags-module-launcher,
.dark .ags-client-picker {
    background: #111827 !important;
    border-color: #334155 !important;
    color: #e5e7eb !important;
}

.dark .ags-client-workspaces {
    background: rgba(15, 23, 42, .98) !important;
    border-color: #334155 !important;
}

.dark .ags-top-search-input,
.dark .ags-topbar-menu-heading strong,
.dark .ags-module-launcher-head strong,
.dark .ags-client-picker-head strong {
    color: #f8fafc !important;
}

.dark .ags-client-picker-search { border-color:#334155; background:#111827; }
.dark .ags-client-picker-search input { color:#f8fafc !important; }
.dark .ags-client-picker-copy strong { color:#e5e7eb; }
.dark .ags-client-picker-item:hover { background:#1e293b; }

/* v1.6.3 - secure eConsulat access card */
.ags-secure-access-panel{margin-top:1rem}
.ags-secure-verified{display:inline-flex;align-items:center;padding:.28rem .5rem;border-radius:999px;background:#edf8f2;color:#28724d;font-size:.65rem;font-weight:800;white-space:nowrap}
.ags-secure-access-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.75rem;padding:0 1rem 1rem}
.ags-secure-field{display:grid;gap:.3rem;padding:.8rem;border:1px solid #e8edf3;border-radius:.65rem;background:#fbfcfe;min-width:0}
.ags-secure-field>span{font-size:.62rem;font-weight:800;text-transform:uppercase;letter-spacing:.045em;color:#8a98aa}
.ags-secure-field>strong{font-size:.78rem;color:#253f5b;overflow-wrap:anywhere}
.ags-secure-field>button,.ags-secure-actions button{justify-self:start;border:1px solid #d8e3ef;border-radius:.5rem;background:#fff;color:#2e6198;padding:.34rem .52rem;font-size:.64rem;font-weight:800;cursor:pointer}
.ags-secure-field>button:hover,.ags-secure-actions button:hover{background:#f0f6fd;border-color:#c5d8ec}
.ags-secure-actions{display:flex;flex-wrap:wrap;gap:.4rem}
.ags-secure-actions button:disabled{opacity:.55;cursor:wait}
.ags-secure-notes{grid-column:1/-1}
@media(max-width:760px){.ags-secure-access-grid{grid-template-columns:1fr}}
