/* Atlas Core design system — dependency-free, dark-first and accessible. */
:root {
    color-scheme: dark;
    --atlas-bg: #06111d;
    --atlas-bg-deep: #030a12;
    --atlas-surface: #0a1c2e;
    --atlas-surface-raised: #10273d;
    --atlas-surface-soft: #0d2236;
    --atlas-primary: #1261ff;
    --atlas-primary-hover: color-mix(in srgb, var(--atlas-primary) 84%, white);
    --atlas-cyan: #00d4ff;
    --atlas-success: #00e0b8;
    --atlas-muted: #64748b;
    --atlas-text: #e6edf3;
    --atlas-text-soft: #a9bac9;
    --atlas-white: #ffffff;
    --atlas-warning: #fbbf24;
    --atlas-danger: #fb7185;
    --atlas-info: #38bdf8;
    --atlas-border: rgba(148, 163, 184, 0.18);
    --atlas-border-strong: color-mix(in srgb, var(--atlas-cyan) 28%, transparent);
    --atlas-focus: 0 0 0 3px color-mix(in srgb, var(--atlas-cyan) 34%, transparent);
    --atlas-shadow-sm: 0 8px 24px rgba(0, 0, 0, 0.18);
    --atlas-shadow-lg: 0 22px 70px rgba(0, 0, 0, 0.38);
    --atlas-gradient: linear-gradient(135deg, var(--atlas-success) 0%, var(--atlas-cyan) 48%, var(--atlas-primary) 100%);
    --atlas-sidebar-bg: radial-gradient(circle at 50% 0, color-mix(in srgb, var(--atlas-cyan) 8%, transparent), transparent 14rem), linear-gradient(180deg, #071727 0%, #06111d 100%);
    --atlas-topbar-bg: rgba(6, 17, 29, 0.88);
    --atlas-panel-bg: linear-gradient(150deg, rgba(16, 39, 61, 0.96), rgba(10, 28, 46, 0.96));
    --atlas-menu-bg: #0a1c2e;
    --atlas-control-bg: rgba(3, 10, 18, 0.48);
    --atlas-control-focus-bg: rgba(3, 10, 18, 0.72);
    --atlas-table-bg: rgba(10, 28, 46, 0.62);
    --atlas-table-head-bg: rgba(3, 10, 18, 0.3);
    --atlas-hover-bg: rgba(255, 255, 255, 0.045);
    --surface: var(--atlas-surface);
    --border: var(--atlas-border);
    --text: var(--atlas-text);
    --text-muted: var(--atlas-text-soft);
    --atlas-font: "Sora", "Segoe UI", Arial, sans-serif;
    --atlas-radius-sm: 8px;
    --atlas-radius: 12px;
    --atlas-radius-lg: 18px;
    --atlas-sidebar-width: 276px;
    --atlas-sidebar-compact: 88px;
    --atlas-topbar-height: 80px;
    --atlas-transition: 180ms ease;
}

html[data-theme="light"] {
    color-scheme: light;
    --atlas-bg: #f4f7fb;
    --atlas-bg-deep: #e9eff6;
    --atlas-surface: #ffffff;
    --atlas-surface-raised: #ffffff;
    --atlas-surface-soft: #edf3f8;
    --atlas-muted: #6a7d8d;
    --atlas-text: #142433;
    --atlas-text-soft: #5f7384;
    --atlas-border: rgba(28, 57, 78, 0.15);
    --atlas-border-strong: color-mix(in srgb, var(--atlas-primary) 30%, transparent);
    --atlas-shadow-sm: 0 8px 24px rgba(38, 65, 84, 0.1);
    --atlas-shadow-lg: 0 22px 70px rgba(38, 65, 84, 0.18);
    --atlas-sidebar-bg: radial-gradient(circle at 50% 0, color-mix(in srgb, var(--atlas-cyan) 11%, transparent), transparent 14rem), linear-gradient(180deg, #f7fbfe 0%, #edf3f8 100%);
    --atlas-topbar-bg: rgba(255, 255, 255, 0.9);
    --atlas-panel-bg: linear-gradient(150deg, #ffffff, #f8fbfd);
    --atlas-menu-bg: #ffffff;
    --atlas-control-bg: #ffffff;
    --atlas-control-focus-bg: #ffffff;
    --atlas-table-bg: rgba(255, 255, 255, 0.92);
    --atlas-table-head-bg: #edf3f8;
    --atlas-hover-bg: color-mix(in srgb, var(--atlas-primary) 7%, transparent);
}

/* Atlas application modules */
.button.button--primary {
    color: var(--atlas-primary-contrast, #fff);
    border-color: transparent;
    background: var(--atlas-primary, #1261ff);
    box-shadow: 0 10px 24px color-mix(in srgb, var(--atlas-primary) 24%, transparent);
}

.button.button--primary:hover { color: var(--atlas-primary-contrast, #fff); transform: translateY(-1px); box-shadow: 0 12px 28px color-mix(in srgb, var(--atlas-primary) 30%, transparent); }

.content-grid.content-grid--form { grid-template-columns: minmax(280px, .82fr) minmax(0, 1.5fr); }

.inline-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
}

.inline-form select,
.inline-form input { min-width: 8rem; width: auto; }

.permission-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .65rem;
    padding: 1rem;
    border: 1px solid rgba(100, 116, 139, .28);
    border-radius: .9rem;
}

.permission-grid legend { padding: 0 .45rem; color: var(--atlas-text, #e6edf3); font-weight: 700; }

.check-card {
    display: flex;
    align-items: flex-start;
    gap: .7rem;
    padding: .75rem;
    border: 1px solid rgba(100, 116, 139, .22);
    border-radius: .75rem;
    background: var(--atlas-surface-soft);
    cursor: pointer;
}

.check-card:hover { border-color: color-mix(in srgb, var(--atlas-cyan) 50%, transparent); }
.check-card input { width: 1rem; height: 1rem; margin-top: .2rem; accent-color: var(--atlas-primary); }
.check-card span { display: grid; gap: .15rem; }
.check-card small { color: var(--atlas-text-soft); }

.card-list,
.notification-list { display: grid; gap: .75rem; }

.list-card,
.notification-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid rgba(100, 116, 139, .22);
    border-radius: .9rem;
    background: var(--atlas-surface-soft);
}

.list-card h3,
.notification-item h3 { margin: 0 0 .25rem; }
.list-card p,
.notification-item p { margin: 0; color: var(--atlas-text-soft); }
.list-card__meta { display: flex; align-items: center; gap: .7rem; color: var(--atlas-text-soft); }
.plan-list-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(10rem, 11rem);
    gap: 1.25rem;
}
.plan-list-card__content { min-width: 0; }
.plan-list-card__modules { overflow-wrap: anywhere; }
.plan-status-form {
    display: grid;
    min-width: 10rem;
    gap: .5rem;
}
.plan-status-form .form-select,
.plan-status-form .button { width: 100%; }
.plan-status-form .form-select { min-height: 40px; }
.details-form { margin-top: 1rem; min-width: min(42rem, 72vw); }

.notification-item { justify-content: flex-start; }
.notification-item > div { flex: 1; }
.notification-item.is-unread { border-color: color-mix(in srgb, var(--atlas-cyan) 50%, transparent); background: color-mix(in srgb, var(--atlas-primary) 8%, transparent); }
.notification-item__dot { width: .65rem; height: .65rem; flex: 0 0 auto; border-radius: 50%; background: #64748b; }
.notification-item.is-unread .notification-item__dot { background: var(--atlas-cyan); box-shadow: 0 0 0 .3rem color-mix(in srgb, var(--atlas-cyan) 10%, transparent); }
.notification-item__title { display: flex; justify-content: space-between; gap: 1rem; }
.notification-item__title time { color: var(--atlas-text-soft); font-size: .8rem; white-space: nowrap; }

.brand-preview {
    min-height: 8rem;
    display: grid;
    place-content: center;
    text-align: center;
    border: 1px solid color-mix(in srgb, var(--preview-primary) 60%, transparent);
    border-radius: 1rem;
    background: linear-gradient(135deg, var(--preview-secondary), color-mix(in srgb, var(--preview-primary) 18%, #06111d));
    box-shadow: inset 0 0 40px color-mix(in srgb, var(--preview-primary) 12%, transparent);
}

.brand-preview strong { color: #fff; font-size: 1.35rem; letter-spacing: .08em; }
.brand-preview span { color: var(--preview-accent); }
.secret-token { display: block; max-width: 100%; overflow-wrap: anywhere; user-select: all; }

@media (max-width: 920px) {
    .content-grid.content-grid--form { grid-template-columns: 1fr; }
    .plan-list-card { grid-template-columns: minmax(0, 1fr) minmax(10rem, auto); }
    .plan-list-card__content { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
    .permission-grid { grid-template-columns: 1fr; }
    .list-card,
    .notification-item { align-items: flex-start; flex-direction: column; }
    .notification-item__title { flex-direction: column; gap: .25rem; }
    .details-form { min-width: 0; }
    .inline-form > * { width: 100%; }
    .plan-list-card { grid-template-columns: 1fr; }
    .plan-list-card__content { grid-column: auto; }
    .plan-list-card__meta { align-items: flex-start; flex-direction: column; }
    .plan-status-form { width: 100%; }
}

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

html {
    min-width: 320px;
    background: var(--atlas-bg);
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--atlas-text);
    background:
        radial-gradient(circle at 90% -10%, color-mix(in srgb, var(--atlas-primary) 13%, transparent), transparent 32rem),
        var(--atlas-bg);
    font-family: var(--atlas-font);
    font-size: 0.9375rem;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

body.sidebar-open,
body.modal-open {
    overflow: hidden;
}

button,
input,
select,
textarea {
    color: inherit;
    font: inherit;
}

button,
[role="button"] {
    touch-action: manipulation;
}

button:not(:disabled),
select:not(:disabled),
[type="checkbox"]:not(:disabled),
[type="radio"]:not(:disabled) {
    cursor: pointer;
}

img,
svg {
    display: block;
    max-width: 100%;
}

a {
    color: var(--atlas-cyan);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.22em;
}

a:hover {
    color: var(--atlas-success);
}

:focus-visible {
    border-radius: 4px;
    outline: 2px solid var(--atlas-cyan);
    outline-offset: 3px;
}

::selection {
    color: #001018;
    background: var(--atlas-cyan);
}

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

h1,
h2,
h3,
h4 {
    color: var(--atlas-text);
    font-weight: 650;
    letter-spacing: -0.025em;
    line-height: 1.2;
}

.skip-link {
    position: fixed;
    z-index: 10000;
    top: 10px;
    left: 10px;
    padding: 0.75rem 1rem;
    border-radius: var(--atlas-radius-sm);
    color: #001018;
    background: var(--atlas-cyan);
    font-weight: 700;
    transform: translateY(-150%);
    transition: transform var(--atlas-transition);
}

.skip-link:focus {
    transform: translateY(0);
}

.sr-only {
    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;
}

.app-shell {
    min-height: 100vh;
}

.app-frame {
    display: flex;
    min-width: 0;
    min-height: 100vh;
    margin-left: var(--atlas-sidebar-width);
    flex-direction: column;
    transition: margin-left var(--atlas-transition);
}

.sidebar {
    position: fixed;
    z-index: 900;
    inset: 0 auto 0 0;
    display: flex;
    width: var(--atlas-sidebar-width);
    min-height: 100dvh;
    border-right: 1px solid var(--atlas-border);
    background: var(--atlas-sidebar-bg);
    box-shadow: 12px 0 40px rgba(0, 0, 0, 0.18);
    flex-direction: column;
    transition: width var(--atlas-transition), transform var(--atlas-transition);
}

.sidebar__brand {
    display: flex;
    min-height: var(--atlas-topbar-height);
    padding: 0 1rem 0 1.25rem;
    border-bottom: 1px solid var(--atlas-border);
    align-items: center;
    justify-content: space-between;
}

.atlas-brand {
    display: inline-flex;
    min-width: 0;
    color: var(--atlas-text);
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.atlas-brand:hover {
    color: var(--atlas-text);
}

.atlas-brand__mark {
    width: 42px;
    min-width: 42px;
    height: 42px;
    filter: drop-shadow(0 5px 12px color-mix(in srgb, var(--atlas-cyan) 20%, transparent));
}

.atlas-brand__copy {
    display: grid;
    line-height: 1;
    gap: 0.32rem;
}

.atlas-brand__copy strong {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.26em;
}

.atlas-brand__copy small {
    color: var(--atlas-cyan);
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.5em;
}

.icon-button {
    display: inline-grid;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 10px;
    color: var(--atlas-text-soft);
    background: transparent;
    place-items: center;
    transition: color var(--atlas-transition), background var(--atlas-transition), border-color var(--atlas-transition);
}

.icon-button:hover {
    border-color: var(--atlas-border);
    color: var(--atlas-cyan);
    background: var(--atlas-hover-bg);
}

.icon-button svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.sidebar__nav {
    padding: 1.25rem 0.85rem;
    overflow-x: hidden;
    overflow-y: auto;
    flex: 1;
    scrollbar-width: thin;
    scrollbar-color: var(--atlas-muted) transparent;
}

.sidebar__section-label {
    margin: 0 0.75rem 0.6rem;
    color: var(--atlas-text-soft);
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.nav-list {
    display: grid;
    padding: 0;
    margin: 0;
    list-style: none;
    gap: 0.3rem;
}

.nav-link {
    position: relative;
    display: flex;
    min-height: 48px;
    padding: 0.68rem 0.8rem;
    border: 1px solid transparent;
    border-radius: var(--atlas-radius-sm);
    color: var(--atlas-text-soft);
    align-items: center;
    gap: 0.85rem;
    text-decoration: none;
    transition: color var(--atlas-transition), background var(--atlas-transition), border-color var(--atlas-transition);
}

.nav-link::before {
    position: absolute;
    top: 12px;
    bottom: 12px;
    left: -0.85rem;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--atlas-gradient);
    content: "";
    opacity: 0;
    transition: opacity var(--atlas-transition);
}

.nav-link:hover {
    color: var(--atlas-text);
    background: var(--atlas-hover-bg);
}

.nav-link.is-active {
    border-color: color-mix(in srgb, var(--atlas-cyan) 18%, transparent);
    color: var(--atlas-text);
    background: linear-gradient(90deg, color-mix(in srgb, var(--atlas-primary) 20%, transparent), color-mix(in srgb, var(--atlas-cyan) 7%, transparent));
    box-shadow: inset 0 0 22px color-mix(in srgb, var(--atlas-primary) 7%, transparent);
}

.nav-link.is-active::before {
    opacity: 1;
}

.nav-icon {
    width: 21px;
    min-width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.nav-link.is-active .nav-icon {
    color: var(--atlas-cyan);
    filter: drop-shadow(0 0 8px color-mix(in srgb, var(--atlas-cyan) 28%, transparent));
}

.nav-link__label {
    overflow: hidden;
    font-weight: 550;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-link__badge {
    min-width: 24px;
    padding: 0.15rem 0.42rem;
    margin-left: auto;
    border-radius: 999px;
    color: var(--atlas-cyan);
    background: color-mix(in srgb, var(--atlas-cyan) 12%, transparent);
    font-size: 0.7rem;
    font-weight: 700;
    text-align: center;
}

.sidebar__footer {
    display: flex;
    min-height: 74px;
    padding: 1rem 1.35rem;
    border-top: 1px solid var(--atlas-border);
    align-items: center;
    gap: 0.75rem;
}

.status-dot {
    width: 9px;
    min-width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--atlas-success);
    box-shadow: 0 0 0 5px rgba(0, 224, 184, 0.1), 0 0 16px rgba(0, 224, 184, 0.45);
}

.sidebar__footer-copy {
    display: grid;
    overflow: hidden;
    line-height: 1.3;
}

.sidebar__footer-copy strong {
    overflow: hidden;
    font-size: 0.75rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar__footer-copy small {
    color: var(--atlas-text-soft);
    font-size: 0.68rem;
}

.sidebar-backdrop {
    position: fixed;
    z-index: 850;
    inset: 0;
    display: none;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: rgba(1, 7, 12, 0.72);
    backdrop-filter: blur(3px);
}

.topbar {
    position: sticky;
    z-index: 700;
    top: 0;
    display: flex;
    min-height: var(--atlas-topbar-height);
    padding: 0.75rem clamp(1rem, 2.4vw, 2rem);
    border-bottom: 1px solid var(--atlas-border);
    background: var(--atlas-topbar-bg);
    backdrop-filter: blur(16px);
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.topbar__leading,
.topbar__actions,
.topbar__custom-actions {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 0.75rem;
}

.topbar__menu-toggle {
    display: none;
}

.menu-icon {
    display: grid;
    width: 21px;
    gap: 4px;
}

.menu-icon i {
    display: block;
    width: 100%;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
}

.topbar__title-group {
    min-width: 0;
}

.topbar__eyebrow {
    margin: 0 0 0.16rem;
    color: var(--atlas-cyan);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.17em;
    text-transform: uppercase;
}

.topbar__title {
    overflow: hidden;
    margin: 0;
    font-size: clamp(1.12rem, 2vw, 1.42rem);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar__subtitle {
    overflow: hidden;
    max-width: 58ch;
    margin: 0.16rem 0 0;
    color: var(--atlas-text-soft);
    font-size: 0.76rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-menu {
    position: relative;
}

.user-menu__trigger {
    display: flex;
    min-height: 48px;
    padding: 0.35rem 0.5rem;
    border: 1px solid transparent;
    border-radius: var(--atlas-radius);
    align-items: center;
    gap: 0.65rem;
    list-style: none;
    transition: background var(--atlas-transition), border-color var(--atlas-transition);
}

.user-menu__trigger::-webkit-details-marker {
    display: none;
}

.user-menu__trigger:hover,
.user-menu[open] .user-menu__trigger {
    border-color: var(--atlas-border);
    background: var(--atlas-hover-bg);
}

.avatar {
    display: grid;
    width: 38px;
    min-width: 38px;
    height: 38px;
    border: 1px solid color-mix(in srgb, var(--atlas-cyan) 35%, transparent);
    border-radius: 11px;
    color: #001018;
    background: var(--atlas-gradient);
    box-shadow: 0 8px 18px color-mix(in srgb, var(--atlas-primary) 18%, transparent);
    font-weight: 800;
    place-items: center;
}

.user-menu__identity {
    display: grid;
    min-width: 0;
    line-height: 1.2;
    text-align: left;
}

.user-menu__identity strong {
    max-width: 150px;
    overflow: hidden;
    font-size: 0.78rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-menu__identity small {
    color: var(--atlas-text-soft);
    font-size: 0.68rem;
}

.user-menu__chevron {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: var(--atlas-text-soft);
    stroke-width: 1.8;
    transition: transform var(--atlas-transition);
}

.user-menu[open] .user-menu__chevron {
    transform: rotate(180deg);
}

.user-menu__panel {
    position: absolute;
    top: calc(100% + 0.55rem);
    right: 0;
    display: grid;
    width: min(260px, calc(100vw - 2rem));
    padding: 0.45rem;
    border: 1px solid var(--atlas-border-strong);
    border-radius: var(--atlas-radius);
    background: var(--atlas-menu-bg);
    box-shadow: var(--atlas-shadow-lg);
    gap: 0.15rem;
}

.user-menu__summary {
    display: grid;
    padding: 0.7rem 0.8rem 0.8rem;
    margin-bottom: 0.25rem;
    border-bottom: 1px solid var(--atlas-border);
    line-height: 1.35;
}

.user-menu__summary span {
    overflow: hidden;
    color: var(--atlas-text-soft);
    font-size: 0.73rem;
    text-overflow: ellipsis;
}

.user-menu__panel a {
    padding: 0.68rem 0.8rem;
    border-radius: 7px;
    color: var(--atlas-text);
    text-decoration: none;
}

.user-menu__panel a:hover {
    color: var(--atlas-cyan);
    background: var(--atlas-hover-bg);
}

.app-content {
    width: 100%;
    max-width: 1680px;
    padding: clamp(1rem, 2.5vw, 2rem);
    margin: 0 auto;
    flex: 1;
}

.app-content:focus {
    outline: none;
}

.app-footer {
    display: flex;
    padding: 1rem clamp(1rem, 2.5vw, 2rem) 1.35rem;
    border-top: 1px solid var(--atlas-border);
    color: var(--atlas-text-soft);
    font-size: 0.72rem;
    justify-content: space-between;
    gap: 1rem;
}

.app-footer p {
    margin: 0;
}

.app-footer__version {
    color: var(--atlas-muted);
}

/* Content and data components */
.eyebrow {
    margin: 0 0 0.35rem;
    color: var(--atlas-cyan);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.page-intro {
    margin-bottom: 1.35rem;
}

.page-intro h2 {
    margin-bottom: 0.4rem;
    font-size: clamp(1.25rem, 2.3vw, 1.8rem);
}

.page-intro p:last-child {
    max-width: 68ch;
    margin-bottom: 0;
    color: var(--atlas-text-soft);
}

.hero-panel {
    position: relative;
    display: flex;
    min-height: 190px;
    padding: clamp(1.25rem, 3vw, 2rem);
    margin-bottom: 1.25rem;
    border: 1px solid var(--atlas-border-strong);
    border-radius: var(--atlas-radius-lg);
    background:
        radial-gradient(circle at 86% 50%, color-mix(in srgb, var(--atlas-cyan) 12%, transparent), transparent 20rem),
        linear-gradient(120deg, color-mix(in srgb, var(--atlas-primary) 15%, transparent), rgba(10, 28, 46, 0.95) 44%);
    box-shadow: var(--atlas-shadow-sm);
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    overflow: hidden;
}

.hero-panel::after {
    position: absolute;
    right: -4rem;
    bottom: -6rem;
    width: 20rem;
    height: 12rem;
    border: 1px solid color-mix(in srgb, var(--atlas-cyan) 15%, transparent);
    border-radius: 50%;
    content: "";
    transform: rotate(-12deg);
}

.hero-panel > * {
    position: relative;
    z-index: 1;
}

.hero-panel h2 {
    margin-bottom: 0.45rem;
    font-size: clamp(1.5rem, 3vw, 2.25rem);
}

.hero-panel p:last-child {
    max-width: 64ch;
    margin-bottom: 0;
    color: var(--atlas-text-soft);
}

.hero-panel__actions,
.form-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.7rem;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 1.25rem;
    gap: 1rem;
}

.metric-grid .metric-card {
    position: relative;
    min-height: 148px;
    padding: 1.2rem;
    border: 1px solid var(--atlas-border);
    border-radius: var(--atlas-radius);
    background: var(--atlas-panel-bg);
    box-shadow: var(--atlas-shadow-sm);
}

.metric-grid .metric-card p {
    margin-bottom: 0.75rem;
    color: var(--atlas-text-soft);
    font-size: 0.74rem;
    font-weight: 600;
}

.metric-grid .metric-card > strong {
    display: block;
    margin-bottom: 0.6rem;
    font-size: clamp(1.45rem, 3vw, 2rem);
    letter-spacing: -0.04em;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.metric-grid .metric-card > small {
    color: var(--atlas-text-soft);
    font-size: 0.69rem;
}

.metric-card__accent {
    position: absolute;
    top: 0;
    right: 1rem;
    left: 1rem;
    height: 2px;
    border-radius: 0 0 3px 3px;
    background: var(--atlas-primary);
}

.metric-card__accent--2 { background: var(--atlas-cyan); }
.metric-card__accent--3 { background: var(--atlas-success); }

.content-grid {
    display: grid;
    min-width: 0;
    gap: 1rem;
}

.content-grid--sidebar {
    grid-template-columns: minmax(0, 1.65fr) minmax(280px, 0.75fr);
}

.card-grid--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.panel--narrow {
    width: min(680px, 100%);
    margin: 2rem auto;
}

.panel--narrow .form-actions,
.panel > .form-actions {
    padding: 1.25rem;
}

.panel > form.form-grid {
    padding: 1.25rem;
}

.panel > form.form-grid .form-actions {
    padding-top: 0.25rem;
}

.form-stack {
    display: grid;
    padding: 1.25rem;
    gap: 1rem;
}

.auth-card .form-stack,
.context-card .form-stack {
    padding: 0;
}

.button--block {
    width: 100%;
}

.context-card {
    display: grid;
    padding: 1.25rem;
    align-content: start;
    gap: 1rem;
}

.context-card__mark {
    display: grid;
    width: 52px;
    height: 52px;
    border: 1px solid color-mix(in srgb, var(--atlas-cyan) 30%, transparent);
    border-radius: 15px;
    color: #001018;
    background: var(--atlas-gradient);
    font-size: 1.25rem;
    font-weight: 800;
    place-items: center;
}

.detail-list {
    display: grid;
    padding: 0 1.25rem 1.25rem;
    margin: 0;
}

.detail-list > div {
    display: flex;
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--atlas-border);
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.detail-list > div:last-child {
    border-bottom: 0;
}

.detail-list dt {
    color: var(--atlas-text-soft);
    font-size: 0.75rem;
}

.detail-list dd {
    margin: 0;
    font-size: 0.78rem;
    font-weight: 600;
    text-align: right;
}

.status-list {
    display: grid;
    padding: 0 1.25rem 1.25rem;
    margin: 0;
    list-style: none;
    gap: 0.25rem;
}

.status-list li {
    display: flex;
    min-height: 58px;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--atlas-border);
    align-items: center;
    gap: 0.85rem;
}

.status-list li:last-child {
    border-bottom: 0;
}

.status-list li div {
    display: grid;
}

.status-list small {
    color: var(--atlas-text-soft);
    font-size: 0.69rem;
}

.empty-state--compact {
    min-height: 150px;
    padding: 1.25rem;
}

/* Authentication */
.auth-page {
    display: grid;
    min-height: 100dvh;
    background:
        radial-gradient(circle at 12% 20%, color-mix(in srgb, var(--atlas-cyan) 12%, transparent), transparent 28rem),
        radial-gradient(circle at 88% 80%, color-mix(in srgb, var(--atlas-primary) 12%, transparent), transparent 28rem),
        var(--atlas-bg-deep);
    place-items: center;
}

.auth-shell {
    display: grid;
    width: min(1120px, calc(100% - 2rem));
    min-height: min(680px, calc(100dvh - 2rem));
    border: 1px solid var(--atlas-border);
    border-radius: 22px;
    background: rgba(6, 17, 29, 0.88);
    box-shadow: var(--atlas-shadow-lg);
    grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
    overflow: hidden;
}

.auth-hero {
    position: relative;
    display: flex;
    padding: clamp(2rem, 5vw, 4.5rem);
    background:
        radial-gradient(circle at 75% 20%, rgba(0, 224, 184, 0.13), transparent 18rem),
        linear-gradient(145deg, color-mix(in srgb, var(--atlas-primary) 18%, transparent), rgba(10, 28, 46, 0.88));
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
}

.auth-hero::after {
    position: absolute;
    right: -8rem;
    bottom: -7rem;
    width: 30rem;
    height: 16rem;
    border: 1px solid color-mix(in srgb, var(--atlas-cyan) 16%, transparent);
    border-radius: 50%;
    content: "";
    transform: rotate(-14deg);
}

.auth-brand {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.auth-brand__mark {
    width: 50px;
    height: 50px;
}

.auth-brand span {
    display: grid;
    line-height: 1;
    gap: 0.35rem;
}

.auth-brand strong {
    letter-spacing: 0.28em;
}

.auth-brand small {
    color: var(--atlas-cyan);
    font-size: 0.61rem;
    font-weight: 700;
    letter-spacing: 0.4em;
}

.auth-hero__content {
    position: relative;
    z-index: 1;
    max-width: 560px;
}

.auth-hero__content h1 {
    margin-bottom: 1rem;
    font-size: clamp(2rem, 4.5vw, 3.5rem);
}

.auth-hero__content > p:last-child,
.auth-hero__footer {
    color: var(--atlas-text-soft);
}

.auth-hero__footer {
    position: relative;
    z-index: 1;
    margin: 0;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.auth-card {
    display: flex;
    padding: clamp(1.5rem, 4vw, 3.25rem);
    background: color-mix(in srgb, var(--atlas-surface) 90%, transparent);
    flex-direction: column;
    justify-content: center;
}

.auth-card__header {
    margin-bottom: 1.35rem;
}

.auth-card__header h2 {
    margin-bottom: 0.45rem;
    font-size: 1.6rem;
}

.auth-card__header > p:last-child,
.auth-card__help {
    color: var(--atlas-text-soft);
    font-size: 0.76rem;
}

.auth-card__help {
    margin: 1.25rem 0 0;
    text-align: center;
}

.page-header {
    display: flex;
    margin-bottom: 1.5rem;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
}

.page-header h2 {
    margin-bottom: 0.35rem;
    font-size: clamp(1.25rem, 2vw, 1.75rem);
}

.page-header p {
    max-width: 70ch;
    margin-bottom: 0;
    color: var(--atlas-text-soft);
}

.cluster {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.stack {
    display: grid;
    gap: 1rem;
}

.dashboard-grid,
.card-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.card,
.panel {
    min-width: 0;
    border: 1px solid var(--atlas-border);
    border-radius: var(--atlas-radius);
    background: var(--atlas-panel-bg);
    box-shadow: var(--atlas-shadow-sm);
}

.card {
    padding: 1.25rem;
}

.card--interactive {
    transition: border-color var(--atlas-transition), transform var(--atlas-transition), box-shadow var(--atlas-transition);
}

.card--interactive:hover {
    border-color: var(--atlas-border-strong);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.25);
    transform: translateY(-2px);
}

.card__header,
.panel__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.card__header h2,
.card__header h3,
.panel__header h2,
.panel__header h3 {
    margin: 0;
    font-size: 1rem;
}

.panel__header {
    padding: 1.15rem 1.25rem;
    border-bottom: 1px solid var(--atlas-border);
}

.panel__body {
    padding: 1.25rem;
}

.metric-card {
    position: relative;
    overflow: hidden;
}

.metric-card::after {
    position: absolute;
    right: -35px;
    bottom: -45px;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--atlas-primary) 10%, transparent);
    content: "";
    filter: blur(2px);
}

.metric-card__label {
    display: block;
    margin-bottom: 0.7rem;
    color: var(--atlas-text-soft);
    font-size: 0.76rem;
    font-weight: 600;
}

.metric-card__value {
    display: block;
    margin-bottom: 0.55rem;
    color: var(--atlas-white);
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.metric-card__trend {
    color: var(--atlas-text-soft);
    font-size: 0.72rem;
}

.metric-card__trend.is-positive {
    color: var(--atlas-success);
}

.metric-card__trend.is-negative {
    color: var(--atlas-danger);
}

.text-muted {
    color: var(--atlas-text-soft) !important;
}

.text-success {
    color: var(--atlas-success) !important;
}

.text-danger {
    color: var(--atlas-danger) !important;
}

.divider {
    height: 1px;
    margin: 1rem 0;
    border: 0;
    background: var(--atlas-border);
}

/* Buttons */
.button,
.btn {
    display: inline-flex;
    min-height: 44px;
    padding: 0.65rem 1rem;
    border: 1px solid transparent;
    border-radius: var(--atlas-radius-sm);
    color: var(--atlas-primary-contrast, var(--atlas-white));
    background: var(--atlas-primary);
    box-shadow: 0 8px 20px color-mix(in srgb, var(--atlas-primary) 20%, transparent);
    font-weight: 650;
    line-height: 1.2;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
    transition: background var(--atlas-transition), border-color var(--atlas-transition), color var(--atlas-transition), transform var(--atlas-transition), box-shadow var(--atlas-transition);
}

.button:hover,
.btn:hover {
    color: var(--atlas-primary-contrast, var(--atlas-white));
    background: var(--atlas-primary-hover);
    box-shadow: 0 10px 26px color-mix(in srgb, var(--atlas-primary) 30%, transparent);
    transform: translateY(-1px);
}

.button:active,
.btn:active {
    transform: translateY(0);
}

.button--secondary,
.btn-secondary {
    border-color: color-mix(in srgb, var(--atlas-cyan) 45%, transparent);
    color: var(--atlas-cyan);
    background: color-mix(in srgb, var(--atlas-cyan) 6%, transparent);
    box-shadow: none;
}

.button--secondary:hover,
.btn-secondary:hover {
    border-color: var(--atlas-cyan);
    color: #001018;
    background: var(--atlas-cyan);
    box-shadow: 0 10px 24px color-mix(in srgb, var(--atlas-cyan) 16%, transparent);
}

.button--ghost,
.btn-ghost {
    border-color: var(--atlas-border);
    color: var(--atlas-text);
    background: transparent;
    box-shadow: none;
}

.button--ghost:hover,
.btn-ghost:hover {
    border-color: var(--atlas-border-strong);
    color: var(--atlas-cyan);
    background: rgba(255, 255, 255, 0.04);
    box-shadow: none;
}

.button--danger,
.btn-danger {
    border-color: rgba(251, 113, 133, 0.35);
    color: #fff;
    background: #be314b;
    box-shadow: 0 8px 20px rgba(190, 49, 75, 0.2);
}

.button--small,
.btn-sm {
    min-height: 36px;
    padding: 0.45rem 0.7rem;
    font-size: 0.78rem;
}

.button--icon {
    width: 44px;
    padding: 0;
}

.button:disabled,
.btn:disabled,
.is-disabled {
    cursor: not-allowed;
    opacity: 0.48;
    pointer-events: none;
}

/* Forms */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.form-group,
.field {
    display: grid;
    min-width: 0;
    gap: 0.42rem;
}

.form-group--full,
.field--full {
    grid-column: 1 / -1;
}

.form-label,
.field label,
label.form-label {
    color: var(--atlas-text);
    font-size: 0.78rem;
    font-weight: 600;
}

.form-label .required,
.field .required {
    color: var(--atlas-danger);
}

.form-control,
.form-select,
.field input:not([type="checkbox"]):not([type="radio"]),
.field select,
.field textarea {
    width: 100%;
    min-height: 46px;
    padding: 0.7rem 0.82rem;
    border: 1px solid var(--atlas-border);
    border-radius: var(--atlas-radius-sm);
    color: var(--atlas-text);
    background: var(--atlas-control-bg);
    outline: none;
    transition: border-color var(--atlas-transition), box-shadow var(--atlas-transition), background var(--atlas-transition);
}

/* Select global: mantém filtros, tabelas, cards e formulários no mesmo padrão. */
select:not([multiple]) {
    min-height: 46px;
    padding: 0.7rem 2.6rem 0.7rem 0.82rem;
    border: 1px solid var(--atlas-border);
    border-radius: var(--atlas-radius-sm);
    color: var(--atlas-text);
    background-color: var(--atlas-control-bg);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a9bac9' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.78rem center;
    background-size: 1rem;
    outline: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    transition: border-color var(--atlas-transition), box-shadow var(--atlas-transition), background-color var(--atlas-transition);
}

select:not([multiple]):hover {
    border-color: rgba(148, 163, 184, 0.36);
    background-color: var(--atlas-control-focus-bg);
}

select:not([multiple]):focus {
    border-color: var(--atlas-cyan);
    background-color: var(--atlas-control-focus-bg);
    box-shadow: var(--atlas-focus);
}

select:disabled {
    cursor: not-allowed;
    opacity: 0.52;
}

select option,
select optgroup {
    color: var(--atlas-text);
    background: var(--atlas-surface);
}

textarea.form-control,
.field textarea {
    min-height: 120px;
    resize: vertical;
}

.form-control:hover,
.form-select:hover,
.field input:hover,
.field select:hover,
.field textarea:hover {
    border-color: rgba(148, 163, 184, 0.36);
}

.form-control:focus,
.form-select:focus,
.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: var(--atlas-cyan);
    background-color: var(--atlas-control-focus-bg);
    box-shadow: var(--atlas-focus);
}

.form-control::placeholder,
.field input::placeholder,
.field textarea::placeholder {
    color: #8192a4;
    opacity: 1;
}

.form-control[aria-invalid="true"],
.field [aria-invalid="true"],
.is-invalid {
    border-color: var(--atlas-danger) !important;
    box-shadow: 0 0 0 3px rgba(251, 113, 133, 0.13) !important;
}

.field-help,
.form-text {
    margin: 0;
    color: var(--atlas-text-soft);
    font-size: 0.72rem;
}

.field-error,
.invalid-feedback {
    margin: 0;
    color: #ff9bac;
    font-size: 0.72rem;
}

.input-group {
    position: relative;
    display: flex;
}

.input-group .form-control {
    padding-right: 3rem;
}

.input-action {
    position: absolute;
    top: 1px;
    right: 1px;
    width: 44px;
    height: 44px;
    border: 0;
    color: var(--atlas-text-soft);
    background: transparent;
}

input[type="checkbox"],
input[type="radio"] {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--atlas-primary);
}

.check-row {
    display: flex;
    min-height: 44px;
    align-items: center;
    gap: 0.65rem;
}

/* Tables */
.table-wrap {
    width: 100%;
    border: 1px solid var(--atlas-border);
    border-radius: var(--atlas-radius);
    overflow-x: auto;
    background: var(--atlas-table-bg);
    scrollbar-width: thin;
    scrollbar-color: var(--atlas-muted) transparent;
}

.data-table,
.table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    font-size: 0.82rem;
}

.data-table th,
.data-table td,
.table th,
.table td {
    padding: 0.88rem 1rem;
    border-bottom: 1px solid var(--atlas-border);
    text-align: left;
    vertical-align: middle;
}

.data-table th,
.table th {
    color: var(--atlas-text-soft);
    background: var(--atlas-table-head-bg);
    font-size: 0.69rem;
    font-weight: 700;
    letter-spacing: 0.055em;
    text-transform: uppercase;
    white-space: nowrap;
}

.data-table tbody tr,
.table tbody tr {
    transition: background var(--atlas-transition);
}

.data-table tbody tr:hover,
.table tbody tr:hover {
    background: color-mix(in srgb, var(--atlas-cyan) 3.5%, transparent);
}

.data-table tr:last-child td,
.table tr:last-child td {
    border-bottom: 0;
}

.table-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.35rem;
}

/* Status and feedback */
.badge,
.status-badge {
    display: inline-flex;
    min-height: 26px;
    padding: 0.25rem 0.58rem;
    border: 1px solid var(--atlas-border);
    border-radius: 999px;
    color: var(--atlas-text-soft);
    background: rgba(100, 116, 139, 0.12);
    font-size: 0.68rem;
    font-weight: 700;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
}

.badge::before,
.status-badge::before {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    content: "";
}

.badge--success,
.status-active {
    border-color: rgba(0, 224, 184, 0.25);
    color: var(--atlas-success);
    background: rgba(0, 224, 184, 0.08);
}

.badge--warning,
.status-trial,
.status-pending {
    border-color: rgba(251, 191, 36, 0.25);
    color: #ffd76b;
    background: rgba(251, 191, 36, 0.08);
}

.badge--danger,
.status-expired,
.status-suspended,
.status-cancelled {
    border-color: rgba(251, 113, 133, 0.25);
    color: #ff9bac;
    background: rgba(251, 113, 133, 0.08);
}

.badge--info {
    border-color: rgba(56, 189, 248, 0.25);
    color: #7dd3fc;
    background: rgba(56, 189, 248, 0.08);
}

.alert-stack {
    display: grid;
    margin-bottom: 1.25rem;
    gap: 0.7rem;
}

.alert {
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr auto;
    padding: 0.9rem 1rem;
    border: 1px solid var(--atlas-border);
    border-left-width: 3px;
    border-radius: var(--atlas-radius-sm);
    background: var(--atlas-surface-raised);
    box-shadow: var(--atlas-shadow-sm);
    align-items: flex-start;
    gap: 0.75rem;
    transition: opacity var(--atlas-transition), transform var(--atlas-transition), max-height 240ms ease, margin 240ms ease, padding 240ms ease;
}

.alert.is-leaving {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    margin: 0;
    opacity: 0;
    overflow: hidden;
    transform: translateY(-6px);
}

.alert__icon {
    display: grid;
    width: 22px;
    height: 22px;
    margin-top: 0.05rem;
    border: 2px solid currentColor;
    border-radius: 50%;
    place-items: center;
}

.alert__icon::after {
    font-size: 0.72rem;
    font-weight: 800;
    content: "i";
}

.alert__content strong {
    display: block;
    margin-bottom: 0.12rem;
    color: var(--atlas-text);
    font-size: 0.8rem;
}

.alert__content p {
    margin: 0;
    color: var(--atlas-text-soft);
    font-size: 0.76rem;
}

.alert__close {
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 7px;
    color: var(--atlas-text-soft);
    background: transparent;
    font-size: 1.25rem;
    line-height: 1;
}

.alert__close:hover {
    color: var(--atlas-text);
    background: rgba(255, 255, 255, 0.06);
}

.alert--success { border-left-color: var(--atlas-success); color: var(--atlas-success); }
.alert--error { border-left-color: var(--atlas-danger); color: var(--atlas-danger); }
.alert--warning { border-left-color: var(--atlas-warning); color: var(--atlas-warning); }
.alert--info { border-left-color: var(--atlas-info); color: var(--atlas-info); }
.alert--success .alert__icon::after { content: "✓"; }
.alert--error .alert__icon::after { content: "!"; }
.alert--warning .alert__icon::after { content: "!"; }

.empty-state {
    display: grid;
    min-height: 260px;
    padding: 2rem;
    color: var(--atlas-text-soft);
    text-align: center;
    place-items: center;
}

.empty-state__content {
    max-width: 480px;
}

.empty-state__icon {
    display: grid;
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    border: 1px solid var(--atlas-border-strong);
    border-radius: 18px;
    color: var(--atlas-cyan);
    background: linear-gradient(135deg, color-mix(in srgb, var(--atlas-success) 10%, transparent), color-mix(in srgb, var(--atlas-primary) 12%, transparent));
    place-items: center;
}

.empty-state h2,
.empty-state h3 {
    margin-bottom: 0.45rem;
}

.empty-state p {
    margin-bottom: 1.15rem;
}

.skeleton {
    position: relative;
    overflow: hidden;
    min-height: 14px;
    border-radius: 6px;
    background: rgba(100, 116, 139, 0.16);
}

.skeleton::after {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(230, 237, 243, 0.08), transparent);
    content: "";
    animation: atlas-shimmer 1.5s infinite;
    transform: translateX(-100%);
}

@keyframes atlas-shimmer {
    to { transform: translateX(100%); }
}

/* Pagination, tabs and modal */
.pagination {
    display: flex;
    padding: 0;
    margin: 1rem 0 0;
    flex-wrap: wrap;
    gap: 0.35rem;
    list-style: none;
}

.pagination a,
.pagination span {
    display: grid;
    min-width: 40px;
    min-height: 40px;
    padding: 0.45rem;
    border: 1px solid var(--atlas-border);
    border-radius: 8px;
    color: var(--atlas-text-soft);
    background: var(--atlas-surface-soft);
    text-decoration: none;
    place-items: center;
}

.pagination a:hover,
.pagination .is-current,
.pagination [aria-current="page"] {
    border-color: var(--atlas-primary);
    color: var(--atlas-primary-contrast, var(--atlas-white));
    background: var(--atlas-primary);
}

.tabs {
    display: flex;
    padding: 0.25rem;
    border: 1px solid var(--atlas-border);
    border-radius: 10px;
    background: var(--atlas-surface-soft);
    overflow-x: auto;
    gap: 0.2rem;
}

.tab {
    min-height: 40px;
    padding: 0.55rem 0.8rem;
    border: 0;
    border-radius: 7px;
    color: var(--atlas-text-soft);
    background: transparent;
    white-space: nowrap;
}

.tab[aria-selected="true"] {
    color: var(--atlas-white);
    background: color-mix(in srgb, var(--atlas-primary) 26%, transparent);
}

[role="tabpanel"][hidden] {
    display: none;
}

.modal,
dialog.modal {
    width: min(600px, calc(100vw - 2rem));
    max-height: calc(100dvh - 2rem);
    padding: 0;
    border: 1px solid var(--atlas-border-strong);
    border-radius: var(--atlas-radius-lg);
    color: var(--atlas-text);
    background: var(--atlas-surface);
    box-shadow: var(--atlas-shadow-lg);
    overflow: auto;
}

.modal::backdrop,
dialog.modal::backdrop {
    background: rgba(1, 7, 12, 0.78);
    backdrop-filter: blur(4px);
}

.modal__header,
.modal__footer {
    display: flex;
    padding: 1rem 1.25rem;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.modal__header {
    border-bottom: 1px solid var(--atlas-border);
}

.modal__header h2,
.modal__header h3 {
    margin: 0;
    font-size: 1.05rem;
}

.modal__body {
    padding: 1.25rem;
}

.modal__footer {
    border-top: 1px solid var(--atlas-border);
    justify-content: flex-end;
}

/* White-label */
body[data-branding="custom"] .sidebar {
    background:
        radial-gradient(circle at 50% 0, color-mix(in srgb, var(--brand-accent) 9%, transparent), transparent 14rem),
        linear-gradient(180deg, color-mix(in srgb, var(--brand-secondary) 92%, #000 8%), var(--brand-secondary));
}

body[data-branding="custom"] .nav-link.is-active {
    border-color: color-mix(in srgb, var(--brand-accent) 24%, transparent);
    background: linear-gradient(90deg, color-mix(in srgb, var(--brand-primary) 25%, transparent), color-mix(in srgb, var(--brand-accent) 7%, transparent));
}

body[data-branding="custom"] .atlas-brand__copy strong {
    font-size: 0.86rem;
    letter-spacing: 0.04em;
}

.atlas-brand__logo-frame {
    display: grid;
    width: 48px;
    min-width: 48px;
    height: 46px;
    padding: 0.3rem;
    border: 1px solid color-mix(in srgb, var(--brand-accent) 25%, transparent);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    place-items: center;
}

.atlas-brand__logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.atlas-brand__copy strong {
    max-width: 148px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.branding-panel {
    min-width: 0;
}

.branding-assets {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
}

.branding-upload-card {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    padding: 0.9rem;
    border: 1px solid var(--atlas-border);
    border-radius: var(--atlas-radius);
    background: var(--atlas-surface-soft);
    align-items: center;
    gap: 0.9rem;
}

.branding-upload-card__visual {
    display: grid;
    width: 112px;
    height: 84px;
    padding: 0.65rem;
    border: 1px dashed color-mix(in srgb, var(--brand-accent) 42%, transparent);
    border-radius: 12px;
    background: var(--brand-secondary, #0a1c2e);
    place-items: center;
    overflow: hidden;
}

.branding-upload-card--favicon {
    grid-template-columns: 84px minmax(0, 1fr);
}

.branding-upload-card--favicon .branding-upload-card__visual {
    width: 76px;
    height: 76px;
}

.branding-upload-card__visual img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.branding-upload-card__visual.is-removed {
    opacity: 0.55;
}

.branding-fallback-mark {
    display: grid;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    color: #001018;
    background: var(--atlas-gradient);
    font-size: 1.4rem;
    font-weight: 800;
    place-items: center;
}

.branding-file-input {
    width: 100%;
    min-height: 42px;
    padding: 0.38rem;
    margin-top: 0.5rem;
    border: 1px solid var(--atlas-border);
    border-radius: 8px;
    color: var(--atlas-text-soft);
    background: var(--atlas-control-bg);
    font-size: 0.7rem;
}

.branding-file-input::file-selector-button {
    min-height: 32px;
    padding: 0.4rem 0.65rem;
    margin-right: 0.55rem;
    border: 0;
    border-radius: 6px;
    color: #fff;
    background: var(--brand-primary, var(--atlas-primary));
    font-weight: 650;
}

.branding-colors {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.8rem;
}

.branding-color-field {
    display: grid;
    padding: 0.8rem;
    border: 1px solid var(--atlas-border);
    border-radius: 10px;
    background: var(--atlas-surface-soft);
    gap: 0.45rem;
}

.branding-color-field > span:first-child {
    font-size: 0.77rem;
    font-weight: 650;
}

.branding-color-field__control {
    display: flex;
    min-height: 42px;
    padding: 0.25rem 0.5rem 0.25rem 0.25rem;
    border: 1px solid var(--atlas-border);
    border-radius: 8px;
    align-items: center;
    gap: 0.55rem;
}

.branding-color-field input[type="color"] {
    width: 44px;
    height: 34px;
    padding: 2px;
    border: 0;
    border-radius: 6px;
    background: transparent;
}

.branding-color-field output {
    font-family: Consolas, monospace;
    font-size: 0.75rem;
}

.branding-color-field small,
.branding-meta-fields small {
    color: var(--atlas-text-soft);
    font-size: 0.68rem;
}

.contrast-checks {
    display: flex;
    padding: 0.75rem;
    border: 1px solid var(--atlas-border);
    border-radius: 10px;
    background: var(--atlas-surface-soft);
    flex-wrap: wrap;
    gap: 0.5rem;
}

.contrast-checks span {
    display: inline-flex;
    min-height: 30px;
    padding: 0.32rem 0.62rem;
    border: 1px solid currentColor;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 650;
    align-items: center;
    gap: 0.3rem;
}

.contrast-checks span::before {
    content: "✓";
}

.contrast-checks .is-valid {
    color: var(--atlas-success);
    background: rgba(0, 224, 184, 0.06);
}

.contrast-checks .is-invalid {
    color: #ff9bac;
    background: rgba(251, 113, 133, 0.07);
}

.contrast-checks .is-invalid::before {
    content: "!";
}

.branding-preview-toolbar {
    display: flex;
    min-height: 44px;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.preview-switch {
    display: flex;
    padding: 0.2rem;
    border: 1px solid var(--atlas-border);
    border-radius: 8px;
    background: var(--atlas-surface-soft);
}

.preview-switch button {
    min-height: 34px;
    padding: 0.4rem 0.7rem;
    border: 0;
    border-radius: 6px;
    color: var(--atlas-text-soft);
    background: transparent;
    font-size: 0.7rem;
}

.preview-switch button.is-active {
    color: #fff;
    background: var(--brand-primary, var(--atlas-primary));
}

.brand-preview.brand-preview--app {
    display: grid;
    width: 100%;
    min-height: 320px;
    padding: 0;
    border-color: color-mix(in srgb, var(--preview-accent) 45%, transparent);
    background: #06111d;
    box-shadow: var(--atlas-shadow-sm);
    grid-template-columns: minmax(130px, 24%) minmax(0, 1fr);
    place-content: stretch;
    text-align: left;
    overflow: hidden;
    transition: width var(--atlas-transition), grid-template-columns var(--atlas-transition);
}

.brand-preview--app.is-mobile {
    width: min(360px, 100%);
    min-height: 540px;
    margin-inline: auto;
    grid-template-columns: 72px minmax(0, 1fr);
}

.brand-preview__sidebar {
    display: flex;
    padding: 1rem;
    background: var(--preview-secondary);
    flex-direction: column;
    gap: 0.8rem;
}

.brand-preview__sidebar > i {
    display: block;
    width: 80%;
    height: 9px;
    border-radius: 8px;
    background: color-mix(in srgb, var(--preview-accent) 18%, transparent);
}

.brand-preview__sidebar > i:first-of-type {
    background: color-mix(in srgb, var(--preview-primary) 50%, transparent);
}

.brand-preview__logo {
    display: flex;
    min-height: 52px;
    margin-bottom: 0.7rem;
    align-items: center;
    gap: 0.55rem;
    overflow: hidden;
}

.brand-preview__logo img {
    width: min(100%, 130px);
    max-height: 48px;
    object-fit: contain;
    object-position: left center;
}

.brand-preview__logo strong {
    color: #fff;
    font-size: 0.78rem;
}

.brand-preview__logo .branding-fallback-mark {
    width: 38px;
    min-width: 38px;
    height: 38px;
    border-radius: 9px;
    font-size: 1rem;
}

.brand-preview__content {
    display: flex;
    min-width: 0;
    padding: 1rem;
    flex-direction: column;
    gap: 1rem;
}

.brand-preview__topbar {
    display: flex;
    min-height: 46px;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.16);
    color: #e6edf3;
    font-size: 0.78rem;
    font-weight: 650;
    align-items: center;
    justify-content: space-between;
}

.brand-preview__topbar b {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: var(--preview-primary);
}

.brand-preview__message {
    color: var(--preview-accent);
    font-size: 0.74rem;
}

.brand-preview__cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.6rem;
}

.brand-preview__cards span {
    min-height: 74px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 9px;
    background: color-mix(in srgb, var(--preview-secondary) 75%, #10273d);
}

.brand-preview__content > button {
    width: fit-content;
    min-height: 36px;
    padding: 0.5rem 0.8rem;
    margin-top: auto;
    border: 0;
    border-radius: 7px;
    color: #fff;
    background: var(--preview-primary);
    font-size: 0.7rem;
    font-weight: 700;
    pointer-events: none;
}

.brand-preview--app.is-mobile .brand-preview__sidebar {
    padding: 0.7rem;
}

.brand-preview--app.is-mobile .brand-preview__logo strong,
.brand-preview--app.is-mobile .brand-preview__sidebar > i {
    display: none;
}

.brand-preview--app.is-mobile .brand-preview__cards {
    grid-template-columns: 1fr;
}

.brand-preview--app.is-mobile .brand-preview__cards span {
    min-height: 86px;
}

@media (min-width: 1025px) {
    .app-shell.is-sidebar-collapsed .atlas-brand__logo-frame {
        width: 42px;
        min-width: 42px;
    }
}

@media (max-width: 1100px) {
    .branding-assets,
    .branding-colors {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .branding-upload-card,
    .branding-upload-card--favicon {
        grid-template-columns: 1fr;
    }

    .branding-upload-card__visual,
    .branding-upload-card--favicon .branding-upload-card__visual {
        width: 100%;
        height: 110px;
    }

    .branding-upload-card--favicon .branding-upload-card__visual img {
        max-width: 72px;
    }

    .branding-preview-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .brand-preview.brand-preview--app {
        min-height: 480px;
        grid-template-columns: 68px minmax(0, 1fr);
    }

    .brand-preview__sidebar {
        padding: 0.65rem;
    }

    .brand-preview__logo strong,
    .brand-preview__sidebar > i {
        display: none;
    }

    .brand-preview__cards {
        grid-template-columns: 1fr;
    }
}

/* Shared support for Chamados modules */
.stack > * {
    min-width: 0;
}

.prose {
    color: var(--atlas-text-soft);
    line-height: 1.72;
    overflow-wrap: anywhere;
}

.prose > :last-child {
    margin-bottom: 0;
}

.timeline {
    position: relative;
    display: grid;
    padding-left: 1.25rem;
    gap: 0.8rem;
}

.timeline::before {
    position: absolute;
    top: 0.4rem;
    bottom: 0.4rem;
    left: 0.35rem;
    width: 1px;
    background: var(--atlas-border-strong);
    content: "";
}

.timeline-item {
    position: relative;
    padding: 0.9rem 1rem;
    border: 1px solid var(--atlas-border);
    border-radius: var(--atlas-radius-sm);
    background: var(--atlas-surface-soft);
}

.timeline-item::before {
    position: absolute;
    top: 1.1rem;
    left: -1.28rem;
    width: 9px;
    height: 9px;
    border: 2px solid var(--atlas-bg);
    border-radius: 50%;
    background: var(--atlas-cyan);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--atlas-cyan) 18%, transparent);
    content: "";
}

.timeline-item.is-internal {
    border-color: rgba(251, 191, 36, 0.26);
    background: rgba(251, 191, 36, 0.045);
}

.timeline-item.is-internal::before {
    background: var(--atlas-warning);
}

.timeline-item__meta {
    display: flex;
    margin-bottom: 0.45rem;
    color: var(--atlas-text-soft);
    font-size: 0.7rem;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.5rem;
}

.ticket-reply {
    padding: 1rem;
    border: 1px solid var(--atlas-border);
    border-radius: var(--atlas-radius);
    background: var(--atlas-surface-soft);
}

.audit-mini {
    display: grid;
    padding: 0;
    margin: 0;
    color: var(--atlas-text-soft);
    font-size: 0.72rem;
    list-style: none;
    gap: 0.45rem;
}

.audit-mini > * {
    padding-bottom: 0.45rem;
    border-bottom: 1px solid var(--atlas-border);
}

.filter-bar {
    display: flex;
    padding: 0.75rem;
    border: 1px solid var(--atlas-border);
    border-radius: var(--atlas-radius);
    background: var(--atlas-surface-soft);
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.65rem;
}

.filter-bar .field {
    min-width: min(190px, 100%);
    flex: 1;
}

.report-bars {
    display: grid;
    gap: 0.65rem;
}

.report-bar {
    display: grid;
    grid-template-columns: minmax(100px, 0.7fr) minmax(140px, 1.6fr) auto;
    min-width: 0;
    color: var(--atlas-text-soft);
    font-size: 0.72rem;
    align-items: center;
    gap: 0.7rem;
}

.report-bar__track {
    height: 9px;
    border-radius: 999px;
    background: rgba(100, 116, 139, 0.17);
    overflow: hidden;
}

.report-bar__fill {
    width: var(--bar-width, 0%);
    height: 100%;
    border-radius: inherit;
    background: var(--badge-color, var(--atlas-gradient));
}

.badge[style*="--badge-color"],
.badge.has-color {
    border-color: color-mix(in srgb, var(--badge-color) 30%, transparent);
    color: var(--badge-color);
    background: color-mix(in srgb, var(--badge-color) 9%, transparent);
}

@media (max-width: 640px) {
    .filter-bar {
        align-items: stretch;
        flex-direction: column;
    }

    .filter-bar > *,
    .filter-bar .field {
        width: 100%;
    }

    .report-bar {
        grid-template-columns: 1fr auto;
    }

    .report-bar__track {
        grid-column: 1 / -1;
        grid-row: 2;
    }
}

/* Utilities */
.w-full { width: 100% !important; }
.mt-0 { margin-top: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }
.text-right { text-align: right !important; }
.nowrap { white-space: nowrap !important; }

/* Collapsed desktop sidebar */
@media (min-width: 1025px) {
    .app-shell.is-sidebar-collapsed .sidebar {
        width: var(--atlas-sidebar-compact);
    }

    .app-shell.is-sidebar-collapsed .app-frame {
        margin-left: var(--atlas-sidebar-compact);
    }

    .app-shell.is-sidebar-collapsed .sidebar__brand {
        padding-inline: 0.75rem;
        justify-content: center;
    }

    .app-shell.is-sidebar-collapsed .atlas-brand,
    .app-shell.is-sidebar-collapsed .atlas-brand__copy,
    .app-shell.is-sidebar-collapsed .sidebar__section-label,
    .app-shell.is-sidebar-collapsed .nav-link__label,
    .app-shell.is-sidebar-collapsed .nav-link__badge,
    .app-shell.is-sidebar-collapsed .sidebar__footer-copy {
        display: none;
    }

    .app-shell.is-sidebar-collapsed .sidebar__collapse,
    .app-shell.is-sidebar-collapsed .topbar__menu-toggle {
        display: inline-grid;
    }

    .app-shell.is-sidebar-collapsed .sidebar__collapse {
        border-color: color-mix(in srgb, var(--atlas-cyan) 22%, transparent);
        color: var(--atlas-cyan);
        background: color-mix(in srgb, var(--atlas-cyan) 8%, transparent);
    }

    .app-shell.is-sidebar-collapsed .sidebar__collapse svg {
        transform: rotate(180deg);
    }

    .app-shell.is-sidebar-collapsed .sidebar__nav {
        padding-inline: 0.75rem;
    }

    .app-shell.is-sidebar-collapsed .nav-link {
        justify-content: center;
        padding-inline: 0.7rem;
    }

    .app-shell.is-sidebar-collapsed .sidebar__footer {
        justify-content: center;
    }
}

@media (max-width: 1200px) {
    .dashboard-grid,
    .card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .card-grid--3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1024px) {
    .sidebar {
        width: min(var(--atlas-sidebar-width), calc(100vw - 3rem));
        transform: translateX(-105%);
    }

    .app-frame {
        margin-left: 0;
    }

    .topbar__menu-toggle {
        display: inline-grid;
    }

    .app-shell.is-sidebar-open .sidebar {
        transform: translateX(0);
    }

    .app-shell.is-sidebar-open .sidebar-backdrop {
        display: block;
    }

    .sidebar__collapse {
        display: none;
    }
}

@media (max-width: 720px) {
    :root {
        --atlas-topbar-height: 68px;
    }

    .topbar {
        padding-inline: 0.75rem;
    }

    .topbar__eyebrow,
    .topbar__subtitle,
    .user-menu__identity,
    .user-menu__chevron {
        display: none;
    }

    .topbar__actions {
        gap: 0.35rem;
    }

    .topbar__custom-actions .button:not(.button--icon) span,
    .topbar__custom-actions .btn:not(.button--icon) span {
        display: none;
    }

    .app-content {
        padding: 1rem 0.75rem 1.5rem;
    }

    .app-footer {
        padding-inline: 0.75rem;
        flex-direction: column;
        gap: 0.25rem;
    }

    .page-header {
        align-items: stretch;
        flex-direction: column;
    }

    .hero-panel {
        min-height: 0;
        align-items: stretch;
        flex-direction: column;
    }

    .hero-panel__actions,
    .form-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .hero-panel__actions .button,
    .form-actions .button {
        width: 100%;
    }

    .metric-grid,
    .content-grid--sidebar,
    .card-grid--3 {
        grid-template-columns: 1fr;
    }

    .auth-shell {
        width: 100%;
        min-height: 100dvh;
        border: 0;
        border-radius: 0;
        grid-template-columns: 1fr;
    }

    .auth-hero {
        min-height: 300px;
        padding: 1.5rem;
    }

    .auth-hero__content h1 {
        font-size: clamp(1.75rem, 9vw, 2.5rem);
    }

    .auth-card {
        padding: 1.5rem;
    }

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

    .card,
    .panel__body,
    .panel__header {
        padding: 1rem;
    }

    .table-wrap[data-card-table] {
        border: 0;
        background: transparent;
        overflow: visible;
    }

    .table-wrap[data-card-table] table,
    .table-wrap[data-card-table] tbody,
    .table-wrap[data-card-table] tr,
    .table-wrap[data-card-table] td {
        display: block;
        width: 100%;
    }

    .table-wrap[data-card-table] thead {
        display: none;
    }

    .table-wrap[data-card-table] tr {
        padding: 0.8rem 1rem;
        margin-bottom: 0.75rem;
        border: 1px solid var(--atlas-border);
        border-radius: var(--atlas-radius);
        background: var(--atlas-surface);
    }

    .table-wrap[data-card-table] td {
        display: grid;
        grid-template-columns: minmax(100px, 40%) 1fr;
        padding: 0.5rem 0;
        border-bottom: 1px solid var(--atlas-border);
        text-align: right;
        gap: 0.75rem;
    }

    .table-wrap[data-card-table] td::before {
        color: var(--atlas-text-soft);
        content: attr(data-label);
        font-size: 0.7rem;
        font-weight: 700;
        text-align: left;
        text-transform: uppercase;
    }

    .table-wrap[data-card-table] td:last-child {
        border-bottom: 0;
    }

    .modal__footer {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .modal__footer .button,
    .modal__footer .btn {
        width: 100%;
    }
}

@media (max-width: 420px) {
    .topbar__title {
        max-width: 42vw;
    }

    .sidebar {
        width: calc(100vw - 1.25rem);
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media print {
    body {
        color: #0a1c2e;
        background: #fff;
    }

    .sidebar,
    .topbar,
    .app-footer,
    .sidebar-backdrop,
    .alert__close,
    [data-no-print] {
        display: none !important;
    }

    .app-frame {
        margin: 0;
    }

    .app-content {
        max-width: none;
        padding: 0;
    }

    .card,
    .panel,
    .table-wrap {
        color: #0a1c2e;
        border-color: #cbd5e1;
        background: #fff;
        box-shadow: none;
        break-inside: avoid;
    }
}

/* CRM comercial */
.crm-subnav {
    display: flex;
    padding: 0.3rem;
    margin-bottom: 1rem;
    border: 1px solid var(--atlas-border);
    border-radius: 12px;
    background: var(--atlas-surface-soft);
    overflow-x: auto;
    scrollbar-width: thin;
    gap: 0.25rem;
}

.crm-subnav a {
    min-height: 38px;
    padding: 0.55rem 0.85rem;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--atlas-text-soft);
    font-size: 0.76rem;
    font-weight: 700;
    white-space: nowrap;
}

.crm-subnav a:hover,
.crm-subnav a:focus-visible {
    color: #fff;
    background: color-mix(in srgb, var(--atlas-primary) 10%, transparent);
}

.crm-subnav a.is-active {
    border-color: color-mix(in srgb, var(--brand-primary) 32%, transparent);
    color: #fff;
    background: color-mix(in srgb, var(--brand-primary) 18%, transparent);
}

.crm-overview-grid,
.crm-detail-grid,
.crm-settings-grid {
    display: grid;
    min-width: 0;
    gap: 1rem;
}

.crm-overview-grid {
    grid-template-columns: minmax(0, 1.6fr) minmax(260px, 0.7fr);
    margin-bottom: 1rem;
}

.crm-detail-grid {
    grid-template-columns: minmax(0, 1.6fr) minmax(290px, 0.7fr);
}

.crm-settings-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 0 1.25rem 1.25rem;
}

.crm-settings-grid > section > h3 {
    margin: 0 0 0.75rem;
    font-size: 0.92rem;
}

.crm-empty {
    display: grid;
    min-height: 190px;
    padding: 1.5rem;
    color: var(--atlas-text-soft);
    text-align: center;
    place-items: center;
    place-content: center;
    gap: 0.5rem;
}

.crm-empty > span {
    display: grid;
    width: 46px;
    height: 46px;
    border: 1px solid color-mix(in srgb, var(--atlas-cyan) 22%, transparent);
    border-radius: 14px;
    color: var(--atlas-cyan);
    background: color-mix(in srgb, var(--atlas-cyan) 6%, transparent);
    font-size: 1.25rem;
    place-items: center;
}

.crm-empty h3,
.crm-empty p {
    max-width: 500px;
    margin: 0;
}

.crm-empty h3 {
    color: var(--atlas-text);
    font-size: 0.96rem;
}

.crm-empty p {
    font-size: 0.76rem;
    line-height: 1.55;
}

.crm-empty--compact {
    min-height: 100px;
    padding: 1rem;
}

.crm-activity-list {
    display: grid;
    padding: 0 1.25rem 1.25rem;
    gap: 0.55rem;
}

.crm-activity {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto auto;
    min-width: 0;
    padding: 0.72rem;
    border: 1px solid var(--atlas-border);
    border-radius: 10px;
    color: var(--atlas-text);
    background: var(--atlas-surface-soft);
    align-items: center;
    gap: 0.7rem;
}

a.crm-activity:hover {
    border-color: color-mix(in srgb, var(--atlas-cyan) 28%, transparent);
    transform: translateY(-1px);
}

.crm-activity--done {
    opacity: 0.66;
}

.crm-activity__icon {
    display: grid;
    width: 38px;
    height: 38px;
    border: 1px solid color-mix(in srgb, var(--atlas-cyan) 20%, transparent);
    border-radius: 10px;
    color: var(--atlas-cyan);
    background: color-mix(in srgb, var(--atlas-cyan) 7%, transparent);
    font-size: 0.75rem;
    font-weight: 800;
    place-items: center;
}

.crm-activity > span:nth-child(2) {
    display: grid;
    min-width: 0;
    gap: 0.2rem;
}

.crm-activity strong,
.crm-activity small {
    overflow: hidden;
    text-overflow: ellipsis;
}

.crm-activity strong {
    font-size: 0.77rem;
    white-space: nowrap;
}

.crm-activity small,
.crm-activity time {
    color: var(--atlas-text-soft);
    font-size: 0.68rem;
}

.crm-health {
    align-self: stretch;
}

.crm-health__item {
    display: grid;
    grid-template-columns: 1fr auto;
    padding: 0.7rem 1.25rem;
    color: var(--atlas-text-soft);
    font-size: 0.73rem;
    gap: 0.55rem;
}

.crm-health__item > strong {
    color: var(--atlas-text);
}

.crm-health__item > div {
    grid-column: 1 / -1;
    height: 7px;
    border-radius: 999px;
    background: rgba(100, 116, 139, 0.18);
    overflow: hidden;
}

.crm-health__item i {
    display: block;
    width: var(--progress, 0%);
    height: 100%;
    border-radius: inherit;
    background: var(--atlas-gradient);
}

.crm-health > .button {
    width: calc(100% - 2.5rem) !important;
    margin: 0.55rem 1.25rem 1.25rem;
}

.crm-kanban-panel {
    overflow: hidden;
}

.crm-kanban {
    display: grid;
    grid-auto-columns: minmax(270px, 1fr);
    grid-auto-flow: column;
    padding: 0 1.25rem 1.25rem;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-snap-type: inline proximity;
    scrollbar-color: color-mix(in srgb, var(--atlas-cyan) 30%, transparent) transparent;
    gap: 0.75rem;
}

.crm-kanban__column {
    min-width: 0;
    min-height: 320px;
    border: 1px solid var(--atlas-border);
    border-top: 2px solid var(--stage-color, var(--atlas-primary));
    border-radius: 12px;
    background: var(--atlas-surface-soft);
    scroll-snap-align: start;
}

.crm-kanban__column > header {
    display: flex;
    min-height: 48px;
    padding: 0.7rem 0.8rem;
    border-bottom: 1px solid var(--atlas-border);
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.crm-kanban__column > header > span {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 0.5rem;
}

.crm-kanban__column > header i {
    width: 8px;
    min-width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--stage-color, var(--atlas-primary));
    box-shadow: 0 0 12px color-mix(in srgb, var(--stage-color) 55%, transparent);
}

.crm-kanban__column > header strong {
    overflow: hidden;
    font-size: 0.76rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.crm-kanban__column > header b {
    min-width: 26px;
    padding: 0.2rem 0.45rem;
    border-radius: 999px;
    color: var(--atlas-text-soft);
    background: rgba(100, 116, 139, 0.13);
    font-size: 0.68rem;
    text-align: center;
}

.crm-kanban__cards {
    display: grid;
    padding: 0.65rem;
    align-content: start;
    gap: 0.6rem;
}

.crm-deal-card {
    display: grid;
    padding: 0.78rem;
    border: 1px solid var(--atlas-border);
    border-radius: 10px;
    background: linear-gradient(145deg, rgba(10, 28, 46, 0.9), rgba(6, 17, 29, 0.92));
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    gap: 0.5rem;
}

.crm-deal-card:hover {
    border-color: color-mix(in srgb, var(--stage-color) 35%, var(--atlas-border));
}

.crm-deal-card a small,
.crm-deal-card p,
.crm-deal-card footer {
    color: var(--atlas-text-soft);
    font-size: 0.66rem;
}

.crm-deal-card h3,
.crm-deal-card p {
    margin: 0;
}

.crm-deal-card h3 {
    margin-top: 0.16rem;
    color: var(--atlas-text);
    font-size: 0.8rem;
    line-height: 1.35;
}

.crm-deal-card > strong {
    font-size: 0.85rem;
}

.crm-deal-card footer {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
}

.crm-stage-move,
.crm-inline-form {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 0.35rem;
}

.crm-stage-move {
    padding-top: 0.5rem;
    border-top: 1px solid var(--atlas-border);
}

.crm-stage-move label,
.crm-stage-move select,
.crm-inline-form select {
    min-width: 0;
    width: 100%;
}

.crm-stage-move label {
    flex: 1;
}

.crm-kanban__empty {
    padding: 1rem 0.6rem;
    border: 1px dashed var(--atlas-border);
    border-radius: 9px;
    color: var(--atlas-text-soft);
    font-size: 0.68rem;
    text-align: center;
}

.crm-record-hero {
    display: flex;
    min-height: 150px;
    padding: 1.4rem;
    margin-bottom: 1rem;
    border: 1px solid color-mix(in srgb, var(--record-color) 28%, var(--atlas-border));
    border-left: 3px solid var(--record-color, var(--atlas-primary));
    border-radius: var(--atlas-radius);
    background: radial-gradient(circle at 85% 20%, color-mix(in srgb, var(--record-color) 10%, transparent), transparent 38%), var(--atlas-surface);
    box-shadow: var(--atlas-shadow-sm);
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
}

.crm-record-hero h2 {
    margin: 0.65rem 0 0.35rem;
    font-size: clamp(1.3rem, 2.5vw, 2rem);
}

.crm-record-hero p {
    margin: 0;
    color: var(--atlas-text-soft);
    font-size: 0.78rem;
}

.crm-record-hero__value {
    display: grid;
    min-width: 190px;
    text-align: right;
    justify-items: end;
    gap: 0.4rem;
}

.crm-record-hero__value small {
    color: var(--atlas-text-soft);
    font-size: 0.68rem;
}

.crm-record-hero__value strong {
    font-size: clamp(1.15rem, 2.3vw, 1.65rem);
}

.crm-activity-form {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding: 0 1.25rem 1.25rem;
    gap: 0.75rem;
}

.crm-activity-form__subject {
    grid-column: span 2;
}

.crm-activity-form .field--full {
    grid-column: 1 / -1;
}

.crm-definition-list {
    display: grid;
    padding: 0 1.25rem 1.25rem;
    margin: 0;
    gap: 0;
}

.crm-definition-list > div {
    display: grid;
    grid-template-columns: minmax(95px, 0.75fr) minmax(0, 1.25fr);
    padding: 0.58rem 0;
    border-bottom: 1px solid var(--atlas-border);
    gap: 0.65rem;
}

.crm-definition-list > div:last-child {
    border-bottom: 0;
}

.crm-definition-list dt,
.crm-definition-list dd {
    margin: 0;
    overflow-wrap: anywhere;
    font-size: 0.72rem;
}

.crm-definition-list dt {
    color: var(--atlas-text-soft);
}

.crm-definition-list dd {
    color: var(--atlas-text);
    text-align: right;
}

.crm-conversion {
    border-color: rgba(0, 224, 184, 0.2);
    background: radial-gradient(circle at 100% 0, rgba(0, 224, 184, 0.06), transparent 44%), var(--atlas-surface);
}

.crm-history {
    position: relative;
    display: grid;
    padding: 0 1.25rem 1.25rem 2.15rem;
    margin: 0;
    list-style: none;
    gap: 0.8rem;
}

.crm-history::before {
    position: absolute;
    top: 0.35rem;
    bottom: 1.65rem;
    left: 1.43rem;
    width: 1px;
    background: var(--atlas-border-strong);
    content: "";
}

.crm-history li {
    position: relative;
    min-width: 0;
}

.crm-history li > i {
    position: absolute;
    top: 0.28rem;
    left: -0.98rem;
    width: 8px;
    height: 8px;
    border: 2px solid var(--atlas-bg);
    border-radius: 50%;
    background: var(--atlas-cyan);
}

.crm-history li div {
    display: grid;
    gap: 0.2rem;
}

.crm-history strong {
    font-size: 0.73rem;
}

.crm-history small {
    color: var(--atlas-text-soft);
    font-size: 0.65rem;
}

.crm-funnel {
    display: grid;
    padding: 0 1.25rem 1.25rem;
    gap: 0.75rem;
}

.crm-funnel__row {
    display: grid;
    grid-template-columns: minmax(110px, 0.65fr) minmax(160px, 1.5fr) 38px minmax(95px, auto);
    min-width: 0;
    font-size: 0.72rem;
    align-items: center;
    gap: 0.65rem;
}

.crm-funnel__row > div {
    height: 12px;
    border-radius: 999px;
    background: rgba(100, 116, 139, 0.15);
    overflow: hidden;
}

.crm-funnel__row i {
    display: block;
    width: var(--funnel-width, 0%);
    height: 100%;
    border-radius: inherit;
    background: var(--stage-color, var(--atlas-primary));
}

.crm-funnel__row small {
    color: var(--atlas-text-soft);
    text-align: right;
}

.crm-big-stat {
    display: grid;
    padding: 0.2rem 1.25rem 1.25rem;
    text-align: center;
    gap: 0.25rem;
}

.crm-big-stat strong {
    color: var(--atlas-cyan);
    font-size: clamp(2rem, 5vw, 3.25rem);
}

.crm-big-stat span {
    color: var(--atlas-text-soft);
    font-size: 0.72rem;
}

.crm-goal-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 0 1.25rem 1.25rem;
    gap: 0.75rem;
}

.crm-goal {
    display: grid;
    padding: 1rem;
    border: 1px solid var(--atlas-border);
    border-radius: 11px;
    background: var(--atlas-surface-soft);
    gap: 0.42rem;
}

.crm-goal h3,
.crm-goal p {
    margin: 0;
}

.crm-goal h3 {
    font-size: 0.82rem;
}

.crm-goal p,
.crm-goal small {
    color: var(--atlas-text-soft);
    font-size: 0.67rem;
}

.crm-goal > strong {
    color: var(--atlas-cyan);
    font-size: 1.25rem;
}

.crm-stage-settings {
    display: grid;
    gap: 0.6rem;
}

.crm-stage-setting {
    display: grid;
    grid-template-columns: 5px minmax(130px, 1.3fr) 70px 70px 90px minmax(110px, 0.8fr) minmax(90px, 0.7fr) auto;
    padding: 0.75rem;
    border: 1px solid var(--atlas-border);
    border-radius: 10px;
    background: var(--atlas-surface-soft);
    align-items: end;
    gap: 0.55rem;
}

.crm-stage-setting__handle {
    height: 100%;
    min-height: 42px;
    border-radius: 999px;
    background: var(--stage-color, var(--atlas-primary));
}

.crm-stage-setting .field > span {
    font-size: 0.61rem;
}

.crm-create-block {
    margin: 0 1.25rem 1.25rem;
    border: 1px solid var(--atlas-border);
    border-radius: 10px;
    background: var(--atlas-surface-soft);
}

.crm-create-block > summary {
    padding: 0.85rem 1rem;
    color: var(--atlas-cyan);
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
}

.crm-create-block > form {
    padding: 0 1rem 1rem;
}

.crm-goal-form {
    padding: 0 1.25rem 1.25rem;
}

@media (max-width: 1280px) {
    .crm-stage-setting {
        grid-template-columns: 5px repeat(3, minmax(100px, 1fr));
    }

    .crm-stage-setting__handle {
        grid-row: 1 / span 3;
    }
}

@media (max-width: 980px) {
    .crm-overview-grid,
    .crm-detail-grid,
    .crm-settings-grid {
        grid-template-columns: 1fr;
    }

    .crm-goal-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .crm-activity-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {
    .crm-subnav {
        margin-inline: -0.25rem;
    }

    .crm-record-hero {
        align-items: flex-start;
        flex-direction: column;
    }

    .crm-record-hero__value {
        min-width: 0;
        text-align: left;
        justify-items: start;
    }

    .crm-activity {
        grid-template-columns: 36px minmax(0, 1fr) auto;
    }

    .crm-activity > time {
        grid-column: 2 / -1;
    }

    .crm-activity > form {
        grid-column: 3;
        grid-row: 1;
    }

    .crm-activity-form,
    .crm-goal-grid {
        grid-template-columns: 1fr;
    }

    .crm-activity-form__subject {
        grid-column: auto;
    }

    .crm-funnel__row {
        grid-template-columns: 1fr auto;
    }

    .crm-funnel__row > div {
        grid-column: 1 / -1;
        grid-row: 2;
    }

    .crm-funnel__row small {
        grid-column: 1 / -1;
        text-align: left;
    }

    .crm-stage-setting {
        grid-template-columns: 5px 1fr 1fr;
    }

    .crm-stage-setting__handle {
        grid-row: 1 / span 5;
    }

    .crm-stage-setting > .button {
        grid-column: 2 / -1;
        width: 100%;
    }

    .crm-settings-grid,
    .crm-kanban,
    .crm-activity-list,
    .crm-funnel,
    .crm-goal-grid,
    .crm-goal-form,
    .crm-definition-list,
    .crm-activity-form {
        padding-inline: 1rem;
    }
}

@media print {
    .crm-subnav,
    .crm-stage-move,
    .crm-activity-form,
    .crm-create-block,
    .crm-goal-form {
        display: none !important;
    }

    .crm-kanban {
        display: block;
        overflow: visible;
    }

    .crm-kanban__column {
        margin-bottom: 1rem;
        break-inside: avoid;
    }
}

/* UX quality pass: dense settings and operational data tables */
.table-wrap > table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    font-size: 0.82rem;
}

.table-wrap > table th,
.table-wrap > table td {
    padding: 0.88rem 1rem;
    border-bottom: 1px solid var(--atlas-border);
    text-align: left;
    vertical-align: middle;
}

.table-wrap > table th {
    color: var(--atlas-text-soft);
    background: var(--atlas-table-head-bg);
    font-size: 0.69rem;
    font-weight: 700;
    letter-spacing: 0.055em;
    text-transform: uppercase;
    white-space: nowrap;
}

.table-wrap > table tbody tr {
    transition: background var(--atlas-transition);
}

.table-wrap > table tbody tr:hover {
    background: color-mix(in srgb, var(--atlas-cyan) 3.5%, transparent);
}

.table-wrap > table tr:last-child td {
    border-bottom: 0;
}

.table-wrap > table td > small {
    display: block;
    margin-top: 0.2rem;
    color: var(--atlas-text-soft);
    font-size: 0.7rem;
    line-height: 1.35;
}

.table-cell--contact {
    max-width: 18rem;
    overflow-wrap: anywhere;
}

.table--units {
    min-width: 850px;
}

.table--partners {
    min-width: 1080px;
}

.units-layout {
    grid-template-columns: minmax(0, 1fr);
}

.panel__toolbar {
    max-width: 100%;
    justify-content: flex-end;
}

.panel__toolbar .panel__search {
    width: clamp(15rem, 25vw, 24rem);
}

.panel__toolbar .form-control,
.panel__toolbar .form-select,
.table-action-form .form-select {
    min-height: 40px;
    padding-block: 0.5rem;
}

.table-action-form {
    flex-wrap: nowrap;
}

.table-action-form .form-select {
    width: auto;
    min-width: 7.5rem;
}

.table-empty td {
    padding: 2rem 1rem !important;
    color: var(--atlas-text-soft);
    text-align: center !important;
}

.crm-settings-grid {
    grid-template-columns: minmax(0, 1fr);
}

.crm-settings-grid > section {
    min-width: 0;
}

.crm-stage-setting {
    grid-template-columns: 5px minmax(180px, 1.6fr) 76px 88px 112px minmax(140px, 1fr) minmax(108px, 0.8fr) auto;
    width: 100%;
}

.crm-stage-setting > .field,
.crm-stage-setting > .button,
.crm-stage-setting input,
.crm-stage-setting select {
    min-width: 0;
}

.crm-stage-setting input[type="color"] {
    padding: 0.35rem;
    cursor: pointer;
}

.crm-stage-setting > .button {
    align-self: end;
}

@media (max-width: 1180px) {
    .crm-stage-setting {
        grid-template-columns: 5px repeat(3, minmax(0, 1fr));
    }

    .crm-stage-setting__handle {
        grid-row: 1 / span 3;
    }

    .crm-stage-setting > .button {
        width: 100%;
    }
}

@media (max-width: 900px) {
    .panel__header {
        align-items: stretch;
        flex-direction: column;
    }

    .panel__toolbar {
        width: 100%;
        justify-content: flex-start;
    }

    .panel__toolbar .panel__search {
        width: min(100%, 28rem);
        flex: 1 1 15rem;
    }
}

@media (max-width: 720px) {
    .table-wrap[data-card-table] .table--units,
    .table-wrap[data-card-table] .table--partners {
        min-width: 0;
    }

    .table-wrap[data-card-table] .table-empty {
        display: block;
        padding: 0;
    }

    .table-wrap[data-card-table] .table-empty td {
        display: block;
        padding: 1.5rem 1rem !important;
        border: 1px dashed var(--atlas-border);
        border-radius: var(--atlas-radius);
        text-align: center;
    }

    .table-wrap[data-card-table] .table-empty td::before {
        display: none;
    }

    .crm-stage-setting {
        grid-template-columns: 5px repeat(2, minmax(0, 1fr));
    }

    .crm-stage-setting__handle {
        grid-row: 1 / span 5;
    }

    .crm-stage-setting > .field:nth-of-type(1),
    .crm-stage-setting > .button {
        grid-column: 2 / -1;
    }
}

@media (max-width: 480px) {
    .table-action-form {
        align-items: stretch;
        flex-direction: column;
    }

    .table-action-form .form-select,
    .table-action-form .button {
        width: 100%;
    }

    .crm-stage-setting {
        grid-template-columns: 5px minmax(0, 1fr);
        padding: 0.7rem;
    }

    .crm-stage-setting__handle {
        grid-row: 1 / span 7;
    }

    .crm-stage-setting > .field,
    .crm-stage-setting > .field:nth-of-type(1),
    .crm-stage-setting > .button {
        grid-column: 2;
    }
}

/* Theme switcher */
.theme-toggle {
    flex: 0 0 auto;
    border-color: var(--atlas-border);
    background: var(--atlas-surface-soft);
}

.theme-toggle__sun,
.theme-toggle__moon {
    display: none;
}

html[data-theme="dark"] .theme-toggle__sun,
html[data-theme="light"] .theme-toggle__moon {
    display: block;
}

.theme-toggle--auth {
    position: fixed;
    z-index: 10020;
    top: 1rem;
    right: 1rem;
    background: var(--atlas-surface);
    box-shadow: var(--atlas-shadow-sm);
}

html[data-theme="light"] .auth-shell {
    background: rgba(255, 255, 255, 0.94);
}

html[data-theme="light"] .auth-hero {
    background:
        radial-gradient(circle at 75% 20%, color-mix(in srgb, var(--atlas-cyan) 16%, transparent), transparent 18rem),
        linear-gradient(145deg, color-mix(in srgb, var(--atlas-primary) 9%, #ffffff), #edf4f9);
}

html[data-theme="light"] .auth-card {
    background: rgba(255, 255, 255, 0.9);
}

html[data-theme="light"] .hero-panel {
    border-color: color-mix(in srgb, var(--brand-primary) 22%, var(--atlas-border));
    background:
        radial-gradient(circle at 88% 45%, color-mix(in srgb, var(--brand-accent) 11%, transparent), transparent 21rem),
        linear-gradient(120deg, color-mix(in srgb, var(--brand-primary) 9%, #ffffff), #f7fbfe 58%, color-mix(in srgb, var(--brand-accent) 7%, #ffffff));
}

html[data-theme="light"] .hero-panel::after {
    border-color: color-mix(in srgb, var(--brand-primary) 12%, transparent);
}

html[data-theme="light"] .metric-card::after {
    background: color-mix(in srgb, var(--atlas-primary) 5%, transparent);
    filter: none;
}

html[data-theme="light"] .list-card,
html[data-theme="light"] .notification-item {
    border-color: color-mix(in srgb, var(--atlas-primary) 10%, var(--atlas-border));
    background: #f8fbfd;
}

html[data-theme="light"] .tabs,
html[data-theme="light"] .crm-subnav {
    border-color: color-mix(in srgb, var(--atlas-primary) 10%, var(--atlas-border));
    background: #eaf1f7;
}

html[data-theme="light"] .tab[aria-selected="true"],
html[data-theme="light"] .crm-subnav a.is-active {
    border-color: var(--brand-primary);
    color: #ffffff;
    background: var(--brand-primary);
}

html[data-theme="light"] .crm-subnav a:hover,
html[data-theme="light"] .crm-subnav a:focus-visible {
    color: var(--brand-primary);
    background: color-mix(in srgb, var(--brand-primary) 8%, transparent);
}

html[data-theme="light"] .crm-subnav a.is-active:hover,
html[data-theme="light"] .crm-subnav a.is-active:focus-visible {
    color: #ffffff;
    background: var(--brand-primary);
}

html[data-theme="light"] body[data-branding="custom"] .sidebar {
    background:
        radial-gradient(circle at 50% 0, color-mix(in srgb, var(--brand-accent) 12%, transparent), transparent 14rem),
        linear-gradient(180deg, color-mix(in srgb, var(--brand-secondary) 10%, #ffffff), color-mix(in srgb, var(--brand-secondary) 5%, #f1f6fa));
}

html[data-theme="light"] .pdv-launch-card--primary h3,
html[data-theme="light"] .pdv-launch-card--primary p {
    color: #eaf8fc;
}

@media (max-width: 640px) {
    .theme-toggle--auth {
        top: 0.65rem;
        right: 0.65rem;
    }
}

/* Phase 5 UX hardening: shared responsive and accessibility rules */
.app-frame,
.app-content,
.page-header > *,
.panel__header > *,
.card__header > *,
.list-card > *,
.notification-item > * {
    min-width: 0;
}

.panel__header p,
.card__header p,
.list-card p,
.notification-item p,
.table-wrap td,
.detail-list dd {
    overflow-wrap: anywhere;
}

.panel__header p:last-child,
.card__header p:last-child {
    margin-bottom: 0;
    color: var(--atlas-text-soft);
}

fieldset {
    min-width: 0;
}

/* Bare controls still occur in compact filters and row actions. */
.inline-form input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]),
.inline-form textarea {
    min-height: 40px;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--atlas-border);
    border-radius: var(--atlas-radius-sm);
    color: var(--atlas-text);
    background: var(--atlas-control-bg);
    outline: none;
    transition: border-color var(--atlas-transition), box-shadow var(--atlas-transition), background var(--atlas-transition);
}

.inline-form input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):focus,
.inline-form textarea:focus {
    border-color: var(--atlas-cyan);
    background: var(--atlas-control-focus-bg);
    box-shadow: var(--atlas-focus);
}

input[type="file"]::file-selector-button {
    min-height: 34px;
    padding: 0.4rem 0.7rem;
    margin-right: 0.65rem;
    border: 1px solid color-mix(in srgb, var(--atlas-cyan) 38%, transparent);
    border-radius: 7px;
    color: var(--atlas-cyan);
    background: color-mix(in srgb, var(--atlas-cyan) 7%, transparent);
    font: inherit;
    font-weight: 650;
    cursor: pointer;
}

.table-wrap {
    max-width: 100%;
    overscroll-behavior-inline: contain;
}

.table-wrap:focus-visible {
    border-color: var(--atlas-cyan);
    box-shadow: var(--atlas-focus);
    outline: 0;
}

.table-wrap td > form,
.table-wrap td > .table-actions {
    max-width: 100%;
}

.table-wrap td .inline-form {
    flex-wrap: nowrap;
}

.table-wrap td .inline-form select {
    min-width: 7.5rem;
    max-width: 100%;
}

.table-empty td {
    height: 8rem;
    padding: 2rem 1rem !important;
    color: var(--atlas-text-soft);
    text-align: center !important;
}

.filter-bar .button,
.filter-bar .btn {
    flex: 0 0 auto;
}

.list-card__meta {
    flex-wrap: wrap;
}

@media (max-width: 900px) {
    .panel__header > .inline-form,
    .panel__header > .cluster {
        width: 100%;
    }

    .panel__header > .inline-form > input:not([type="hidden"]),
    .panel__header > .inline-form > select {
        min-width: min(12rem, 100%);
        flex: 1 1 12rem;
    }
}

@media (max-width: 720px) {
    .button--small,
    .btn-sm {
        min-height: 44px;
    }

    .table-wrap[data-card-table] tbody {
        display: grid;
        gap: 0.75rem;
    }

    .table-wrap[data-card-table] tr {
        margin-bottom: 0;
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    }

    .table-wrap[data-card-table] td {
        min-width: 0;
        align-items: center;
    }

    .table-wrap[data-card-table] td > :only-child {
        min-width: 0;
    }

    .table-wrap[data-card-table] td .inline-form,
    .table-wrap[data-card-table] td .table-actions,
    .table-wrap[data-card-table] td .table-action-form {
        width: 100%;
        align-items: stretch;
        flex-direction: column;
    }

    .table-wrap[data-card-table] td .inline-form select,
    .table-wrap[data-card-table] td .inline-form .button,
    .table-wrap[data-card-table] td .table-actions .button,
    .table-wrap[data-card-table] td .table-action-form .form-select,
    .table-wrap[data-card-table] td .table-action-form .button {
        width: 100%;
    }

    .table-wrap[data-card-table] .table-empty {
        box-shadow: none;
    }

    .table-wrap[data-card-table] .table-empty td {
        min-height: 8rem;
        place-content: center;
    }

    .filter-bar .button,
    .filter-bar .btn,
    .inline-form .button,
    .inline-form .btn {
        min-height: 44px;
    }

    .list-card > form,
    .notification-item > form,
    .list-card > details {
        width: 100%;
    }

    .list-card > form .button,
    .notification-item > form .button,
    .list-card > details > summary {
        width: 100%;
    }

    .detail-list > div {
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .table-wrap[data-card-table] td {
        grid-template-columns: minmax(5.8rem, 36%) minmax(0, 1fr);
        gap: 0.6rem;
    }

    .table-wrap[data-card-table] td[data-label="Ação"],
    .table-wrap[data-card-table] td[data-label="Acao"] {
        grid-template-columns: 1fr;
    }

    .table-wrap[data-card-table] td[data-label="Ação"]::before,
    .table-wrap[data-card-table] td[data-label="Acao"]::before {
        margin-bottom: 0.2rem;
    }

    .detail-list > div {
        align-items: stretch;
        flex-direction: column;
        gap: 0.25rem;
    }

    .detail-list dd {
        text-align: left;
    }
}
