:root {
    --shell-border: #d9e1ea;
    --shell-muted: #667085;
    --shell-bg: #f4f7f7;
    --shell-panel: #ffffff;
    --shell-ink: #17212f;
    --shell-ink-soft: #344054;
    --shell-accent: #126e75;
    --shell-accent-soft: #e5f3f2;
    --shell-warn: #b55b19;
    --shell-danger: #b42318;
    --shell-shadow: 0 1rem 2.5rem rgba(23, 33, 47, 0.08);
}

html {
    font-size: 16px;
}

body {
    margin: 0;
    background: var(--shell-bg);
    color: var(--shell-ink);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.htmx-indicator {
    opacity: 0;
}

.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
    opacity: 1;
    transition: opacity 200ms ease-in;
}

.app-shell {
    min-height: 100vh;
}

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 1020;
    border-bottom: 1px solid var(--shell-border);
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(12px);
}

.app-topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    min-height: 4.5rem;
    padding: 0.75rem 1.5rem;
}

.app-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--shell-ink);
    text-decoration: none;
    min-width: max-content;
}

.app-brand:hover,
.app-brand:focus {
    color: var(--shell-accent);
}

.app-brand-mark {
    display: inline-grid;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.7rem;
    background: var(--shell-ink);
    color: #ffffff;
    font-weight: 800;
}

.app-brand-text {
    font-size: 1.15rem;
    font-weight: 750;
}

.app-session-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.session-pill,
.shell-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    max-width: 22rem;
    min-height: 2.25rem;
    border: 1px solid var(--shell-border);
    border-radius: 999px;
    padding: 0.35rem 0.8rem;
    background: #ffffff;
    color: var(--shell-ink-soft);
}

.session-pill-tenant {
    background: var(--shell-accent-soft);
    border-color: #b9ddda;
}

.session-pill-label {
    color: var(--shell-muted);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
}

.session-pill-value {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.9rem;
    font-weight: 650;
}

.app-logout-button {
    border-radius: 999px;
}

.app-body {
    display: grid;
    grid-template-columns: minmax(14rem, 16rem) minmax(0, 1fr);
    align-items: stretch;
    min-height: calc(100vh - 4.5rem);
}

.app-sidebar {
    border-right: 1px solid var(--shell-border);
    background: #fbfcfc;
    padding: 1.25rem 1rem;
}

.app-nav-group {
    position: sticky;
    top: 5.5rem;
    gap: 1.15rem;
}

.app-nav-heading {
    padding: 0 0.7rem;
    color: var(--shell-muted);
    font-size: 0.74rem;
    font-weight: 800;
    text-transform: uppercase;
}

.app-nav-heading-admin {
    margin-top: 0.45rem;
    padding-top: 1rem;
    border-top: 1px solid var(--shell-border);
}

.app-nav-list {
    display: grid;
    gap: 0.25rem;
}

.app-nav-list-admin {
    padding-left: 0.25rem;
    border-left: 3px solid #d7c7a1;
}

.app-nav-link {
    display: flex;
    align-items: center;
    min-height: 2.4rem;
    border-radius: 0.7rem;
    padding: 0.55rem 0.75rem;
    color: var(--shell-ink-soft);
    font-weight: 650;
    text-decoration: none;
}

.app-nav-link:hover,
.app-nav-link:focus {
    background: var(--shell-accent-soft);
    color: var(--shell-accent);
}

.app-nav-link.active {
    background: var(--shell-ink);
    color: #ffffff;
}

.app-nav-link-admin.active {
    background: #4f3d1f;
}

.app-main {
    min-width: 0;
    padding: 2rem;
}

.app-main-public {
    grid-column: 1 / -1;
}

.nav-link {
    color: #29415e;
    border-radius: 0.65rem;
}

.nav-link:hover,
.nav-link:focus {
    background: rgba(13, 110, 253, 0.08);
    color: #0d6efd;
}

.nav-link.active {
    background: rgba(13, 110, 253, 0.12);
    color: #0d6efd;
}

.record-template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
    gap: 1rem;
}

.record-template-card {
    position: relative;
    min-height: 18rem;
    border: 1px solid var(--shell-border);
    border-top: 4px solid var(--shell-accent);
    border-radius: 0.75rem;
    padding: 1.15rem;
    background: var(--shell-panel);
    box-shadow: 0 0.75rem 2rem rgba(23, 33, 47, 0.06);
    transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.record-template-card:hover,
.record-template-card:focus-within {
    transform: translateY(-2px);
    border-color: #b9ddda;
    box-shadow: var(--shell-shadow);
}

.record-template-card-top,
.record-template-detail-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.record-template-mark {
    display: inline-grid;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.7rem;
    background: var(--shell-ink);
    color: #ffffff;
    font-weight: 800;
}

.record-template-blue { border-top-color: #1d4ed8; }
.record-template-teal { border-top-color: #0f766e; }
.record-template-green { border-top-color: #15803d; }
.record-template-amber { border-top-color: #b55b19; }
.record-template-slate { border-top-color: #475467; }
.record-template-indigo { border-top-color: #4338ca; }
.record-template-gray,
.record-template-neutral { border-top-color: #667085; }

.record-template-meta,
.record-template-sections,
.record-template-signal-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.record-template-meta span,
.record-template-sections span,
.record-template-signal-list span {
    display: inline-flex;
    align-items: center;
    min-height: 1.75rem;
    border: 1px solid var(--shell-border);
    border-radius: 999px;
    padding: 0.25rem 0.65rem;
    background: #fbfcfc;
    color: var(--shell-ink-soft);
    font-size: 0.84rem;
    font-weight: 650;
}

.record-template-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.record-template-summary-card {
    border: 1px solid var(--shell-border);
    border-radius: 0.75rem;
    padding: 1rem;
    background: #ffffff;
}

.record-template-summary-card span {
    display: block;
    color: var(--shell-muted);
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
}

.record-template-summary-card strong {
    display: block;
    margin-top: 0.25rem;
    color: var(--shell-ink);
    font-size: 1.35rem;
    line-height: 1.1;
}

.record-template-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(18rem, 22rem);
    gap: 1.25rem;
    align-items: start;
}

.record-template-field-table th {
    color: var(--shell-muted);
    font-size: 0.76rem;
    text-transform: uppercase;
}

.record-template-field-groups dt {
    color: var(--shell-ink);
    font-size: 0.85rem;
    font-weight: 800;
}

.record-template-field-groups dd {
    margin-bottom: 0.9rem;
    color: var(--shell-muted);
}

.page-section,
.placeholder-shell,
.auth-shell {
    max-width: 76rem;
}

.page-section {
    margin-inline: auto;
}

.auth-shell {
    padding-top: 12vh;
}

.search-shell {
    max-width: 24rem;
    width: 100%;
}

.page-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.page-title {
    color: var(--shell-ink);
    font-size: clamp(2rem, 4vw, 3.25rem);
    font-weight: 780;
    line-height: 1.05;
}

.page-subtitle {
    max-width: 46rem;
    color: var(--shell-muted);
    font-size: 1rem;
}

.eyebrow {
    color: var(--shell-accent);
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
}

.content-panel {
    border: 1px solid rgba(23, 33, 47, 0.08);
    border-radius: 0.95rem;
    background: var(--shell-panel);
    box-shadow: var(--shell-shadow);
    padding: 1.25rem;
}

.panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.panel-title {
    color: var(--shell-ink);
    font-size: 1.15rem;
    font-weight: 760;
}

.dashboard-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.dashboard-metric-card {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(23, 33, 47, 0.08);
    border-radius: 0.95rem;
    background: #ffffff;
    box-shadow: 0 0.65rem 1.5rem rgba(23, 33, 47, 0.06);
}

.dashboard-metric-card::before {
    content: "";
    display: block;
    height: 0.35rem;
    background: var(--metric-accent, var(--shell-accent));
}

.metric-today { --metric-accent: #126e75; }
.metric-upcoming { --metric-accent: #6750a4; }
.metric-overdue { --metric-accent: #b42318; }
.metric-tasks { --metric-accent: #b55b19; }

.metric-link {
    display: grid;
    gap: 0.35rem;
    min-height: 9rem;
    padding: 1rem;
    color: inherit;
    text-decoration: none;
}

.metric-link:hover,
.metric-link:focus {
    background: rgba(18, 110, 117, 0.04);
}

.metric-label {
    color: var(--shell-muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.metric-value {
    color: var(--shell-ink);
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1;
}

.metric-note {
    color: var(--shell-muted);
    font-size: 0.92rem;
}

.work-item-list {
    display: grid;
    gap: 0.85rem;
}

.session-summary-panel {
    position: sticky;
    top: 5.5rem;
}

.session-detail-list {
    display: grid;
    gap: 0.75rem;
}

.session-detail-list div {
    display: grid;
    gap: 0.2rem;
    border-bottom: 1px solid var(--shell-border);
    padding-bottom: 0.75rem;
}

.session-detail-list dt {
    color: var(--shell-muted);
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
}

.session-detail-list dd {
    margin: 0;
    color: var(--shell-ink);
    font-weight: 650;
    overflow-wrap: anywhere;
}

.tenant-option {
    cursor: pointer;
}

.admin-page {
    max-width: 72rem;
}

.admin-summary-card {
    border: 1px solid rgba(19, 32, 51, 0.08);
    background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
}

.admin-metric {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}

.admin-callout {
    background: #fff7e8;
    border: 1px solid #efd39d;
    color: #6b5326;
}

.admin-muted-box {
    background: rgba(13, 110, 253, 0.06);
    border: 1px solid rgba(13, 110, 253, 0.12);
}

.admin-table th,
.admin-table td {
    vertical-align: middle;
}

.quick-task-fab {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    border-radius: 999px;
    padding-inline: 1rem;
    z-index: 1030;
}

.page-summary-card {
    border: 1px solid rgba(19, 32, 51, 0.08);
    background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
    color: inherit;
}

.page-summary-card:hover,
.page-summary-card:focus {
    border-color: rgba(13, 110, 253, 0.24);
    box-shadow: 0 0.75rem 1.75rem rgba(13, 110, 253, 0.08);
}

.work-item-card {
    border: 1px solid rgba(23, 33, 47, 0.08);
    border-radius: 0.9rem;
    background: #ffffff;
    box-shadow: 0 0.45rem 1.25rem rgba(23, 33, 47, 0.05);
    overflow: hidden;
}

.work-item-main {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
}

.work-item-content {
    min-width: 0;
    flex: 1;
}

.work-item-badges {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-bottom: 0.65rem;
}

.work-item-heading {
    margin-bottom: 0.75rem;
}

.work-item-card-overdue {
    border-left: 0.35rem solid #dc3545;
}

.work-item-card-missed {
    border-left: 0.35rem solid #212529;
}

.work-item-title {
    color: var(--shell-ink);
    font-size: 1.04rem;
    font-weight: 750;
    text-decoration: none;
}

.work-item-title:hover,
.work-item-title:focus {
    color: var(--shell-accent);
}

.work-item-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem 1rem;
}

.work-item-meta {
    display: grid;
    gap: 0.1rem;
    min-width: 0;
}

.work-item-meta span {
    color: var(--shell-muted);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.work-item-meta strong {
    color: var(--shell-ink-soft);
    font-size: 0.9rem;
    font-weight: 650;
    overflow-wrap: anywhere;
}

.work-item-actions {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
}

.user-empty-state {
    border: 1px dashed rgba(19, 32, 51, 0.18);
    border-radius: 1rem;
    padding: 1.25rem;
    background: rgba(255, 255, 255, 0.7);
}

.calendar-planning-page {
    max-width: 90rem;
}

.calendar-hero-actions,
.calendar-mode-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.calendar-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.calendar-summary-card {
    display: grid;
    gap: 0.25rem;
    border: 1px solid rgba(23, 33, 47, 0.08);
    border-radius: 0.8rem;
    background: #ffffff;
    padding: 1rem;
    box-shadow: 0 0.45rem 1.25rem rgba(23, 33, 47, 0.05);
}

.calendar-summary-card span {
    color: var(--shell-muted);
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
}

.calendar-summary-card strong {
    color: var(--shell-ink);
    font-size: 2rem;
    line-height: 1;
}

.calendar-summary-total { border-top: 0.35rem solid var(--shell-accent); }
.calendar-summary-conflicts { border-top: 0.35rem solid var(--shell-warn); }
.calendar-summary-overdue { border-top: 0.35rem solid var(--shell-danger); }

.calendar-toolbar {
    display: grid;
    gap: 1rem;
}

.calendar-filter-form {
    display: grid;
    grid-template-columns: repeat(4, minmax(9rem, 1fr)) auto auto;
    align-items: end;
    gap: 0.75rem;
}

.calendar-filter-form .form-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.calendar-week-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.85rem;
}

.calendar-day-column,
.calendar-month-cell {
    min-width: 0;
    border: 1px solid rgba(23, 33, 47, 0.08);
    border-radius: 0.8rem;
    background: rgba(255, 255, 255, 0.86);
}

.calendar-day-column {
    display: grid;
    grid-template-rows: auto 1fr;
    gap: 0.8rem;
    min-height: 20rem;
    padding: 0.8rem;
}

.calendar-day-header,
.calendar-month-cell-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.calendar-day-today {
    border-color: rgba(18, 110, 117, 0.45);
    box-shadow: inset 0 0 0 1px rgba(18, 110, 117, 0.16);
}

.calendar-day-items {
    display: grid;
    gap: 0.75rem;
    align-content: start;
}

.calendar-day-items .work-item-main {
    display: grid;
    padding: 0.8rem;
}

.calendar-day-items .work-item-meta-grid {
    grid-template-columns: 1fr;
}

.calendar-day-empty {
    color: var(--shell-muted);
    font-size: 0.9rem;
}

.calendar-month-grid {
    display: grid;
    gap: 0.55rem;
}

.calendar-month-week {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.55rem;
}

.calendar-month-week-heading span {
    color: var(--shell-muted);
    font-size: 0.74rem;
    font-weight: 800;
    text-align: center;
    text-transform: uppercase;
}

.calendar-month-cell {
    display: grid;
    align-content: start;
    gap: 0.5rem;
    min-height: 9.5rem;
    padding: 0.7rem;
}

.calendar-month-cell-muted {
    background: rgba(255, 255, 255, 0.45);
    color: var(--shell-muted);
}

.calendar-month-cell-header a {
    color: var(--shell-ink);
    font-weight: 760;
    text-decoration: none;
}

.calendar-month-cell-header a:hover,
.calendar-month-cell-header a:focus {
    color: var(--shell-accent);
}

.calendar-month-signals,
.calendar-month-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.calendar-month-preview-item {
    display: block;
    width: 100%;
    overflow: hidden;
    color: var(--shell-ink-soft);
    font-size: 0.82rem;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.organizer-card {
    border: 1px solid rgba(19, 32, 51, 0.08);
}

.user-collapsible-section {
    border: 1px solid rgba(19, 32, 51, 0.08);
    border-radius: 1rem;
    padding: 1rem 1.25rem;
    background: rgba(255, 255, 255, 0.72);
}

.user-collapsible-section summary {
    cursor: pointer;
    list-style: none;
}

.user-collapsible-section summary::-webkit-details-marker {
    display: none;
}

.task-editor-shell,
.task-detail-shell {
    max-width: 76rem;
}

.task-description {
    white-space: pre-wrap;
    line-height: 1.5;
}

.task-field-grid {
    gap: 1rem;
}

@media (max-width: 767.98px) {
    .app-topbar-inner,
    .page-hero,
    .work-item-main {
        align-items: stretch;
        flex-direction: column;
    }

    .app-topbar {
        position: static;
    }

    .app-session-bar {
        align-items: stretch;
        justify-content: flex-start;
    }

    .session-pill {
        flex: 1 1 10rem;
    }

    .app-body {
        display: block;
    }

    .app-sidebar {
        border-right: 0;
        border-bottom: 1px solid var(--shell-border);
    }

    .app-nav-group,
    .session-summary-panel {
        position: static;
    }

    .app-main {
        padding: 1.25rem;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .calendar-summary-grid,
    .calendar-week-grid,
    .calendar-month-week,
    .calendar-filter-form {
        grid-template-columns: 1fr;
    }

    .calendar-month-week-heading {
        display: none;
    }

    .calendar-day-column,
    .calendar-month-cell {
        min-height: auto;
    }

    .work-item-meta-grid {
        grid-template-columns: 1fr;
    }

    .quick-task-fab {
        right: 1rem;
        bottom: 1rem;
    }
}

@media (min-width: 768px) and (max-width: 1199.98px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .calendar-week-grid,
    .calendar-month-week {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .calendar-month-week-heading {
        display: none;
    }

    .calendar-filter-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* -------------------------------------------------------------------------
   Release-candidate UX polish layer
   Adds: refined focus rings, button hierarchy, login/forbidden shells,
   smoother card lift, badge tokens, table polish. Does not redefine any
   existing class names; safe to remove without breaking the base shell.
   ------------------------------------------------------------------------- */

:root {
    --brand-primary: #1d4ed8;
    --brand-primary-strong: #1e3a8a;
    --brand-accent: #0f766e;
    --brand-surface: #ffffff;
    --brand-surface-muted: #f6f8fb;
    --brand-ring: rgba(29, 78, 216, 0.18);
}

*:focus-visible {
    outline: 2px solid var(--brand-primary);
    outline-offset: 2px;
    border-radius: 0.4rem;
}

html {
    scroll-padding-top: 6rem;
}

button,
a,
input,
select,
textarea,
[tabindex] {
    scroll-margin-top: 6rem;
}

.btn {
    font-weight: 650;
    letter-spacing: 0.005em;
    border-radius: 0.55rem;
    transition: box-shadow 160ms ease, transform 160ms ease, background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.btn-primary {
    background-color: var(--brand-primary);
    border-color: var(--brand-primary);
}

.btn-primary:hover,
.btn-primary:focus-visible {
    background-color: var(--brand-primary-strong);
    border-color: var(--brand-primary-strong);
    box-shadow: 0 0.5rem 1rem var(--brand-ring);
}

.btn-outline-primary {
    color: var(--brand-primary);
    border-color: rgba(29, 78, 216, 0.45);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus-visible {
    background-color: rgba(29, 78, 216, 0.08);
    color: var(--brand-primary-strong);
    border-color: var(--brand-primary);
}

.card,
.content-panel,
.work-item-card,
.dashboard-metric-card {
    transition: box-shadow 200ms ease, transform 200ms ease, border-color 200ms ease;
}

.dashboard-metric-card:hover,
.dashboard-metric-card:focus-within,
.work-item-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 1rem 2rem rgba(23, 33, 47, 0.10);
}

.badge.rounded-pill {
    font-weight: 650;
    letter-spacing: 0.02em;
    padding-inline: 0.65rem;
}

.admin-table,
.table {
    --bs-table-hover-bg: rgba(29, 78, 216, 0.04);
}

.table thead th {
    color: var(--shell-muted);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--shell-border);
}

.form-label {
    font-weight: 650;
    color: var(--shell-ink-soft);
}

.form-control,
.form-select {
    border-radius: 0.55rem;
    border-color: var(--shell-border);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 0.2rem var(--brand-ring);
}

/* Auth/login shell polish */
.auth-shell {
    max-width: 28rem;
}

.auth-shell .card {
    border: 1px solid rgba(23, 33, 47, 0.08);
    border-radius: 1rem;
    box-shadow: 0 1.5rem 3rem rgba(23, 33, 47, 0.10);
}

.auth-shell .card-body {
    padding: 2rem !important;
}

.auth-shell h1 {
    font-weight: 780;
    letter-spacing: -0.01em;
}

/* Forbidden / access-denied shell polish */
.forbidden-shell {
    max-width: 36rem;
    padding-top: 8vh;
}

.forbidden-card {
    border: 1px solid rgba(180, 35, 24, 0.16);
    border-radius: 1rem;
    background: linear-gradient(180deg, #ffffff 0%, #fdf6f5 100%);
    box-shadow: 0 1.25rem 2.5rem rgba(180, 35, 24, 0.08);
}

.forbidden-glyph {
    display: inline-grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    margin-bottom: 1rem;
    border-radius: 50%;
    background: rgba(180, 35, 24, 0.12);
    color: #b42318;
    font-size: 1.4rem;
    font-weight: 800;
    line-height: 1;
}

.forbidden-help {
    margin-top: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(23, 33, 47, 0.08);
}

/* Empty state polish */
.user-empty-state h2,
.user-empty-state h3 {
    color: var(--shell-ink);
    letter-spacing: -0.005em;
}

/* Page title rhythm */
.display-6,
.page-title {
    letter-spacing: -0.015em;
}

/* Sidebar active-link contrast for keyboard users */
.app-nav-link:focus-visible {
    outline-offset: 0;
    box-shadow: inset 0 0 0 2px var(--brand-primary);
}

/* Quick action FAB polish */
.quick-task-fab {
    box-shadow: 0 0.85rem 1.75rem rgba(29, 78, 216, 0.30);
}

.quick-task-fab:hover,
.quick-task-fab:focus-visible {
    transform: translateY(-1px);
}

/* -------------------------------------------------------------------------
   Release-candidate UX polish layer 2 — branding pass
   Adds: SVG brand mark sizing, dashboard hero tint, admin tile accent stripe,
   refined nav active gradient, polished pill metrics. Additive only; safe to
   remove without breaking any of layer 1 above.
   ------------------------------------------------------------------------- */

.app-brand-mark {
    overflow: hidden;
    background: transparent;
    padding: 0;
}

.app-brand-mark-svg {
    width: 100%;
    height: 100%;
    display: block;
}

.app-brand-text {
    background: linear-gradient(95deg, var(--shell-ink) 30%, var(--brand-primary-strong) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: -0.005em;
}

/* Sidebar active link gets a subtle brand gradient + accent dot */
.app-nav-link {
    position: relative;
}

.app-nav-link.active {
    background: linear-gradient(180deg, var(--shell-ink) 0%, #1f2c41 100%);
    color: #ffffff;
    box-shadow: 0 0.45rem 0.95rem rgba(23, 33, 47, 0.18);
}

.app-nav-link.active::before {
    content: "";
    position: absolute;
    left: -0.45rem;
    top: 50%;
    width: 0.35rem;
    height: 1.25rem;
    transform: translateY(-50%);
    border-radius: 0.25rem;
    background: var(--brand-accent);
}

.app-nav-link-admin.active {
    background: linear-gradient(180deg, #4f3d1f 0%, #6a5026 100%);
}

.app-nav-link-admin.active::before {
    background: #d7c7a1;
}

/* Dashboard hero soft tint so the landing surface anchors the eye */
.dashboard-hero {
    position: relative;
    border-radius: 1.1rem;
    padding: 1.5rem 1.75rem;
    background: linear-gradient(135deg, rgba(18, 110, 117, 0.08) 0%, rgba(29, 78, 216, 0.06) 100%);
    border: 1px solid rgba(18, 110, 117, 0.12);
}

.dashboard-hero .page-title {
    color: var(--shell-ink);
}

.dashboard-hero .page-subtitle {
    color: var(--shell-ink-soft);
}

/* Admin summary tiles: stripe + hover lift to match dashboard metric cards */
.admin-summary-card {
    position: relative;
    overflow: hidden;
    border-radius: 0.95rem;
    transition: box-shadow 200ms ease, transform 200ms ease, border-color 200ms ease;
}

.admin-summary-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 0.3rem;
    background: var(--admin-accent, var(--brand-primary));
    opacity: 0.85;
}

.admin-summary-card .card-body {
    padding-top: 1.25rem;
}

.admin-summary-card:hover,
.admin-summary-card:focus-within {
    transform: translateY(-1px);
    box-shadow: 0 1rem 2rem rgba(23, 33, 47, 0.10);
    border-color: rgba(29, 78, 216, 0.18);
}

.admin-tile-members    { --admin-accent: #1d4ed8; }
.admin-tile-invites    { --admin-accent: #b45309; }
.admin-tile-roles      { --admin-accent: #6750a4; }
.admin-tile-modules    { --admin-accent: #0f766e; }
.admin-tile-integrations { --admin-accent: #4f3d1f; }
.admin-tile-accounting { --admin-accent: #15803d; }

/* Eyebrow uppercase rhythm fix */
.eyebrow {
    letter-spacing: 0.08em;
}

/* Page-section vertical rhythm: ensure first child doesn't double-pad */
.page-section > .dashboard-hero + .dashboard-grid {
    margin-top: 1.25rem;
}

/* Metric value tightens */
.metric-value,
.admin-metric {
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.015em;
}

/* Tenant pill: ensure accent reads even at small sizes */
.session-pill-tenant .session-pill-value {
    color: var(--shell-accent);
}

/* Work item priority signal: ensure contrast on white card */
.work-item-card .text-warning {
    color: #b45309 !important;
}

.work-item-card .text-danger {
    color: #b91c1c !important;
}

/* Subtle separator below page hero on non-hero pages for rhythm */
.page-hero {
    padding-bottom: 0.25rem;
}

/* Login: tighter heading rhythm */
.auth-shell h1 {
    margin-bottom: 0.5rem;
}

.auth-shell .auth-eyebrow {
    color: var(--brand-accent);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* Print: hide chrome */
@media print {
    .app-topbar,
    .app-sidebar,
    .quick-task-fab {
        display: none !important;
    }

    .app-body {
        display: block;
    }

    .app-main {
        padding: 0;
    }
}


