:root {
    --color-primary: #2563eb;
    --color-primary-hover: #1d4ed8;
    --color-primary-soft: #eff6ff;
    --color-nav: #f5f5f7;
    --color-nav-surface: #eff6ff;
    --color-nav-highlight: #e5e5e7;
    --color-background: #ffffff;
    --color-surface: #ffffff;
    --color-surface-muted: #f8fafc;
    --color-text: #0f172a;
    --color-text-secondary: #64748b;
    --color-border: #e2e8f0;
    --color-border-strong: #cbd5e1;
    --color-success: #15803d;
    --color-success-soft: #f0fdf4;
    --color-warning: #b45309;
    --color-warning-soft: #fffbeb;
    --color-danger: #dc2626;
    --color-danger-hover: #b91c1c;
    --color-danger-soft: #fef2f2;
    --color-danger-border: #fecaca;
    --color-info: #0369a1;
    --color-info-soft: #f0f9ff;
    --color-success-border: #bbf7d0;
    --color-warning-border: #fde68a;
    --color-info-border: #bae6fd;
    --shadow-card: 0 1px 2px rgba(15, 23, 42, 0.04), 0 10px 30px rgba(15, 23, 42, 0.05);
    --shadow-control: 0 1px 2px rgba(15, 23, 42, 0.08);
    --radius-card: 12px;
    --radius-control: 8px;
    --transition: 180ms ease;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    color-scheme: light;
}

html[data-theme="dark"] {
    color-scheme: dark;
}

html[data-theme="system"] {
    color-scheme: light dark;
}

html[data-color-scheme="dark"] {
    --color-background: #0f172a;
    --color-surface: #162033;
    --color-surface-muted: #1e293b;
    --color-text: #f8fafc;
    --color-text-secondary: #cbd5e1;
    --color-border: #334155;
    --color-border-strong: #475569;
    --color-nav: #111c31;
    --color-nav-surface: #1e293b;
    --color-nav-highlight: #334155;
    --color-primary-soft: #172554;
    --color-success: #4ade80;
    --color-success-soft: rgba(34, 197, 94, 0.14);
    --color-success-border: #166534;
    --color-warning: #fbbf24;
    --color-warning-soft: rgba(245, 158, 11, 0.14);
    --color-warning-border: #92400e;
    --color-danger: #fb7185;
    --color-danger-hover: #fda4af;
    --color-danger-soft: rgba(225, 29, 72, 0.14);
    --color-danger-border: #9f3a50;
    --color-info: #38bdf8;
    --color-info-soft: rgba(14, 165, 233, 0.14);
    --color-info-border: #075985;
    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.2), 0 10px 30px rgba(0, 0, 0, 0.24);
}

.navbar-actions {
    grid-column: 3;
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 10px;
}

.theme-toggle {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-secondary);
    background: var(--color-surface);
    border: 1px solid var(--color-border-strong);
    border-radius: 50%;
    box-shadow: var(--shadow-control);
    cursor: pointer;
}

.theme-toggle:hover {
    color: var(--color-primary);
    border-color: var(--color-primary);
}

.theme-icon {
    display: none;
}

.theme-toggle[data-theme="light"] .theme-icon-light,
.theme-toggle[data-theme="dark"] .theme-icon-dark,
.theme-toggle[data-theme="system"] .theme-icon-system {
    display: block;
}

html[data-color-scheme="dark"] .navbar a,
html[data-color-scheme="dark"] label,
html[data-color-scheme="dark"] th {
    color: var(--color-text);
}

html[data-color-scheme="dark"] .profile-trigger,
html[data-color-scheme="dark"] .profile-popover,
html[data-color-scheme="dark"] .confirmation-dialog,
html[data-color-scheme="dark"] .side-drawer,
html[data-color-scheme="dark"] input,
html[data-color-scheme="dark"] table,
html[data-color-scheme="dark"] th,
html[data-color-scheme="dark"] .btn-secondary,
html[data-color-scheme="dark"] .pagination-button,
html[data-color-scheme="dark"] .floating-help-card {
    background: var(--color-surface);
    color: var(--color-text);
}

html[data-color-scheme="dark"] th {
    background: var(--color-surface-muted);
}

html[data-color-scheme="dark"] .section-tabs {
    background: var(--color-surface-muted);
}

html[data-color-scheme="dark"] .section-tab[aria-selected="true"] {
    background: transparent;
}

html[data-color-scheme="dark"] .section-tabs::before {
    background: var(--color-nav-highlight);
}

html[data-color-scheme="dark"] .empty-state-panel {
    background: var(--color-surface-muted);
}

html[data-color-scheme="dark"] .floating-help-card p {
    color: var(--color-info);
}

html[data-color-scheme="dark"] .btn-secondary:hover,
html[data-color-scheme="dark"] .profile-popover .btn-secondary:hover {
    color: #fff;
}

body {
    min-width: 320px;
    min-height: 100vh;
    overflow: hidden;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--color-background);
    color: var(--color-text);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--color-primary);
    text-decoration: none;
}

button,
input {
    font: inherit;
}

.icon {
    width: 17px;
    height: 17px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.container {
    width: 100%;
    max-width: 1600px;
    height: calc(100dvh - 68px);
    margin: 0 auto;
    padding: 32px 32px 48px;
    overflow: hidden;
}

.navbar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--color-nav);
    color: var(--color-text);
    border-bottom: 1px solid var(--color-border);
    box-shadow: 0 2px 14px rgba(15, 23, 42, 0.06);
}

.navbar-inner {
    width: 100%;
    max-width: 1600px;
    min-height: 68px;
    margin: 0 auto;
    padding: 10px 32px;
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto minmax(220px, 1fr);
    align-items: center;
    gap: 24px;
}

.navbar .brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--color-text);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.02em;
    white-space: nowrap;
}

.navbar-content {
    display: contents;
}

.navbar-links {
    display: flex;
    align-items: center;
}

.navbar-links {
    grid-column: 2;
    position: relative;
    gap: 10px;
}

.navbar a {
    color: var(--color-text);
}

.nav-link {
    position: relative;
    z-index: 1;
    min-height: 40px;
    padding: 9px 12px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    transition: color var(--transition), background-color var(--transition);
}

.nav-link:hover {
    color: var(--color-text);
    background: transparent;
}

.nav-link.active {
    color: var(--color-text);
    background: var(--color-nav-highlight);
    box-shadow: none;
}

.navbar-links.is-ready .nav-link.active {
    background: transparent;
}

.nav-slider {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 0;
    width: 0;
    opacity: 0;
    background: var(--color-nav-highlight);
    border-radius: 999px;
    pointer-events: none;
    transition: width 240ms cubic-bezier(0.22, 1, 0.36, 1), transform 240ms cubic-bezier(0.22, 1, 0.36, 1), opacity 120ms ease;
}

.navbar-links:not(.is-ready) .nav-slider {
    transition: none;
}

.navbar-links.is-ready .nav-slider {
    opacity: 1;
}

.profile-menu {
    position: relative;
}

.profile-trigger {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text);
    background: var(--color-surface);
    border: 1px solid var(--color-border-strong);
    border-radius: 50%;
    box-shadow: var(--shadow-control);
    cursor: pointer;
    list-style: none;
    transition: color var(--transition), background-color var(--transition), border-color var(--transition);
}

.profile-trigger::-webkit-details-marker {
    display: none;
}

.profile-trigger:hover,
.profile-menu[open] .profile-trigger {
    color: var(--color-primary);
    background: var(--color-primary-soft, #eff6ff);
    border-color: #93c5fd;
}

.profile-trigger:focus-visible,
.drawer-close:focus-visible {
    outline: 3px solid rgba(59, 130, 246, 0.35);
    outline-offset: 2px;
}

.profile-popover {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 40;
    width: 230px;
    padding: 14px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 11px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.14);
}

.profile-identity {
    margin-bottom: 12px;
    padding-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--color-text);
    border-bottom: 1px solid var(--color-border);
    font-size: 13px;
    font-weight: 650;
    overflow-wrap: anywhere;
}

.profile-avatar {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    color: var(--color-primary);
    background: var(--color-primary-soft);
    border-radius: 50%;
}

.profile-popover form,
.profile-popover .btn {
    width: 100%;
}

.card {
    margin-bottom: 24px;
    padding: 24px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
}

.card[data-paginated-container] {
    display: flex;
    flex-direction: column;
    min-height: calc(100dvh - 190px);
    max-height: calc(100dvh - 190px);
}

.card[data-paginated-container] .empty-state-panel {
    flex: 1;
    min-height: 0;
}

.card[data-paginated-container] .table-wrap {
    flex: 1;
    min-height: 0;
    overflow-y: hidden;
}

.card[data-paginated-container] .table-wrap table {
    height: 100%;
}

.card[data-paginated-container] .table-wrap:has(tr:not([data-placeholder-row]):nth-child(12)) {
    overflow-y: auto;
}

tr[data-placeholder-row] {
    height: 45px;
}

tr[data-placeholder-row] td {
    color: transparent;
}

.card h1,
.card h2 {
    margin-bottom: 16px;
}

.card-heading {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--color-text);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.015em;
}

.card-heading .icon {
    color: var(--color-primary);
}

.page-header {
    min-height: 46px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.page-header h1 {
    color: var(--color-text);
    font-size: clamp(25px, 3vw, 30px);
    font-weight: 750;
    line-height: 1.2;
    letter-spacing: -0.035em;
}

.section-tabs {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    padding: 4px;
    background: var(--color-surface-muted);
    border: 1px solid var(--color-border);
    border-radius: 999px;
}

.section-tabs::before {
    position: absolute;
    top: 4px;
    bottom: 4px;
    left: 4px;
    width: calc((100% - 12px) / 2);
    background: var(--color-surface);
    border-radius: 999px;
    box-shadow: var(--shadow-control);
    content: "";
    pointer-events: none;
    transition: transform 240ms cubic-bezier(0.22, 1, 0.36, 1);
}

.section-tabs.show-second::before {
    transform: translateX(calc(100% + 4px));
}

.section-tab {
    position: relative;
    z-index: 1;
    flex: 1 1 0;
    min-height: 34px;
    padding: 7px 15px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--color-text-secondary);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: color var(--transition), background-color var(--transition), box-shadow var(--transition);
}

.section-tab[aria-selected="true"] {
    color: var(--color-primary);
}

.section-tab:focus-visible,
.pagination-button:focus-visible,
.floating-help-button:focus-visible {
    outline: 3px solid rgba(59, 130, 246, 0.35);
    outline-offset: 2px;
}

.card-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.card-topbar .card-heading {
    margin-bottom: 0;
}

.card-actions {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.toast-stack {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 60;
    width: min(390px, calc(100vw - 32px));
    display: grid;
    gap: 10px;
    pointer-events: none;
}

.toast {
    padding: 13px 16px;
    border: 1px solid;
    border-radius: var(--radius-control);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
    font-size: 13px;
    font-weight: 600;
    pointer-events: auto;
    animation: toast-enter 220ms ease-out;
}

.toast-success {
    background: var(--color-success-soft);
    color: var(--color-success);
    border-color: var(--color-success-border);
}

.toast-error {
    background: var(--color-danger-soft);
    color: var(--color-danger);
    border-color: var(--color-danger-border);
}

.toast-leaving {
    animation: toast-leave 220ms ease-in forwards;
}

.pagination {
    min-height: 36px;
    padding-top: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.pagination-button {
    min-height: 32px;
    padding: 6px 12px;
    border: 1px solid var(--color-border-strong);
    border-radius: 999px;
    background: var(--color-surface);
    color: var(--color-text);
    font-size: 12px;
    font-weight: 650;
    cursor: pointer;
}

.pagination-button:hover:not(:disabled) {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.pagination-button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.pagination-status {
    min-width: 90px;
    color: var(--color-text-secondary);
    font-size: 12px;
    font-weight: 650;
    text-align: center;
}

.row-number {
    width: 56px;
    color: var(--color-text-secondary);
    font-weight: 700;
    text-align: center;
}

table th:first-child,
table td.row-number {
    width: 56px;
    text-align: center;
}

.floating-help {
    position: relative;
    z-index: 30;
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

.floating-help-card {
    position: absolute;
    right: 0;
    bottom: calc(100% + 10px);
    width: min(360px, calc(100vw - 32px));
    padding: 16px 18px;
    background: var(--color-surface);
    border: 1px solid var(--color-info-border);
    border-radius: var(--radius-card);
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.16);
}

.floating-help-card p {
    color: var(--color-info);
    font-size: 13px;
}

.floating-help-button {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--color-info);
    background: var(--color-info-soft);
    border: 1px solid var(--color-info-border);
    border-radius: 50%;
    box-shadow: var(--shadow-control);
    cursor: pointer;
}

@keyframes toast-enter {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes toast-leave {
    to { opacity: 0; transform: translateY(-8px); }
}

.btn {
    min-height: 40px;
    padding: 9px 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: var(--color-primary);
    color: #fff;
    box-shadow: var(--shadow-control);
    font-size: 13px;
    font-weight: 650;
    line-height: 1.2;
    text-align: center;
    cursor: pointer;
    transition: background-color var(--transition), border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.btn:hover {
    background: var(--color-primary-hover);
    color: #fff;
    box-shadow: 0 5px 14px rgba(37, 99, 235, 0.2);
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn:focus-visible,
.nav-link:focus-visible,
input:focus-visible {
    outline: 3px solid rgba(59, 130, 246, 0.35);
    outline-offset: 2px;
}

.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.btn-secondary {
    background: var(--color-surface);
    color: var(--color-text);
    border-color: var(--color-border-strong);
}

.btn-secondary:hover {
    background: var(--color-surface-muted);
    color: var(--color-text);
    border-color: #94a3b8;
    box-shadow: var(--shadow-control);
}

.btn-danger {
    background: var(--color-danger-soft);
    color: var(--color-danger);
    border-color: var(--color-danger-border);
}

.btn-danger:hover {
    background: var(--color-danger-soft);
    color: var(--color-danger-hover);
    border-color: var(--color-danger);
    box-shadow: var(--shadow-control);
}

.profile-popover .btn-secondary:hover {
    background: var(--color-danger);
    color: #fff;
    border-color: var(--color-danger);
    box-shadow: 0 5px 14px rgba(220, 38, 38, 0.2);
}

.alert {
    margin-bottom: 20px;
    padding: 13px 16px;
    border: 1px solid;
    border-radius: var(--radius-control);
    font-size: 13px;
    font-weight: 550;
    box-shadow: var(--shadow-control);
}

.alert-success {
    background: var(--color-success-soft);
    color: var(--color-success);
    border-color: var(--color-success-border);
}

.alert-error {
    background: var(--color-danger-soft);
    color: var(--color-danger);
    border-color: var(--color-danger-border);
}

.form-card {
    max-width: 680px;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 7px;
    color: var(--color-text);
    font-size: 13px;
    font-weight: 650;
}

input[type="text"],
input[type="password"] {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    color: var(--color-text);
    background: var(--color-surface);
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-control);
    font-size: 14px;
    transition: border-color var(--transition), box-shadow var(--transition);
}

input[type="text"]:hover,
input[type="password"]:hover {
    border-color: #94a3b8;
}

input[type="text"]:focus,
input[type="password"]:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
    outline: none;
}

input::placeholder {
    color: var(--color-text-secondary);
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 9px;
}

.checkbox-group label {
    margin: 0;
    cursor: pointer;
}

input[type="checkbox"] {
    width: 17px;
    height: 17px;
    accent-color: var(--color-primary);
    cursor: pointer;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
    background: var(--color-surface);
}

.users-table {
    table-layout: fixed;
}

.users-table th,
.users-table td {
    width: 25%;
}

.users-table th:nth-child(n + 2),
.users-table td:nth-child(n + 2) {
    text-align: center;
}

.users-table th:last-child,
.users-table td:last-child {
    text-align: left;
}

.users-table td.actions {
    display: table-cell;
}

.users-table td.actions > .btn,
.users-table td.actions > .inline-form {
    margin: 2px 6px 2px 0;
}

th,
td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--color-border);
    text-align: left;
    vertical-align: middle;
}

th {
    color: var(--color-text-secondary);
    background: var(--color-surface-muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.035em;
    text-transform: uppercase;
    white-space: nowrap;
}

td {
    color: var(--color-text);
    font-size: 13px;
}

tbody tr {
    transition: background-color var(--transition);
}

tbody tr:hover {
    background: var(--color-surface-muted);
}

tbody tr:last-child td {
    border-bottom: 0;
}

td .btn {
    min-height: 34px;
    padding: 7px 11px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 9px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
    text-transform: capitalize;
    white-space: nowrap;
}

.badge::before {
    width: 6px;
    height: 6px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: currentColor;
    content: "";
}

.badge-pending {
    background: var(--color-warning-soft);
    color: var(--color-warning);
    border-color: var(--color-warning-border);
}

.badge-synced,
.badge-active {
    background: var(--color-success-soft);
    color: var(--color-success);
    border-color: var(--color-success-border);
}

.badge-failed {
    background: var(--color-danger-soft);
    color: var(--color-danger);
    border-color: var(--color-danger-border);
}

.badge-inactive {
    background: var(--color-surface-muted);
    color: var(--color-text-secondary);
    border-color: var(--color-border);
}

.actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.section-copy {
    margin: -7px 0 18px;
    color: var(--color-text-secondary);
    font-size: 13px;
}

.status-error {
    max-width: 260px;
    margin-top: 6px;
    color: var(--color-danger);
    font-size: 12px;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.empty-state {
    color: var(--color-text-secondary);
}

.empty-state-panel {
    min-height: 116px;
    padding: 26px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--color-text-secondary);
    background: var(--color-surface-muted);
    border: 1px dashed var(--color-border-strong);
    border-radius: 10px;
    text-align: center;
}

.empty-state-panel .icon {
    width: 24px;
    height: 24px;
    color: var(--color-text-secondary);
}

.info-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 18px 20px;
    background: var(--color-info-soft);
    border-color: var(--color-info-border);
    box-shadow: none;
}

.info-card > .icon {
    width: 20px;
    height: 20px;
    margin-top: 1px;
    color: var(--color-info);
}

.info-card p {
    color: var(--color-info);
    font-size: 13px;
}

.inline-form {
    display: inline-flex;
}

.side-drawer {
    position: fixed;
    inset: 0 0 0 auto;
    width: min(440px, 100vw);
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    padding: 0;
    color: var(--color-text);
    background: var(--color-surface);
    border: 0;
    border-left: 1px solid var(--color-border);
    box-shadow: -18px 0 45px rgba(15, 23, 42, 0.14);
    transform-origin: 100% 50%;
    will-change: transform;
}

.side-drawer[open] {
    display: flex;
    flex-direction: column;
    animation: drawer-enter 440ms both;
}

.side-drawer.is-closing {
    animation: drawer-exit 200ms cubic-bezier(0.4, 0, 1, 1) forwards;
}

.side-drawer::backdrop {
    background: rgba(15, 23, 42, 0.38);
    backdrop-filter: blur(2px);
}

.side-drawer[open]::backdrop {
    animation: drawer-backdrop-in 180ms ease-out both;
}

.side-drawer.is-closing::backdrop {
    animation: drawer-backdrop-out 200ms ease-in both;
}

.confirmation-dialog {
    width: min(430px, calc(100vw - 32px));
    margin: auto;
    padding: 24px;
    color: var(--color-text);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    box-shadow: 0 20px 55px rgba(15, 23, 42, 0.2);
    transform-origin: 50% 58%;
    will-change: transform, opacity;
}

.confirmation-dialog[open] {
    animation: confirmation-pop 440ms both;
}

.confirmation-dialog::backdrop {
    background: rgba(15, 23, 42, 0.42);
    backdrop-filter: blur(2px);
}

.confirmation-dialog[open]::backdrop {
    animation: confirmation-backdrop-in 180ms ease-out both;
}

.confirmation-dialog-content {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.confirmation-dialog-icon {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    color: var(--color-danger);
    background: var(--color-danger-soft);
    border-radius: 50%;
}

.confirmation-dialog h2 {
    margin: 2px 0 6px;
    font-size: 18px;
    font-weight: 750;
}

.confirmation-dialog p {
    color: var(--color-text-secondary);
    font-size: 13px;
}

.confirmation-dialog-actions {
    margin-top: 24px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

@keyframes confirmation-pop {
    0% {
        opacity: 0;
        border-radius: 22px;
        transform: translateY(24px) scale3d(0.76, 0.7, 1);
        animation-timing-function: cubic-bezier(0.18, 0.88, 0.32, 1.18);
    }

    38% {
        opacity: 1;
        border-radius: 10px;
        transform: translateY(-5px) scale3d(1.055, 0.94, 1);
        animation-timing-function: cubic-bezier(0.34, 0, 0.3, 1);
    }

    56% {
        transform: translateY(2px) scale3d(0.975, 1.035, 1);
        animation-timing-function: cubic-bezier(0.34, 0, 0.3, 1);
    }

    72% {
        transform: translateY(-1px) scale3d(1.016, 0.988, 1);
        animation-timing-function: ease-out;
    }

    86% {
        transform: translateY(0) scale3d(0.994, 1.006, 1);
        animation-timing-function: ease-out;
    }

    100% {
        opacity: 1;
        border-radius: var(--radius-card);
        transform: translateY(0) scale3d(1, 1, 1);
    }
}

@keyframes confirmation-backdrop-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.drawer-header {
    min-height: 72px;
    padding: 18px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid var(--color-border);
}

.drawer-header h2 {
    font-size: 20px;
    font-weight: 750;
    letter-spacing: -0.025em;
}

.drawer-close {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    color: var(--color-text-secondary);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 50%;
    cursor: pointer;
    transition: color var(--transition), background-color var(--transition), border-color var(--transition);
}

.drawer-close:hover {
    color: var(--color-text);
    background: var(--color-surface-muted);
    border-color: var(--color-border-strong);
}

.drawer-body {
    padding: 26px 22px;
    overflow-y: auto;
}

.drawer-actions {
    padding-top: 4px;
}

body:has(.side-drawer[open]) {
    overflow: hidden;
}

@keyframes drawer-enter {
    0% {
        transform: translateX(100%) scaleX(0.94);
        animation-timing-function: cubic-bezier(0.18, 0.88, 0.32, 1.12);
    }

    55% {
        transform: translateX(-2%) scaleX(1.012);
        animation-timing-function: cubic-bezier(0.34, 0, 0.3, 1);
    }

    75% {
        transform: translateX(0.7%) scaleX(0.996);
        animation-timing-function: ease-out;
    }

    88% {
        transform: translateX(-0.2%) scaleX(1.002);
    }

    100% {
        transform: translateX(0) scaleX(1);
    }
}

@keyframes drawer-exit {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(100%) scaleX(0.98);
    }
}

@keyframes drawer-backdrop-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes drawer-backdrop-out {
    from { opacity: 1; }
    to { opacity: 0; }
}

.login-page {
    min-height: 100vh;
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-background);
}

.login-card {
    width: 100%;
    max-width: 420px;
    margin: 0;
    padding: 34px;
}

.login-title {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--color-text);
    font-size: 25px;
    font-weight: 750;
    letter-spacing: -0.035em;
}

.login-card > p {
    margin: -8px 0 26px;
    color: var(--color-text-secondary);
}

.login-card .alert {
    margin-bottom: 22px;
}

.login-card .btn {
    width: 100%;
    margin-top: 2px;
}

@media (max-width: 920px) {
    .navbar-inner {
        grid-template-columns: 1fr auto;
        gap: 10px 16px;
        padding-top: 12px;
        padding-bottom: 12px;
    }

    .navbar .brand {
        grid-column: 1;
        grid-row: 1;
    }

    .navbar-links {
        grid-column: 1 / -1;
        grid-row: 2;
        max-width: 100%;
        justify-self: center;
        overflow-x: auto;
        padding-bottom: 2px;
    }

    .navbar-actions {
        grid-column: 2;
        grid-row: 1;
    }
}

@media (max-width: 640px) {
    .container {
        height: calc(100dvh - 116px);
        padding: 24px 16px 36px;
    }

    .navbar-inner {
        padding-right: 16px;
        padding-left: 16px;
    }

    .navbar-links {
        width: 100%;
        justify-self: stretch;
    }

    .nav-link {
        padding-right: 10px;
        padding-left: 10px;
    }

    .page-header {
        align-items: stretch;
        flex-direction: column;
        margin-bottom: 20px;
    }

    .section-tabs {
        width: 100%;
        margin-left: 0;
    }

    .section-tab {
        flex: 1;
    }

    .card-topbar {
        align-items: stretch;
        flex-direction: column;
    }

    .card-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .page-header form,
    .page-header .actions,
    .page-header .btn {
        width: 100%;
    }

    .card {
        max-height: calc(100dvh - 154px);
        padding: 18px;
        margin-bottom: 18px;
    }

    .card-heading {
        font-size: 17px;
    }

    .login-page {
        padding: 16px;
    }

    .login-card {
        padding: 26px 22px;
    }

    .side-drawer {
        width: 100vw;
        border-left: 0;
    }

    .toast-stack {
        right: 16px;
        bottom: 16px;
    }

    .card-actions {
        justify-content: space-between;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }

    .confirmation-dialog[open],
    .confirmation-dialog[open]::backdrop,
    .side-drawer[open],
    .side-drawer[open]::backdrop,
    .side-drawer.is-closing,
    .side-drawer.is-closing::backdrop {
        animation: none;
    }

}
