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

/* Design tokens: public/assets/css/tokens.css (from design/tokens.json) */

html {
    font-size: var(--font-size-base);
}

body {
    margin: 0;
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
    min-height: -webkit-fill-available;
    -webkit-text-size-adjust: 100%;
}

body.body--app {
    overflow: hidden;
}

.icon {
    display: block;
    flex-shrink: 0;
}

.icon--logo {
    color: var(--primary-fg);
}

.icon--chevron {
    color: var(--text-muted);
}

/* App shell */

.app-shell {
    display: flex;
    height: 100vh;
    width: 100%;
    overflow: hidden;
}

.main-shell {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

.page-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    scrollbar-width: thin;
    scrollbar-color: #1e293b transparent;
}

/* Sidebar */

.sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-soft);
}

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

.sidebar__logo {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    text-decoration: none;
    color: var(--text);
}

.sidebar__logo-mark {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    background: var(--primary);
    box-shadow: 0 0 16px rgba(0, 229, 160, 0.25);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.sidebar__logo-text {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.sidebar__close,
.topbar__menu {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}

.sidebar__nav {
    flex: 1;
    padding: 1rem 0.6rem;
    overflow-y: auto;
}

.sidebar__footer {
    padding: 0.75rem 0.6rem 1rem;
    border-top: 1px solid var(--border-soft);
}

.sidebar__link--logout {
    color: var(--text-muted);
}

.sidebar__section {
    margin: 0.85rem 0.75rem 0.35rem;
    font-family: var(--font-mono);
    font-size: 0.62rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.sidebar__link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 0.75rem;
    margin-bottom: 2px;
    border-left: 2px solid transparent;
    border-radius: 4px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.sidebar__link:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.03);
}

.sidebar__link.is-active {
    background: var(--bg-elevated);
    color: var(--text);
    border-left-color: var(--primary);
    font-weight: 500;
}

.sidebar__badge {
    margin-left: auto;
    font-family: var(--font-mono);
    font-size: 0.62rem;
    line-height: 1;
    padding: 0.2rem 0.45rem;
    border-radius: 4px;
    background: var(--primary);
    color: var(--primary-fg);
}

.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 30;
}

/* Topbar */

.topbar {
    height: 56px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0 1.5rem;
    background: var(--bg-sidebar);
    border-bottom: 1px solid var(--border-soft);
}

.topbar__spacer {
    flex: 1;
}

.topbar__left,
.topbar__right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.topbar__breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-family: var(--font-display);
    font-size: 0.82rem;
    letter-spacing: 0.06em;
}

.topbar__crumb {
    color: var(--text-muted);
    white-space: nowrap;
}

.topbar__crumb--accent {
    color: var(--primary);
}

.topbar__crumb--link {
    text-decoration: none;
    transition: opacity 0.15s, color 0.15s;
}

.topbar__crumb--link:hover {
    opacity: 0.88;
}

.topbar__crumb--link.topbar__crumb--accent:hover {
    color: var(--primary);
}

.topbar__search {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    width: 220px;
    max-width: 28vw;
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-family: var(--font-sans);
    font-size: 0.85rem;
    cursor: not-allowed;
    opacity: 0.95;
}

.topbar__search-icon {
    color: var(--text-muted);
    flex-shrink: 0;
}

.topbar__search-placeholder {
    color: var(--text-muted);
    white-space: nowrap;
}

.topbar__notify {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text-muted);
    cursor: not-allowed;
    padding: 0;
}

.topbar__notify-dot {
    position: absolute;
    top: 7px;
    right: 7px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--error);
}

.topbar__user {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding-left: 0.75rem;
    border-left: 1px solid var(--border);
}

.topbar__user-menu {
    position: relative;
    padding-left: 0.75rem;
    border-left: 1px solid var(--border);
}

.topbar__user-trigger {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.25rem 0.35rem 0.25rem 0.25rem;
    border: none;
    border-radius: var(--radius);
    background: transparent;
    color: inherit;
    cursor: pointer;
    transition: background 0.15s;
}

.topbar__user-trigger:hover,
.topbar__user-menu.is-open .topbar__user-trigger {
    background: var(--bg-elevated);
}

.topbar__user-chevron {
    color: var(--text-muted);
    flex-shrink: 0;
    transition: transform 0.15s;
}

.topbar__user-menu.is-open .topbar__user-chevron {
    transform: rotate(180deg);
}

.topbar__avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-family: var(--font-display);
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--primary);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
}

.topbar__user-meta {
    min-width: 0;
}

.topbar__user-name {
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
}

.topbar__user-role {
    font-size: 0.62rem;
    color: var(--text-muted);
}

.topbar__user-dropdown {
    position: absolute;
    top: calc(100% + 0.45rem);
    right: 0;
    min-width: 190px;
    padding: 0.35rem;
    border-radius: calc(var(--radius) + 2px);
    background: var(--bg-card);
    border: 1px solid var(--border);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
    z-index: 120;
}

.topbar__user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.55rem 0.65rem;
    border-radius: var(--radius);
    color: var(--text);
    text-decoration: none;
    font-size: 0.82rem;
    transition: background 0.15s, color 0.15s;
}

.topbar__user-dropdown-item:hover {
    background: var(--bg-elevated);
    color: var(--text);
}

.topbar__user-dropdown-item--logout {
    color: #fca5a5;
}

.topbar__user-dropdown-item--logout:hover {
    color: #fecaca;
    background: rgba(239, 68, 68, 0.1);
}

.topbar__user-dropdown-divider {
    height: 1px;
    margin: 0.35rem 0.25rem;
    background: var(--border);
}

.page-content--immersive {
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.body--tool-immersive .page-content--immersive > .overtop-app {
    flex: 1;
    min-height: 0;
}

/* Auth */

.body--auth {
    min-height: 100vh;
}

.auth-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    gap: 1.25rem;
}

.auth-shell__brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.auth-shell__logo-mark {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    background: var(--primary);
    box-shadow: 0 0 20px rgba(0, 229, 160, 0.25);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.auth-shell__logo-text {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.auth-shell__card {
    width: min(100%, 420px);
}

.auth-shell__footer {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.82rem;
}

/* Typography */

h1 {
    margin: 0 0 0.35rem;
    font-family: var(--font-display);
    font-size: 1.55rem;
    font-weight: 600;
    letter-spacing: 0.04em;
}

h2 {
    margin: 0 0 0.75rem;
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.04em;
}

h3 {
    margin: 1rem 0 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.page-title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text);
    margin: 0;
}

.subtitle,
.meta {
    color: var(--text-muted);
    margin: 0 0 1.25rem;
    font-size: 0.9rem;
}

.breadcrumb {
    display: inline-block;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.82rem;
    margin-bottom: 0.5rem;
}

.breadcrumb:hover {
    color: var(--primary);
}

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

/* Cards / panels */

.card,
.auth-card,
.tool-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}

.auth-card {
    padding: 2rem;
}

.auth-card h1 {
    margin-bottom: 0.25rem;
}

.auth-card__switch {
    margin: 1.25rem 0 0;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.auth-card__switch a {
    color: var(--primary);
    text-decoration: none;
}

.auth-card__switch a:hover {
    text-decoration: underline;
}

.password-hint {
    margin: 0.4rem 0 0;
    font-size: 0.78rem;
    line-height: 1.4;
    font-family: var(--font-sans);
}

.password-hint--weak {
    color: #f87171;
}

.password-hint--medium {
    color: #fbbf24;
}

.password-hint--strong {
    color: var(--primary);
}

.settings-profile {
    margin-bottom: 1.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border);
}

.settings-profile__label {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.settings-profile__value {
    font-size: 0.95rem;
    color: var(--text);
}

.settings-form__title {
    margin: 0 0 1rem;
    font-family: var(--font-display);
    font-size: 1rem;
    letter-spacing: 0.04em;
}

/* KPI / stats */

.stats-grid,
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card,
.kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.1rem;
}

.kpi-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.kpi-card__label {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.kpi-card__icon {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    display: grid;
    place-items: center;
}

.kpi-card__icon--mint { background: rgba(0, 229, 160, 0.08); color: var(--primary); }
.kpi-card__icon--cyan { background: rgba(0, 180, 216, 0.08); color: var(--accent); }
.kpi-card__icon--purple { background: rgba(124, 58, 237, 0.08); color: var(--accent-purple); }
.kpi-card__icon--amber { background: rgba(245, 158, 11, 0.08); color: var(--accent-amber); }

.stat-card__value,
.kpi-card__value {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
    line-height: 1.1;
    margin-bottom: 0.2rem;
}

.stat-card__label,
.kpi-card__delta {
    color: var(--text-muted);
    font-size: 0.78rem;
}

/* Tool grid */

.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.85rem;
}

.tool-card {
    display: block;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.1rem 1.15rem;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s, transform 0.15s, background 0.15s;
}

.tool-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateY(-1px);
}

.tool-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.65rem;
}

.tool-card__icon {
    font-size: 1.35rem;
    line-height: 1;
}

.tool-card__type {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    border: 1px solid rgba(0, 229, 160, 0.18);
    background: rgba(0, 229, 160, 0.08);
    color: var(--primary);
}

.tool-card__title {
    margin: 0 0 0.35rem;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.03em;
}

.tool-card__desc {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.82rem;
    line-height: 1.45;
}

.tool-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.9rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
    font-family: var(--font-mono);
    font-size: 0.62rem;
    color: var(--text-muted);
}

/* Admin links */

.admin-links {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
}

.admin-link {
    display: block;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.15rem;
    color: var(--text);
    text-decoration: none;
    text-align: center;
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: 0.04em;
    transition: border-color 0.15s, background 0.15s;
}

.admin-link:hover {
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.02);
}

/* Forms */

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
select,
textarea {
    width: 100%;
    padding: 0.6rem 0.75rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 16px;
    font-family: var(--font-sans);
    -webkit-appearance: none;
    appearance: none;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 1px rgba(0, 229, 160, 0.25);
}

.checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.88rem;
    margin: 0.25rem 0 1rem;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.5rem;
}

.fieldset {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    margin: 1rem 0;
}

.fieldset legend {
    padding: 0 0.5rem;
    color: var(--text-muted);
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.25rem;
    flex-wrap: wrap;
}

/* Buttons */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.55rem 1rem;
    border: none;
    border-radius: var(--radius);
    font-size: 0.82rem;
    font-weight: 500;
    font-family: var(--font-sans);
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.btn--primary {
    background: var(--primary);
    color: var(--primary-fg);
}

.btn--primary:hover {
    filter: brightness(0.95);
}

.btn--secondary {
    background: var(--bg-elevated);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn--secondary:hover {
    border-color: rgba(255, 255, 255, 0.12);
}

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

.btn-link {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    padding: 0;
    font-size: inherit;
    text-decoration: underline;
}

.inline-form {
    display: inline;
}

/* Tables */

.table-wrap {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.table th,
.table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.table th {
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.table--compact th,
.table--compact td {
    padding: 0.5rem 0.75rem;
}

.table__actions {
    white-space: nowrap;
}

.table-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.table-user__avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-family: var(--font-display);
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--primary);
    background: var(--bg-elevated);
    flex-shrink: 0;
}

.table-user__name {
    font-size: 0.88rem;
    font-weight: 500;
}

.table-user__email {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    color: var(--text-muted);
}

.text-center {
    text-align: center;
}

/* Badges */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.62rem;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.badge--admin {
    background: rgba(0, 229, 160, 0.08);
    color: var(--primary);
    border-color: rgba(0, 229, 160, 0.18);
}

.badge--user {
    background: rgba(0, 180, 216, 0.08);
    color: var(--accent);
    border-color: rgba(0, 180, 216, 0.18);
}

.badge--success,
.badge--completed {
    background: rgba(0, 229, 160, 0.08);
    color: var(--primary);
    border-color: rgba(0, 229, 160, 0.18);
}

.badge--muted {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
}

.badge--queued {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
}

.badge--running {
    background: rgba(0, 180, 216, 0.08);
    color: var(--accent);
    border-color: rgba(0, 180, 216, 0.18);
}

.badge--failed {
    background: rgba(239, 68, 68, 0.08);
    color: var(--error);
    border-color: rgba(239, 68, 68, 0.18);
}

/* Alerts */

.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.88rem;
}

.alert--error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #fca5a5;
}

.alert--success {
    background: rgba(0, 229, 160, 0.08);
    border: 1px solid rgba(0, 229, 160, 0.2);
    color: #86efac;
}

/* Progress */

.progress {
    height: 8px;
    background: rgba(255, 255, 255, 0.07);
    border-radius: 999px;
    overflow: hidden;
    margin: 0.75rem 0 0.25rem;
}

.progress__bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 999px;
    transition: width 0.3s ease;
}

.progress__text {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin: 0 0 1rem;
    font-family: var(--font-mono);
}

.log-box,
.result-box pre {
    background: #05070d;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    overflow-x: auto;
    max-height: 300px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

.chart-wrap {
    margin: 1rem 0;
    max-height: 280px;
}

.filter-tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-tabs a {
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    border: 1px solid var(--border);
}

.filter-tabs a.active,
.filter-tabs a:hover {
    color: var(--text);
    border-color: var(--primary);
    background: rgba(0, 229, 160, 0.08);
}

.access-table-wrap {
    overflow-x: auto;
    margin-bottom: 1rem;
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
    background: var(--bg-card);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
}

code {
    background: var(--bg-elevated);
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.82em;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1rem 2rem;
}

.container--narrow {
    max-width: 420px;
    padding-top: 4rem;
}

/* Legacy header/footer removed from app shell; keep for immersive */

.header,
.footer {
    display: none;
}

/* Responsive */

@media (max-width: 900px) {
    .topbar__search {
        width: 160px;
    }

    .topbar__user-meta {
        display: none;
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 40;
        transform: translateX(-100%);
        transition: transform 0.2s ease;
    }

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

    .sidebar__close,
    .topbar__menu {
        display: inline-flex;
    }

    .page-content {
        padding: 1rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 480px) {
    .stats-grid,
    .kpi-grid,
    .tool-grid {
        grid-template-columns: 1fr;
    }
}
