:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-soft: #dbeafe;
    --primary-ring: rgba(37, 99, 235, 0.16);
    --bg: #f8fafc;
    --surface: #ffffff;
    --surface-muted: #f8fafc;
    --surface-strong: #eff6ff;
    --surface-strong-hover: #dbeafe;
    --text: #0f172a;
    --text-soft: #475569;
    --text-inverse: #0f172a;
    --border: #e2e8f0;
    --border-strong: #bfdbfe;
    --sidebar-bg: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    --topbar-bg: rgba(255, 255, 255, 0.92);
    --input-bg: #ffffff;
    --table-head-bg: #f8fbff;
    --table-row-hover: #f8fbff;
    --danger-bg: #fff1f2;
    --danger-border: #fecdd3;
    --danger-text: #b42318;
    --danger-hover-bg: #ffe4e6;
    --danger-solid-bg: #111111;
    --danger-solid-hover-bg: #242426;
    --quick-filter-active-bg: #111111;
    --quick-filter-active-text: #ffffff;
    --badge-bg: #f8fafc;
    --badge-border: #e5e7eb;
    --badge-text: #475569;
    --success-bg: #ecfdf3;
    --success-border: #bbf7d0;
    --success-text: #15803d;
    --info-bg: #eff6ff;
    --info-border: #bfdbfe;
    --info-text: #1d4ed8;
    --warning-bg: #fdf6e8;
    --warning-border: #f3dec1;
    --warning-text: #9a6700;
    --error-bg: #fef2f2;
    --error-border: #fecaca;
    --error-text: #b91c1c;
    --shadow-pill: 0 4px 14px rgba(15, 23, 42, 0.04);
    --shadow-soft: 0 20px 45px rgba(15, 23, 42, 0.08);
    --shadow-card: 0 12px 30px rgba(15, 23, 42, 0.06);
    --shadow-card-hover: 0 22px 40px rgba(15, 23, 42, 0.1);
    --shadow-button: 0 12px 24px rgba(37, 99, 235, 0.22);
    --radius-lg: 22px;
    --radius-md: 16px;
    --radius-sm: 12px;
    --control-height: 48px;
    --control-height-sm: 40px;
    --page-gap: 20px;
    --card-padding: 20px;
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
}

.dark {
    --bg: #0f172a;
    --surface: #1e293b;
    --surface-muted: #172334;
    --surface-strong: #233248;
    --surface-strong-hover: #2b3d57;
    --text: #e2e8f0;
    --text-soft: #94a3b8;
    --text-inverse: #e2e8f0;
    --border: #334155;
    --border-strong: #475569;
    --sidebar-bg: linear-gradient(180deg, #172334 0%, #0f172a 100%);
    --topbar-bg: rgba(15, 23, 42, 0.92);
    --input-bg: #0f172a;
    --table-head-bg: #172334;
    --table-row-hover: #172334;
    --danger-bg: rgba(239, 68, 68, 0.12);
    --danger-border: rgba(248, 113, 113, 0.35);
    --danger-text: #fca5a5;
    --danger-hover-bg: rgba(239, 68, 68, 0.18);
    --danger-solid-bg: #e2e8f0;
    --danger-solid-hover-bg: #cbd5e1;
    --quick-filter-active-bg: #2563eb;
    --quick-filter-active-text: #ffffff;
    --badge-bg: #172334;
    --badge-border: #334155;
    --badge-text: #cbd5e1;
    --success-bg: rgba(34, 197, 94, 0.14);
    --success-border: rgba(74, 222, 128, 0.28);
    --success-text: #86efac;
    --info-bg: rgba(37, 99, 235, 0.16);
    --info-border: rgba(96, 165, 250, 0.35);
    --info-text: #93c5fd;
    --warning-bg: rgba(245, 158, 11, 0.16);
    --warning-border: rgba(251, 191, 36, 0.32);
    --warning-text: #fcd34d;
    --error-bg: rgba(239, 68, 68, 0.14);
    --error-border: rgba(248, 113, 113, 0.3);
    --error-text: #fca5a5;
    --shadow-pill: 0 4px 14px rgba(2, 6, 23, 0.24);
    --shadow-soft: 0 20px 45px rgba(2, 6, 23, 0.42);
    --shadow-card: 0 12px 30px rgba(2, 6, 23, 0.3);
    --shadow-card-hover: 0 22px 40px rgba(2, 6, 23, 0.4);
    --shadow-button: 0 12px 24px rgba(37, 99, 235, 0.3);
}

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

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    overflow-x: hidden;
}

body.has-mobile-nav-open {
    overflow: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

.hidden {
    display: none !important;
}

.app-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

.sidebar {
    background: var(--sidebar-bg);
    color: var(--text);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    box-shadow: 0 12px 32px rgba(37, 99, 235, 0.08);
}

.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.42);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 70;
}

.sidebar__brand {
    padding: 1.75rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 700;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.28);
}

.brand-row {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.brand-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.brand-subtitle {
    margin: 0.25rem 0 0;
    color: var(--text-soft);
    font-size: 0.9rem;
}

.sidebar__nav {
    padding: 1.25rem 1rem;
    display: grid;
    gap: 0.55rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    border-radius: 16px;
    color: var(--text-soft);
    font-size: 0.95rem;
    font-weight: 600;
    border: 1px solid transparent;
    transition: background-color 0.18s ease, color 0.18s ease, transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.nav-link:hover {
    background: var(--primary-soft);
    color: var(--primary-dark);
    border-color: rgba(37, 99, 235, 0.16);
    transform: translateX(2px);
}

.nav-link.is-active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 12px 26px rgba(37, 99, 235, 0.24);
}

.nav-link__icon,
.button__icon,
.metric-card__icon,
.pill__icon,
.user-pill__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.nav-link__icon svg,
.button__icon svg,
.metric-card__icon svg,
.pill__icon svg,
.user-pill__icon svg {
    width: 1rem;
    height: 1rem;
    stroke-width: 2;
}

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

.topbar {
    background: var(--topbar-bg);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(8px);
    position: relative;
    z-index: 1200;
    overflow: visible;
}

.topbar__inner,
.page {
    width: min(1180px, calc(100% - 2rem));
    max-width: calc(100% - 2rem);
    margin: 0 auto;
}

.topbar__inner {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.5rem 0;
    overflow: visible;
}

.topbar__main {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    min-width: 0;
}

.mobile-nav-toggle {
    flex-shrink: 0;
}

.topbar__title {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.topbar__subtitle {
    margin: 0.35rem 0 0;
    color: var(--text-soft);
    font-size: 0.95rem;
}

.topbar__actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    min-width: 0;
    overflow: visible;
}

.notification-menu {
    position: relative;
    z-index: 1300;
}

.notification-menu summary {
    list-style: none;
}

.notification-menu summary::-webkit-details-marker {
    display: none;
}

.notification-menu[open] .notification-menu__button {
    background: var(--primary-soft);
    border-color: rgba(37, 99, 235, 0.18);
    color: var(--primary-dark);
    box-shadow: 0 14px 30px rgba(37, 99, 235, 0.16);
}

.notification-menu__button {
    overflow: visible;
    min-width: 48px;
    width: 48px;
    height: 48px;
    padding: 0;
    border-radius: 16px;
    box-shadow: var(--shadow-pill);
}

.notification-badge {
    position: absolute;
    top: -0.28rem;
    right: -0.28rem;
    min-width: 22px;
    height: 22px;
    padding: 0 0.4rem;
    border-radius: 999px;
    background: var(--primary);
    color: #ffffff;
    border: 2px solid var(--surface);
    font-size: 0.7rem;
    font-weight: 800;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.3);
}

.notification-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 0.7rem);
    width: min(390px, calc(100vw - 2rem));
    padding: 0.85rem;
    border-radius: 22px;
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.2);
    z-index: 1400;
}

.notification-dropdown__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.25rem 0.25rem 0.8rem;
    margin-bottom: 0.35rem;
    border-bottom: 1px solid var(--border);
}

.notification-list {
    display: grid;
    gap: 0.65rem;
    max-height: 340px;
    overflow-y: auto;
    padding: 0.25rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.55) transparent;
}

.notification-list::-webkit-scrollbar {
    width: 8px;
}

.notification-list::-webkit-scrollbar-track {
    background: transparent;
}

.notification-list::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.45);
    border-radius: 999px;
}

.notification-item {
    position: relative;
    padding: 0.9rem 0.95rem;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: var(--surface-muted);
    transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

.notification-item:hover {
    transform: translateY(-1px);
    border-color: rgba(37, 99, 235, 0.2);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}

.notification-item.is-unread {
    border-color: rgba(37, 99, 235, 0.24);
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), var(--surface));
}

.notification-item__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.notification-item__dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: var(--primary);
    flex-shrink: 0;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.notification-item__message {
    margin: 0.7rem 0 0;
    line-height: 1.45;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
}

.notification-item__time {
    margin: 0.45rem 0 0;
    font-size: 0.8rem;
    color: var(--text-soft);
}

.page {
    padding: 1.75rem 0 2rem;
}

.page-stack {
    display: grid;
    gap: var(--page-gap);
}

.section-card,
.metric-card,
.info-card,
.timeline-card,
.auth-card,
.modal__panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    min-width: 0;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.section-card:hover,
.metric-card:hover,
.info-card:hover,
.timeline-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-card-hover);
    border-color: rgba(37, 99, 235, 0.12);
}

.section-card,
.timeline-card,
.auth-card,
.modal__panel {
    padding: var(--card-padding);
}

.metric-grid {
    display: grid;
    gap: 1rem;
}

.metric-card {
    padding: 1.5rem;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.05);
}

.metric-card__label {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0;
    color: var(--text-soft);
    font-size: 0.92rem;
    font-weight: 600;
}

.metric-card__value {
    margin: 1rem 0 0;
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.05em;
}

.metric-card__value.is-accent {
    color: var(--primary);
}

.metric-card__value.is-success {
    color: var(--success-text);
}

.metric-card__value.is-warning {
    color: var(--warning-text);
}

.metric-card__hint {
    margin: 0.55rem 0 0;
    color: var(--text-soft);
    font-size: 0.82rem;
}

.metric-grid--secondary .metric-card__value {
    font-size: 2rem;
}

.split-grid {
    display: grid;
    gap: 1.5rem;
}

.chart-grid {
    display: grid;
    gap: 1.5rem;
}

.chart-card {
    min-height: 360px;
}

.chart-wrap {
    position: relative;
    min-height: 280px;
}

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

.section-title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.section-subtitle {
    margin: 0.35rem 0 0;
    color: var(--text-soft);
    font-size: 0.92rem;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.48rem 0.85rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    border: 1px solid var(--border);
    background: var(--surface-muted);
    color: var(--text-soft);
}

.pill.is-warning {
    background: var(--warning-bg);
    border-color: var(--warning-border);
    color: var(--warning-text);
}

.link-inline {
    color: var(--text);
    font-size: 0.92rem;
    font-weight: 700;
}

.link-inline:hover {
    text-decoration: underline;
}

.attention-list,
.recent-list,
.timeline-list {
    display: grid;
    gap: 0.9rem;
}

.attention-item,
.recent-item,
.timeline-item {
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--surface-muted);
    padding: 1rem 1.1rem;
}

.attention-item:hover,
.recent-item:hover {
    background: var(--surface);
    box-shadow: var(--shadow-card);
}

.item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.9rem;
}

.item-title {
    margin: 0;
    font-size: 0.98rem;
    font-weight: 700;
}

.item-meta,
.muted-text {
    color: var(--text-soft);
    font-size: 0.9rem;
}

.item-caption {
    margin: 0.45rem 0 0;
    color: var(--text-soft);
    font-size: 0.82rem;
}

.toolbar {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.toolbar__group {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.toolbar__actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.toolbar__actions > * {
    width: 100%;
}

.input,
.textarea,
.select {
    width: 100%;
    min-height: var(--control-height);
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--input-bg);
    color: var(--text);
    padding: 0.875rem 1rem;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 2.9rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 14px 14px;
}

.input:focus,
.textarea:focus,
.select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-ring);
    background: var(--input-bg);
}

.textarea {
    min-height: 120px;
    resize: vertical;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: var(--control-height);
    border: 1px solid transparent;
    border-radius: 14px;
    padding: 0.85rem 1.15rem;
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: transform 0.16s ease, background-color 0.16s ease, color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.button:hover {
    transform: translateY(-2px);
}

.button.is-loading {
    color: transparent !important;
    pointer-events: none;
}

.button.is-loading .button__icon,
.button.is-loading [data-lucide] {
    opacity: 0;
}

.button.is-loading::after {
    content: "";
    position: absolute;
    inset: 50% auto auto 50%;
    width: 16px;
    height: 16px;
    margin-left: -8px;
    margin-top: -8px;
    border-radius: 999px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    animation: button-spin 0.7s linear infinite;
}

.button:disabled {
    opacity: 0.7;
    cursor: wait;
    transform: none;
}

.button--primary {
    background: var(--primary);
    color: #ffffff;
    box-shadow: var(--shadow-button);
}

.button--primary:hover {
    background: var(--primary-dark);
    box-shadow: 0 16px 28px rgba(37, 99, 235, 0.28);
}

.button--secondary {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text);
}

.button--secondary:hover {
    background: var(--primary-soft);
    border-color: rgba(37, 99, 235, 0.18);
    color: var(--primary-dark);
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.12);
}

.button--ghost {
    background: transparent;
    color: var(--text-soft);
}

.button--ghost:hover {
    background: var(--primary-soft);
    color: var(--primary-dark);
}

.button--danger {
    background: var(--danger-bg);
    color: var(--danger-text);
    border-color: var(--danger-border);
}

.button--danger:hover {
    background: var(--danger-hover-bg);
}

.button--danger-solid {
    background: var(--danger-solid-bg);
    color: var(--quick-filter-active-text);
}

.button--danger-solid:hover {
    background: var(--danger-solid-hover-bg);
}

.button--small {
    min-height: var(--control-height-sm);
    padding: 0.6rem 0.9rem;
    font-size: 0.8rem;
    border-radius: 12px;
}

.button--icon {
    min-width: 46px;
    padding: 0.85rem;
    position: relative;
}

.form-panel {
    margin-top: 1.25rem;
    padding: 1.35rem;
    border-radius: var(--radius-md);
    background: var(--surface-muted);
    border: 1px solid var(--border);
}

.filters-bar {
    margin-top: 1.25rem;
    padding: 1.1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--surface-muted);
    display: grid;
    gap: 1rem;
}

.filters-grid {
    display: grid;
    gap: 0.85rem;
}

.filters-actions {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.filters-actions__buttons,
.quick-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.filters-actions__buttons > *,
.quick-filters > * {
    flex: 1 1 100%;
}

.quick-filter-button,
.quick-filter-chip {
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.quick-filter-button.is-selected {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    box-shadow: var(--shadow-button);
}

.quick-filter-row {
    margin-top: 1rem;
}

.quick-filter-row__scroll {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.quick-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.8rem 1rem;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-size: 0.88rem;
    font-weight: 700;
    white-space: nowrap;
    transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.quick-filter-chip:hover {
    background: var(--surface-muted);
}

.quick-filter-chip.is-active {
    background: var(--quick-filter-active-bg);
    border-color: var(--quick-filter-active-bg);
    color: var(--quick-filter-active-text);
}

.quick-filter-chip__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 0.55rem;
    border-radius: 999px;
    background: var(--surface-muted);
    color: var(--text);
    font-size: 0.78rem;
    font-weight: 800;
}

.quick-filter-chip.is-active .quick-filter-chip__count {
    background: rgba(255, 255, 255, 0.16);
    color: var(--quick-filter-active-text);
}

.form-grid {
    display: grid;
    gap: 1rem;
}

.field {
    display: grid;
    gap: 0.5rem;
}

.field__label {
    font-size: 0.9rem;
    font-weight: 700;
}

.field__hint {
    margin: 0;
    color: var(--text-soft);
    font-size: 0.85rem;
}

.table-wrap {
    overflow-x: auto;
    max-width: 100%;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface);
}

.table {
    width: 100%;
    border-collapse: collapse;
    min-width: 860px;
}

.table thead {
    background: var(--table-head-bg);
}

.table th,
.table td {
    padding: 1rem 1.1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.table th {
    color: var(--text-soft);
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.table tbody tr {
    transition: background-color 0.16s ease, box-shadow 0.16s ease;
}

.table tbody tr:hover {
    background: var(--table-row-hover);
    box-shadow: inset 3px 0 0 var(--primary), 0 8px 18px rgba(15, 23, 42, 0.03);
}

.table-name {
    font-weight: 700;
}

.table-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.table-cell-actions {
    min-width: 0;
}

.table-actions > * {
    display: inline-flex;
    flex-shrink: 0;
}

.table-shell {
    position: relative;
}

.skeleton-shell {
    position: relative;
}

.skeleton-shell.is-loading > * {
    opacity: 0;
}

.skeleton-shell.is-loading::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 22px;
    background:
        linear-gradient(90deg, rgba(148, 163, 184, 0.12) 25%, rgba(148, 163, 184, 0.22) 37%, rgba(148, 163, 184, 0.12) 63%),
        linear-gradient(var(--bg), var(--bg));
    background-size: 220% 100%, 100% 100%;
    animation: table-skeleton-shimmer 1.2s ease-in-out infinite;
    pointer-events: none;
    min-height: 150px;
}

.table-shell.is-loading .table {
    opacity: 0;
}

.table-shell.is-loading::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 18px;
    background:
        linear-gradient(90deg, rgba(148, 163, 184, 0.12) 25%, rgba(148, 163, 184, 0.22) 37%, rgba(148, 163, 184, 0.12) 63%),
        linear-gradient(var(--surface), var(--surface));
    background-size: 220% 100%, 100% 100%;
    animation: table-skeleton-shimmer 1.2s ease-in-out infinite;
    pointer-events: none;
}

.table-shell.is-loading::before {
    content: "";
    position: absolute;
    inset: 1rem;
    border-radius: 14px;
    background:
        linear-gradient(var(--table-head-bg), var(--table-head-bg)) top/100% 54px no-repeat,
        linear-gradient(rgba(148, 163, 184, 0.12), rgba(148, 163, 184, 0.12)) left 0 top 74px/100% 52px repeat-y;
    pointer-events: none;
    opacity: 0.95;
}

.pagination-bar {
    margin-top: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.pagination-summary {
    margin: 0;
    color: var(--text-soft);
    font-size: 0.92rem;
}

.pagination-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.pagination-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    padding: 0.7rem 0.95rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-size: 0.88rem;
    font-weight: 700;
    transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.pagination-link:hover {
    background: var(--surface-muted);
}

.pagination-link.is-active {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
}

.pagination-link.is-disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    border: 1px solid var(--badge-border);
    background: var(--badge-bg);
    color: var(--badge-text);
    text-transform: capitalize;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.status-new {
    background: var(--badge-bg);
    border-color: var(--badge-border);
    color: var(--badge-text);
}

.status-interested {
    background: var(--info-bg);
    border-color: var(--info-border);
    color: var(--info-text);
}

.status-closed,
.status-converted {
    background: var(--success-bg);
    border-color: var(--success-border);
    color: var(--success-text);
}

.status-lost,
.status-not_interested {
    background: var(--error-bg);
    border-color: var(--error-border);
    color: var(--error-text);
}

.status-contacted,
.status-qualified,
.status-site_visit,
.status-negotiation,
.status-booked,
.status-no_response,
.status-need_follow_up {
    background: var(--badge-bg);
    border-color: var(--border);
    color: var(--text);
}

.status-available {
    background: var(--badge-bg);
    border-color: var(--border);
    color: var(--text);
}

.status-sold,
.status-purchased {
    background: var(--success-bg);
    border-color: var(--success-border);
    color: var(--success-text);
}

.status-select {
    min-width: 150px;
    padding-right: 2.5rem;
}

.status-info {
    background: var(--info-bg);
    border-color: var(--info-border);
    color: var(--info-text);
}

.auto-email-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.auto-email-results-card .toolbar {
    margin-bottom: 1rem;
}

.auto-email-layout {
    display: grid;
    gap: 1rem;
    grid-template-areas:
        "composer"
        "results";
}

.auto-email-composer-card {
    grid-area: composer;
}

.auto-email-results-card {
    grid-area: results;
}

@media (min-width: 1100px) {
    .auto-email-layout {
        align-items: start;
        grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.85fr);
        grid-template-areas: "results composer";
    }

    .auto-email-composer-card {
        position: sticky;
        top: 1rem;
    }
}

.status-warning {
    background: var(--warning-bg);
    border-color: var(--warning-border);
    color: var(--warning-text);
}

.status-success {
    background: var(--success-bg);
    border-color: var(--success-border);
    color: var(--success-text);
}

.message {
    padding: 0.95rem 1rem;
    border-radius: 14px;
    font-size: 0.92rem;
    border: 1px solid transparent;
}

.message--success {
    background: var(--info-bg);
    border-color: var(--info-border);
    color: var(--info-text);
}

.message--error {
    background: var(--error-bg);
    border-color: var(--error-border);
    color: var(--error-text);
}

.payment-card {
    min-width: 220px;
    display: grid;
    gap: 0.75rem;
}

.payment-summary p {
    margin: 0 0 0.25rem;
    font-size: 0.88rem;
}

.payment-form {
    display: grid;
    gap: 0.45rem;
}

.input--compact {
    padding: 0.65rem 0.8rem;
    border-radius: 12px;
}

.receipt-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.receipt-company {
    margin: 0 0 0.35rem;
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.receipt-meta p {
    margin: 0 0 0.35rem;
    color: var(--text-soft);
    font-size: 0.92rem;
}

.receipt-footer {
    margin: 1.5rem 0 0;
    text-align: center;
    color: var(--text-soft);
    font-size: 0.95rem;
    font-weight: 600;
}

.empty-state {
    color: var(--text-soft);
    font-size: 0.95rem;
}

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

@keyframes table-skeleton-shimmer {
    0% {
        background-position: 100% 0, 0 0;
    }
    100% {
        background-position: -100% 0, 0 0;
    }
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: grid;
    place-items: center;
    padding: 1rem;
    background: rgba(15, 15, 16, 0.52);
}

.modal__panel {
    width: min(100%, 760px);
    box-shadow: var(--shadow-soft);
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
}

.modal__panel--small {
    width: min(100%, 560px);
}

.modal__header,
.detail-header,
.detail-header__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.detail-grid {
    display: grid;
    gap: 1.5rem;
}

.detail-content {
    display: grid;
    gap: 1rem;
}

.detail-info-grid {
    display: grid;
    gap: 1rem;
}

.detail-note {
    padding: 1rem;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text);
}

.timeline-item__time {
    color: var(--text-soft);
    font-size: 0.82rem;
}

.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1.25rem;
}

.auth-card {
    width: min(100%, 430px);
}

.auth-card__header {
    margin-bottom: 1.5rem;
    text-align: center;
}

.auth-title {
    margin: 0;
    font-size: 1.9rem;
    font-weight: 800;
    letter-spacing: -0.04em;
}

.auth-subtitle {
    margin: 0.55rem 0 0;
    color: var(--text-soft);
}

@media (min-width: 768px) {
    .app-shell {
        flex-direction: row;
    }

    .sidebar {
        width: 280px;
        flex: 0 0 280px;
        min-height: 100vh;
        border-right: 1px solid var(--border-strong);
        border-bottom: 0;
    }

    .topbar__inner {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .topbar__main {
        align-items: center;
    }

    .topbar__actions {
        gap: 0.65rem;
    }

    .mobile-nav-toggle {
        display: none;
    }

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

    .toolbar,
    .toolbar__group,
    .toolbar__actions {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .toolbar__actions > * {
        width: auto;
    }

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

    .filters-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

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

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

    .pagination-bar {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .filters-actions__buttons > *,
    .quick-filters > * {
        flex: 0 0 auto;
    }
}

@media (min-width: 768px) and (max-width: 1024px) {
    .topbar__inner {
        gap: 0.85rem;
    }

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

    .notification-menu__button,
    #theme-toggle {
        width: 46px;
        min-width: 46px;
        height: 46px;
        border-radius: 15px;
    }

    .user-pill {
        padding: 0.65rem 0.9rem;
        font-size: 0.86rem;
    }

    .topbar__actions > a.button {
        min-height: 46px;
        padding: 0.78rem 1rem;
    }
}

@media (max-width: 767px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: min(88vw, 320px);
        height: 100vh;
        border-right: 1px solid var(--border);
        border-bottom: 0;
        z-index: 80;
        transform: translateX(-100%);
        transition: transform 0.22s ease;
        overflow-y: auto;
    }

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

    .app-shell.is-sidebar-open .sidebar-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    .topbar {
        position: sticky;
        top: 0;
        z-index: 50;
    }

    .topbar__inner,
    .page {
        width: min(100%, calc(100% - 1rem));
        max-width: calc(100% - 1rem);
    }

    .topbar__inner {
        padding: 0.78rem 0;
        gap: 0.72rem;
    }

    .topbar__title {
        font-size: 1.3rem;
    }

    .topbar__subtitle {
        font-size: 0.82rem;
        margin-top: 0.2rem;
    }

    .topbar__actions {
        display: grid;
        grid-template-columns: auto auto minmax(0, 1fr) auto;
        gap: 0.55rem;
        align-items: center;
        min-width: 0;
    }

    .topbar__actions .notification-menu,
    .topbar__actions > #theme-toggle {
        width: auto;
    }

    .topbar__actions .notification-menu {
        justify-self: start;
    }

    .notification-menu__button,
    #theme-toggle,
    .user-pill,
    .topbar__actions > a.button {
        min-height: 44px;
        height: 44px;
        border-radius: 14px;
    }

    .notification-menu__button,
    #theme-toggle {
        width: 44px;
        min-width: 44px;
        padding: 0;
    }

    .notification-badge {
        top: -0.12rem;
        right: -0.12rem;
        min-width: 20px;
        height: 20px;
        font-size: 0.68rem;
    }

    .notification-dropdown {
        right: auto;
        left: 0;
        width: min(360px, calc(100vw - 1rem));
    }

    .page {
        padding: 1rem 0 1.5rem;
    }

    .section-card,
    .timeline-card,
    .auth-card,
    .modal__panel {
        padding: 1rem;
        border-radius: 18px;
    }

    .metric-card {
        padding: 0.95rem 1rem;
        border-radius: 18px;
        box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
    }

    .metric-grid,
    .metric-grid--secondary {
        gap: 0.8rem;
    }

    .metric-card__label {
        gap: 0.35rem;
        font-size: 0.84rem;
    }

    .metric-card__icon svg {
        width: 0.92rem;
        height: 0.92rem;
    }

    .metric-card__value {
        margin-top: 0.7rem;
        font-size: 1.55rem;
        line-height: 1.05;
    }

    .metric-grid--secondary .metric-card__value {
        font-size: 1.42rem;
    }

    .metric-card__hint {
        margin-top: 0.35rem;
        font-size: 0.77rem;
        line-height: 1.4;
    }

    .section-header,
    .detail-header,
    .detail-header__top,
    .modal__header,
    .item-row,
    .receipt-card__header {
        flex-direction: column;
        align-items: stretch;
    }

    .detail-header__top .status-badge,
    .section-header .pill,
    .detail-header .button,
    .detail-header .table-actions {
        align-self: flex-start;
    }

    .button,
    .button--small {
        width: 100%;
    }

    .button--icon,
    .mobile-nav-toggle {
        width: 48px;
        min-width: 48px;
    }

    .user-pill {
        width: 100%;
        justify-content: flex-start;
        gap: 0.45rem;
        padding: 0 0.8rem;
        font-size: 0.82rem;
        font-weight: 700;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
        min-height: 44px;
    }

    .user-pill__icon {
        flex-shrink: 0;
    }

    .notification-menu__button,
    #theme-toggle {
        width: 44px;
        min-width: 44px;
    }

    .topbar__actions > a.button {
        width: auto;
        min-width: 0;
        justify-content: center;
        padding: 0 0.95rem;
        font-size: 0.84rem;
        box-shadow: 0 10px 22px rgba(37, 99, 235, 0.18);
    }

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

    .quick-filter-row__scroll {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 0.2rem;
        margin-right: -0.2rem;
    }

    .quick-filter-chip {
        flex: 0 0 auto;
    }

    .table-wrap {
        overflow: visible;
        border: 0;
        background: transparent;
    }

    .table {
        min-width: 0;
        border-collapse: separate;
        border-spacing: 0;
    }

    .table thead {
        display: none;
    }

    .table,
    .table tbody,
    .table tr,
    .table td {
        display: block;
        width: 100%;
    }

    .table tbody {
        display: grid;
        gap: 0.9rem;
    }

    .table tbody tr {
        border: 1px solid var(--border);
        border-radius: 18px;
        background: var(--surface);
        box-shadow: var(--shadow-card);
        padding: 0.2rem 0;
    }

    .table tbody tr:hover {
        box-shadow: var(--shadow-card-hover);
        background: var(--surface);
    }

    .table td {
        border-bottom: 1px solid var(--border);
        padding: 0.85rem 1rem;
    }

    .table td:last-child {
        border-bottom: 0;
    }

    .table td::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 0.35rem;
        color: var(--text-soft);
        font-size: 0.76rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.08em;
    }

    .table-cell-actions .table-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .table-shell.is-loading::before,
    .table-shell.is-loading::after {
        display: none;
    }

    .table-shell.is-loading .table {
        opacity: 1;
    }

    .pagination-nav {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
    }

    .login-shell {
        padding: 1rem;
    }

    .auth-title {
        font-size: 1.6rem;
    }
}

@media (min-width: 480px) and (max-width: 767px) {
    .metric-grid,
    .metric-grid--secondary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .topbar__title {
        font-size: 1.4rem;
    }
}

@media (max-width: 420px) {
    .topbar__actions {
        grid-template-columns: auto auto minmax(0, 1fr);
    }

    .topbar__actions > a.button {
        grid-column: 1 / -1;
        width: 100%;
        min-height: 42px;
    }

    .topbar__title {
        font-size: 1.2rem;
    }
}

@media (min-width: 1100px) {
    .metric-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .metric-grid--secondary {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .split-grid {
        grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    }

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

    .detail-grid {
        grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
    }

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

    .filters-actions {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}
.user-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.7rem 1rem;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-soft);
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: var(--shadow-pill);
}
