/* Resto Panel 4.59.0 — opcjonalny motyw Modern.
   Wszystkie reguły są ograniczone do data-ui-theme="modern", aby motyw Klasyczny pozostał bez zmian. */

html[data-ui-theme="modern"] {
    --blue-50: #eef2ff;
    --blue-100: #e0e7ff;
    --blue-200: #c7d2fe;
    --blue-500: #6366f1;
    --blue-600: #4f46e5;
    --blue-700: #4338ca;
    --page-bg: #f3f6fb;
    --surface: #ffffff;
    --surface-soft: #f7f9fc;
    --surface-hover: #eef2f8;
    --text: #111827;
    --text-secondary: #667085;
    --text-faint: #98a2b3;
    --border: #e3e8ef;
    --border-strong: #cdd5df;
    --sidebar-bg: #111827;
    --sidebar-surface: #182235;
    --sidebar-text: #f2f4f7;
    --sidebar-muted: #98a2b3;
    --sidebar-border: #263244;
    --success: #17a673;
    --shadow: 0 1px 2px rgb(16 24 40 / .04), 0 14px 34px rgb(16 24 40 / .07);
    --modern-card-radius: 18px;
    --modern-control-radius: 12px;
    --brand-accent-rgb: 99 102 241;
    --brand-accent-light-rgb: 129 140 248;
    --brand-accent-dark-rgb: 67 56 202;
    --brand-accent-100: #4f46e5;
    --brand-accent-200: #4f46e5;
    --brand-accent-300: #6366f1;
    --brand-accent-500: #6366f1;
    --brand-accent-muted: #667085;
    --brand-accent-muted-alt: #667085;
    --brand-accent-muted-light: #667085;
    --brand-accent-border: #818cf8;
    --resto-outline: #d8dee9;
    --resto-outline-soft: #e3e8ef;
    --resto-outline-hover: #818cf8;
    --resto-outline-focus: #6366f1;
    --dashboard-attention-fill: var(--blue-500);
    --dashboard-attention-text: var(--blue-600);
}

html.dark[data-ui-theme="modern"] {
    --page-bg: #090d16;
    --surface: #111827;
    --surface-soft: #0d1422;
    --surface-hover: #182235;
    --text: #f4f6fb;
    --text-secondary: #aab4c5;
    --text-faint: #778397;
    --border: #263244;
    --border-strong: #35445b;
    --sidebar-bg: #070b12;
    --sidebar-surface: #101827;
    --sidebar-text: #f6f8fc;
    --sidebar-muted: #8793a6;
    --sidebar-border: #202a3a;
    --success: #48d597;
    --shadow: 0 1px 2px rgb(0 0 0 / .26), 0 18px 42px rgb(0 0 0 / .25);
    --brand-accent-rgb: 129 140 248;
    --brand-accent-light-rgb: 165 180 252;
    --brand-accent-dark-rgb: 99 102 241;
    --brand-accent-100: #c7d2fe;
    --brand-accent-200: #a5b4fc;
    --brand-accent-300: #a5b4fc;
    --brand-accent-500: #818cf8;
    --brand-accent-muted: #8793a6;
    --brand-accent-muted-alt: #aab4c5;
    --brand-accent-muted-light: #aab4c5;
    --brand-accent-border: #6366f1;
    --resto-outline: #35445b;
    --resto-outline-soft: #263244;
    --resto-outline-hover: #536987;
    --resto-outline-focus: #818cf8;
    --dashboard-attention-fill: var(--blue-500);
    --dashboard-attention-text: var(--blue-200);
}

html[data-ui-theme="modern"] body {
    background-image:
        radial-gradient(circle at 78% -8%, color-mix(in srgb, var(--blue-500) 13%, transparent), transparent 32rem),
        linear-gradient(180deg, color-mix(in srgb, var(--page-bg) 96%, #fff), var(--page-bg));
    letter-spacing: -.005em;
}

html.dark[data-ui-theme="modern"] body {
    background-image:
        radial-gradient(circle at 78% -8%, color-mix(in srgb, var(--blue-500) 15%, transparent), transparent 34rem),
        linear-gradient(180deg, #0a0f1a, var(--page-bg));
}

html[data-ui-theme="modern"] .sidebar {
    background:
        radial-gradient(circle at 15% 0%, rgb(99 102 241 / .18), transparent 18rem),
        linear-gradient(180deg, #111827 0%, #0c1320 100%);
    border-right-color: color-mix(in srgb, var(--blue-500) 16%, var(--sidebar-border));
    box-shadow: 12px 0 40px rgb(15 23 42 / .08);
}

html.dark[data-ui-theme="modern"] .sidebar {
    background:
        radial-gradient(circle at 15% 0%, rgb(99 102 241 / .16), transparent 18rem),
        linear-gradient(180deg, #080d16 0%, #060a11 100%);
}

html[data-ui-theme="modern"] .sidebar-header {
    min-height: 78px;
    padding: 12px 16px;
}

html[data-ui-theme="modern"] .brand-mark.brand-logo {
    width: 50px;
    height: 50px;
    padding: 3px;
    border-color: rgb(129 140 248 / .38);
    border-radius: 15px;
    background: #0a0f19;
    box-shadow: 0 10px 26px rgb(0 0 0 / .22), 0 0 0 3px rgb(99 102 241 / .08);
}

html[data-ui-theme="modern"] .brand-copy strong {
    color: #f8fafc;
    font-family: Inter, ui-sans-serif, system-ui, sans-serif;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: -.01em;
}

html[data-ui-theme="modern"] .brand-copy small {
    color: #98a2b3;
    letter-spacing: .02em;
}

html[data-ui-theme="modern"] .sidebar-search {
    border-radius: 13px;
    background: rgb(255 255 255 / .055);
    border-color: rgb(255 255 255 / .08);
}

html[data-ui-theme="modern"] .sidebar-search:focus-within {
    border-color: rgb(129 140 248 / .55);
    box-shadow: 0 0 0 3px rgb(99 102 241 / .13);
}

html[data-ui-theme="modern"] .sidebar-link,
html[data-ui-theme="modern"] .sidebar-group-toggle,
html[data-ui-theme="modern"] .sidebar-submenu-link {
    border-radius: 11px;
}

html[data-ui-theme="modern"] .sidebar-link.active,
html[data-ui-theme="modern"] .sidebar-submenu-link.active,
html[data-ui-theme="modern"] .sidebar-group-toggle.active {
    color: #ffffff;
    background: linear-gradient(135deg, rgb(99 102 241 / .28), rgb(99 102 241 / .12));
    box-shadow: inset 0 0 0 1px rgb(129 140 248 / .22), 0 8px 20px rgb(0 0 0 / .08);
}

html[data-ui-theme="modern"] .sidebar-submenu-link {
    color: #b7c1d1;
}

html[data-ui-theme="modern"] .sidebar-submenu-link:hover {
    color: #ffffff;
}

html[data-ui-theme="modern"] .sidebar-submenu-link::before {
    background: #536075;
}

html[data-ui-theme="modern"] .sidebar-submenu-link.active::before {
    background: #a5b4fc;
    box-shadow: 0 0 0 4px rgb(129 140 248 / .13);
}

html[data-ui-theme="modern"] .topbar {
    min-height: var(--topbar-height);
    border-bottom-color: color-mix(in srgb, var(--blue-500) 12%, var(--border));
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    box-shadow: 0 1px 0 rgb(16 24 40 / .02);
    backdrop-filter: blur(16px) saturate(145%);
}

html.dark[data-ui-theme="modern"] .topbar {
    background: rgb(12 18 30 / .82);
}

html[data-ui-theme="modern"] .page-context small {
    color: var(--blue-600);
    font-weight: 750;
}

html.dark[data-ui-theme="modern"] .page-context small {
    color: var(--blue-200);
}

html[data-ui-theme="modern"] .online-users-button,
html[data-ui-theme="modern"] .notification-bell-button,
html[data-ui-theme="modern"] .user-profile-button,
html[data-ui-theme="modern"] .icon-button {
    border-radius: var(--modern-control-radius);
}

html[data-ui-theme="modern"] .online-users-button,
html[data-ui-theme="modern"] .notification-bell-button {
    background: color-mix(in srgb, var(--surface) 92%, var(--blue-50));
    box-shadow: 0 1px 2px rgb(16 24 40 / .04);
}

html[data-ui-theme="modern"] .user-profile-button:hover,
html[data-ui-theme="modern"] .user-profile-button.is-open {
    border-color: color-mix(in srgb, var(--blue-500) 28%, var(--border));
    background: color-mix(in srgb, var(--blue-500) 6%, var(--surface));
}

html[data-ui-theme="modern"] .avatar {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    box-shadow: 0 7px 18px rgb(99 102 241 / .22);
}

html[data-ui-theme="modern"] .profile-menu,
html[data-ui-theme="modern"] .notification-panel,
html[data-ui-theme="modern"] .online-users-panel,
html[data-ui-theme="modern"] .account-actions-popover {
    border-radius: 18px;
    border-color: color-mix(in srgb, var(--blue-500) 14%, var(--border));
    box-shadow: 0 22px 56px rgb(15 23 42 / .18);
}

html.dark[data-ui-theme="modern"] .profile-menu,
html.dark[data-ui-theme="modern"] .notification-panel,
html.dark[data-ui-theme="modern"] .online-users-panel,
html.dark[data-ui-theme="modern"] .account-actions-popover {
    box-shadow: 0 24px 58px rgb(0 0 0 / .38);
}

html[data-ui-theme="modern"] .profile-menu-item .icon,
html[data-ui-theme="modern"] .settings-heading-icon,
html[data-ui-theme="modern"] .settings-navigation-item > span:first-child,
html[data-ui-theme="modern"] .settings-section-icon,
html[data-ui-theme="modern"] .section-icon,
html[data-ui-theme="modern"] .eyebrow {
    color: var(--blue-600);
}

html.dark[data-ui-theme="modern"] .profile-menu-item .icon,
html.dark[data-ui-theme="modern"] .settings-heading-icon,
html.dark[data-ui-theme="modern"] .settings-navigation-item > span:first-child,
html.dark[data-ui-theme="modern"] .settings-section-icon,
html.dark[data-ui-theme="modern"] .section-icon,
html.dark[data-ui-theme="modern"] .eyebrow {
    color: var(--blue-200);
}

html[data-ui-theme="modern"] .primary-button {
    border-color: #5b5fe8;
    border-radius: var(--modern-control-radius);
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: #ffffff;
    box-shadow: 0 8px 20px rgb(79 70 229 / .20);
}

html[data-ui-theme="modern"] .primary-button:hover {
    border-color: #4f46e5;
    background: linear-gradient(135deg, #7477f5, #5b52eb);
    box-shadow: 0 10px 24px rgb(79 70 229 / .25);
}

html[data-ui-theme="modern"] .secondary-button,
html[data-ui-theme="modern"] .small-button,
html[data-ui-theme="modern"] .topbar-link {
    border-radius: var(--modern-control-radius);
    background: color-mix(in srgb, var(--surface) 96%, var(--blue-50));
}

html[data-ui-theme="modern"] .secondary-button:hover,
html[data-ui-theme="modern"] .small-button:hover,
html[data-ui-theme="modern"] .topbar-link:hover {
    border-color: color-mix(in srgb, var(--blue-500) 45%, var(--border));
    color: var(--blue-600);
    background: color-mix(in srgb, var(--blue-500) 7%, var(--surface));
}

html.dark[data-ui-theme="modern"] .secondary-button:hover,
html.dark[data-ui-theme="modern"] .small-button:hover,
html.dark[data-ui-theme="modern"] .topbar-link:hover {
    color: var(--blue-200);
}

html[data-ui-theme="modern"] .form-field input,
html[data-ui-theme="modern"] .form-field textarea,
html[data-ui-theme="modern"] .form-field select,
html[data-ui-theme="modern"] .settings-field input,
html[data-ui-theme="modern"] .settings-field textarea,
html[data-ui-theme="modern"] .settings-field select,
html[data-ui-theme="modern"] .sidebar-search input {
    border-radius: var(--modern-control-radius);
}

html[data-ui-theme="modern"] .form-field input:focus,
html[data-ui-theme="modern"] .form-field textarea:focus,
html[data-ui-theme="modern"] .form-field select:focus,
html[data-ui-theme="modern"] .settings-input-unit:focus-within,
html[data-ui-theme="modern"] .settings-field > input[type="url"]:focus,
html[data-ui-theme="modern"] .settings-field > input[type="text"]:focus {
    border-color: var(--blue-500);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue-500) 18%, transparent);
}

html[data-ui-theme="modern"] .accounts-hero,
html[data-ui-theme="modern"] .positions-hero,
html[data-ui-theme="modern"] .menu-hero,
html[data-ui-theme="modern"] .invoice-hero,
html[data-ui-theme="modern"] .warehouse-hero,
html[data-ui-theme="modern"] .dashboard-kpi-card,
html[data-ui-theme="modern"] .dashboard-panel,
html[data-ui-theme="modern"] .settings-panel,
html[data-ui-theme="modern"] .settings-form,
html[data-ui-theme="modern"] .panel-notice,
html[data-ui-theme="modern"] .app-modal,
html[data-ui-theme="modern"] .invoice-product-card,
html[data-ui-theme="modern"] .sheet-viewer {
    border-radius: var(--modern-card-radius);
    border-color: color-mix(in srgb, var(--blue-500) 9%, var(--border));
    box-shadow: var(--shadow);
}

html[data-ui-theme="modern"] .accounts-hero,
html[data-ui-theme="modern"] .positions-hero,
html[data-ui-theme="modern"] .menu-hero,
html[data-ui-theme="modern"] .invoice-hero,
html[data-ui-theme="modern"] .warehouse-hero {
    background:
        radial-gradient(circle at 94% -18%, color-mix(in srgb, var(--blue-500) 13%, transparent), transparent 34%),
        var(--surface);
}

html[data-ui-theme="modern"] .dashboard-kpi-card {
    background: linear-gradient(145deg, color-mix(in srgb, var(--surface) 96%, var(--blue-50)), var(--surface));
}

html[data-ui-theme="modern"] .dashboard-kpi-card:hover {
    border-color: color-mix(in srgb, var(--blue-500) 38%, var(--border));
    box-shadow: 0 18px 38px rgb(16 24 40 / .10);
}

html.dark[data-ui-theme="modern"] .dashboard-kpi-card:hover {
    box-shadow: 0 18px 38px rgb(0 0 0 / .28);
}

html[data-ui-theme="modern"] .dashboard-kpi-icon,
html[data-ui-theme="modern"] .metric-icon,
html[data-ui-theme="modern"] .activity-icon,
html[data-ui-theme="modern"] .quick-icon,
html[data-ui-theme="modern"] .category-icon,
html[data-ui-theme="modern"] .invoice-hero-icon,
html[data-ui-theme="modern"] .invoice-row-icon,
html[data-ui-theme="modern"] .invoice-product-icon {
    color: var(--blue-600);
    background: color-mix(in srgb, var(--blue-500) 10%, var(--surface));
}

html.dark[data-ui-theme="modern"] .dashboard-kpi-icon,
html.dark[data-ui-theme="modern"] .metric-icon,
html.dark[data-ui-theme="modern"] .activity-icon,
html.dark[data-ui-theme="modern"] .quick-icon,
html.dark[data-ui-theme="modern"] .category-icon,
html.dark[data-ui-theme="modern"] .invoice-hero-icon,
html.dark[data-ui-theme="modern"] .invoice-row-icon,
html.dark[data-ui-theme="modern"] .invoice-product-icon {
    color: var(--blue-200);
}

html[data-ui-theme="modern"] .accounts-table,
html[data-ui-theme="modern"] .table-wrap {
    border-radius: 16px;
}

html[data-ui-theme="modern"] .accounts-table th {
    color: var(--text-secondary);
    background: color-mix(in srgb, var(--surface-soft) 92%, var(--blue-50));
    font-size: .7rem;
    letter-spacing: .055em;
}

html[data-ui-theme="modern"] .accounts-table tbody tr:hover td,
html[data-ui-theme="modern"] table tbody tr:hover td {
    background: color-mix(in srgb, var(--blue-500) 5%, var(--surface));
}

html[data-ui-theme="modern"] .status-badge.info,
html[data-ui-theme="modern"] .dark .status-badge.info {
    background: color-mix(in srgb, var(--blue-500) 12%, var(--surface));
    color: var(--blue-600);
}

html.dark[data-ui-theme="modern"] .status-badge.info {
    color: var(--blue-200);
}

html[data-ui-theme="modern"] .settings-navigation-item {
    border-radius: 12px;
}

html[data-ui-theme="modern"] .settings-navigation-item.active {
    background: color-mix(in srgb, var(--blue-500) 9%, var(--surface));
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--blue-500) 25%, var(--border));
}

html[data-ui-theme="modern"] .settings-section-block-highlight,
html[data-ui-theme="modern"] .settings-switch-primary,
html[data-ui-theme="modern"] .settings-info-box {
    background: color-mix(in srgb, var(--blue-500) 5%, var(--surface));
}

html[data-ui-theme="modern"] .app-modal-backdrop {
    background: rgb(15 23 42 / .52);
    backdrop-filter: blur(7px);
}

html[data-ui-theme="modern"] .app-modal {
    box-shadow: 0 28px 80px rgb(15 23 42 / .24);
}

html.dark[data-ui-theme="modern"] .app-modal {
    box-shadow: 0 30px 90px rgb(0 0 0 / .45);
}

html[data-ui-theme="modern"] .app-modal-eyebrow,
html[data-ui-theme="modern"] .invoice-card-metric.invoice-card-total strong,
html[data-ui-theme="modern"] .invoice-total-final dd,
html[data-ui-theme="modern"] .work-entry-amount strong,
html[data-ui-theme="modern"] .menu-current-price strong,
html[data-ui-theme="modern"] .menu-product-price,
html[data-ui-theme="modern"] .account-position-label,
html[data-ui-theme="modern"] .position-meta .icon,
html[data-ui-theme="modern"] .auth-back-link {
    color: var(--blue-600);
}

html.dark[data-ui-theme="modern"] .app-modal-eyebrow,
html.dark[data-ui-theme="modern"] .invoice-card-metric.invoice-card-total strong,
html.dark[data-ui-theme="modern"] .invoice-total-final dd,
html.dark[data-ui-theme="modern"] .work-entry-amount strong,
html.dark[data-ui-theme="modern"] .menu-current-price strong,
html.dark[data-ui-theme="modern"] .menu-product-price,
html.dark[data-ui-theme="modern"] .account-position-label,
html.dark[data-ui-theme="modern"] .position-meta .icon,
html.dark[data-ui-theme="modern"] .auth-back-link {
    color: var(--blue-200);
}

html[data-ui-theme="modern"] .app-notification {
    border-radius: 16px;
    box-shadow: 0 20px 54px rgb(15 23 42 / .18);
}

html[data-ui-theme="modern"] .profile-ui-theme-option.is-active {
    border-color: color-mix(in srgb, var(--blue-500) 62%, var(--border));
    background: color-mix(in srgb, var(--blue-500) 9%, var(--surface));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue-500) 10%, transparent);
}

html[data-ui-theme="modern"] .profile-ui-theme-option.is-active .profile-ui-theme-preview {
    border-color: color-mix(in srgb, var(--blue-500) 55%, var(--border));
}

html[data-ui-theme="modern"] .profile-ui-theme-preview[data-ui-preview="modern"] {
    background: linear-gradient(135deg, #101827 0 30%, #f7f9fc 30% 100%);
}

html.dark[data-ui-theme="modern"] .profile-ui-theme-preview[data-ui-preview="modern"] {
    background: linear-gradient(135deg, #070b12 0 30%, #111827 30% 100%);
}

@media (max-width: 720px) {
    html[data-ui-theme="modern"] .brand-mark.brand-logo {
        width: 46px;
        height: 46px;
        border-radius: 13px;
    }

    html[data-ui-theme="modern"] .main-content {
        padding-inline: 14px;
    }
}


/* 4.58.1 — pełne odcięcie motywu Modern od starej palety Paleto Bay.
   Kolory semantyczne (success/warning/danger) pozostają celowo bez zmian. */
html[data-ui-theme="modern"] .welcome-panel {
    background:
        radial-gradient(circle at 88% 20%, color-mix(in srgb, var(--blue-500) 10%, transparent), transparent 30%),
        linear-gradient(135deg, color-mix(in srgb, var(--blue-500) 7%, var(--surface)) 0%, var(--surface-soft) 58%, var(--surface) 100%);
}

html.dark[data-ui-theme="modern"] .welcome-panel {
    background:
        radial-gradient(circle at 88% 20%, color-mix(in srgb, var(--blue-500) 12%, transparent), transparent 30%),
        linear-gradient(135deg, var(--surface) 0%, color-mix(in srgb, var(--blue-500) 4%, var(--surface)) 55%, var(--surface-soft) 100%);
}

html[data-ui-theme="modern"] .online-user-avatar {
    color: #ffffff;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    box-shadow: 0 7px 18px rgb(99 102 241 / .20);
}

html[data-ui-theme="modern"] .general-log-changes pre {
    background: color-mix(in srgb, var(--surface-soft) 82%, #050812);
    color: var(--text);
    border: 1px solid var(--border);
}

html.dark[data-ui-theme="modern"] .general-log-filters .form-field input,
html.dark[data-ui-theme="modern"] .general-log-filters .form-field select {
    background-color: var(--surface-soft) !important;
}

html[data-ui-theme="modern"] .collaboration-filter-panel select:focus {
    border-color: var(--blue-500);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue-500) 18%, transparent);
}

html[data-ui-theme="modern"] .auth-back-link,
html[data-ui-theme="modern"] .invoice-drawer-heading-icon,
html[data-ui-theme="modern"] .invoice-drawer-footer-total strong,
html[data-ui-theme="modern"] .invoice-card-metric.invoice-card-total strong,
html[data-ui-theme="modern"] .invoice-total-final dd,
html[data-ui-theme="modern"] .work-entry-amount strong,
html[data-ui-theme="modern"] .menu-current-price strong,
html[data-ui-theme="modern"] .menu-product-price,
html[data-ui-theme="modern"] .account-position-label,
html[data-ui-theme="modern"] .position-meta .icon {
    color: var(--blue-600);
}

html.dark[data-ui-theme="modern"] .auth-back-link,
html.dark[data-ui-theme="modern"] .invoice-drawer-heading-icon,
html.dark[data-ui-theme="modern"] .invoice-drawer-footer-total strong,
html.dark[data-ui-theme="modern"] .invoice-card-metric.invoice-card-total strong,
html.dark[data-ui-theme="modern"] .invoice-total-final dd,
html.dark[data-ui-theme="modern"] .work-entry-amount strong,
html.dark[data-ui-theme="modern"] .menu-current-price strong,
html.dark[data-ui-theme="modern"] .menu-product-price,
html.dark[data-ui-theme="modern"] .account-position-label,
html.dark[data-ui-theme="modern"] .position-meta .icon {
    color: var(--blue-200);
}

html[data-ui-theme="modern"] .date-pill,
html[data-ui-theme="modern"] .permission-count,
html[data-ui-theme="modern"] .position-rank,
html[data-ui-theme="modern"] .avatar.small {
    border-color: color-mix(in srgb, var(--blue-500) 20%, var(--border));
}

html.dark[data-ui-theme="modern"] .date-pill,
html.dark[data-ui-theme="modern"] .permission-count,
html.dark[data-ui-theme="modern"] .position-rank {
    color: var(--text-secondary);
    border-color: color-mix(in srgb, var(--blue-500) 22%, var(--border));
    background: color-mix(in srgb, var(--blue-500) 9%, var(--surface));
}

html.dark[data-ui-theme="modern"] .scheduled-rate,
html.dark[data-ui-theme="modern"] .menu-rank,
html.dark[data-ui-theme="modern"] .menu-current-price,
html.dark[data-ui-theme="modern"] .menu-archive-heading > span,
html.dark[data-ui-theme="modern"] .invoice-status-tabs a:hover,
html.dark[data-ui-theme="modern"] .invoice-status-tabs a.active,
html.dark[data-ui-theme="modern"] .status-badge.info,
html.dark[data-ui-theme="modern"] .demo-badge,
html.dark[data-ui-theme="modern"] .construction-badge {
    background: color-mix(in srgb, var(--blue-500) 11%, var(--surface));
    color: var(--blue-200);
}

html[data-ui-theme="modern"] .sidebar-link:focus-visible,
html[data-ui-theme="modern"] .sidebar-group-toggle:focus-visible,
html[data-ui-theme="modern"] .sidebar-submenu-link:focus-visible,
html[data-ui-theme="modern"] .sidebar-search input:focus-visible,
html[data-ui-theme="modern"] .icon-button:focus-visible,
html[data-ui-theme="modern"] .theme-button:focus-visible,
html[data-ui-theme="modern"] .quick-links a:focus-visible,
html[data-ui-theme="modern"] .primary-button:focus-visible,
html[data-ui-theme="modern"] .app-modal button:focus-visible,
html[data-ui-theme="modern"] .permission-category-check input:focus-visible + span,
html[data-ui-theme="modern"] .permission-item-check input:focus-visible + span {
    outline-color: color-mix(in srgb, var(--blue-500) 55%, transparent);
}

html[data-ui-theme="modern"] .accounts-primary-action,
html[data-ui-theme="modern"] .accounts-tabs a.active,
html[data-ui-theme="modern"] .account-form-avatar,
html[data-ui-theme="modern"] .permission-category-check input:checked + span,
html[data-ui-theme="modern"] .permission-item-check input:checked + span,
html[data-ui-theme="modern"] .permission-category-check input:indeterminate + span {
    box-shadow: 0 8px 20px color-mix(in srgb, var(--blue-500) 18%, transparent);
}

html[data-ui-theme="modern"] .account-search:focus-within,
html[data-ui-theme="modern"] .permission-group:focus-within {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue-500) 14%, transparent);
}


html.dark[data-ui-theme="modern"] .general-log-filters .form-field input:focus,
html.dark[data-ui-theme="modern"] .general-log-filters .form-field select:focus {
    border-color: var(--resto-outline-focus) !important;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue-500) 18%, transparent) !important;
}

/* 4.58.2 — domknięcie pozostałych akcentów Klasycznego w Modern.
   Kolory statusów semantycznych pozostają odrębne, natomiast dekoracyjne złote
   etykiety, aktywne grupy nawigacji i akcje pomocnicze korzystają z palety Modern. */
html[data-ui-theme="modern"] .section-kicker {
    color: var(--blue-600);
}

html.dark[data-ui-theme="modern"] .section-kicker {
    color: var(--blue-200);
}

html[data-ui-theme="modern"] .invoice-rejection-box .section-kicker,
html[data-ui-theme="modern"] .form-alert-error .section-kicker {
    color: #dc2626;
}

html.dark[data-ui-theme="modern"] .invoice-rejection-box .section-kicker,
html.dark[data-ui-theme="modern"] .form-alert-error .section-kicker {
    color: #fca5a5;
}

html[data-ui-theme="modern"] .welcome-panel {
    border-color: color-mix(in srgb, var(--blue-500) 18%, var(--border));
}

html[data-ui-theme="modern"] .date-pill {
    color: var(--blue-600);
    background: color-mix(in srgb, var(--blue-500) 7%, var(--surface));
}

html.dark[data-ui-theme="modern"] .date-pill {
    color: var(--blue-200);
}

html[data-ui-theme="modern"] .permission-count span {
    color: var(--blue-600);
}

html.dark[data-ui-theme="modern"] .permission-count span {
    color: var(--blue-200);
}

html[data-ui-theme="modern"] .permission-bulk-button:hover {
    border-color: var(--blue-500);
    background: color-mix(in srgb, var(--blue-500) 8%, var(--surface));
    color: var(--blue-600);
}

html.dark[data-ui-theme="modern"] .permission-bulk-button:hover {
    color: var(--blue-200);
}

html.dark[data-ui-theme="modern"] .panel-notice {
    border-color: color-mix(in srgb, var(--blue-500) 30%, var(--border));
    background: color-mix(in srgb, var(--blue-500) 9%, var(--surface));
    color: var(--blue-200);
}

html[data-ui-theme="modern"] .sidebar-group.open .sidebar-group-copy strong,
html[data-ui-theme="modern"] .sidebar-group-toggle:hover .sidebar-group-copy strong {
    color: #ffffff;
}

html[data-ui-theme="modern"] .sidebar-group.open .sidebar-group-copy small,
html[data-ui-theme="modern"] .sidebar-group-toggle:hover .sidebar-group-copy small {
    color: #aeb8ca;
}

html[data-ui-theme="modern"] .group-chevron {
    color: #8996aa;
    background: color-mix(in srgb, var(--blue-500) 7%, var(--sidebar-surface));
}

html[data-ui-theme="modern"] .sidebar-group.open .group-chevron,
html[data-ui-theme="modern"] .sidebar-group-toggle:hover .group-chevron {
    color: #c7d2fe;
    background: color-mix(in srgb, var(--blue-500) 13%, var(--sidebar-surface));
}

html[data-ui-theme="modern"] .sidebar-submenu-link {
    color: #b7c1d1;
}

html[data-ui-theme="modern"] .sidebar-submenu-link:hover {
    color: #f8fafc;
}

html[data-ui-theme="modern"] .sidebar-submenu-link.active {
    color: #ffffff;
}

/* W blokerze dziennego wpisu sam stan jest już czerwony, dlatego akcja nawigacyjna
   nie potrzebuje dodatkowego klasycznego bursztynowego akcentu. */
html[data-ui-theme="modern"] .account-balance-invoice-blocker .warning-button {
    border-color: color-mix(in srgb, var(--blue-500) 44%, var(--border));
    background: color-mix(in srgb, var(--blue-500) 10%, var(--surface));
    color: var(--blue-600);
    border-radius: var(--modern-control-radius);
    box-shadow: 0 7px 18px color-mix(in srgb, var(--blue-500) 12%, transparent);
}

html[data-ui-theme="modern"] .account-balance-invoice-blocker .warning-button:hover {
    border-color: color-mix(in srgb, var(--blue-500) 68%, var(--border));
    background: color-mix(in srgb, var(--blue-500) 15%, var(--surface));
    color: var(--blue-700);
}

html.dark[data-ui-theme="modern"] .account-balance-invoice-blocker .warning-button {
    color: var(--blue-200);
}

html.dark[data-ui-theme="modern"] .account-balance-invoice-blocker .warning-button:hover {
    color: #eef2ff;
}

/* 4.58.7 — stany oczekujące i przypomnienia w Modern korzystają z jednego
   akcentu indigo. Czerwony pozostaje zarezerwowany dla błędów, odrzuceń
   i akcji niebezpiecznych. */
html[data-ui-theme="modern"] .status-badge.status-warning {
    color: var(--blue-700);
    background: color-mix(in srgb, var(--blue-500) 11%, var(--surface));
    border-color: color-mix(in srgb, var(--blue-500) 22%, transparent);
}

html[data-ui-theme="modern"] .status-badge.status-warning > span {
    background: var(--blue-500);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue-500) 14%, transparent);
}

html.dark[data-ui-theme="modern"] .status-badge.status-warning {
    color: var(--blue-200);
    background: color-mix(in srgb, var(--blue-500) 16%, var(--surface));
    border-color: color-mix(in srgb, var(--blue-500) 30%, transparent);
}

html[data-ui-theme="modern"] .topbar-balance-reminder {
    border-color: color-mix(in srgb, var(--blue-500) 34%, var(--border));
    background: color-mix(in srgb, var(--blue-500) 7%, var(--surface));
    box-shadow: 0 8px 22px color-mix(in srgb, var(--blue-500) 8%, transparent);
}

html[data-ui-theme="modern"] .topbar-balance-reminder:hover {
    border-color: color-mix(in srgb, var(--blue-500) 54%, var(--border));
    background: color-mix(in srgb, var(--blue-500) 11%, var(--surface));
}

html[data-ui-theme="modern"] .topbar-balance-reminder:focus-visible {
    outline-color: color-mix(in srgb, var(--blue-500) 58%, #ffffff);
}

html[data-ui-theme="modern"] .global-balance-reminder-icon {
    color: var(--blue-600);
    background: color-mix(in srgb, var(--blue-500) 11%, transparent);
}

html.dark[data-ui-theme="modern"] .topbar-balance-reminder {
    border-color: color-mix(in srgb, var(--blue-500) 34%, var(--border));
    background: color-mix(in srgb, var(--blue-500) 9%, var(--surface));
    box-shadow: 0 8px 22px color-mix(in srgb, var(--blue-500) 8%, transparent);
}

html.dark[data-ui-theme="modern"] .topbar-balance-reminder:hover {
    border-color: color-mix(in srgb, var(--blue-500) 52%, var(--border));
    background: color-mix(in srgb, var(--blue-500) 13%, var(--surface));
}

html.dark[data-ui-theme="modern"] .global-balance-reminder-icon {
    color: var(--blue-200);
    background: color-mix(in srgb, var(--blue-500) 13%, transparent);
}



/* Dashboard Modern 4.58.7 — action-required states share the indigo Modern accent. */
html[data-ui-theme="modern"] .dashboard-command-status.has-attention {
    border-color: color-mix(in srgb, var(--dashboard-attention-fill) 30%, var(--border));
    background: color-mix(in srgb, var(--dashboard-attention-fill) 4%, var(--surface));
}

html[data-ui-theme="modern"] .dashboard-command-status.has-attention .dashboard-command-status-icon,
html[data-ui-theme="modern"] .dashboard-kpi-card.tone-warning .dashboard-kpi-icon,
html[data-ui-theme="modern"] .dashboard-attention-count.has-items,
html[data-ui-theme="modern"] .dashboard-attention-row.tone-warning .dashboard-attention-row-icon,
html[data-ui-theme="modern"] .dashboard-attention-item.tone-warning .dashboard-item-icon {
    background: color-mix(in srgb, var(--dashboard-attention-fill) 12%, var(--surface));
    color: var(--dashboard-attention-text);
}

html[data-ui-theme="modern"] .dashboard-kpi-card.tone-warning::after {
    background: color-mix(in srgb, var(--dashboard-attention-fill) 7%, transparent);
}

html[data-ui-theme="modern"] .dashboard-attention-count.has-items {
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--dashboard-attention-fill) 16%, transparent);
}

html[data-ui-theme="modern"] .dashboard-attention-row.tone-warning:hover {
    border-color: color-mix(in srgb, var(--dashboard-attention-fill) 28%, var(--border));
}

/* 4.58.8 — pełny audit palety Modern.
   Wszystkie niebłędne stany operacyjne i legacy komponenty korzystają z indigo/neutral,
   a publiczna rekrutacja pozostaje poza systemem Modern. */
html[data-ui-theme="modern"] {
    --accent-text: #ffffff;
    --modern-attention: var(--blue-500);
    --modern-attention-strong: var(--blue-600);
    --modern-attention-soft: color-mix(in srgb, var(--blue-500) 11%, var(--surface));
}

html.dark[data-ui-theme="modern"] {
    --accent-text: #ffffff;
    --modern-attention: var(--blue-500);
    --modern-attention-strong: var(--blue-200);
    --modern-attention-soft: color-mix(in srgb, var(--blue-500) 15%, var(--surface));
}

/* Legacy badges: pending / inactive / warning are attention states, not errors. */
html[data-ui-theme="modern"] .status-badge.warning,
html[data-ui-theme="modern"] .status-badge.status-warning,
html[data-ui-theme="modern"] .status-badge.status-inactive,
html[data-ui-theme="modern"] .status-badge-warning,
html[data-ui-theme="modern"] .status-pending,
html[data-ui-theme="modern"] .status-review {
    border-color: color-mix(in srgb, var(--blue-500) 24%, var(--border));
    background: var(--modern-attention-soft);
    color: var(--modern-attention-strong);
}

html[data-ui-theme="modern"] .status-badge.warning::before,
html[data-ui-theme="modern"] .status-badge.status-warning::before,
html[data-ui-theme="modern"] .status-badge.status-inactive::before,
html[data-ui-theme="modern"] .status-badge.status-inactive > span,
html[data-ui-theme="modern"] .status-badge.status-warning > span {
    background: var(--modern-attention);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue-500) 14%, transparent);
}

html.dark[data-ui-theme="modern"] .status-badge.muted {
    background: color-mix(in srgb, var(--surface-hover) 82%, var(--surface));
    color: var(--text-secondary);
}

/* Standard warnings in Modern intentionally use the interface accent. Danger/error remains red. */
html[data-ui-theme="modern"] .form-alert-warning,
html[data-ui-theme="modern"] .session-timeout-unsaved {
    border-color: color-mix(in srgb, var(--blue-500) 32%, var(--border));
    background: color-mix(in srgb, var(--blue-500) 8%, var(--surface));
    color: var(--text);
}

html[data-ui-theme="modern"] .warning-button {
    border-color: color-mix(in srgb, var(--blue-500) 42%, var(--border));
    background: color-mix(in srgb, var(--blue-500) 9%, var(--surface));
    color: var(--blue-600);
    border-radius: var(--modern-control-radius);
}

html[data-ui-theme="modern"] .warning-button:hover {
    border-color: color-mix(in srgb, var(--blue-500) 64%, var(--border));
    background: color-mix(in srgb, var(--blue-500) 14%, var(--surface));
    color: var(--blue-700);
}

html.dark[data-ui-theme="modern"] .warning-button,
html.dark[data-ui-theme="modern"] .warning-button:hover {
    color: var(--blue-200);
}

html[data-ui-theme="modern"] .auth-card-icon-warning,
html[data-ui-theme="modern"] .section-icon-warning,
html[data-ui-theme="modern"] .app-modal:not(.app-modal-danger) .app-modal-icon,
html[data-ui-theme="modern"] .general-log-result-warning {
    border-color: color-mix(in srgb, var(--blue-500) 24%, var(--border));
    background: color-mix(in srgb, var(--blue-500) 11%, var(--surface));
    color: var(--blue-600);
}

html.dark[data-ui-theme="modern"] .auth-card-icon-warning,
html.dark[data-ui-theme="modern"] .section-icon-warning,
html.dark[data-ui-theme="modern"] .app-modal:not(.app-modal-danger) .app-modal-icon,
html.dark[data-ui-theme="modern"] .general-log-result-warning {
    color: var(--blue-200);
}

html[data-ui-theme="modern"] .blocked-action-button .icon {
    color: var(--blue-600);
}

html.dark[data-ui-theme="modern"] .blocked-action-button .icon {
    color: var(--blue-200);
}

/* Balance reminder (non-error), discount labels and notification icons. */
html[data-ui-theme="modern"] .account-balance-reminder:not(.account-balance-invoice-blocker) {
    border-color: color-mix(in srgb, var(--blue-500) 30%, var(--border));
    background: color-mix(in srgb, var(--blue-500) 7%, var(--surface));
}

html[data-ui-theme="modern"] .account-balance-reminder:not(.account-balance-invoice-blocker) > span {
    color: var(--blue-600);
    background: color-mix(in srgb, var(--blue-500) 11%, transparent);
}

html.dark[data-ui-theme="modern"] .account-balance-reminder:not(.account-balance-invoice-blocker) > span {
    color: var(--blue-200);
}

html[data-ui-theme="modern"] .invoice-discount-badge:not(.invoice-package-badge) {
    border-color: color-mix(in srgb, var(--blue-500) 30%, var(--border));
    background: color-mix(in srgb, var(--blue-500) 9%, var(--surface));
    color: var(--blue-600);
}

html.dark[data-ui-theme="modern"] .invoice-discount-badge:not(.invoice-package-badge) {
    border-color: color-mix(in srgb, var(--blue-500) 34%, var(--border));
    background: color-mix(in srgb, var(--blue-500) 13%, var(--surface));
    color: var(--blue-200);
}

html[data-ui-theme="modern"] .notification-type-icon {
    background: color-mix(in srgb, var(--blue-500) 10%, var(--surface));
    color: var(--blue-600);
}

html.dark[data-ui-theme="modern"] .notification-type-icon {
    color: var(--blue-200);
}

html[data-ui-theme="modern"] .notification-panel-actions button:not(.danger),
html[data-ui-theme="modern"] .notification-panel > header a,
html[data-ui-theme="modern"] .button-link:not(.danger) {
    color: var(--blue-600);
}

html.dark[data-ui-theme="modern"] .notification-panel-actions button:not(.danger),
html.dark[data-ui-theme="modern"] .notification-panel > header a,
html.dark[data-ui-theme="modern"] .button-link:not(.danger) {
    color: var(--blue-200);
}

/* Session, FiveM and maintenance attention states. */
html[data-ui-theme="modern"] .session-timeout-card {
    border-color: color-mix(in srgb, var(--blue-500) 34%, var(--border));
}

html[data-ui-theme="modern"] .session-timeout-icon {
    color: var(--blue-600);
    background: color-mix(in srgb, var(--blue-500) 12%, transparent);
}

html.dark[data-ui-theme="modern"] .session-timeout-icon {
    color: var(--blue-200);
}

html[data-ui-theme="modern"] .session-timeout-progress::-webkit-progress-value,
html[data-ui-theme="modern"] .session-timeout-progress::-moz-progress-bar {
    background: var(--blue-500);
}

html[data-ui-theme="modern"] .fivem-users-button.is-unavailable .online-users-status-dot,
html[data-ui-theme="modern"] .fivem-status-card-icon i {
    background: var(--blue-500);
}

html[data-ui-theme="modern"] .fivem-status-card.status-online .fivem-status-card-icon i {
    background: #22c55e;
}

/* Medium-risk is an attention state in Modern; low/high retain success/danger semantics. */
html[data-ui-theme="modern"] .risk-medium {
    color: var(--blue-600);
    border-color: color-mix(in srgb, var(--blue-500) 28%, var(--border));
    background: color-mix(in srgb, var(--blue-500) 9%, var(--surface));
}

html.dark[data-ui-theme="modern"] .risk-medium {
    color: var(--blue-200);
}

/* App warning surfaces use blue; errors/danger actions are not touched. */
html[data-ui-theme="modern"] .app-notification-warning {
    border-color: color-mix(in srgb, var(--blue-500) 34%, var(--border));
}

html[data-ui-theme="modern"] .app-notification-warning .app-notification-icon {
    background: color-mix(in srgb, var(--blue-500) 11%, var(--surface));
    color: var(--blue-600);
}

html.dark[data-ui-theme="modern"] .app-notification-warning .app-notification-icon {
    color: var(--blue-200);
}

html[data-ui-theme="modern"] .app-modal-warning .danger-button {
    border-color: var(--blue-600);
    background: var(--blue-600);
    box-shadow: 0 8px 18px color-mix(in srgb, var(--blue-500) 20%, transparent);
}

html[data-ui-theme="modern"] .app-modal-warning .danger-button:hover {
    border-color: var(--blue-700);
    background: var(--blue-700);
}

/* Login/setup/password/maintenance auth shell. Public recruitment never receives data-ui-theme=modern. */
html[data-ui-theme="modern"] .auth-body {
    background:
        radial-gradient(circle at 16% 12%, color-mix(in srgb, var(--blue-500) 15%, transparent), transparent 30%),
        radial-gradient(circle at 86% 88%, color-mix(in srgb, var(--blue-500) 7%, transparent), transparent 30%),
        var(--page-bg);
}

html[data-ui-theme="modern"] .auth-topbar {
    border-bottom-color: color-mix(in srgb, var(--blue-500) 14%, var(--border));
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    box-shadow: 0 1px 0 rgb(16 24 40 / .03);
    backdrop-filter: blur(16px) saturate(145%);
}

html.dark[data-ui-theme="modern"] .auth-topbar {
    background: rgb(12 18 30 / .86);
}

html[data-ui-theme="modern"] .auth-brand .brand-mark.brand-logo {
    border-color: rgb(129 140 248 / .36);
    background: #0a0f19;
    box-shadow: 0 10px 26px rgb(0 0 0 / .18), 0 0 0 3px rgb(99 102 241 / .07);
}

html[data-ui-theme="modern"] .auth-card {
    border-color: color-mix(in srgb, var(--blue-500) 15%, var(--border));
    border-radius: var(--modern-card-radius);
    background: color-mix(in srgb, var(--surface) 98%, var(--blue-50));
    box-shadow: 0 24px 70px rgb(15 23 42 / .12);
}

html.dark[data-ui-theme="modern"] .auth-card {
    background: color-mix(in srgb, var(--surface) 97%, var(--blue-500));
    box-shadow: 0 28px 78px rgb(0 0 0 / .38);
}

html[data-ui-theme="modern"] .auth-card-branded::before {
    background: linear-gradient(90deg, #4338ca, #818cf8, #4338ca);
}

html[data-ui-theme="modern"] .auth-seal {
    filter: drop-shadow(0 12px 20px rgb(15 23 42 / .18));
}

html[data-ui-theme="modern"] .auth-card-icon,
html[data-ui-theme="modern"] .auth-card-branded .auth-card-icon {
    border-color: color-mix(in srgb, var(--blue-500) 26%, var(--border));
    background: color-mix(in srgb, var(--blue-500) 10%, var(--surface));
    color: var(--blue-600);
}

html.dark[data-ui-theme="modern"] .auth-card-icon,
html.dark[data-ui-theme="modern"] .auth-card-branded .auth-card-icon {
    color: var(--blue-200);
}

html[data-ui-theme="modern"] .auth-form .form-field input,
html[data-ui-theme="modern"] .auth-form .form-field textarea,
html[data-ui-theme="modern"] .auth-form .form-field select {
    border-radius: var(--modern-control-radius);
    border-color: color-mix(in srgb, var(--blue-500) 12%, var(--border-strong));
    background: color-mix(in srgb, var(--surface-soft) 94%, var(--blue-50));
}

html[data-ui-theme="modern"] .auth-form .form-field input:focus,
html[data-ui-theme="modern"] .auth-form .form-field textarea:focus,
html[data-ui-theme="modern"] .auth-form .form-field select:focus {
    border-color: var(--blue-500);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue-500) 16%, transparent);
}

html[data-ui-theme="modern"] .auth-security-note .icon,
html[data-ui-theme="modern"] .auth-instructions code,
html[data-ui-theme="modern"] .auth-back-link {
    color: var(--blue-600);
}

html.dark[data-ui-theme="modern"] .auth-security-note .icon,
html.dark[data-ui-theme="modern"] .auth-instructions code,
html.dark[data-ui-theme="modern"] .auth-back-link {
    color: var(--blue-200);
}

html[data-ui-theme="modern"] .auth-theme-button {
    border-color: color-mix(in srgb, var(--blue-500) 18%, var(--border));
    background: color-mix(in srgb, var(--blue-500) 5%, var(--surface));
}

html[data-ui-theme="modern"] .auth-theme-button:hover {
    border-color: color-mix(in srgb, var(--blue-500) 38%, var(--border));
    background: color-mix(in srgb, var(--blue-500) 9%, var(--surface));
}

html[data-ui-theme="modern"] .auth-footer {
    color: var(--text-faint);
}

/* 4.59.0 — statystyka użycia motywów w menu użytkownika. */
html[data-ui-theme="modern"] .profile-theme-usage-card.is-modern {
    border-color: color-mix(in srgb, var(--blue-500) 42%, var(--border));
    background: color-mix(in srgb, var(--blue-500) 10%, var(--surface));
}

html[data-ui-theme="modern"] .profile-theme-usage-card.is-modern > strong,
html[data-ui-theme="modern"] .profile-theme-usage-progress {
    color: var(--blue-500);
}

