:root {
    --admin-primary: #c24b2d;
    --admin-primary-deep: #8f2f1d;
    --admin-ink: #1a2731;
    --admin-muted: #5f6b76;
    --admin-surface: rgba(255, 252, 248, 0.96);
    --admin-surface-strong: #fffaf4;
    --admin-outline: rgba(24, 35, 45, 0.09);
    --admin-sidebar: #17222c;
    --admin-sidebar-soft: #21313e;
}

html, body {
    font-family: 'Manrope', 'Segoe UI', sans-serif;
    background:
        radial-gradient(circle at top left, rgba(194, 75, 45, 0.18), transparent 26%),
        radial-gradient(circle at top right, rgba(23, 34, 44, 0.16), transparent 28%),
        linear-gradient(180deg, #f7f1ea 0%, #efe7df 100%);
    margin: 0;
    padding: 0;
    min-height: 100%;
    color: var(--admin-ink);
}

body {
    min-height: 100vh;
}

a {
    color: inherit;
}

/* Local utility classes used by the Razor views. They replace the former Tailwind CDN. */
.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

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

.flex-1 {
    flex: 1 1 0%;
}

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

.items-start {
    align-items: flex-start;
}

.justify-between {
    justify-content: space-between;
}

.justify-center {
    justify-content: center;
}

.justify-end {
    justify-content: flex-end;
}

.gap-1 {
    gap: 4px;
}

.gap-2 {
    gap: 8px;
}

.gap-3 {
    gap: 12px;
}

.gap-4 {
    gap: 16px;
}

.gap-6 {
    gap: 24px;
}

.mt-1 {
    margin-top: 4px;
}

.mt-2 {
    margin-top: 8px;
}

.mt-3 {
    margin-top: 12px;
}

.mt-4 {
    margin-top: 16px;
}

.mb-1 {
    margin-bottom: 4px;
}

.mb-2 {
    margin-bottom: 8px;
}

.mb-3 {
    margin-bottom: 12px;
}

.mb-4 {
    margin-bottom: 16px;
}

.mb-6 {
    margin-bottom: 24px;
}

.mr-1 {
    margin-right: 4px;
}

.mr-2 {
    margin-right: 8px;
}

.ml-2 {
    margin-left: 8px;
}

.p-3 {
    padding: 12px;
}

.px-4 {
    padding-left: 16px;
    padding-right: 16px;
}

.px-8 {
    padding-left: 32px;
    padding-right: 32px;
}

.py-1 {
    padding-top: 4px;
    padding-bottom: 4px;
}

.py-6 {
    padding-top: 24px;
    padding-bottom: 24px;
}

.py-8 {
    padding-top: 32px;
    padding-bottom: 32px;
}

.pt-3 {
    padding-top: 12px;
}

.pb-1 {
    padding-bottom: 4px;
}

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

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

.text-sm {
    font-size: 0.875rem;
}

.text-mono {
    font-family: Consolas, 'Cascadia Mono', monospace;
}

.text-gray-400 {
    color: rgba(255, 248, 242, 0.52) !important;
}

.text-gray-500 {
    color: var(--admin-muted) !important;
}

.text-danger {
    color: #c0392b !important;
}

.font-semibold {
    font-weight: 700;
}

.font-bold {
    font-weight: 800;
}

.shadow-lg {
    box-shadow: 0 18px 40px rgba(18, 27, 35, 0.12) !important;
}

.rounded {
    border-radius: 12px;
}

.rounded-lg {
    border-radius: 18px;
}

.border {
    border: 1px solid var(--admin-outline);
}

.border-2 {
    border-width: 2px;
}

.border-dashed {
    border-style: dashed;
}

.cursor-pointer {
    cursor: pointer;
}

.w-40 {
    width: 10rem;
}

.w-44 {
    width: 11rem;
}

.w-48 {
    width: 12rem;
}

.app-page {
    max-width: 1480px;
    margin: 0 auto;
}

.admin-page-shell {
    padding: 0 24px 24px;
}

.page-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 28px 30px;
    border-radius: 26px;
    background:
        radial-gradient(circle at top right, rgba(194, 75, 45, 0.12), transparent 26%),
        linear-gradient(180deg, rgba(255, 252, 248, 0.96), rgba(251, 246, 240, 0.92));
}

.page-hero__eyebrow {
    display: inline-block;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--admin-muted);
    margin-bottom: 8px;
}

.page-hero__title {
    margin: 0;
}

.page-hero__subtitle {
    max-width: 760px;
    color: var(--admin-muted);
    margin-top: 8px;
}

.page-hero__actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

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

.surface-panel {
    padding: 22px;
    border-radius: 24px !important;
}

.surface-panel--nested {
    padding: 0;
    border-radius: 0 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

.compact-panel {
    min-height: 144px;
}

.surface-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.surface-panel__header--stacked {
    align-items: flex-start;
    flex-wrap: wrap;
}

.page-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.page-toolbar__search {
    min-width: min(100%, 340px);
    flex: 1 1 320px;
}

.page-toolbar__select {
    min-width: 220px;
}

.signal-list {
    display: grid;
    gap: 14px;
}

.signal-row {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.56);
    border: 1px solid rgba(24, 35, 45, 0.06);
}

.signal-row__icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
}

.signal-row__icon--warning {
    background: rgba(214, 137, 16, 0.14);
    color: #cf8200;
}

.signal-row__icon--danger {
    background: rgba(192, 57, 43, 0.14);
    color: #ba3f28;
}

.signal-row__icon--info {
    background: rgba(37, 99, 235, 0.12);
    color: #2563eb;
}

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

.admin-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 290px minmax(0, 1fr);
}

.admin-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 24px 18px;
    background:
        radial-gradient(circle at top, rgba(194, 75, 45, 0.25), transparent 24%),
        linear-gradient(180deg, var(--admin-sidebar) 0%, var(--admin-sidebar-soft) 100%);
    color: #f8efe7;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 20;
}

.admin-sidebar__brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
    padding: 8px 10px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-sidebar__logo {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.06));
    color: #ffd9cc;
}

.admin-sidebar__eyebrow,
.admin-header__eyebrow {
    letter-spacing: 0.12em;
    text-transform: uppercase;
    opacity: 0.7;
}

.admin-sidebar__title {
    color: #fff8f2;
}

.admin-sidebar__menu {
    flex: 1;
    overflow: auto;
    padding-right: 4px;
}

.admin-sidebar__menu .mud-navmenu {
    gap: 4px;
}

.admin-sidebar__menu .mud-nav-link {
    margin: 2px 0;
    border-radius: 14px;
    color: rgba(255, 248, 242, 0.82);
    padding: 10px 14px;
}

.admin-sidebar__menu .mud-nav-link .mud-nav-link-text {
    font-weight: 600;
}

.admin-sidebar__menu .mud-nav-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff8f2;
}

.admin-sidebar__menu .mud-nav-link.active {
    background: linear-gradient(90deg, rgba(194, 75, 45, 0.34), rgba(194, 75, 45, 0.08));
    color: #fff8f2;
}

.admin-sidebar__menu .mud-nav-link.active .mud-nav-link-icon,
.admin-sidebar__menu .mud-nav-link .mud-nav-link-icon {
    color: #ffd3c0;
}

.admin-sidebar__menu .mud-typography {
    color: rgba(255, 248, 242, 0.52) !important;
    letter-spacing: 0.14em;
}

.admin-sidebar__footer {
    margin-top: 20px;
    padding: 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.06);
}

.admin-sidebar__footer-text {
    color: rgba(255, 248, 242, 0.78);
}

.admin-content {
    min-width: 0;
    padding-bottom: 32px;
}

.admin-header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 24px;
    backdrop-filter: blur(18px);
    background: rgba(247, 241, 234, 0.82);
    border-bottom: 1px solid rgba(26, 39, 49, 0.08);
}

.admin-header__left,
.admin-header__actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.admin-header__title {
    margin: 0;
}

.admin-header__menu {
    display: none !important;
}

.admin-mobile-backdrop {
    display: none;
}

.mud-paper,
.mud-card {
    border: 1px solid var(--admin-outline);
    box-shadow: 0 18px 40px rgba(18, 27, 35, 0.08) !important;
    background: var(--admin-surface) !important;
}

.mud-table-container,
.mud-tabs-panels,
.mud-dialog,
.mud-popover {
    background: var(--admin-surface-strong);
}

.auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 18px;
}

.auth-shell__content--wide {
    width: min(1160px, 100%);
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(360px, 440px);
    gap: 32px;
    align-items: stretch;
}

.auth-hero,
.auth-form-panel {
    border: 1px solid rgba(255, 255, 255, 0.52);
    box-shadow: 0 28px 60px rgba(24, 35, 45, 0.12);
    backdrop-filter: blur(16px);
}

.auth-hero {
    padding: 48px;
    border-radius: 32px;
    background:
        radial-gradient(circle at top left, rgba(194, 75, 45, 0.18), transparent 28%),
        linear-gradient(180deg, rgba(255, 250, 244, 0.9), rgba(247, 239, 232, 0.86));
}

.auth-form-panel {
    display: flex;
    align-items: center;
    padding: 18px;
    border-radius: 32px;
    background: rgba(255, 252, 248, 0.86);
}

.auth-brand-chip {
    margin-bottom: 18px;
}

.auth-brand-title {
    color: var(--admin-ink);
    line-height: 1.05;
    max-width: 12ch;
}

.auth-brand-subtitle {
    color: var(--admin-muted);
    max-width: 34rem;
    margin-top: 18px;
    line-height: 1.6;
}

.auth-hero__highlights {
    margin-top: 28px;
    display: grid;
    gap: 14px;
}

.auth-highlight {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.56);
    color: var(--admin-ink);
    font-weight: 600;
}

.login-card {
    width: 100%;
    border-radius: 26px !important;
}

.login-card__chip {
    margin-bottom: 18px;
}

.login-card__link {
    font-weight: 700;
    color: var(--admin-primary);
}

.admin-top-chip {
    font-weight: 700;
}

.kpi-card {
    border-radius: 22px !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 32px rgba(24, 35, 45, 0.12) !important;
}

.kpi-card__content {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 22px;
}

.kpi-card__icon {
    width: 56px;
    height: 56px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background: rgba(194, 75, 45, 0.08);
}

.kpi-card__value {
    line-height: 1;
    margin-bottom: 6px;
}

.kpi-card__title {
    font-weight: 700;
}

.kpi-card__subtitle {
    color: var(--admin-muted);
    margin-top: 4px;
}

.entity-cell__title {
    font-weight: 700;
}

.entity-cell__meta {
    color: var(--admin-muted);
    font-size: 0.84rem;
    margin-top: 2px;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 44px 20px;
    text-align: center;
    color: var(--admin-muted);
}

.empty-state__icon {
    width: 56px;
    height: 56px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background: rgba(194, 75, 45, 0.08);
    color: var(--admin-primary);
}

.empty-state__message {
    font-weight: 700;
    color: var(--admin-ink);
}

.empty-state__subtitle {
    max-width: 42ch;
    color: var(--admin-muted);
}

.detail-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.detail-summary-list {
    display: grid;
    gap: 16px;
}

#blazor-error-ui {
    display: none;
}

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

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

    .admin-sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: min(82vw, 310px);
        transform: translateX(-104%);
        transition: transform 0.24s ease;
    }

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

    .admin-mobile-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(17, 24, 31, 0.34);
        z-index: 15;
    }

    .admin-mobile-backdrop.is-visible {
        display: block;
    }

    .admin-header {
        padding: 16px 18px;
    }

    .admin-header__menu {
        display: inline-flex !important;
    }

    .admin-top-chip {
        display: none !important;
    }

    .page-hero {
        padding: 22px;
    }

    .page-hero__actions {
        justify-content: flex-start;
    }

    .auth-shell__content--wide {
        grid-template-columns: 1fr;
    }

    .auth-hero,
    .auth-form-panel {
        padding: 24px;
    }
}

@media (max-width: 640px) {
    .dashboard-grid,
    .quick-actions-grid {
        grid-template-columns: 1fr;
    }

    .admin-page-shell {
        padding: 0 14px 18px;
    }

    .page-hero {
        padding: 18px;
        border-radius: 20px;
        flex-direction: column;
        align-items: flex-start;
    }

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

    .page-hero__actions .mud-button-root {
        width: 100%;
        justify-content: center;
    }

    .surface-panel {
        padding: 18px;
    }

    .surface-panel__header {
        flex-direction: column;
        align-items: flex-start;
    }

    .page-toolbar {
        width: 100%;
    }

    .page-toolbar__search,
    .page-toolbar__select,
    .page-toolbar .mud-input-control {
        min-width: 0;
        width: 100%;
        flex: 1 1 100%;
    }

    .page-toolbar .mud-button-root {
        width: 100%;
        justify-content: center;
    }

    .admin-page-shell .mud-grid {
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .admin-page-shell .mud-grid > .mud-grid-item {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .admin-page-shell .mud-breadcrumbs {
        overflow-wrap: anywhere;
    }

    .admin-page-shell .mud-tabs-toolbar {
        overflow-x: auto;
    }

    .admin-page-shell .mud-timeline,
    .admin-page-shell .mud-timeline-root {
        max-width: 100%;
        overflow-x: auto;
    }

    .admin-page-shell .mud-paper {
        max-width: 100%;
        overflow-wrap: anywhere;
    }

    .flex.items-center.justify-between,
    .flex.items-start.justify-between {
        flex-wrap: wrap;
        align-items: flex-start;
        gap: 12px;
    }

    .flex.items-center.justify-between > .flex.gap-2,
    .flex.items-start.justify-between > .flex.gap-2 {
        width: 100%;
        flex-wrap: wrap;
    }

    .flex.items-center.justify-between > .flex.gap-2 .mud-button-root,
    .flex.items-start.justify-between > .flex.gap-2 .mud-button-root {
        flex: 1 1 140px;
        justify-content: center;
    }

    .w-40,
    .w-44,
    .w-48 {
        width: 100%;
    }

    .auth-shell {
        padding: 18px 12px;
    }

    .auth-hero {
        padding: 22px;
    }

    .auth-form-panel {
        padding: 10px;
    }
}
