:root {
    color-scheme: light;
    --ink: #1f2937;
    --muted: #667085;
    --line: #e4e7ec;
    --surface: #ffffff;
    --canvas: #f5f7fb;
    --brand: #5b5bd6;
    --brand-dark: #4545b8;
    --brand-soft: #eeeeff;
    --success: #16835b;
    --shadow: 0 12px 30px rgba(16, 24, 40, 0.07);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background: var(--canvas);
}

body {
    min-height: 100vh;
    margin: 0;
    display: flex;
    flex-direction: column;
}

a {
    color: inherit;
}

.app-header {
    position: sticky;
    z-index: 20;
    top: 0;
    border-bottom: 1px solid rgba(228, 231, 236, 0.9);
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(14px);
}

.header-inner,
.app-footer {
    width: min(1600px, calc(100% - 40px));
    margin-inline: auto;
}

.header-inner {
    min-height: 68px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 20px;
}

.header-primary { min-width: 0; display: flex; align-items: center; gap: 28px; }

.brand {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #24245f;
    font-size: 1.05rem;
    font-weight: 760;
    text-decoration: none;
}

.brand-name { white-space: nowrap; }
.brand-logo {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border: 1px solid #d6d3b0;
    border-radius: 9px;
    background: #fff;
    box-shadow: 0 6px 16px rgba(117, 102, 23, 0.18);
}

.brand-mark {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    color: #fff;
    background: linear-gradient(145deg, #6f6ff0, #4444af);
    box-shadow: 0 8px 18px rgba(91, 91, 214, 0.28);
    font-size: 0.72rem;
    letter-spacing: 0.04em;
}

.page-context {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--muted);
    font-size: 0.78rem;
}

.page-context strong {
    max-width: 260px;
    overflow: hidden;
    color: #344054;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.header-actions {
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-tenant-center { min-width: 0; justify-self: center; }

.header-icon-button {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 11px;
    color: #475467;
    background: #fff;
    cursor: pointer;
    font: inherit;
}

.header-icon-button { width: 40px; padding: 0; font-size: 1.2rem; }
.header-icon-button:hover,
.header-icon-button:focus-visible {
    border-color: #bdbdf9;
    color: var(--brand-dark);
    outline: none;
    box-shadow: 0 0 0 3px rgba(91, 91, 214, 0.11);
}

.active-tenant {
    max-width: min(360px, 34vw);
    min-height: 38px;
    padding: 7px 10px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border-radius: 10px;
    color: #344054;
    background: #f2f4f7;
    font-size: 0.8rem;
    font-weight: 750;
}

.active-tenant span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

kbd {
    min-width: 22px;
    padding: 3px 6px;
    display: inline-block;
    border: 1px solid #d0d5dd;
    border-bottom-width: 2px;
    border-radius: 5px;
    color: #667085;
    background: #f9fafb;
    font-family: inherit;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
}

.environment-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 10px;
    border: 1px solid #d6d6ff;
    border-radius: 999px;
    color: var(--brand-dark);
    background: var(--brand-soft);
    font-size: 0.75rem;
    font-weight: 700;
    text-decoration: none;
}

.environment-ai-link:hover {
    color: #fff;
    border-color: #6258e8;
    background: #6258e8;
    box-shadow: 0 7px 16px rgba(98, 88, 232, 0.24);
}

.avatar {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: #344054;
    font-size: 0.8rem;
    font-weight: 700;
}

.account-menu { position: relative; }
.account-trigger { list-style: none; }
.account-trigger::-webkit-details-marker { display: none; }
.account-trigger {
    min-height: 42px; padding: 4px 8px 4px 5px; display: inline-flex; align-items: center; gap: 9px;
    border: 1px solid transparent; border-radius: 12px; color: var(--ink); background: transparent;
    cursor: pointer; font: inherit; font-size: 0.84rem; font-weight: 700;
}
.account-trigger:hover, .account-trigger:focus-visible, .account-menu[open] .account-trigger { border-color: var(--line); background: #f8f9fc; }
.account-dropdown {
    position: absolute; top: calc(100% + 8px); right: 0; width: 300px; padding: 8px;
    border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
    box-shadow: 0 18px 38px rgba(16, 24, 40, 0.14); z-index: 30;
}
.account-dropdown a, .account-dropdown button {
    width: 100%; padding: 10px 11px; display: flex; align-items: center; gap: 9px;
    border: 0; border-radius: 8px; color: #344054; background: transparent; cursor: pointer;
    font: inherit; font-size: 0.86rem; font-weight: 600; text-align: left; text-decoration: none;
}
.account-dropdown a:hover, .account-dropdown a:focus-visible,
.account-dropdown button:hover, .account-dropdown button:focus-visible { color: var(--brand-dark); background: var(--brand-soft); }
.account-dropdown form { margin: 0; }
.account-summary { padding: 7px 11px 9px; display: grid; gap: 2px; }
.account-summary strong { overflow-wrap: anywhere; font-size: 0.86rem; }
.account-summary span { overflow-wrap: anywhere; color: var(--muted); font-size: 0.75rem; }
.dropdown-divider { height: 1px; margin: 5px 0; background: var(--line); }
.account-tenant-summary { padding: 8px 11px; display: grid; gap: 2px; }
.account-tenant-summary span, .tenant-switch-form label { color: var(--muted); font-size: 0.72rem; font-weight: 650; }
.account-tenant-summary strong { overflow-wrap: anywhere; font-size: 0.84rem; }
.account-tenant-summary small { color: var(--brand-dark); font-size: 0.7rem; font-weight: 750; }
.tenant-switch-form { padding: 6px 11px 9px; display: grid; grid-template-columns: 1fr auto; gap: 7px; }
.tenant-switch-form label { grid-column: 1 / -1; }
.tenant-switch-form select { min-width: 0; padding: 8px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: #fff; font: inherit; font-size: 0.78rem; }
.tenant-switch-button { width: auto !important; padding-inline: 12px !important; color: #fff !important; background: var(--brand) !important; }

.launcher-is-open { overflow: hidden; }

.module-launcher {
    width: min(1040px, calc(100% - 32px));
    max-width: none;
    max-height: min(820px, calc(100dvh - 42px));
    margin: auto;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 20px;
    color: var(--ink);
    background: transparent;
    box-shadow: 0 30px 90px rgba(16, 24, 40, 0.28);
}

.module-launcher::backdrop {
    background: rgba(16, 24, 40, 0.56);
    backdrop-filter: blur(4px);
}

.launcher-frame {
    max-height: min(820px, calc(100dvh - 42px));
    display: flex;
    flex-direction: column;
    background: var(--surface);
}

.launcher-header {
    padding: 22px 24px 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.launcher-heading { min-width: 0; flex: 1; }
.launcher-title-row {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.launcher-category-filters {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 7px;
}

.launcher-category-filter {
    min-height: 34px;
    padding: 7px 15px;
    border: 1px solid #e0e3ef;
    border-radius: 999px;
    color: #59627a;
    background: #fff;
    box-shadow: 0 5px 14px rgba(50, 53, 82, 0.08);
    cursor: pointer;
    font: inherit;
    font-size: 0.75rem;
    font-weight: 750;
    white-space: nowrap;
    transition: color 160ms ease, background 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.launcher-category-filter:hover {
    border-color: #c9c5fb;
    color: #5b52c7;
    background: #f5f3ff;
    box-shadow: 0 8px 18px rgba(91, 82, 199, 0.15);
    transform: translateY(-1px);
}

.launcher-category-filter:focus-visible {
    outline: 3px solid rgba(115, 103, 240, 0.24);
    outline-offset: 2px;
}

.launcher-category-filter.is-active {
    border-color: transparent;
    color: #fff;
    background: linear-gradient(135deg, #7367f0, #5f52d9);
    box-shadow: 0 8px 18px rgba(115, 103, 240, 0.28);
}

.launcher-kicker {
    display: block;
    margin-bottom: 4px;
    color: var(--brand);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.launcher-header h2 { margin: 0; font-size: 1.3rem; }
.launcher-close {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 10px;
    color: #667085;
    background: #f2f4f7;
    cursor: pointer;
    font-size: 1.35rem;
}

.launcher-close:hover,
.launcher-close:focus-visible { color: var(--brand-dark); background: var(--brand-soft); outline: 2px solid #bdbdf9; }

.launcher-search {
    margin: 0 24px 15px;
    min-height: 48px;
    padding: 7px 9px 7px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid #d0d5dd;
    border-radius: 12px;
    background: #fff;
}

.launcher-search:focus-within {
    border-color: #8b8bea;
    box-shadow: 0 0 0 3px rgba(91, 91, 214, 0.13);
}

.launcher-search > i { color: #667085; font-size: 1.15rem; }
.launcher-search input {
    min-width: 0;
    flex: 1;
    border: 0;
    outline: 0;
    color: var(--ink);
    background: transparent;
    font: inherit;
    font-size: 0.9rem;
}

.launcher-results {
    min-height: 240px;
    padding: 4px 24px 24px;
    overflow: auto;
    overscroll-behavior: contain;
}

.launcher-section + .launcher-section { margin-top: 24px; }
.launcher-section-highlight {
    margin: 0 -8px;
    padding: 14px 8px;
    border-radius: 14px;
    background: #fafaff;
}

.launcher-section-heading {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.launcher-section-heading h3 {
    margin: 0;
    color: #5b5bd6;
    font-size: 0.92rem;
    font-weight: 800;
    letter-spacing: 0.01em;
}

.launcher-section-heading h3 i { margin-right: 4px; color: #d68a00; }
.launcher-section-heading span { color: var(--muted); font-size: 0.7rem; }
.launcher-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.launcher-feature {
    --launcher-accent: #5b5bd6;
    --launcher-accent-2: #7c68e8;
    --launcher-soft: #f2f1ff;
    min-width: 0;
    position: relative;
    isolation: isolate;
    display: flex;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--launcher-accent) 16%, #e5e8f0);
    border-radius: 13px;
    background: linear-gradient(145deg, #fff 50%, var(--launcher-soft));
    transition: border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

.launcher-feature::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: linear-gradient(180deg, var(--launcher-accent), var(--launcher-accent-2));
}

.launcher-feature::after {
    content: "";
    position: absolute;
    z-index: -1;
    right: -42px;
    bottom: -58px;
    width: 124px;
    height: 124px;
    border-radius: 50%;
    background: var(--launcher-accent);
    opacity: 0.07;
}

.launcher-feature[data-module-id="Embroidery"] { --launcher-accent: #0f9f79; --launcher-accent-2: #37bfd5; --launcher-soft: #eefbf7; }
.launcher-feature[data-feature-id="users-admin"],
.launcher-feature[data-feature-id="profile"] { --launcher-accent: #3974d9; --launcher-accent-2: #42a5ea; --launcher-soft: #eff6ff; }
.launcher-feature[data-feature-id="roles-admin"],
.launcher-feature[data-feature-id="change-password"] { --launcher-accent: #7b61d1; --launcher-accent-2: #ad69de; --launcher-soft: #f7f2ff; }
.launcher-feature[data-feature-id="tenants-admin"] { --launcher-accent: #d7831f; --launcher-accent-2: #eeb63a; --launcher-soft: #fff7e8; }
.launcher-feature[data-feature-id="audit-admin"] { --launcher-accent: #d64d64; --launcher-accent-2: #ed7180; --launcher-soft: #fff1f4; }

.launcher-feature:hover,
.launcher-feature:focus-within {
    border-color: color-mix(in srgb, var(--launcher-accent) 38%, #d7dcea);
    box-shadow: 0 10px 24px color-mix(in srgb, var(--launcher-accent) 16%, transparent);
    transform: translateY(-1px);
}

.launcher-open-form { min-width: 0; flex: 1; margin: 0; }
.launcher-open-button {
    width: 100%;
    min-height: 100px;
    padding: 14px 43px 14px 14px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    border: 0;
    border-radius: inherit;
    color: inherit;
    background: transparent;
    cursor: pointer;
    font: inherit;
    text-align: left;
    text-decoration: none;
}

.launcher-open-button:focus-visible { outline: 3px solid rgba(91, 91, 214, 0.26); outline-offset: 1px; }
.launcher-feature-icon {
    width: 38px;
    height: 38px;
    flex: none;
    display: grid;
    place-items: center;
    border-radius: 10px;
    color: #fff;
    background: linear-gradient(145deg, var(--launcher-accent), var(--launcher-accent-2));
    box-shadow: 0 8px 16px color-mix(in srgb, var(--launcher-accent) 24%, transparent);
    font-size: 1.08rem;
}

.launcher-feature-copy { min-width: 0; display: grid; gap: 3px; }
.launcher-feature-copy strong { color: #101828; font-size: 0.87rem; }
.launcher-feature-copy small {
    display: -webkit-box;
    overflow: hidden;
    color: var(--muted);
    font-size: 0.73rem;
    font-weight: 500;
    line-height: 1.35;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.launcher-feature-copy em { margin-top: 2px; color: var(--launcher-accent); font-size: 0.66rem; font-style: normal; font-weight: 750; }
.launcher-favorite-form { position: absolute; top: 9px; right: 9px; margin: 0; }
.launcher-favorite-button {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 8px;
    color: #98a2b3;
    background: transparent;
    cursor: pointer;
    font-size: 1rem;
}

.launcher-favorite-button:hover,
.launcher-favorite-button:focus-visible { color: #b76e00; background: #fff7e6; outline: 2px solid #ffd690; }
.launcher-favorite-button.is-favorite { color: #d68a00; }
.launcher-loading,
.launcher-empty {
    min-height: 230px;
    padding: 38px 20px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 8px;
    color: var(--muted);
    text-align: center;
}

.launcher-empty > i { color: #98a2b3; font-size: 2rem; }
.launcher-empty h3 { margin: 2px 0 0; color: #344054; font-size: 1rem; }
.launcher-empty p { max-width: 440px; margin: 0; font-size: 0.8rem; }
.launcher-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid #e4e7ec;
    border-top-color: var(--brand);
    border-radius: 50%;
    animation: launcher-spin 700ms linear infinite;
}

@keyframes launcher-spin { to { transform: rotate(360deg); } }
.launcher-footer {
    min-height: 46px;
    padding: 9px 24px;
    display: flex;
    align-items: center;
    gap: 18px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    background: #fcfcfd;
    font-size: 0.7rem;
}

.launcher-footer kbd + kbd { margin-left: 3px; }

.page-shell {
    flex: 1;
    width: 100%;
    margin: 0;
    padding: 64px clamp(20px, 3vw, 56px) 72px;
}

.page-shell.admin-grid-shell {
    padding-top: 12px;
}

.hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 32px;
    margin-bottom: 34px;
}

.hero > div,
.page-heading {
    max-width: 760px;
}

.eyebrow {
    display: block;
    margin-bottom: 12px;
    color: var(--brand);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 14px;
    color: #101828;
    font-size: clamp(2rem, 4vw, 3.25rem);
    line-height: 1.06;
    letter-spacing: -0.035em;
}

h2 {
    margin-bottom: 9px;
    font-size: 1.08rem;
}

p {
    color: var(--muted);
    line-height: 1.65;
}

.status-badge {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 13px;
    border: 1px solid #b9e8d3;
    border-radius: 999px;
    color: #116847;
    background: #ecfdf3;
    font-size: 0.78rem;
    font-weight: 700;
}

.status-badge > span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-bottom: 24px;
}

.card,
.panel {
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.card {
    min-height: 190px;
    padding: 24px;
}

.card-index {
    display: inline-block;
    margin-bottom: 35px;
    color: var(--brand);
    font-size: 0.76rem;
    font-weight: 800;
}

.card p {
    margin-bottom: 0;
    font-size: 0.91rem;
}

.panel {
    padding: 26px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 36px;
}

.panel-block {
    display: block;
    margin-top: 26px;
}

.action-list {
    width: min(100%, 520px);
    display: grid;
    gap: 8px;
}

.action-list a {
    padding: 12px 14px;
    display: flex;
    justify-content: space-between;
    gap: 20px;
    border-radius: 9px;
    background: #f8f9fc;
    text-decoration: none;
}

.action-list a:hover,
.action-list a:focus-visible {
    outline: 2px solid #bdbdf9;
    background: var(--brand-soft);
}

.action-list code {
    color: #303067;
    font-weight: 700;
}

.action-list span {
    color: var(--muted);
    font-size: 0.84rem;
}

.page-heading {
    margin-bottom: 24px;
}

.page-heading h1 {
    font-size: clamp(1.9rem, 3vw, 2.75rem);
}

.error-state {
    max-width: 620px;
    margin: 5vh auto;
    padding: 46px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--surface);
    box-shadow: var(--shadow);
    text-align: center;
}

.error-code {
    display: block;
    margin-bottom: 8px;
    color: var(--brand);
    font-size: 0.78rem;
    font-weight: 800;
}

.error-state h1 {
    font-size: 2rem;
}

.error-state code {
    display: block;
    margin: 20px 0;
    padding: 10px;
    border-radius: 8px;
    background: #f2f4f7;
    overflow-wrap: anywhere;
}

.button {
    display: inline-block;
    padding: 10px 16px;
    border-radius: 9px;
    color: #fff;
    background: var(--brand);
    font-weight: 700;
    text-decoration: none;
}

.button:hover,
.button:focus-visible {
    background: var(--brand-dark);
}

.button { border: 0; cursor: pointer; font: inherit; }
.button-secondary { border: 1px solid var(--line); color: #344054; background: #fff; }
.button-secondary:hover, .button-secondary:focus-visible { color: var(--brand-dark); background: var(--brand-soft); }

.auth-body {
    min-height: 100vh; display: grid; place-items: center; padding: 32px 20px;
    background: radial-gradient(circle at 14% 12%, rgba(91, 91, 214, 0.13), transparent 28rem),
        radial-gradient(circle at 90% 88%, rgba(22, 131, 91, 0.08), transparent 26rem), var(--canvas);
}
.auth-shell { width: min(100%, 440px); }
.auth-brand { margin-bottom: 22px; display: flex; justify-content: center; }
.auth-card { padding: 36px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: 0 22px 55px rgba(16, 24, 40, 0.11); }
.auth-heading { margin-bottom: 26px; }
.auth-heading h1, .auth-message h1 { margin-bottom: 10px; font-size: 2rem; }
.auth-icon { width: 46px; height: 46px; margin-bottom: 20px; display: grid; place-items: center; border-radius: 13px; color: var(--brand-dark); background: var(--brand-soft); font-size: 1.45rem; }
.auth-icon-warning { color: #9a6700; background: #fff7d6; }
.account-form { width: min(100%, 560px); display: grid; gap: 18px; }
.field-group { display: grid; gap: 7px; }
.field-group label { color: #344054; font-size: 0.84rem; font-weight: 700; }
.form-control { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid #d0d5dd; border-radius: 9px; color: var(--ink); background: #fff; font: inherit; }
.form-control:focus { border-color: #8b8bea; outline: 3px solid rgba(91, 91, 214, 0.13); }
.account-check { display: flex; align-items: flex-start; gap: 9px; color: #475467; font-size: 0.82rem; line-height: 1.45; }
.account-check input { margin-top: 3px; }
.auth-submit { width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.auth-footnote { margin: 22px 0 0; padding-top: 20px; border-top: 1px solid var(--line); font-size: 0.78rem; text-align: center; }
.auth-message { text-align: center; }
.auth-message .auth-icon { margin-inline: auto; }
.auth-message .button { margin-top: 8px; }
.validation-summary:empty, .field-error:empty { display: none; }
.validation-summary, .field-error { color: #b42318; font-size: 0.8rem; }
.validation-summary { padding: 10px 12px; border: 1px solid #fecdca; border-radius: 9px; background: #fef3f2; }
.validation-summary ul { margin: 0; padding-left: 18px; }
.account-page-heading { max-width: 680px; }
.password-panel { display: block; max-width: 680px; }
.form-actions { display: flex; gap: 10px; }
.account-alert { margin-bottom: 20px; padding: 12px 15px; display: flex; align-items: center; gap: 9px; border: 1px solid #b9e8d3; border-radius: 10px; color: #116847; background: #ecfdf3; font-size: 0.86rem; font-weight: 650; }
.profile-grid { display: grid; grid-template-columns: minmax(250px, 0.8fr) minmax(380px, 1.4fr); gap: 20px; align-items: start; }
.profile-card { display: grid; justify-content: stretch; }
.profile-avatar { width: 68px; height: 68px; display: grid; place-items: center; border-radius: 18px; color: #fff; background: linear-gradient(145deg, #6f6ff0, #4444af); font-size: 1.5rem; font-weight: 800; }
.profile-details { display: block; }
.detail-list { margin: 18px 0 24px; }
.detail-list > div { padding: 12px 0; display: grid; grid-template-columns: minmax(130px, 0.7fr) 1.3fr; gap: 20px; border-bottom: 1px solid var(--line); }
.detail-list dt { color: var(--muted); font-size: 0.82rem; }
.detail-list dd { margin: 0; overflow-wrap: anywhere; font-size: 0.86rem; font-weight: 650; }

.app-footer {
    padding-block: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px 28px;
    flex-wrap: wrap;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.78rem;
}
.footer-brand, .footer-credit { display: inline-flex; align-items: center; gap: 10px; }
.footer-brand > i, .footer-credit > i { width: 32px; height: 32px; flex: 0 0 32px; display: grid; place-items: center; border-radius: 10px; color: #5b59d6; background: #f0efff; font-size: 1.05rem; }
.footer-brand > span { display: grid; gap: 1px; }
.footer-brand strong, .footer-credit strong { color: #344054; font-weight: 750; }
.footer-brand small { color: var(--muted); font-size: 0.72rem; }
.footer-credit { color: #667085; }

.admin-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.admin-heading h1 { margin-bottom: 8px; }
.admin-grid-panel { padding: 0; overflow: hidden; }
.admin-grid-shell .admin-grid-panel { margin-top: 0; }
.admin-grid-tools { padding: 16px 18px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); }
.admin-grid-tools label { font-weight: 700; color: #344054; }
.admin-grid-actions { display: flex; flex: 0 0 auto; gap: 8px; }
.admin-grid-search { display: flex; flex: 1 1 420px; justify-content: flex-end; gap: 8px; max-width: 560px; }
.admin-grid-tools .form-control { flex: 1; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
.grid-action { display: inline-block; margin-right: 8px; color: var(--brand-dark); font-weight: 700; text-decoration: none; }
.grid-action:hover { text-decoration: underline; }
.grid-icon-action {
    width: 34px;
    height: 34px;
    margin-right: 6px;
    display: inline-grid;
    place-items: center;
    border: 1px solid #deddfa;
    border-radius: 9px;
    color: var(--brand-dark);
    background: #f7f7ff;
    font-size: 1.08rem;
    text-decoration: none;
    vertical-align: middle;
    transition: color 140ms ease, background-color 140ms ease, border-color 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}
.grid-icon-action:last-child { margin-right: 0; }
.grid-icon-action:hover {
    border-color: var(--brand);
    color: #fff;
    background: var(--brand);
    box-shadow: 0 6px 14px rgba(91, 91, 214, 0.24);
    transform: translateY(-1px);
}
.grid-icon-action:focus-visible { outline: 3px solid rgba(91, 91, 214, 0.25); outline-offset: 2px; }
.admin-notice { margin: 0 0 18px; padding: 12px 15px; border-radius: 10px; border: 1px solid; }
.admin-notice-success { color: #067647; background: #ecfdf3; border-color: #abefc6; }
.admin-notice-error, .validation-summary { color: #b42318; background: #fef3f2; border-color: #fecdca; }
.admin-form-panel { max-width: 1040px; }
.admin-popup-panel { max-width: none; margin: 0; padding: 22px; border: 0; border-radius: 0; box-shadow: none; }
.admin-editor-window .k-window-content { max-height: calc(100vh - 130px); padding: 0; overflow-y: auto; }
.admin-popup-loading, .admin-popup-error { min-height: 160px; padding: 32px; display: grid; place-items: center; color: var(--muted); text-align: center; }
.admin-popup-error { color: #b42318; }
.admin-popup-notice { margin-bottom: 12px; }
.admin-concurrency-alert {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 14px;
    margin: 18px 18px 0;
    padding: 16px;
    color: #7a2e0e;
    background: linear-gradient(135deg, #fff8eb, #fff3d6);
    border: 1px solid #f5c978;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgb(122 46 14 / 8%);
}
.admin-concurrency-alert > i { margin-top: 2px; color: #d97706; font-size: 1.5rem; }
.admin-concurrency-alert strong { display: block; color: #7a2e0e; }
.admin-concurrency-alert p { margin: 4px 0 12px; color: #8a4b20; }
.admin-concurrency-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.admin-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.user-create-form-grid { align-items: start; }
.user-create-form-grid .user-create-credential-field { align-self: start; align-content: start; grid-auto-rows: max-content; }
.user-create-form-grid .user-create-credential-field > label { min-height: 20px; display: flex; align-items: flex-end; }
.user-create-form-grid .user-create-credential-field > .form-control { height: 42px; }
.user-create-form-grid .user-create-credential-field > small { margin: 0; line-height: 1.45; }
.admin-form-wide { grid-column: 1 / -1; }
.form-field { display: grid; gap: 7px; }
.form-field label, .form-check label { color: #344054; font-weight: 700; }
.form-field small { color: var(--muted); }
.form-field span.field-validation-error { color: #b42318; font-size: .84rem; }
.form-control { min-height: 42px; width: 100%; padding: 9px 11px; border: 1px solid #d0d5dd; border-radius: 9px; background: #fff; color: #101828; font: inherit; }
textarea.form-control { min-height: 88px; resize: vertical; }
.form-control:focus { border-color: #7f56d9; outline: 3px solid rgba(127,86,217,.13); }
.form-check { display: flex; align-items: center; gap: 8px; min-height: 42px; }
.form-check input, .permission-checks input { width: 17px; height: 17px; accent-color: var(--brand); }
.admin-form-actions { display: flex; gap: 10px; margin-top: 24px; }
.admin-popup-panel .admin-form-actions { justify-content: flex-end; }
.button-danger { color: #fff; background: #d92d20; border-color: #d92d20; }
.danger-zone { margin-top: 28px; padding-top: 20px; border-top: 1px solid #fecdca; }
.permission-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.permission-groups fieldset { margin: 0; padding: 16px; border: 1px solid var(--line); border-radius: 12px; }
.permission-groups legend { padding: 0 7px; font-weight: 800; color: #344054; }
.permission-checks { display: grid; gap: 10px; }
.permission-checks label { display: flex; align-items: center; gap: 8px; }
.tenant-access-list { display: grid; gap: 14px; }
.tenant-access-card { padding: 16px; border: 1px solid var(--line); border-radius: 12px; }
.tenant-access-title { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.tenant-access-card .permission-checks { grid-template-columns: repeat(3, minmax(0, 1fr)); padding-left: 25px; }
.k-grid { border: 0 !important; }
.k-grid .k-grid-header { background: #f9fafb; }
.k-grid tbody > tr,
.k-grid tbody > tr > td {
    transition: background-color 150ms ease, box-shadow 150ms ease;
}
.k-grid tbody > tr:hover,
.k-grid tbody > tr.k-state-hover {
    background-color: #f4f3ff !important;
    box-shadow: inset 3px 0 0 var(--brand);
}
.k-grid tbody > tr:hover > td,
.k-grid tbody > tr.k-state-hover > td {
    background-color: transparent !important;
}

@media (max-width: 760px) {
    .header-inner,
    .app-footer {
        width: calc(100% - 28px);
    }

    .page-context, .environment-pill, .header-tenant-center { display: none; }
    .header-inner { grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
    .header-primary { gap: 10px; }
    .header-actions { gap: 7px; }
    .page-shell {
        padding: 40px 14px 52px;
    }

    .page-shell.admin-grid-shell { padding-top: 10px; }
    .app-footer { align-items: flex-start; flex-direction: column; }

    .hero,
    .panel {
        flex-direction: column;
    }

    .card-grid {
        grid-template-columns: 1fr;
    }

    .profile-grid { grid-template-columns: 1fr; }
    .admin-heading { align-items: stretch; flex-direction: column; }
    .admin-grid-tools { align-items: stretch; flex-direction: column; }
    .admin-grid-actions, .admin-grid-search { width: 100%; max-width: none; }
    .admin-editor-window.k-window { width: calc(100vw - 24px) !important; left: 12px !important; }
    .admin-popup-panel { padding: 18px; }
    .admin-form-grid, .permission-groups { grid-template-columns: 1fr; }
    .tenant-access-title { flex-direction: column; }
    .tenant-access-card .permission-checks { grid-template-columns: 1fr; }

    .status-badge {
        align-self: flex-start;
    }

    .action-list,
    .action-list a {
        width: 100%;
    }

    .account-trigger-name { display: none; }
    .auth-card { padding: 28px 22px; }
    .detail-list > div { grid-template-columns: 1fr; gap: 4px; }

    .module-launcher {
        width: 100%;
        height: 100dvh;
        max-height: none;
        margin: 0;
        border-radius: 0;
    }
    .launcher-frame { height: 100dvh; max-height: none; }
    .launcher-header { padding: 18px 16px 13px; }
    .launcher-title-row { align-items: flex-start; flex-direction: column; gap: 12px; }
    .launcher-category-filters { justify-content: flex-start; }
    .launcher-search { margin: 0 16px 12px; }
    .launcher-results { padding: 3px 16px 20px; }
    .launcher-grid { grid-template-columns: 1fr; }
    .launcher-footer { padding-inline: 16px; gap: 10px; }
}

@media (max-width: 430px) {
    .brand-name { display: none; }
    .launcher-category-filter { padding-inline: 12px; }
    .launcher-footer span:first-child { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .launcher-feature,
    .launcher-category-filter { transition: none; }
    .grid-icon-action,
    .k-grid tbody > tr,
    .k-grid tbody > tr > td { transition: none; }
    .launcher-spinner { animation-duration: 1.4s; }
}
