:root {
    --bg: #0f172a;
    --panel: #111827;
    --panel-soft: #1f2937;
    --text: #e5e7eb;
    --muted: #9ca3af;
    --accent: #38bdf8;
    --accent-dark: #0284c7;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--bg);
    color: var(--text);
}

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
    outline: 3px solid rgba(56,189,248,0.72);
    outline-offset: 3px;
}

@keyframes ui-spin {
    to {
        transform: rotate(360deg);
    }
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 250px 1fr;
}

.sidebar {
    background: #020617;
    padding: 24px;
    border-right: 1px solid rgba(255,255,255,0.08);
}

.brand {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 32px;
    color: var(--accent);
}

nav {
    display: grid;
    gap: 10px;
}

nav a {
    color: var(--text);
    text-decoration: none;
    padding: 12px 14px;
    border-radius: 10px;
    background: rgba(255,255,255,0.04);
}

nav a:hover {
    background: rgba(56,189,248,0.16);
}

.main-content {
    padding: 48px;
}

.hero {
    max-width: 850px;
}

.eyebrow {
    color: var(--accent);
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

h1 {
    font-size: 48px;
    margin: 10px 0 16px;
}

p {
    color: var(--muted);
    font-size: 18px;
    line-height: 1.6;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--accent);
    color: #00111f;
    text-decoration: none;
    font-weight: 700;
    padding: 14px 20px;
    border-radius: 12px;
    margin-top: 18px;
}

.button:hover {
    background: var(--accent-dark);
    color: white;
}

.cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-top: 32px;
}

.dashboard-page {
    display: grid;
    gap: 24px;
}

.dashboard-cards {
    margin-top: 0;
}

.dashboard-empty-state,
.not-found-state {
    display: grid;
    gap: 10px;
    max-width: 720px;
    padding: 28px;
    border: 1px dashed rgba(255,255,255,0.16);
    border-radius: 18px;
    background: rgba(255,255,255,0.04);
}

.dashboard-empty-state h2,
.dashboard-empty-state p,
.not-found-state h1,
.not-found-state p {
    margin: 0;
}

.not-found-state .button {
    justify-self: start;
}

.card {
    background: var(--panel);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 18px;
    padding: 24px;
}

.card h2 {
    margin-top: 0;
}

@media (max-width: 800px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,0.08);
    }

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

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

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 28px;
}

.table-card {
    background: var(--panel);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 18px;
    overflow: hidden;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

th {
    color: var(--accent);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

td {
    color: var(--text);
}

td a {
    color: var(--accent);
    font-weight: 700;
    text-decoration: none;
}

.form-card {
    background: var(--panel);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 18px;
    padding: 24px;
    max-width: 980px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

label {
    display: grid;
    gap: 8px;
    color: var(--text);
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 12px;
    background: var(--panel-soft);
    color: var(--text);
    padding: 12px 14px;
    font: inherit;
}

textarea {
    resize: vertical;
}

.full-width {
    grid-column: 1 / -1;
}

.actions {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 22px;
}

button.button {
    border: 0;
    cursor: pointer;
}

button:disabled,
.button:disabled,
.button[aria-disabled="true"] {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

form.is-loading {
    opacity: 0.86;
}

form.is-loading .button[type="submit"]::after {
    content: "";
    display: inline-block;
    width: 0.85em;
    height: 0.85em;
    margin-left: 8px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: ui-spin .7s linear infinite;
}

.button-secondary {
    background: rgba(255,255,255,0.08);
    color: var(--text);
}

.button-danger {
    background: rgba(239,68,68,0.14);
    color: #fecaca;
}

.button-danger:hover {
    background: rgba(239,68,68,0.28);
    color: #fff;
}

.alert {
    background: rgba(239,68,68,0.12);
    border: 1px solid rgba(239,68,68,0.35);
    border-radius: 14px;
    padding: 14px 18px;
    margin-bottom: 18px;
}

.alert p {
    margin: 0;
    color: #fecaca;
}

.detail-card dl {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 12px 18px;
    margin: 0;
}

.detail-card dt {
    color: var(--muted);
    font-weight: 700;
}

.detail-card dd {
    margin: 0;
    color: var(--text);
}

@media (max-width: 800px) {
    .page-header {
        display: block;
    }

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

/* User menu pages */
.account-page {
    display: grid;
    gap: 22px;
}

.account-hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    padding: 28px;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(14, 165, 233, .18), rgba(15, 23, 42, .92));
}

.account-hero h1 {
    margin: 0 0 10px;
    font-size: clamp(32px, 4vw, 48px);
}

.account-hero p {
    margin: 0;
    max-width: 760px;
}

.account-grid {
    display: grid;
    gap: 18px;
}

.account-grid--profile {
    grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
    align-items: start;
}

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

.account-card {
    min-width: 0;
    padding: 22px;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 18px;
    background: rgba(17, 24, 39, .88);
}

.account-card h2,
.account-card p {
    margin-top: 0;
}

.account-card p {
    margin-bottom: 0;
    font-size: 15px;
}

.account-card--wide {
    grid-column: 1 / -1;
}

.account-card--muted {
    background: rgba(15, 23, 42, .7);
}

.account-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.account-card__header h2 {
    margin-bottom: 0;
    font-size: 22px;
}

.account-stack,
.account-form-stack {
    display: grid;
    gap: 18px;
}

.account-two-column {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    align-items: stretch;
}

.account-avatar {
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 22px;
    background: var(--accent);
    color: #06111f;
    font-weight: 900;
}

.account-avatar--large {
    width: 96px;
    height: 96px;
    font-size: 34px;
}

.account-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.account-card--profile {
    display: grid;
    gap: 18px;
}

.account-card--profile h2 {
    margin-bottom: 4px;
}

.account-meta-list,
.account-system-list {
    display: grid;
    gap: 12px;
    margin: 0;
}

.account-meta-list div,
.account-system-list div {
    display: grid;
    gap: 4px;
    padding-top: 12px;
    border-top: 1px solid rgba(148, 163, 184, .14);
}

.account-meta-list dt,
.account-system-list dt {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.account-meta-list dd,
.account-system-list dd {
    margin: 0;
    color: var(--text);
    overflow-wrap: anywhere;
}

.account-status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 10px;
    border: 1px solid rgba(56, 189, 248, .26);
    border-radius: 999px;
    background: rgba(56, 189, 248, .12);
    color: #bae6fd;
    font-size: 12px;
    font-weight: 800;
}

.account-toggle {
    display: flex;
    grid-template-columns: none;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 14px;
    background: rgba(255,255,255,.035);
}

.account-toggle input {
    width: 18px;
    margin-top: 3px;
}

.account-toggle span {
    display: grid;
    gap: 4px;
}

.account-toggle small,
.form-help {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}

.account-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 0;
}

.account-version-card {
    min-width: 170px;
    padding: 16px 18px;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 18px;
    background: rgba(255,255,255,.06);
}

.account-version-card span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.account-version-card strong {
    display: block;
    margin-top: 6px;
    font-size: 28px;
}

.account-link-list,
.account-placeholder-list {
    display: grid;
    gap: 10px;
}

.account-link-list a,
.account-placeholder-list span {
    padding: 12px 14px;
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 14px;
    background: rgba(255,255,255,.035);
}

.account-link-list a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 800;
}

.account-placeholder-list span {
    color: var(--muted);
}

@media (max-width: 980px) {
    .account-grid--profile,
    .account-grid--settings,
    .account-grid--support,
    .account-two-column {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    .account-hero {
        display: grid;
        padding: 22px;
    }

    .account-actions {
        justify-content: stretch;
    }

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

/* Developer Toolkit */
.developer-toolkit-page {
    display: grid;
    gap: 22px;
}

.developer-toolkit-hero,
.studio-developer-tools {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    padding: 28px;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(20, 184, 166, .16), rgba(15, 23, 42, .92));
}

.developer-toolkit-hero h1,
.studio-developer-tools h2 {
    margin: 0 0 10px;
}

.developer-toolkit-hero h1 {
    font-size: clamp(32px, 4vw, 48px);
}

.developer-toolkit-hero p,
.studio-developer-tools p {
    max-width: 760px;
    margin: 0;
}

.studio-developer-tools .studio-builder-card {
    width: min(360px, 100%);
    margin-top: 0;
}

.studio-developer-tools .studio-builder-card__icon {
    font-size: 13px;
    font-weight: 900;
}

.developer-toolkit-warning {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 16px 18px;
    border: 1px solid rgba(251, 191, 36, .34);
    border-radius: 18px;
    background: rgba(251, 191, 36, .12);
    color: #fde68a;
}

.developer-toolkit-warning strong {
    color: #fef3c7;
}

.developer-toolkit-warning span {
    color: #fde68a;
}

.developer-toolkit-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr);
    gap: 18px;
}

.developer-toolkit-grid--panels {
    align-items: start;
}

.developer-toolkit-card {
    min-width: 0;
    padding: 22px;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 18px;
    background: rgba(17, 24, 39, .88);
}

.developer-toolkit-card--wide {
    grid-row: span 2;
}

.developer-toolkit-card--full {
    grid-column: 1 / -1;
}

.developer-toolkit-card__header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.developer-toolkit-card__header h2 {
    margin: 0;
    font-size: 22px;
}

.developer-toolkit-status {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 0;
}

.developer-toolkit-status div {
    min-width: 0;
    padding: 14px;
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 14px;
    background: rgba(255,255,255,.035);
}

.developer-toolkit-status dt {
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.developer-toolkit-status dd {
    margin: 0;
    color: var(--text);
    font-weight: 800;
    overflow-wrap: anywhere;
}

.developer-toolkit-status--single {
    grid-template-columns: 1fr;
}

.developer-toolkit-indicator {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 6px 10px;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 999px;
    background: rgba(15, 23, 42, .7);
    color: var(--text);
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

.developer-toolkit-indicator--ok {
    border-color: rgba(34, 197, 94, .28);
    background: rgba(34, 197, 94, .12);
}

.developer-toolkit-indicator--warning {
    border-color: rgba(251, 191, 36, .32);
    background: rgba(251, 191, 36, .12);
}

.developer-toolkit-indicator--error {
    border-color: rgba(248, 113, 113, .34);
    background: rgba(248, 113, 113, .12);
}

.developer-toolkit-checklist,
.developer-toolkit-command-list {
    display: grid;
    gap: 12px;
}

.developer-toolkit-check {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 12px;
    padding: 14px;
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 14px;
    background: rgba(255,255,255,.035);
}

.developer-toolkit-check span {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 999px;
    background: rgba(34, 197, 94, .16);
}

.developer-toolkit-check span::before {
    content: "";
    width: 9px;
    height: 5px;
    border-left: 2px solid #86efac;
    border-bottom: 2px solid #86efac;
    transform: rotate(-45deg);
}

.developer-toolkit-check strong {
    display: block;
    margin-bottom: 4px;
}

.developer-toolkit-check p,
.developer-toolkit-card > p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.developer-toolkit-card > p {
    margin-bottom: 16px;
}

.developer-toolkit-command {
    margin: 0;
    padding: 14px 16px;
    border: 1px solid rgba(56, 189, 248, .18);
    border-radius: 14px;
    background: rgba(2, 6, 23, .72);
    color: #bae6fd;
    overflow-x: auto;
}

.developer-toolkit-command code {
    font: 700 13px/1.6 Consolas, Monaco, "Courier New", monospace;
}

.developer-toolkit-actions {
    margin-top: 16px;
}

.developer-toolkit-future-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.developer-toolkit-future-action {
    display: grid;
    gap: 14px;
    min-height: 150px;
    padding: 16px;
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 14px;
    background: rgba(255,255,255,.03);
    opacity: .72;
}

.developer-toolkit-future-action strong {
    display: block;
    margin-bottom: 6px;
}

.developer-toolkit-future-action p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.developer-toolkit-future-action > span {
    align-self: end;
    justify-self: start;
    padding: 5px 9px;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 999px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
}

@media (max-width: 1000px) {
    .developer-toolkit-grid {
        grid-template-columns: 1fr;
    }

    .developer-toolkit-card--wide {
        grid-row: auto;
    }

    .developer-toolkit-card--full {
        grid-column: auto;
    }

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

@media (max-width: 760px) {
    .developer-toolkit-hero,
    .studio-developer-tools,
    .developer-toolkit-warning {
        display: grid;
        padding: 22px;
    }

    .developer-toolkit-status {
        grid-template-columns: 1fr;
    }

    .developer-toolkit-card__header {
        display: grid;
    }

    .developer-toolkit-future-grid {
        grid-template-columns: 1fr;
    }
}

/* Ivervo DataGrid */
.datagrid {
    background: var(--panel);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 18px;
    overflow: hidden;
}

.datagrid__header,
.datagrid__footer,
.datagrid__bulkbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.datagrid__footer {
    border-top: 1px solid rgba(255,255,255,0.08);
    border-bottom: 0;
}

.datagrid__header h2 {
    margin: 0 0 6px;
}

.datagrid__header p,
.datagrid__footer,
.datagrid__bulkbar {
    color: var(--muted);
}

.datagrid__header p {
    margin: 0;
    font-size: 15px;
}

.datagrid__tools {
    display: flex;
    align-items: end;
    gap: 12px;
    min-width: 420px;
}

.datagrid__search {
    flex: 1;
}

.datagrid__page-size {
    width: 110px;
}

.datagrid__search span,
.datagrid__page-size span {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.datagrid__bulkbar {
    background: rgba(56,189,248,0.08);
}

.datagrid__table-wrap {
    overflow-x: auto;
}

.datagrid__table th.is-sortable {
    cursor: pointer;
    user-select: none;
}

.datagrid__table th.is-sortable:hover,
.datagrid__table th.is-sortable:focus-visible {
    background: rgba(255,255,255,0.04);
}

.datagrid__sort-indicator {
    margin-left: 8px;
    font-size: 0;
    color: var(--muted);
}

.datagrid__sort-indicator::before {
    content: "\2195";
    font-size: 13px;
}

.datagrid__table th[data-sort-direction="asc"] .datagrid__sort-indicator::after {
    content: " ↑";
    color: var(--accent);
}

.datagrid__table th[data-sort-direction="desc"] .datagrid__sort-indicator::after {
    content: " ↓";
    color: var(--accent);
}

.datagrid__select-col {
    width: 44px;
    text-align: center;
}

.datagrid__table th[data-sort-direction] .datagrid__sort-indicator::before {
    content: "";
}

.datagrid__table th[data-sort-direction="asc"] .datagrid__sort-indicator::after {
    content: " \2191";
    color: var(--accent);
    font-size: 13px;
}

.datagrid__table th[data-sort-direction="desc"] .datagrid__sort-indicator::after {
    content: " \2193";
    color: var(--accent);
    font-size: 13px;
}

.datagrid__pagination {
    display: flex;
    align-items: center;
    gap: 12px;
}

.datagrid__pagination .button {
    margin-top: 0;
    padding: 10px 14px;
}

.datagrid__pagination .button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.datagrid__row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: flex-end;
    white-space: nowrap;
}

.datagrid__empty {
    display: grid;
    gap: 8px;
    min-height: 160px;
    align-content: center;
    border-style: dashed;
    text-align: center;
}

.datagrid__empty h2,
.datagrid__empty p {
    margin: 0;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    background: rgba(156,163,175,0.14);
    color: var(--text);
}

.status-pill--active {
    background: rgba(34,197,94,0.14);
    color: #bbf7d0;
}

.status-pill--inactive {
    background: rgba(250,204,21,0.14);
    color: #fef08a;
}

.status-pill--archived {
    background: rgba(148,163,184,0.14);
    color: #cbd5e1;
}

.muted {
    color: var(--muted);
}

@media (max-width: 900px) {
    .datagrid__header,
    .datagrid__footer,
    .datagrid__bulkbar {
        display: block;
    }

    .datagrid__tools {
        min-width: 0;
        margin-top: 16px;
    }

    .datagrid__pagination {
        margin-top: 14px;
    }
}

/* Ivervo Command Palette */
.command-palette-trigger {
    width: 100%;
    margin-top: 24px;
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 12px;
    background: rgba(255,255,255,0.04);
    color: var(--muted);
    padding: 12px 14px;
    text-align: left;
    cursor: pointer;
    font: inherit;
}

.command-palette-trigger span {
    display: inline-flex;
    min-width: 42px;
    justify-content: center;
    margin-right: 8px;
    border-radius: 8px;
    background: rgba(255,255,255,0.08);
    color: var(--text);
    font-weight: 800;
}

.command-palette-trigger:hover {
    background: rgba(56,189,248,0.14);
    color: var(--text);
}

.command-palette[hidden] {
    display: none;
}

.command-palette {
    position: fixed;
    inset: 0;
    z-index: 1000;
}

.command-palette__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2,6,23,0.72);
    backdrop-filter: blur(8px);
}

.command-palette__panel {
    position: relative;
    width: min(760px, calc(100vw - 32px));
    margin: 8vh auto 0;
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 22px;
    background: #0b1220;
    box-shadow: 0 30px 90px rgba(0,0,0,0.45);
    overflow: hidden;
}

.command-palette__search {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.command-palette__search span {
    min-width: 46px;
    border-radius: 10px;
    background: rgba(255,255,255,0.08);
    color: var(--text);
    text-align: center;
    font-weight: 900;
    padding: 8px 10px;
}

.command-palette__search input {
    border: 0;
    background: transparent;
    padding: 10px 0;
    font-size: 18px;
    outline: none;
}

.command-palette__hint {
    padding: 10px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    color: var(--muted);
    font-size: 13px;
}

.command-palette__results {
    max-height: 440px;
    overflow-y: auto;
    padding: 10px;
}

.command-palette__result {
    display: grid;
    grid-template-columns: 44px 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    color: var(--text);
    text-decoration: none;
}

.command-palette__result:hover,
.command-palette__result.is-selected {
    background: rgba(56,189,248,0.14);
}

.command-palette__icon {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(255,255,255,0.07);
    font-size: 20px;
}

.command-palette__content {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.command-palette__content strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.command-palette__content small {
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.command-palette__type {
    color: var(--muted);
    font-size: 12px;
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 999px;
    padding: 5px 9px;
    white-space: nowrap;
}

.command-palette__empty {
    padding: 28px;
    color: var(--muted);
    text-align: center;
}

.has-command-palette {
    overflow: hidden;
}

@media (max-width: 700px) {
    .command-palette__panel {
        margin-top: 24px;
    }

    .command-palette__result {
        grid-template-columns: 40px 1fr;
    }

    .command-palette__type {
        display: none;
    }
}

/* Universal Sidebar v0.2.9 */
.app-shell {
    grid-template-columns: 292px 1fr;
}

.sidebar--universal {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 18px;
    gap: 18px;
    overflow: hidden;
}

.sidebar-top,
.sidebar-bottom {
    flex: 0 0 auto;
}

.brand--compact {
    display: inline-flex;
    align-items: center;
    color: var(--accent);
    text-decoration: none;
    margin-bottom: 18px;
}

.workspace-switcher {
    position: relative;
    margin-bottom: 12px;
}

.workspace-switcher__button {
    width: 100%;
    display: grid;
    grid-template-columns: 38px 1fr auto;
    align-items: center;
    gap: 10px;
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 16px;
    background: rgba(255,255,255,0.055);
    color: var(--text);
    padding: 10px;
    cursor: pointer;
    text-align: left;
}

.workspace-switcher__button:hover {
    background: rgba(56,189,248,0.12);
}

.workspace-switcher__icon {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(56,189,248,0.14);
    color: var(--accent);
    font-size: 0;
    font-weight: 900;
}

.workspace-switcher__icon::after {
    content: "WS";
    font-size: 11px;
}

.workspace-switcher__text {
    display: grid;
    gap: 2px;
}

.workspace-switcher__text small,
.sidebar-section__title {
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.workspace-menu,
.quick-create__menu {
    position: absolute;
    left: 0;
    right: 0;
    z-index: 20;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 16px;
    background: #0b1220;
    box-shadow: 0 18px 44px rgba(0,0,0,0.35);
    padding: 8px;
}

.workspace-menu {
    top: calc(100% + 8px);
}

.workspace-menu__form {
    margin: 0;
}

.workspace-menu__item,
.quick-create__menu a,
.sidebar-mini-link {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 9px;
    border: 0;
    color: var(--text);
    text-decoration: none;
    padding: 9px 10px;
    border-radius: 11px;
    background: transparent;
    font-size: 14px;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.workspace-menu__item:hover,
.workspace-menu__item.is-active,
.quick-create__menu a:hover,
.sidebar-mini-link:hover {
    background: rgba(56,189,248,0.13);
}

.workspace-menu__item:disabled {
    cursor: default;
    opacity: 1;
}

.workspace-menu__item span {
    display: inline-grid;
    place-items: center;
    min-width: 24px;
    min-height: 24px;
    border-radius: 8px;
    background: rgba(255,255,255,0.08);
    color: var(--accent);
    font-size: 11px;
    font-weight: 900;
}

.workspace-menu__separator {
    height: 1px;
    margin: 8px 4px;
    background: rgba(255,255,255,0.16);
}

.workspace-menu__empty {
    padding: 10px;
    color: var(--muted);
    font-size: 13px;
}

.command-palette-trigger--sidebar {
    margin-top: 0;
    margin-bottom: 0;
}

.command-palette-trigger--sidebar span {
    min-width: 54px;
}

.sidebar-nav {
    display: block;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding-right: 4px;
}

.sidebar-section {
    margin-bottom: 22px;
}

.sidebar-section__title {
    margin: 0 0 8px 10px;
}

.sidebar-link {
    width: 100%;
    display: grid;
    grid-template-columns: 32px 1fr auto;
    align-items: center;
    gap: 8px;
    color: var(--text);
    text-decoration: none;
    padding: 10px 10px;
    border-radius: 13px;
    background: transparent;
    margin-bottom: 4px;
}

.sidebar-link:hover,
.sidebar-link.is-active {
    background: rgba(56,189,248,0.14);
}

.sidebar-link.is-disabled {
    opacity: 0.52;
    cursor: not-allowed;
}

.sidebar-link__icon {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(255,255,255,0.06);
}

.sidebar-link__label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-link__count {
    color: var(--muted);
    font-size: 11px;
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 999px;
    padding: 3px 7px;
}

.sidebar-mini-link {
    justify-content: space-between;
    min-width: 0;
}

.sidebar-mini-link span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-mini-link__remove {
    border: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    padding: 2px 4px;
}

.sidebar-mini-link__remove:hover {
    color: var(--text);
}

.quick-create {
    position: relative;
}

.quick-create__button {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 14px;
    background: var(--accent);
    color: #00111f;
    padding: 12px 14px;
    font-weight: 800;
    cursor: pointer;
}

.quick-create__button:hover {
    background: var(--accent-dark);
    color: #ffffff;
}

.quick-create__menu {
    bottom: calc(100% + 8px);
}

.page-toolbar {
    display: flex;
    justify-content: flex-end;
    margin: -24px 0 18px;
}

.page-toolbar__favorite {
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 999px;
    background: rgba(255,255,255,0.04);
    color: var(--muted);
    padding: 8px 12px;
    cursor: pointer;
    font-weight: 700;
}

.page-toolbar__favorite:hover,
.page-toolbar__favorite.is-active {
    color: var(--text);
    background: rgba(56,189,248,0.14);
}

@media (max-width: 800px) {
    .sidebar--universal {
        position: relative;
        height: auto;
    }

    .page-toolbar {
        margin-top: 0;
    }
}


/* Notification Center */
.page-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.notification-center {
    position: relative;
}

.notification-button {
    position: relative;
    border: 1px solid rgba(148, 163, 184, .28);
    background: rgba(15, 23, 42, .84);
    color: #e5e7eb;
    border-radius: 12px;
    min-width: 42px;
    height: 38px;
    cursor: pointer;
}

.notification-button:hover {
    border-color: rgba(96, 165, 250, .55);
}

.notification-button__badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    line-height: 18px;
    font-weight: 700;
}

.notification-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 50;
    width: min(420px, calc(100vw - 32px));
    max-height: 70vh;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, .24);
    border-radius: 18px;
    background: #0f172a;
    box-shadow: 0 24px 80px rgba(0, 0, 0, .42);
}

.notification-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(148, 163, 184, .18);
}

.notification-panel__header button,
.notification-item__actions button {
    border: 0;
    background: transparent;
    color: #60a5fa;
    cursor: pointer;
    font-size: 12px;
}

.notification-panel__list {
    max-height: 58vh;
    overflow: auto;
}

.notification-panel__empty {
    padding: 18px;
    color: #94a3b8;
    font-size: 14px;
}

.notification-item {
    display: grid;
    grid-template-columns: 34px 1fr auto;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(148, 163, 184, .12);
    background: rgba(30, 41, 59, .48);
}

.notification-item.is-read {
    opacity: .68;
    background: transparent;
}

.notification-item__icon {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: rgba(96, 165, 250, .12);
}

.notification-item__body strong {
    display: block;
    color: #f8fafc;
    font-size: 14px;
    margin-bottom: 3px;
}

.notification-item__body p {
    margin: 0 0 6px;
    color: #cbd5e1;
    font-size: 13px;
    line-height: 1.35;
}

.notification-item__body small {
    color: #64748b;
}

.notification-item__actions {
    display: flex;
    align-items: flex-start;
}

/* Core v0.3.3 - Studio Foundation */
.studio-page {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.studio-hero {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: flex-start;
    padding: 28px;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(37, 99, 235, .22), rgba(15, 23, 42, .92));
}

.studio-hero h1 {
    margin: 0 0 10px;
    font-size: clamp(32px, 5vw, 54px);
    letter-spacing: -0.04em;
}

.studio-hero p {
    max-width: 760px;
    margin: 0;
    color: #cbd5e1;
    line-height: 1.6;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 16px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 700;
    white-space: nowrap;
}

.button-primary {
    color: #ffffff;
    background: #2563eb;
}

.studio-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.studio-stat-card,
.studio-builder-card,
.studio-blueprint {
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 20px;
    background: rgba(15, 23, 42, .72);
    box-shadow: 0 18px 45px rgba(0, 0, 0, .18);
}

.studio-stat-card {
    padding: 20px;
}

.studio-stat-card strong {
    display: block;
    color: #f8fafc;
    font-size: 34px;
    line-height: 1;
}

.studio-stat-card span {
    display: block;
    margin-top: 8px;
    color: #94a3b8;
}

.studio-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.studio-builder-card {
    padding: 20px;
}

.studio-builder-card__top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 18px;
}

.studio-builder-card__icon {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: rgba(96, 165, 250, .13);
    font-size: 22px;
}

.studio-builder-card__status {
    padding: 5px 9px;
    border-radius: 999px;
    background: rgba(34, 197, 94, .12);
    color: #86efac;
    font-size: 12px;
    font-weight: 700;
}

.studio-builder-card h2,
.studio-blueprint h2,
.studio-blueprint h3 {
    margin: 0 0 8px;
}

.studio-builder-card p,
.studio-blueprint p {
    margin: 0;
    color: #cbd5e1;
    line-height: 1.55;
}

.studio-blueprint {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr);
    gap: 22px;
    padding: 24px;
}

.studio-blueprint__meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 22px 0 0;
}

.studio-blueprint__meta div {
    padding: 14px;
    border-radius: 14px;
    background: rgba(30, 41, 59, .72);
}

.studio-blueprint__meta dt {
    color: #94a3b8;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.studio-blueprint__meta dd {
    margin: 6px 0 0;
    color: #f8fafc;
    font-weight: 700;
}

.studio-blueprint__list {
    padding: 18px;
    border-radius: 18px;
    background: rgba(30, 41, 59, .72);
}

.studio-blueprint__list ul {
    display: grid;
    gap: 10px;
    margin: 14px 0 0;
    padding: 0;
    list-style: none;
    color: #dbeafe;
}

@media (max-width: 1000px) {
    .studio-hero,
    .studio-blueprint {
        grid-template-columns: 1fr;
        flex-direction: column;
    }

    .studio-grid,
    .studio-stats {
        grid-template-columns: 1fr;
    }
}

/* Core v0.3.4 - Daily Briefing Foundation */
.today-page {
    display: grid;
    gap: 24px;
}

.today-hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    padding: 28px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(56,189,248,0.16), rgba(15,23,42,0.88));
}

.today-hero h1 {
    margin-bottom: 8px;
}

.today-date-card {
    min-width: 180px;
    padding: 18px;
    border-radius: 18px;
    background: rgba(2,6,23,0.46);
    border: 1px solid rgba(255,255,255,0.08);
    text-align: right;
}

.today-date-card span,
.today-date-card strong {
    display: block;
}

.today-date-card span {
    color: var(--muted);
    margin-bottom: 6px;
}

.today-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.today-summary-card {
    padding: 20px;
    border-radius: 18px;
    background: var(--panel);
    border: 1px solid rgba(255,255,255,0.08);
}

.today-summary-card strong {
    display: block;
    font-size: 34px;
    margin-bottom: 4px;
}

.today-summary-card span {
    color: var(--muted);
}

.today-summary-card--warning strong { color: #fbbf24; }
.today-summary-card--success strong { color: #34d399; }
.today-summary-card--info strong { color: var(--accent); }
.today-summary-card--neutral strong { color: var(--text); }

.today-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.65fr);
    gap: 20px;
}

.today-side-stack {
    display: grid;
    gap: 20px;
}

.today-panel {
    padding: 24px;
    border-radius: 22px;
    background: var(--panel);
    border: 1px solid rgba(255,255,255,0.08);
}

.today-panel__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 18px;
}

.today-panel h2 {
    margin-top: 0;
}

.today-empty {
    padding: 22px;
    border-radius: 18px;
    background: rgba(255,255,255,0.04);
    border: 1px dashed rgba(255,255,255,0.14);
}

.today-task-list,
.today-recommendations,
.today-mini-list {
    display: grid;
    gap: 12px;
}

.today-task-card {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 14px;
    padding: 16px;
    border-radius: 16px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
}

.today-check-button {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.18);
    background: rgba(255,255,255,0.05);
    color: var(--text);
    cursor: pointer;
    font-weight: 800;
}

.today-check-button:hover {
    background: #34d399;
    color: #022c22;
}

.today-check-button:disabled {
    cursor: wait;
    opacity: 0.62;
}

.today-task-card__top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.today-task-card__top span {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    color: var(--muted);
    text-transform: uppercase;
}

.today-task-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin-top: 8px;
    color: var(--muted);
    font-size: 13px;
}

.today-task-card__meta a {
    color: var(--accent);
    font-weight: 800;
    text-decoration: none;
}

.today-task-card__meta a:hover {
    color: var(--text);
}

.today-due-badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 8px;
    border-radius: 999px;
    font-weight: 900;
}

.today-due-badge--overdue {
    background: rgba(239,68,68,0.16);
    color: #fecaca;
}

.today-due-badge--today {
    background: rgba(249,115,22,0.16);
    color: #fed7aa;
}

.today-due-badge--upcoming {
    background: rgba(34,197,94,0.14);
    color: #bbf7d0;
}

.today-priority--urgent,
.today-priority--high {
    border-color: rgba(248,113,113,0.42);
}

.today-recommendation-card {
    display: grid;
    grid-template-columns: 38px 1fr;
    gap: 12px;
    padding: 14px;
    border-radius: 16px;
    background: rgba(56,189,248,0.08);
    border: 1px solid rgba(56,189,248,0.16);
}

.today-recommendation-card > span {
    font-size: 24px;
}

.today-mini-row {
    display: grid;
    gap: 4px;
    padding: 12px;
    border-radius: 14px;
    background: rgba(255,255,255,0.04);
    text-decoration: none;
    color: var(--text);
}

.today-mini-row:hover {
    background: rgba(56,189,248,0.12);
}

.today-mini-row span,
.today-task-card small {
    color: var(--muted);
    font-size: 13px;
}

.button-secondary {
    background: rgba(255,255,255,0.08);
    color: var(--text);
    border: 1px solid rgba(255,255,255,0.12);
}

@media (max-width: 1100px) {
    .today-layout,
    .today-summary-grid {
        grid-template-columns: 1fr;
    }

    .today-hero {
        flex-direction: column;
    }

    .today-date-card {
        text-align: left;
    }
}


/* Ivervo auth background v2 */
body.auth-page{
    min-height:100vh;
    background:
        linear-gradient(90deg, rgba(9,18,34,.18) 0%, rgba(9,18,34,.48) 48%, rgba(9,18,34,.72) 100%),
        url('/assets/images/auth/auth-background.webp?v=1') center center / cover no-repeat fixed !important;
}

body.auth-page::before{
    content:"";
    position:fixed;
    inset:0;
    z-index:-1;
    pointer-events:none;
    background:
        radial-gradient(circle at 28% 42%, rgba(34,197,255,.12), transparent 32%),
        radial-gradient(circle at 74% 55%, rgba(0,0,0,.35), transparent 42%);
}

body.auth-page .auth-shell,
body.auth-page .auth-wrapper,
body.auth-page .login-page,
body.auth-page .auth-layout{
    background:transparent !important;
}

body.auth-page .auth-card,
body.auth-page .login-card{
    background:rgba(10,18,36,.72);
    backdrop-filter:blur(18px);
    -webkit-backdrop-filter:blur(18px);
}

/* CRM Foundation v1 */
.crm-customer-page {
    display: grid;
    gap: 18px;
}

.crm-customer-header p {
    margin: 8px 0 0;
    color: var(--muted);
}

.crm-tab-shell {
    position: sticky;
    top: 0;
    z-index: 5;
    padding: 8px 0;
    background: var(--bg);
}

.crm-tab-nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 8px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    background: var(--panel);
}

.crm-tab-nav a {
    flex: 0 0 auto;
    padding: 10px 14px;
    border-radius: 12px;
    color: var(--muted);
    text-decoration: none;
    font-weight: 800;
}

.crm-tab-nav a:hover {
    color: var(--text);
    background: rgba(255,255,255,0.06);
}

.crm-summary-grid {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.crm-workspace {
    display: grid;
    gap: 18px;
}

.crm-panel {
    scroll-margin-top: 90px;
}

.crm-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.crm-panel-header h2,
.crm-panel-header p {
    margin: 0;
}

.crm-panel-count {
    display: inline-grid;
    min-width: 44px;
    height: 44px;
    place-items: center;
    border: 1px solid rgba(56,189,248,0.28);
    border-radius: 12px;
    background: rgba(56,189,248,0.12);
    color: var(--accent);
    font-size: 18px;
    font-weight: 900;
}

.crm-contact-form {
    display: grid;
    gap: 16px;
    margin-bottom: 22px;
    padding: 18px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    background: rgba(255,255,255,0.035);
}

.crm-contact-form h3 {
    margin: 0 0 4px;
}

.crm-contact-form p {
    margin: 0;
}

.crm-contact-form textarea {
    width: 100%;
}

.crm-toggle-row {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 14px;
    background: rgba(255,255,255,0.04);
    color: var(--text);
    cursor: pointer;
    font-weight: 800;
}

.crm-toggle-row:hover {
    border-color: rgba(56,189,248,0.34);
    background: rgba(56,189,248,0.08);
}

.crm-toggle-row input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.crm-toggle-row__control {
    position: relative;
    flex: 0 0 auto;
    width: 42px;
    height: 24px;
    border-radius: 999px;
    background: rgba(148,163,184,0.28);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.10);
    transition: background .16s ease, box-shadow .16s ease;
}

.crm-toggle-row__control::after {
    content: "";
    position: absolute;
    top: 4px;
    left: 4px;
    width: 16px;
    height: 16px;
    border-radius: 999px;
    background: #fff;
    transition: transform .16s ease;
}

.crm-toggle-row input:checked + .crm-toggle-row__control {
    background: var(--accent);
    box-shadow: 0 0 0 3px rgba(56,189,248,0.16);
}

.crm-toggle-row input:checked + .crm-toggle-row__control::after {
    transform: translateX(18px);
}

.crm-toggle-row input:focus-visible + .crm-toggle-row__control {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.crm-contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
}

.crm-contact-card {
    display: grid;
    gap: 16px;
    padding: 18px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    background: rgba(255,255,255,0.04);
}

.crm-contact-card--primary {
    border-color: rgba(56,189,248,0.38);
    background: linear-gradient(135deg, rgba(56,189,248,0.12), rgba(255,255,255,0.035));
}

.crm-contact-card__top {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
}

.crm-contact-card__top strong,
.crm-contact-card__top span {
    display: block;
}

.crm-contact-card__top strong {
    font-size: 18px;
}

.crm-contact-card__top span {
    margin-top: 2px;
    color: var(--muted);
}

.crm-contact-card__top em {
    display: inline-flex;
    width: fit-content;
    margin-top: 8px;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(56,189,248,0.18);
    color: var(--accent);
    font-size: 12px;
    font-style: normal;
    font-weight: 900;
}

.crm-contact-avatar {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border-radius: 14px;
    background: rgba(56,189,248,0.16);
    color: var(--accent);
    font-weight: 900;
}

.crm-contact-details {
    display: grid;
    gap: 10px;
    margin: 0;
}

.crm-contact-details div {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 10px;
}

.crm-contact-details dt {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.crm-contact-details dd {
    min-width: 0;
    margin: 0;
}

.crm-contact-details a {
    color: var(--accent);
    overflow-wrap: anywhere;
    text-decoration: none;
}

.crm-contact-details span {
    color: var(--muted);
}

.crm-contact-note {
    margin: 0;
    padding: 12px;
    border-radius: 12px;
    background: rgba(0,0,0,0.14);
    color: var(--muted);
    font-size: 14px;
}

.crm-contact-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.crm-contact-actions .button {
    margin-top: 0;
}

.crm-empty-state {
    padding: 18px;
    border: 1px dashed rgba(255,255,255,0.14);
    border-radius: 16px;
    background: rgba(255,255,255,0.03);
}

.crm-empty-state p {
    margin: 4px 0 0;
}

.crm-definition-list {
    display: grid;
    grid-template-columns: minmax(150px, 220px) minmax(0, 1fr);
    gap: 10px 18px;
}

.crm-definition-list dt {
    color: var(--muted);
    font-weight: 800;
}

.crm-definition-list dd {
    margin: 0;
}

.crm-note-form {
    display: grid;
    gap: 12px;
    margin-bottom: 18px;
}

.crm-note-form textarea {
    width: 100%;
    resize: vertical;
}

.crm-note-list {
    display: grid;
    gap: 12px;
}

.crm-note {
    padding: 14px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    background: rgba(255,255,255,0.04);
}

.crm-note p {
    margin: 0 0 10px;
}

.crm-note small {
    color: var(--muted);
}

.crm-placeholder-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.crm-placeholder-grid > div {
    padding: 16px;
    border: 1px dashed rgba(255,255,255,0.16);
    border-radius: 16px;
    background: rgba(255,255,255,0.03);
}

@media (max-width: 800px) {
    .crm-definition-list,
    .crm-placeholder-grid {
        grid-template-columns: 1fr;
    }
}

/* Tasks Foundation v1 */
.tasks-page {
    display: grid;
    gap: 18px;
}

.tasks-dashboard {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.tasks-dashboard-card {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 88px;
    padding: 14px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    background: rgba(255,255,255,0.04);
}

.tasks-dashboard-card > span {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
}

.tasks-dashboard-card strong {
    display: block;
    color: var(--text);
    font-size: 28px;
    line-height: 1;
}

.tasks-dashboard-card small {
    color: var(--muted);
    font-weight: 900;
}

.tasks-dashboard-card--open {
    border-color: rgba(56,189,248,0.18);
}

.tasks-dashboard-card--overdue {
    border-color: rgba(239,68,68,0.22);
}

.tasks-dashboard-card--done {
    border-color: rgba(34,197,94,0.22);
}

.tasks-toolbar {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: stretch;
    padding: 14px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    background: rgba(255,255,255,0.04);
}

.tasks-open-count {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 190px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(34,197,94,0.12);
    border: 1px solid rgba(34,197,94,0.18);
}

.tasks-open-count > span {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(34,197,94,0.18);
}

.tasks-open-count strong {
    display: block;
    color: var(--text);
    font-size: 24px;
    line-height: 1;
}

.tasks-open-count small {
    color: var(--muted);
    font-weight: 800;
}

.tasks-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
    align-items: end;
    margin: 0;
}

.tasks-controls label {
    display: grid;
    gap: 6px;
    min-width: 190px;
}

.tasks-controls label span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.tasks-controls input,
.tasks-controls select {
    min-height: 40px;
}

.tasks-filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tasks-filter-tabs a {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 8px 12px;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 999px;
    background: rgba(255,255,255,0.04);
    color: var(--muted);
    font-size: 13px;
    font-weight: 900;
    text-decoration: none;
}

.tasks-filter-tabs a:hover,
.tasks-filter-tabs a.is-active {
    border-color: rgba(56,189,248,0.34);
    background: rgba(56,189,248,0.12);
    color: var(--text);
}

.tasks-empty,
.tasks-empty-state {
    display: grid;
    gap: 10px;
}

.tasks-empty-state {
    place-items: center;
    padding: 34px 24px;
    border: 1px dashed rgba(255,255,255,0.16);
    border-radius: 16px;
    background: rgba(255,255,255,0.04);
    text-align: center;
}

.tasks-empty-state__icon {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: rgba(56,189,248,0.12);
    color: var(--accent);
    font-size: 26px;
}

.tasks-empty-state h2,
.tasks-empty-state p {
    margin: 0;
}

.tasks-empty-state p {
    max-width: 430px;
    color: var(--muted);
}

.tasks-form {
    display: grid;
    gap: 18px;
}

.tasks-row-actions {
    align-items: center;
}

.tasks-row-actions form {
    margin: 0;
}

.tasks-row-actions .button {
    min-height: 32px;
    padding: 7px 10px;
    font-size: 13px;
}

.tasks-row-actions form {
    display: inline-flex;
}

.task-detail-actions form {
    display: inline-flex;
}

.task-priority {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(148,163,184,0.14);
    color: var(--text);
    font-size: 13px;
    font-weight: 800;
}

.task-priority--low {
    color: #bbf7d0;
    background: rgba(34,197,94,0.14);
}

.task-priority--normal {
    color: #fef08a;
    background: rgba(250,204,21,0.14);
}

.task-priority--high {
    color: #fecaca;
    background: rgba(239,68,68,0.16);
}

.task-priority--urgent {
    color: #fecaca;
    background: rgba(239,68,68,0.16);
}

.status-pill--task-open {
    background: rgba(56,189,248,0.12);
    color: var(--accent);
}

.status-pill--task-in_progress {
    background: rgba(250,204,21,0.14);
    color: #fef08a;
}

.status-pill--task-done {
    background: rgba(34,197,94,0.14);
    color: #bbf7d0;
}

.task-detail-card {
    display: grid;
    gap: 18px;
}

.task-detail-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.task-detail-card__header > div {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.task-detail-card__header form {
    margin: 0;
}

.task-detail-card p {
    margin: 0;
}

.crm-task-list {
    display: grid;
    gap: 12px;
}

.crm-task-create-form {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) 160px 150px auto;
    gap: 10px;
    align-items: end;
    margin: 0 0 14px;
    padding: 12px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    background: rgba(255,255,255,0.04);
}

.crm-task-create-form label {
    display: grid;
    gap: 6px;
}

.crm-task-create-form label span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.crm-task-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 14px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    background: rgba(255,255,255,0.04);
}

.crm-task-item > div {
    min-width: 0;
}

.crm-task-item a {
    color: var(--text);
    font-weight: 900;
    text-decoration: none;
}

.crm-task-item a:hover {
    color: var(--accent);
}

.crm-task-item p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 14px;
}

.crm-task-item__meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.crm-task-item__meta form {
    margin: 0;
}

.crm-task-item__meta .button {
    min-height: 32px;
    padding: 7px 10px;
    font-size: 13px;
}

@media (max-width: 800px) {
    .tasks-dashboard,
    .crm-task-create-form {
        grid-template-columns: 1fr;
    }

    .tasks-toolbar {
        display: grid;
    }

    .tasks-controls {
        justify-content: stretch;
    }

    .tasks-controls label,
    .tasks-controls .button {
        min-width: 0;
        width: 100%;
    }

    .task-detail-card__header {
        flex-direction: column;
        align-items: flex-start;
    }

    .crm-task-item {
        grid-template-columns: 1fr;
    }

    .crm-task-item__meta {
        justify-content: flex-start;
    }
}
