@property --startup-angle {
    syntax: "<angle>";
    inherits: true;
    initial-value: 0deg;
}

:root {
    color-scheme: light;
    font-family: Inter, "Segoe UI", sans-serif;
    color: var(--text);
    background: var(--page-bg);
    animation: startup-angle 1.65s linear infinite;
}

* {
    box-sizing: border-box;
}

html {
    scrollbar-gutter: stable;
}

html,
body {
    min-height: 100%;
    margin: 0;
}

body {
    color: var(--text);
    background: var(--page-bg);
}

a {
    color: var(--accent-strong);
}

button,
input,
select,
textarea {
    font: inherit;
}

.startup-screen {
    position: fixed;
    z-index: 2000;
    inset: 0;
    display: grid;
    min-height: 100svh;
    overflow: hidden;
    background:
        radial-gradient(circle at 50% 42%, var(--accent-soft) 0, transparent 22rem),
        linear-gradient(145deg, var(--page-bg), var(--surface-muted));
    isolation: isolate;
    place-items: center;
}

.startup-screen::before,
.startup-screen::after {
    position: absolute;
    z-index: -1;
    width: min(28rem, 58vw);
    aspect-ratio: 1;
    border: 1px solid var(--border);
    border-radius: 50%;
    content: "";
    opacity: 0.32;
}

.startup-screen::before {
    transform: translate(-42%, -46%);
}

.startup-screen::after {
    transform: translate(42%, 46%) scale(0.72);
}

.startup-emblem {
    position: relative;
    display: grid;
    width: clamp(10rem, 24vw, 13rem);
    aspect-ratio: 1;
    place-items: center;
}

.startup-mark {
    width: 6.8rem;
    max-width: 58%;
    overflow: visible;
    fill: var(--header-bg);
    filter: drop-shadow(0 0.8rem 1.2rem rgb(var(--shadow) / 16%));
}

.startup-orbit {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
    transform: rotate(var(--startup-angle));
    transform-box: view-box;
    transform-origin: center;
}

.startup-orbit-motion {
    fill: none;
    vector-effect: non-scaling-stroke;
    stroke: var(--accent-strong);
    stroke-width: 2.5;
    stroke-linecap: round;
    filter: drop-shadow(0 0 0.28rem rgb(var(--focus) / 24%));
}

.status-message {
    padding: 2rem;
    color: var(--text-muted);
    text-align: center;
}

@keyframes startup-angle {
    from {
        --startup-angle: 0deg;
    }

    to {
        --startup-angle: 360deg;
    }
}

@media (prefers-reduced-motion: reduce) {
    :root {
        animation: none;
    }
}

.app-shell {
    min-height: 100vh;
}

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    min-height: 4.25rem;
    padding: 0 2rem;
    color: var(--header-text);
    background: var(--header-bg);
    box-shadow: 0 0.25rem 1rem rgb(var(--shadow) / 12%);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    color: inherit;
    font-size: 1.25rem;
    font-weight: 700;
    text-decoration: none;
}

.brand-mark {
    display: block;
    width: 2.15rem;
    height: 2.15rem;
    border: 1px solid rgb(255 255 255 / 55%);
    border-radius: 0.6rem;
    object-fit: cover;
}

.page-content {
    width: min(80rem, calc(100% - 2rem));
    margin: 0 auto;
    padding: 3rem 0;
}

.content-panel,
.auth-card {
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    background: var(--surface);
    box-shadow: 0 0.75rem 2rem rgb(var(--shadow) / 8%);
}

.content-panel {
    padding: clamp(1.5rem, 4vw, 3rem);
}

.content-panel h1,
.auth-heading h1 {
    margin: 0.25rem 0 0.75rem;
}

.eyebrow {
    color: var(--accent-strong);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.muted,
.auth-heading p,
.auth-footer {
    color: var(--text-muted);
}

.auth-shell {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 1.5rem;
    background: linear-gradient(145deg, var(--page-bg), var(--surface-muted));
}

.auth-card {
    width: min(28rem, 100%);
    padding: clamp(1.5rem, 5vw, 2.5rem);
}

.auth-card.wide {
    width: min(34rem, 100%);
}

.auth-card form {
    display: grid;
    gap: 0.65rem;
    margin-top: 1.5rem;
}

.auth-card label {
    margin-top: 0.35rem;
    font-weight: 650;
}

.auth-card input {
    width: 100%;
    min-height: 2.8rem;
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--border-strong);
    border-radius: 0.35rem;
    color: var(--text);
    background: var(--input-bg);
}

.auth-card input:focus {
    border-color: var(--accent);
    outline: 3px solid rgb(var(--focus) / 15%);
}

.primary-button {
    min-height: 2.9rem;
    margin-top: 0.75rem;
    padding: 0.7rem 1rem;
    border: 0;
    border-radius: 0.35rem;
    color: var(--accent-text);
    background: var(--accent-strong);
    cursor: pointer;
}

.primary-button:disabled {
    cursor: wait;
    opacity: 0.65;
}

.primary-button.inline,
.danger-button,
.secondary-button {
    min-height: 2.65rem;
    margin-top: 0;
    padding: 0.6rem 1rem;
    border-radius: 0.4rem;
    cursor: pointer;
}

.secondary-button {
    border: 1px solid var(--border-strong);
    color: var(--text);
    background: var(--surface);
}

.danger-button {
    border: 1px solid var(--danger-text);
    color: #fff;
    background: var(--danger-text);
}

.secondary-button:disabled,
.danger-button:disabled {
    cursor: wait;
    opacity: 0.65;
}

.alert {
    margin-top: 1rem;
    padding: 0.8rem 0.9rem;
    border: 1px solid var(--danger-border);
    border-radius: 0.35rem;
    color: var(--danger-text);
    background: var(--danger-bg);
}

.alert.compact {
    margin-top: 0.75rem;
    padding: 0.65rem 0.75rem;
}

.page-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 2rem;
}

.page-heading h1 {
    margin-bottom: 0.35rem;
}

.page-heading p {
    margin: 0;
}

.home-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, 10rem);
    justify-content: center;
    gap: 2rem;
    margin: 0;
}

.module-home {
    margin-bottom: 1rem;
}

.feature-card {
    display: flex;
    width: 10rem;
    height: 10rem;
    align-items: center;
    flex-direction: column;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.375rem;
    border: 1px solid var(--border);
    border-radius: 0.8rem;
    color: var(--text);
    background: var(--surface-soft);
    font: inherit;
    text-align: center;
    text-decoration: none;
    transition: border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

a.feature-card:hover,
button.feature-card:not(.disabled):hover {
    border-color: var(--accent);
    box-shadow: 0 0.5rem 1.2rem rgb(var(--shadow) / 8%);
    transform: translateY(-1px);
}

.feature-card.selected {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-soft);
}

button.feature-card:not(.disabled) {
    cursor: pointer;
}

.feature-card:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}

.feature-card.disabled {
    color: var(--text-muted);
    background: var(--surface-muted);
    cursor: not-allowed;
    opacity: 0.68;
}

.feature-card strong,
.feature-card small {
    display: block;
}

.feature-card strong {
    font-size: 1rem;
    line-height: 1.15;
}

.feature-card small {
    margin-top: 0.25rem;
    color: var(--text-muted);
}

.feature-icon {
    display: grid;
    flex: 0 0 5rem;
    width: 5rem;
    height: 5rem;
    border-radius: 0.8rem;
    color: var(--accent-text);
    background: var(--accent);
    font-weight: 750;
    place-items: center;
}

.feature-icon .app-icon {
    width: 3.5rem;
    height: 3.5rem;
}

.feature-card.disabled .feature-icon {
    color: var(--text-muted);
    background: var(--surface);
}

.practice-area-title {
    margin: 0;
    font-size: 2rem;
    font-style: italic;
}

.dashboard-title {
    margin: 0.4rem 0 0;
    font-size: 1.25rem;
}

.dashboard-title + .dashboard-stats {
    margin-top: 0.8rem;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.8rem;
    margin-top: 1.75rem;
}

.dashboard-stat {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-height: 5.5rem;
    padding: 0.9rem;
    border: 1px solid var(--border);
    border-radius: 0.65rem;
    color: var(--text);
    background: var(--surface-soft);
    text-decoration: none;
}

.dashboard-stat:hover {
    border-color: var(--accent);
    transform: translateY(-1px);
}

.dashboard-stat-icon {
    display: grid;
    flex: 0 0 2.65rem;
    width: 2.65rem;
    height: 2.65rem;
    border-radius: 0.6rem;
    color: var(--accent-strong);
    background: var(--accent-soft);
    place-items: center;
}

.dashboard-stat.warning .dashboard-stat-icon {
    color: var(--warning-text);
    background: var(--warning-bg);
}

.dashboard-stat.danger .dashboard-stat-icon {
    color: var(--danger-text);
    background: var(--danger-bg);
}

.dashboard-stat.action .dashboard-stat-icon {
    color: var(--accent-text);
    background: var(--accent);
}

.dashboard-stat strong,
.dashboard-stat small {
    display: block;
}

.dashboard-stat strong {
    font-size: 1.35rem;
}

.dashboard-stat small {
    margin-top: 0.1rem;
    color: var(--text-muted);
}

.dashboard-section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin: 2rem 0 0.8rem;
}

.dashboard-section-heading h2,
.dashboard-section-heading p {
    margin: 0;
}

.dashboard-section-heading h2 {
    font-size: 1.15rem;
}

.dashboard-section-heading p {
    margin-top: 0.2rem;
    font-size: 0.82rem;
}

.dashboard-deadlines {
    display: grid;
    border: 1px solid var(--border);
    border-radius: 0.65rem;
    background: var(--surface);
}

.dashboard-deadline {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.9rem;
    padding: 0.7rem 0.85rem;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    text-decoration: none;
}

.dashboard-deadline:last-child {
    border-bottom: 0;
}

.dashboard-deadline:hover {
    background: var(--surface-soft);
}

.deadline-date {
    display: grid;
    width: 3.2rem;
    height: 3.2rem;
    border-radius: 0.55rem;
    color: var(--success-text);
    background: var(--success-bg);
    text-align: center;
    place-content: center;
}

.deadline-date.soon,
.deadline-date.today {
    color: var(--warning-text);
    background: var(--warning-bg);
}

.deadline-date.overdue {
    color: var(--danger-text);
    background: var(--danger-bg);
}

.deadline-date strong,
.deadline-date small {
    line-height: 1;
}

.deadline-date strong {
    font-size: 1.15rem;
}

.deadline-date small {
    margin-top: 0.2rem;
    font-size: 0.62rem;
    font-weight: 800;
}

.dashboard-deadline-copy strong,
.dashboard-deadline-copy small {
    display: block;
}

.dashboard-deadline-copy small {
    margin-top: 0.2rem;
    color: var(--text-muted);
}

.compact-empty {
    min-height: 7rem;
}

.list-toolbar {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1.25rem;
    margin: 2rem 0 1.2rem;
    padding: 1rem;
    border-radius: 0.65rem;
    background: var(--surface-soft);
}

.search-field {
    display: grid;
    flex: 1;
    gap: 0.4rem;
    max-width: 38rem;
    font-weight: 650;
}

.search-field input,
.modal-card input {
    width: 100%;
    min-height: 2.75rem;
    padding: 0.62rem 0.75rem;
    border: 1px solid var(--border-strong);
    border-radius: 0.4rem;
    color: var(--text);
    background: var(--input-bg);
}

.search-field input:focus,
.modal-card input:focus {
    border-color: var(--accent);
    outline: 3px solid rgb(var(--focus) / 15%);
}

.checkbox-field {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-height: 2.75rem;
    white-space: nowrap;
}

.checkbox-field input {
    width: 1.05rem;
    height: 1.05rem;
}

.table-scroll {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 0.85rem 0.8rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
}

.data-table th {
    color: var(--text-muted);
    font-size: 0.76rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.practice-type-column,
.practice-count-column,
.practice-count-cell {
    width: 4.5rem;
    white-space: nowrap;
}

.practice-count-cell {
    text-align: center !important;
    font-weight: 750;
}

.procedure-type-badge {
    display: inline-grid;
    min-width: 2.6rem;
    min-height: 1.65rem;
    padding: 0.18rem 0.4rem;
    border-radius: 0.4rem;
    font-size: 0.73rem;
    font-weight: 850;
    letter-spacing: 0.02em;
    place-items: center;
}

.procedure-type-badge.type-di {
    color: #1e3a8a;
    background: #dbeafe;
}

.procedure-type-badge.type-op {
    color: #6b21a8;
    background: #f3e8ff;
}

.procedure-type-badge.type-ppt {
    color: #065f46;
    background: #d1fae5;
}

.procedure-type-badge.type-pm {
    color: #9a3412;
    background: #ffedd5;
}

.procedure-type-badge.type-unknown {
    color: var(--text);
    background: var(--surface-muted);
}

.table-sort-button {
    display: inline-flex;
    width: 100%;
    align-items: center;
    gap: 0.3rem;
    padding: 0;
    border: 0;
    color: inherit;
    background: transparent;
    font: inherit;
    letter-spacing: inherit;
    text-align: left;
    text-transform: inherit;
    cursor: pointer;
}

.table-sort-button:hover {
    color: var(--accent-strong);
}

.table-sort-button:focus-visible {
    border-radius: 0.2rem;
    outline: 2px solid var(--accent);
    outline-offset: 0.2rem;
}

.sort-indicator {
    min-width: 0.8rem;
    opacity: 0.35;
    font-size: 0.9rem;
    letter-spacing: 0;
    line-height: 1;
    text-transform: none;
}

.sort-indicator.active {
    color: var(--accent-strong);
    opacity: 1;
}

.sort-priority {
    display: inline-grid;
    width: 1.05rem;
    height: 1.05rem;
    border-radius: 50%;
    color: var(--accent-text);
    background: var(--accent-strong);
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1;
    place-items: center;
    text-transform: none;
}

.data-table tbody tr:hover {
    background: var(--surface-soft);
}

.data-table .actions-column,
.data-table .row-actions {
    width: 1%;
    white-space: nowrap;
    text-align: right;
}

.row-actions > * + * {
    margin-left: 0.8rem;
}

.inactive-row {
    color: var(--text-muted);
    background: var(--surface-soft);
}

.deleted-row {
    color: var(--danger-text);
    background: var(--danger-bg);
}

.status-badge.deleted {
    color: var(--danger-text);
    background: var(--danger-bg);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    min-height: 1.75rem;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
}

.status-badge.active {
    color: var(--success-text);
    background: var(--success-bg);
}

.status-badge.inactive {
    color: var(--neutral-badge-text);
    background: var(--neutral-badge-bg);
}

.text-button,
.icon-button {
    padding: 0;
    border: 0;
    color: var(--accent-strong);
    background: transparent;
    cursor: pointer;
}

.text-button:hover {
    text-decoration: underline;
}

.danger-text {
    color: var(--danger-text);
}

.mfa-card {
    width: min(34rem, calc(100vw - 2rem));
}

.mfa-qr {
    display: block;
    width: min(16rem, 70vw);
    margin: 0 auto 1rem;
    border: 0.5rem solid white;
    border-radius: 0.5rem;
}

.mfa-manual-key {
    display: grid;
    gap: 0.35rem;
    margin-bottom: 1rem;
    text-align: center;
}

.mfa-manual-key span {
    color: var(--text-muted);
    font-size: 0.78rem;
}

.mfa-manual-key code {
    overflow-wrap: anywhere;
}

.mfa-recovery-toggle {
    display: block;
    margin: 1rem auto 0;
}

.recovery-codes {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
    margin: 1rem 0;
}

.recovery-codes code {
    padding: 0.55rem;
    border: 1px solid var(--border);
    border-radius: 0.45rem;
    background: var(--surface-muted);
    text-align: center;
}

.mfa-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.65rem;
}

@media (max-width: 32rem) {
    .recovery-codes {
        grid-template-columns: 1fr;
    }

    .mfa-actions {
        align-items: stretch;
        flex-direction: column;
    }
}

.empty-state {
    display: grid;
    gap: 0.35rem;
    min-height: 10rem;
    padding: 2rem;
    border: 1px dashed var(--border-strong);
    border-radius: 0.65rem;
    color: var(--text-muted);
    text-align: center;
    place-content: center;
}

.empty-state strong {
    color: var(--text);
}

.modal-backdrop {
    position: fixed;
    z-index: 1000;
    inset: 0;
    display: grid;
    padding: 1.25rem;
    background: rgb(17 28 36 / 54%);
    place-items: center;
}

.modal-card {
    width: min(34rem, 100%);
    max-height: calc(100vh - 2.5rem);
    overflow-y: auto;
    padding: 1.4rem;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    background: var(--surface);
    box-shadow: 0 1.2rem 3rem rgb(var(--shadow) / 28%);
}

.modal-card.compact-dialog {
    width: min(30rem, 100%);
}

.modal-card form {
    display: grid;
    gap: 0.5rem;
    margin-top: 1.25rem;
}

.modal-card label {
    font-weight: 650;
}

.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.modal-header h2 {
    margin: 0.2rem 0 0;
    font-size: 1.35rem;
}

.icon-button {
    width: 2rem;
    height: 2rem;
    color: var(--text-muted);
    font-size: 1.55rem;
    line-height: 1;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.field-hint {
    margin: 0.25rem 0 0;
    color: var(--text-muted);
    font-size: 0.82rem;
}

.duplicate-warning {
    margin-top: 0.4rem;
    padding: 0.75rem;
    border-left: 3px solid var(--warning-border);
    color: var(--warning-text);
    background: var(--warning-bg);
}

.duplicate-warning ul {
    margin: 0.45rem 0 0;
    padding-left: 1.15rem;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.password-rules {
    margin-top: 0.5rem;
    padding: 0.8rem;
    border-left: 3px solid var(--accent);
    color: var(--text-muted);
    background: var(--surface-soft);
}

.auth-footer {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1.75rem;
    font-size: 0.75rem;
}

.validation-message,
.validation-errors {
    color: var(--danger-text);
}

input.invalid,
select.invalid,
textarea.invalid,
.field-invalid input,
.field-invalid .multi-subject-list {
    border-color: var(--danger-text) !important;
    background: var(--danger-bg) !important;
    box-shadow: 0 0 0 2px rgb(190 45 55 / 12%);
}

#blazor-error-ui {
    display: none;
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    left: 1rem;
    padding: 1rem;
    border: 1px solid var(--warning-border);
    color: var(--warning-text);
    background: var(--warning-bg);
}

#blazor-error-ui .dismiss {
    float: right;
}

.app-icon {
    display: block;
    flex: 0 0 auto;
}

.menu-toggle,
.drawer-close {
    display: grid;
    width: 2.8rem;
    height: 2.8rem;
    padding: 0;
    border: 0;
    border-radius: 0.55rem;
    color: inherit;
    background: transparent;
    cursor: pointer;
    place-items: center;
}

.menu-toggle:hover,
.drawer-close:hover {
    background: rgb(255 255 255 / 12%);
}

.menu-backdrop {
    position: fixed;
    z-index: 2000;
    inset: 0;
    display: flex;
    justify-content: flex-end;
    background: rgb(10 17 24 / 46%);
    animation: menu-fade 140ms ease-out;
}

.navigation-drawer {
    display: flex;
    flex-direction: column;
    width: min(17rem, calc(100% - 1rem));
    height: 100%;
    overflow-y: auto;
    color: var(--text);
    background: var(--surface);
    box-shadow: -1rem 0 3rem rgb(0 0 0 / 22%);
    animation: drawer-in 180ms ease-out;
}

.drawer-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.15rem 1.25rem;
    color: var(--header-text);
    background: var(--header-bg);
}

.drawer-header .eyebrow {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--header-muted);
}

.drawer-header strong {
    font-size: 1.15rem;
}

.drawer-navigation {
    display: grid;
    flex: 1 0 auto;
    align-content: start;
    grid-auto-rows: min-content;
    gap: 0.1rem;
    padding: 0.75rem;
}

.drawer-navigation a,
.drawer-logout {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    min-height: 2.9rem;
    padding: 0.6rem 0.8rem;
    border: 0;
    border-radius: 0.65rem;
    color: var(--text);
    background: transparent;
    font-size: 1.05rem;
    font-weight: 650;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.drawer-navigation a:hover,
.drawer-logout:hover {
    background: var(--surface-soft);
}

.drawer-navigation a.active {
    color: var(--accent-strong);
    background: var(--accent-soft);
}

.drawer-logout {
    color: var(--danger-text);
}

.drawer-section-label {
    margin: 0.7rem 0.8rem 0.15rem;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.drawer-version {
    padding: 0.65rem 1.25rem 1rem;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 650;
    text-align: center;
}

@keyframes drawer-in {
    from {
        transform: translateX(100%);
    }
}

@keyframes menu-fade {
    from {
        opacity: 0;
    }
}

.button-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    text-decoration: none;
}

.secondary-button.inline {
    display: inline-flex;
    width: max-content;
    margin-top: 1rem;
}

.practice-filters {
    display: grid;
    grid-template-columns: minmax(14rem, 2fr) repeat(5, minmax(8rem, 1fr));
    gap: 0.75rem;
    margin: 1.75rem 0 1rem;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 0.7rem;
    background: var(--surface-soft);
}

.practice-filters label,
.field,
.smart-selector {
    display: grid;
    align-content: start;
    gap: 0.4rem;
    min-width: 0;
    font-weight: 650;
}

.practice-filters label > span,
.field > span,
.smart-selector > label {
    color: var(--text-muted);
    font-size: 0.76rem;
    font-weight: 750;
}

.practice-filters input,
.practice-filters select,
.field input,
.field select,
.field textarea,
.smart-selector input,
.route-option input[type="date"] {
    width: 100%;
    min-height: 2.7rem;
    padding: 0.58rem 0.7rem;
    border: 1px solid var(--border-strong);
    border-radius: 0.42rem;
    color: var(--text);
    background: var(--input-bg);
}

.practice-filters input:focus,
.practice-filters select:focus,
.field input:focus,
.field select:focus,
.field textarea:focus,
.smart-selector input:focus,
.route-option input[type="date"]:focus {
    border-color: var(--accent);
    outline: 3px solid rgb(var(--focus) / 15%);
}

.practice-filters .search-field {
    max-width: none;
}

.practice-list-summary {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    margin: 1rem 0 0.35rem;
    color: var(--text-muted);
    font-size: 0.82rem;
}

.practice-list-summary strong {
    color: var(--text);
    font-size: 1rem;
}

.practice-load-more {
    display: flex;
    justify-content: center;
    padding: 1.1rem 0 0.25rem;
}

.practice-number {
    margin-right: 0.45rem;
    color: var(--accent-strong);
    font-weight: 800;
    text-decoration: none;
}

.practice-number:hover {
    text-decoration: underline;
}

.phase-badge,
.deadline-badge {
    display: inline-flex;
    align-items: center;
    min-height: 1.8rem;
    padding: 0.22rem 0.58rem;
    border-radius: 999px;
    font-size: 0.73rem;
    font-weight: 750;
}

.phase-badge {
    color: var(--accent-strong);
    background: var(--accent-soft);
}

.deadline-cell {
    display: grid;
    gap: 0.22rem;
}

.deadline-cell small {
    color: var(--text-muted);
    white-space: nowrap;
}

.deadline-badge.regular {
    color: var(--success-text);
    background: var(--success-bg);
}

.deadline-badge.soon,
.deadline-badge.today {
    color: var(--warning-text);
    background: var(--warning-bg);
}

.deadline-badge.today {
    box-shadow: inset 0 0 0 1px var(--warning-border);
}

.deadline-badge.overdue {
    color: var(--danger-text);
    background: var(--danger-bg);
}

.overdue-row {
    box-shadow: inset 3px 0 var(--danger-border);
}

.practice-editor {
    width: min(96rem, calc(100% - 1.5rem));
    margin: 1rem auto 2rem;
}

.practice-editor-header {
    position: sticky;
    z-index: 50;
    top: 0;
    display: grid;
    grid-template-columns: minmax(16rem, 1fr) auto auto;
    align-items: center;
    gap: 1.25rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    color: var(--header-text);
    background: var(--header-bg);
    box-shadow: 0 0.55rem 1.5rem rgb(var(--shadow) / 16%);
}

.practice-editor-title {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    min-width: 0;
}

.practice-editor-title .eyebrow {
    color: var(--header-muted);
}

.practice-editor-title h1 {
    overflow: hidden;
    margin: 0.1rem 0 0;
    font-size: 1.2rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.back-link {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 0.45rem;
    min-height: 2.6rem;
    padding: 0.45rem 0.75rem;
    border: 1px solid rgb(255 255 255 / 25%);
    border-radius: 0.55rem;
    color: var(--header-text);
    background: rgb(255 255 255 / 10%);
    font-size: 1.4rem;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 700;
    justify-content: center;
}

.practice-editor-summary {
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

.practice-editor-summary > div {
    display: grid;
    gap: 0.15rem;
}

.practice-editor-summary small {
    color: var(--header-muted);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.practice-editor-summary strong {
    max-width: 16rem;
    font-size: 0.83rem;
}

.practice-editor-actions {
    display: flex;
    gap: 0.55rem;
}

.practice-editor-actions .primary-button,
.practice-editor-actions .secondary-button {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    white-space: nowrap;
}

.practice-alert,
.practice-validation {
    margin-inline: 0.25rem;
}

.practice-sections {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 0.75rem;
    margin-top: 0.75rem;
    padding: 0;
    border: 0;
    min-width: 0;
}

.practice-section {
    grid-column: span 6;
    padding: 0.85rem;
    border: 2px solid var(--border);
    border-radius: 0.7rem;
    background: var(--surface);
    box-shadow: 0 0.35rem 1rem rgb(var(--shadow) / 5%);
}

.practice-deadline-stack {
    grid-column: span 6;
    display: grid;
    grid-template-rows: repeat(2, auto);
    gap: 0.75rem;
    min-width: 0;
}

.practice-deadline-stack > .practice-section {
    grid-column: auto;
    min-width: 0;
}

.practice-section.identification-section,
.practice-section.route-section,
.practice-section.notes-section {
    grid-column: 1 / -1;
}

.practice-section > header {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin: -0.85rem -0.85rem 0.8rem;
    padding: 0.62rem 0.75rem;
    border-bottom: 1px solid var(--border);
    border-radius: 0.7rem 0.7rem 0 0;
    background: var(--surface-muted);
}

.practice-section h2,
.practice-section header p {
    margin: 0;
}

.practice-section h2 {
    font-size: 1.15rem;
}

.practice-section header p {
    margin-top: 0.12rem;
    color: var(--text-muted);
    font-size: 0.82rem;
}

.practice-fields {
    display: grid;
    gap: 0.65rem;
}

.identity-grid {
    grid-template-columns: repeat(2, minmax(14rem, 1fr));
}

.subject-field {
    min-width: 0;
}

.multi-subject-editor {
    display: grid;
    gap: 0.4rem;
    min-width: 0;
}

.multi-subject-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    color: var(--text-muted);
    font-size: 0.76rem;
    font-weight: 750;
}

.multi-subject-add {
    display: inline-grid;
    width: 1.35rem;
    height: 1.35rem;
    padding: 0;
    border: 1px solid var(--accent);
    border-radius: 0.32rem;
    color: #fff;
    background: var(--accent);
    cursor: pointer;
    place-items: center;
}

.multi-subject-add span {
    display: block;
    font-size: 1.25rem;
    font-weight: 500;
    line-height: 1;
    transform: translateY(-0.04rem);
}

.multi-subject-add:disabled {
    opacity: 0.55;
    cursor: default;
}

.multi-subject-list {
    display: grid;
    min-height: 2.7rem;
    overflow: hidden;
    border: 1px solid var(--border-strong);
    border-radius: 0.42rem;
    background: var(--input-bg);
}

.multi-subject-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-height: 2.7rem;
    padding: 0.45rem 0.7rem;
}

.multi-subject-row + .multi-subject-row {
    border-top: 1px solid var(--border);
}

.multi-subject-row strong {
    overflow-wrap: anywhere;
    font-size: 0.86rem;
}

.multi-subject-empty {
    align-self: center;
    padding: 0.58rem 0.7rem;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 500;
}

.subject-picker-dialog {
    width: min(38rem, 100%);
}

.subject-picker-search {
    margin-top: 1rem;
}

.subject-picker-results {
    display: grid;
    max-height: min(23rem, 48vh);
    overflow-y: auto;
    margin-top: 0.75rem;
    padding: 0.3rem;
    border: 1px solid var(--border);
    border-radius: 0.55rem;
    background: var(--surface-soft);
}

.subject-picker-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-height: 2.65rem;
    padding: 0.55rem 0.7rem;
    border: 0;
    border-radius: 0.4rem;
    color: var(--text);
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.subject-picker-option:hover:not(:disabled),
.subject-picker-option.selected {
    color: var(--accent-strong);
    background: var(--accent-soft);
}

.subject-picker-option:disabled {
    color: var(--text-muted);
    cursor: default;
}

.subject-picker-option small {
    color: var(--text-muted);
}

.subject-picker-hint {
    display: block;
    margin-top: 0.4rem;
    color: var(--text-muted);
    font-size: 0.75rem;
}

.subject-picker-status,
.subject-picker-error {
    padding: 1rem;
    color: var(--text-muted);
    text-align: center;
}

.subject-picker-error {
    color: var(--danger-text);
}

.date-grid {
    grid-template-columns: repeat(3, minmax(9.5rem, 1fr));
}

.hearing-grid {
    grid-template-columns: repeat(2, minmax(12rem, 1fr));
}

.hearing-grid > :first-child,
.hearing-wide-field {
    grid-column: 1 / -1;
}

.defined-section {
    grid-column: 1 / -1;
}

.procedure-defined-field {
    justify-content: flex-start;
    min-height: 3rem;
    font-size: 1.05rem;
    font-weight: 750;
}

.date-grid > .field > span {
    display: flex;
    align-items: flex-end;
    min-height: 1.85rem;
    line-height: 1.2;
}

.calculated-field output {
    display: flex;
    align-items: center;
    min-height: 2.7rem;
    padding: 0.58rem 0.7rem;
    border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border));
    border-radius: 0.42rem;
    color: var(--accent-strong);
    background: var(--surface-calculated);
    font-weight: 750;
}

.route-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem;
}

.route-option {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) minmax(10rem, 0.42fr);
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 0.6rem;
    background: var(--surface-soft);
    cursor: pointer;
}

.route-option.selected {
    border-color: var(--accent);
    background: var(--accent-soft);
    box-shadow: inset 0 0 0 1px var(--accent);
}

.route-option > input[type="checkbox"] {
    width: 1.1rem;
    height: 1.1rem;
    accent-color: var(--accent);
}

.route-option strong,
.route-option small {
    display: block;
}

.route-option small {
    margin-top: 0.2rem;
    color: var(--text-muted);
    font-size: 0.72rem;
}

.clear-route {
    margin-top: 0.65rem;
}

.notes-section textarea {
    resize: vertical;
}

.practice-editor-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 0.75rem;
    padding: 0.8rem 1rem;
    border: 1px solid var(--border);
    border-radius: 0.65rem;
    background: var(--surface);
}

.practice-footer-actions {
    display: flex;
    gap: 0.6rem;
}

.read-only-banner {
    margin-top: 0.75rem;
    padding: 0.7rem 0.9rem;
    border: 1px solid var(--border-strong);
    border-radius: 0.55rem;
    color: var(--text-muted);
    background: var(--surface-muted);
    font-weight: 700;
}

.state-filter {
    display: grid;
    align-content: start;
    gap: 0.4rem;
    min-width: 0;
}

.state-filter > span {
    color: var(--text-muted);
    font-size: 0.76rem;
    font-weight: 750;
}

.state-checklist-combo {
    position: relative;
}

.state-checklist-combo.open {
    z-index: 110;
}

.state-checklist-trigger {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    width: 100%;
    min-height: 2.7rem;
    padding: 0.58rem 0.7rem;
    border: 1px solid var(--border-strong);
    border-radius: 0.42rem;
    color: var(--text);
    background: var(--input-bg);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.state-checklist-trigger:focus {
    border-color: var(--accent);
    outline: 3px solid rgb(var(--focus) / 15%);
}

.state-checklist-arrow {
    flex: 0 0 auto;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.state-checklist-dismiss {
    position: fixed;
    z-index: 1;
    inset: 0;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: default;
}

.state-checklist-menu {
    position: absolute;
    z-index: 2;
    top: calc(100% + 0.25rem);
    right: 0;
    left: 0;
    display: grid;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 0.55rem;
    background: var(--surface);
    box-shadow: 0 0.8rem 2rem rgb(var(--shadow) / 18%);
}

.practice-filters .state-checklist-menu label {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 2.35rem;
    padding: 0.42rem 0.65rem;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
}

.state-checklist-menu label + label {
    border-top: 1px solid var(--border);
}

.practice-filters .state-checklist-menu input {
    flex: 0 0 auto;
    width: 1rem;
    min-height: 1rem;
    margin: 0;
    padding: 0;
}

.practice-list-counters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0;
    margin: 0.7rem 0 0.9rem;
}

.practice-counter {
    display: inline-flex;
    align-items: baseline;
    gap: 0.4rem;
    padding: 0.15rem 0.9rem;
    border-left: 1px solid var(--border);
}

.practice-counter:first-child {
    padding-left: 0;
    border-left: 0;
}

.practice-counter strong {
    color: var(--accent-strong);
    font-size: 1.05rem;
}

.practice-counter span {
    color: var(--text-muted);
    font-size: 0.78rem;
}

.practice-counter.warning strong {
    color: var(--warning-text);
}

.practice-counter.danger strong {
    color: var(--danger-text);
}

.practice-counter.archived strong {
    color: var(--text-muted);
}

.deadline-text-overdue {
    color: #ffd1d1;
}

.deadline-text-soon {
    color: #ffe0bb;
}

.smart-selector {
    position: relative;
}

.smart-selector.open {
    z-index: 110;
}

.smart-selector-input {
    position: relative;
}

.selection-check {
    position: absolute;
    top: 50%;
    right: 0.75rem;
    display: grid;
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 50%;
    color: #fff;
    background: var(--success-text);
    font-size: 0.75rem;
    transform: translateY(-50%);
    place-items: center;
}

.smart-selector-results {
    position: absolute;
    z-index: 2;
    top: calc(100% + 0.25rem);
    right: 0;
    left: 0;
    display: grid;
    max-height: 18rem;
    overflow-y: auto;
    padding: 0.35rem;
    border: 1px solid var(--border);
    border-radius: 0.55rem;
    background: var(--surface);
    box-shadow: 0 0.8rem 2rem rgb(var(--shadow) / 18%);
}

.smart-selector-dismiss {
    position: fixed;
    z-index: 1;
    inset: 0;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: default;
}

.smart-selector.open .smart-selector-input {
    z-index: 3;
}

.smart-selector-option,
.smart-selector-create {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.72rem;
    border: 0;
    border-radius: 0.4rem;
    color: var(--text);
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.smart-selector-option:hover {
    background: var(--surface-soft);
}

.smart-selector-option small {
    color: var(--text-muted);
}

.smart-selector-create {
    justify-content: flex-start;
    color: var(--accent-strong);
    background: var(--accent-soft);
    font-weight: 750;
}

.smart-selector-status,
.smart-selector-error {
    padding: 0.7rem;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 500;
}

.smart-selector-error {
    color: var(--danger-text);
}

.practice-error-list,
.error-dialog-list {
    margin: 0;
    padding-left: 1.25rem;
}

.practice-error-list li + li,
.error-dialog-list li + li {
    margin-top: 0.35rem;
}

.error-dialog {
    width: min(36rem, 100%);
    border-top: 4px solid var(--danger-text);
}

.error-dialog > p {
    margin: 1rem 0 0.6rem;
    color: var(--text-muted);
}

.error-dialog-list {
    color: var(--danger-text);
}

.settings-message {
    margin-top: 1.25rem;
    padding: 0.75rem 0.9rem;
    border-radius: 0.45rem;
}

.settings-message.success {
    color: var(--success-text);
    background: var(--success-bg);
}

.settings-message.error {
    color: var(--danger-text);
    background: var(--danger-bg);
}

.theme-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 1.75rem;
}

.theme-card {
    display: grid;
    grid-template-columns: minmax(10rem, 0.8fr) minmax(12rem, 1fr);
    gap: 0.85rem 1rem;
    padding: 0.8rem;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    color: var(--text);
    background: var(--surface);
    text-align: left;
    cursor: pointer;
}

.theme-card:hover,
.theme-card.selected {
    border-color: var(--accent);
    box-shadow: 0 0.55rem 1.4rem rgb(var(--shadow) / 10%);
}

.theme-card.selected {
    box-shadow: inset 0 0 0 1px var(--accent), 0 0.55rem 1.4rem rgb(var(--shadow) / 10%);
}

.theme-preview {
    grid-row: span 3;
    overflow: hidden;
    min-height: 9rem;
    border: 1px solid var(--border);
    border-radius: 0.55rem;
    background: var(--preview-bg);
}

.theme-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 2.5rem;
    padding: 0 0.65rem;
    color: #fff;
    background: var(--preview-header);
}

.theme-preview-brand {
    display: grid;
    width: 1.55rem;
    height: 1.55rem;
    border-radius: 0.35rem;
    color: var(--preview-header);
    background: var(--preview-soft);
    font-size: 0.72rem;
    font-weight: 800;
    place-items: center;
}

.theme-preview-body {
    display: grid;
    gap: 0.55rem;
    padding: 0.75rem;
}

.theme-preview-line {
    width: 55%;
    height: 0.45rem;
    border-radius: 999px;
    background: var(--preview-accent);
}

.theme-preview-line.wide {
    width: 80%;
}

.theme-preview-panels {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.45rem;
}

.theme-preview-panels span {
    height: 3.5rem;
    border-radius: 0.35rem;
    background: var(--preview-surface);
    box-shadow: inset 0 0 0 1px rgb(0 0 0 / 8%);
}

.theme-preview-panels span:last-child {
    background: var(--preview-soft);
}

.theme-card-copy strong,
.theme-card-copy small {
    display: block;
}

.theme-card-copy strong {
    font-size: 1.02rem;
}

.theme-card-copy small {
    margin-top: 0.3rem;
    color: var(--text-muted);
    line-height: 1.35;
}

.theme-swatches {
    display: flex;
    gap: 0.4rem;
}

.theme-swatches span {
    width: 1.5rem;
    height: 1.5rem;
    border: 2px solid var(--surface);
    border-radius: 50%;
    box-shadow: 0 0 0 1px var(--border);
}

.theme-selection {
    align-self: end;
    color: var(--accent-strong);
    font-size: 0.76rem;
    font-weight: 750;
}

.administration-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.demo-mode-trigger {
    width: 12px;
    height: 12px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: color-mix(in srgb, var(--text-muted) 18%, transparent);
    cursor: default;
    transition: background-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.demo-mode-trigger.listening {
    background: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent),
                0 0 12px color-mix(in srgb, var(--accent) 70%, transparent);
    transform: scale(1.12);
}

.demo-mode-trigger:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.demo-code-input {
    position: fixed;
    width: 1px;
    height: 1px;
    padding: 0;
    border: 0;
    opacity: 0;
    pointer-events: none;
}

.demo-mode-badge,
.status-badge.demo {
    color: #6a4500;
    background: #fff0b8;
    border: 1px solid #e7c65d;
}

.demo-mode-badge {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.drawer-header .demo-mode-badge {
    margin-top: 0.35rem;
}

.demo-administration-state {
    align-items: flex-start;
}

.demo-administration-state h2,
.demo-administration-state p {
    margin: 0;
}

.administration-section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
}

.administration-section-heading h2,
.administration-section-heading p {
    margin: 0;
}

.administration-section-heading p {
    margin-top: 0.35rem;
}

.administration-toolbar {
    justify-content: flex-start;
}

.select-field {
    display: grid;
    gap: 0.4rem;
    font-weight: 650;
}

.select-field select {
    min-width: 12rem;
    min-height: 2.75rem;
    padding: 0.62rem 0.75rem;
    border: 1px solid var(--border-strong);
    border-radius: 0.4rem;
    color: var(--text);
    background: var(--input-bg);
}

.select-field select:focus {
    border-color: var(--accent);
    outline: 3px solid rgb(var(--focus) / 15%);
}

.administration-user-identity {
    display: grid;
    gap: 0.2rem;
}

.administration-user-identity small,
.administration-secondary-state {
    color: var(--text-muted);
    font-size: 0.76rem;
}

.administration-secondary-state {
    display: block;
    margin-top: 0.3rem;
}

.role-badge {
    display: inline-flex;
    align-items: center;
    min-height: 1.75rem;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
}

.role-badge.admin {
    color: var(--accent-strong);
    background: var(--accent-soft);
}

.role-badge.user {
    color: var(--neutral-badge-text);
    background: var(--neutral-badge-bg);
}

.status-badge.locked {
    color: var(--warning-text);
    background: var(--warning-bg);
}

.administration-actions-cell {
    width: 1%;
    white-space: nowrap;
    text-align: right;
}

.administration-row-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.65rem;
}

.text-button:disabled {
    color: var(--text-muted);
    cursor: not-allowed;
    opacity: 0.55;
    text-decoration: none;
}

.administration-user-editor {
    width: min(46rem, 100%);
}

.administration-user-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
}

.field > span small {
    font-weight: 500;
}

.temporary-password-note {
    margin: 0.75rem 0 0;
    padding: 0.8rem;
    border-left: 3px solid var(--accent);
    color: var(--text-muted);
    background: var(--accent-soft);
}

.backup-policy {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.8rem;
    margin-top: 2rem;
}

.backup-policy > div {
    display: grid;
    gap: 0.3rem;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 0.65rem;
    background: var(--surface-soft);
}

.backup-policy span,
.backup-date small,
.backup-error {
    color: var(--text-muted);
    font-size: 0.78rem;
}

.backup-table-container {
    margin-top: 2rem;
}

.backup-date {
    display: grid;
    gap: 0.2rem;
}

.backup-error {
    display: block;
    max-width: 18rem;
    margin-top: 0.3rem;
}

.backup-checksum {
    padding: 0.2rem 0.35rem;
    border-radius: 0.25rem;
    color: var(--text);
    background: var(--surface-soft);
}

.status-badge.backup-running {
    color: var(--warning-text);
    background: var(--warning-bg);
}

.backup-empty-state {
    margin-top: 2rem;
}

.temporary-password-value {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
    padding: 0.75rem;
    border: 1px solid var(--border-strong);
    border-radius: 0.5rem;
    background: var(--surface-soft);
}

.temporary-password-value code {
    flex: 1;
    overflow-wrap: anywhere;
    color: var(--text);
    font-size: 1.05rem;
    font-weight: 750;
    letter-spacing: 0.04em;
}

@media (max-width: 78rem) {
    .dashboard-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .practice-filters {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .practice-filters .search-field {
        grid-column: span 2;
    }

    .practice-editor-header {
        grid-template-columns: minmax(14rem, 1fr) auto;
    }

    .practice-editor-summary {
        grid-column: 1 / -1;
        grid-row: 2;
        justify-content: space-between;
    }

    .practice-editor-actions {
        justify-content: flex-end;
    }

    .date-grid {
        grid-template-columns: repeat(2, minmax(9rem, 1fr));
    }

    .theme-grid {
        grid-template-columns: 1fr;
    }

    .administration-row-actions {
        flex-wrap: wrap;
    }
}

@media (max-width: 62rem) {
    .practice-section,
    .practice-deadline-stack {
        grid-column: 1 / -1;
    }

    .identity-grid {
        grid-template-columns: 1fr;
    }

    .route-options {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 42rem) {
    .date-grid > .field > span {
        min-height: 0;
    }

    .app-header {
        min-height: 3.75rem;
        padding: 0 1rem;
    }

    .page-content {
        width: min(100% - 1rem, 80rem);
        padding-top: 1.5rem;
    }

    .page-heading,
    .list-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .administration-section-heading,
    .temporary-password-value {
        align-items: stretch;
        flex-direction: column;
    }

    .administration-role-filter select {
        width: 100%;
    }

    .administration-user-form {
        grid-template-columns: 1fr;
    }

    .backup-policy {
        grid-template-columns: 1fr;
    }

    .home-grid {
        width: auto;
        grid-template-columns: repeat(2, 10rem);
        gap: 1rem;
    }

    .module-home {
        padding: 0.5rem;
    }

    .dashboard-stats {
        grid-template-columns: 1fr;
    }

    .dashboard-section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .dashboard-deadline {
        align-items: start;
    }

    .search-field {
        max-width: none;
    }

    .data-table thead {
        display: none;
    }

    .data-table,
    .data-table tbody,
    .data-table tr,
    .data-table td {
        display: block;
        width: 100%;
    }

    .data-table tr {
        margin-bottom: 0.75rem;
        padding: 0.35rem 0.65rem;
        border: 1px solid var(--border);
        border-radius: 0.55rem;
    }

    .data-table td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        padding: 0.6rem 0.25rem;
    }

    .data-table td::before {
        color: var(--text-muted);
        content: attr(data-label);
        font-size: 0.72rem;
        font-weight: 700;
        text-transform: uppercase;
    }

    .data-table .row-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .data-table .row-actions::before {
        content: none;
    }

    .data-table .administration-actions-cell {
        width: 100%;
    }

    .data-table .administration-actions-cell::before {
        content: none;
    }

    .administration-row-actions {
        width: 100%;
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .modal-actions {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .auth-footer {
        flex-direction: column;
    }

    .practice-filters {
        grid-template-columns: 1fr;
    }

    .practice-filters .search-field {
        grid-column: auto;
    }

    .practice-editor {
        width: calc(100% - 0.6rem);
        margin-top: 0.3rem;
    }

    .practice-editor-header {
        position: static;
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .practice-editor-actions,
    .practice-editor-summary {
        grid-column: auto;
        grid-row: auto;
        align-items: stretch;
        flex-direction: column;
    }

    .practice-editor-actions .primary-button,
    .practice-editor-actions .secondary-button {
        justify-content: center;
        width: 100%;
    }

    .practice-sections {
        display: block;
    }

    .practice-deadline-stack {
        margin-top: 0.6rem;
    }

    .practice-deadline-stack > .practice-section {
        margin-top: 0;
    }

    .practice-section {
        margin-top: 0.6rem;
    }

    .date-grid,
    .route-option {
        grid-template-columns: 1fr;
    }

    .route-option > input[type="checkbox"] {
        grid-row: 1;
    }

    .hearing-grid {
        grid-template-columns: 1fr;
    }

    .hearing-grid > :first-child,
    .hearing-wide-field {
        grid-column: auto;
    }

    .practice-footer-actions {
        flex-direction: column;
    }

    .practice-editor-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .theme-card {
        grid-template-columns: 1fr;
    }

    .theme-preview {
        grid-row: auto;
    }
}

@media (max-width: 22rem) {
    .home-grid {
        grid-template-columns: 10rem;
    }
}

.clickable-row {
    cursor: pointer;
}

.data-table tbody tr.clickable-row:hover,
.data-table tbody tr.clickable-row:focus-visible {
    background: var(--accent-soft);
    box-shadow: inset 4px 0 var(--accent);
}

.clickable-row:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
}

.data-table tbody tr.current-row {
    background: var(--accent-soft);
}

.fascicolo-panel {
    margin: 1rem 0.75rem 0;
    overflow: visible;
    border: 2px solid var(--border);
    border-radius: 0.8rem;
    background: var(--surface);
    box-shadow: 0 0.45rem 1.2rem rgb(var(--shadow) / 7%);
}

.fascicolo-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1rem 0.7rem;
}

.fascicolo-panel-header h2,
.fascicolo-panel-header p {
    margin: 0;
}

.fascicolo-panel-header h2 {
    font-size: 1.15rem;
}

.fascicolo-panel-header p {
    margin-top: 0.15rem;
    font-size: 0.76rem;
}

.fascicolo-tabs {
    display: flex;
    gap: 0.25rem;
    padding: 0 1rem;
    border-bottom: 1px solid var(--border);
}

.fascicolo-tabs button {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: -1px;
    padding: 0.65rem 0.9rem;
    border: 1px solid transparent;
    border-bottom-color: var(--border);
    color: var(--text-muted);
    background: transparent;
    font-weight: 750;
    cursor: pointer;
}

.fascicolo-tabs button.active {
    border-color: var(--border);
    border-bottom-color: var(--surface);
    border-radius: 0.55rem 0.55rem 0 0;
    color: var(--accent-strong);
    background: var(--surface);
}

.tab-count {
    display: inline-grid;
    min-width: 1.4rem;
    height: 1.4rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    color: var(--accent-strong);
    background: var(--accent-soft);
    font-size: 0.72rem;
    place-items: center;
}

.fascicolo-tab-content {
    min-height: 11rem;
    padding: 0.9rem 1rem 1rem;
}

.fascicolo-identification-grid {
    padding: 0;
}

.fascicolo-identification-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.8rem;
}

.fascicolo-identification-alert {
    margin-top: 0.8rem;
}

.fascicolo-match-area {
    display: grid;
    gap: 0.7rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.fascicolo-match-heading,
.fascicolo-match-data,
.fascicolo-match-message {
    display: grid;
    gap: 0.25rem;
}

.fascicolo-match-heading span,
.fascicolo-match-data span,
.fascicolo-match-message span {
    color: var(--text-muted);
    font-size: 0.82rem;
}

.fascicolo-match-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(17rem, 0.7fr);
    gap: 1rem;
    padding: 0.85rem;
    border: 1px solid color-mix(in srgb, var(--accent) 42%, var(--border));
    border-radius: 0.65rem;
    background: var(--accent-soft);
}

.fascicolo-match-card.exact {
    border-color: var(--danger-text);
    background: color-mix(in srgb, var(--danger-bg) 78%, var(--surface));
}

.fascicolo-match-message {
    align-content: space-between;
}

.fascicolo-match-message > div {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.fascicolo-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.7rem;
}

.procedure-create {
    position: relative;
}

.practice-list-create {
    z-index: 30;
}

.practice-list-create-button {
    justify-content: center;
    width: 8.75rem;
}

.fascicolo-action-button {
    min-height: 3rem;
    padding: 0.75rem 1.1rem;
    font-size: 1.05rem;
    font-weight: 700;
}

.procedure-create-menu {
    position: absolute;
    z-index: 20;
    top: calc(100% + 0.35rem);
    right: 0;
    display: grid;
    width: min(19rem, 80vw);
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 0.65rem;
    background: var(--surface);
    box-shadow: 0 0.8rem 2rem rgb(var(--shadow) / 18%);
}

.procedure-create-menu button {
    display: grid;
    gap: 0.1rem;
    padding: 0.75rem 0.9rem;
    border: 0;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.procedure-create-menu button:last-child {
    border-bottom: 0;
}

.procedure-create-menu button:not(:disabled):hover {
    background: var(--surface-soft);
}

.procedure-create-menu button:disabled {
    color: var(--text-muted);
    cursor: not-allowed;
    opacity: 0.65;
}

.procedure-create-menu small {
    font-size: 0.68rem;
}

.fascicolo-affidi-table input {
    width: 100%;
    min-width: 10rem;
}

.affido-editor-row {
    display: grid;
    grid-template-columns: minmax(12rem, 2fr) minmax(10rem, 1fr) auto;
    align-items: end;
    gap: 0.75rem;
    padding: 0.9rem;
    border: 1px solid var(--border);
    border-radius: 0.65rem;
    background: var(--surface-muted);
}

.affido-editor-actions {
    display: flex;
    gap: 0.5rem;
}

.affido-editor-table-row {
    background: var(--accent-soft);
}

.affido-editor-table-row input {
    width: 100%;
}

.affido-save-button {
    min-height: 3.25rem;
    padding: 0.8rem 1.25rem;
    font-size: 1.05rem;
    font-weight: 700;
}

.danger-text {
    color: var(--danger-text);
}

.ricorso-empty-content {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin: 0.85rem 0.75rem 0;
    padding: 0.9rem 1rem;
    border: 1px dashed var(--border);
    border-radius: 0.7rem;
    color: var(--text-muted);
    background: var(--surface-muted);
}

.ricorso-empty-content div {
    display: grid;
    gap: 0.15rem;
}

.ricorso-empty-content strong {
    color: var(--text);
}

@media (max-width: 42rem) {
    .fascicolo-panel {
        margin-inline: 0;
    }

    .fascicolo-toolbar,
    .affido-editor-row,
    .fascicolo-match-card {
        align-items: stretch;
        grid-template-columns: 1fr;
        flex-direction: column;
    }

    .procedure-create,
    .fascicolo-toolbar > button {
        width: 100%;
    }

    .procedure-create > button,
    .affido-editor-actions > button {
        justify-content: center;
        width: 100%;
    }

    .affido-editor-actions {
        flex-direction: column;
    }
}
