:root {
    --erp-primary: #2563eb;
    --erp-primary-hover: #1d4ed8;
    --erp-secondary: #10b981;
    --erp-secondary-hover: #059669;
    --erp-bg: #f8fafc;
    --erp-surface: #ffffff;
    --erp-surface-soft: #f1f5f9;
    --erp-sidebar: #111827;
    --erp-sidebar-deep: #0b1220;
    --erp-text: #1f2937;
    --erp-muted: #64748b;
    --erp-border: #e5e7eb;
    --erp-warning: #f59e0b;
    --erp-danger: #ef4444;
    --erp-success: #10b981;
    --erp-radius-sm: 10px;
    --erp-radius-md: 14px;
    --erp-radius-lg: 18px;
    --erp-shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.06);
    --erp-shadow-md: 0 18px 35px -24px rgba(15, 23, 42, 0.45);
    --erp-shadow-lg: 0 30px 60px -35px rgba(15, 23, 42, 0.5);
}

:root[data-theme="dark"] {
    --erp-bg: #0b1220;
    --erp-surface: #111827;
    --erp-surface-soft: #0f172a;
    --erp-text: #e5e7eb;
    --erp-muted: #93a4bd;
    --erp-border: #334155;
}

html[data-theme="dark"] {
    color-scheme: dark;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body.erp-body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 12% -10%, rgba(37, 99, 235, 0.18), transparent 42%),
        radial-gradient(circle at 88% 0%, rgba(16, 185, 129, 0.14), transparent 40%),
        var(--erp-bg);
    color: var(--erp-text);
    font-family: "Plus Jakarta Sans", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    text-rendering: optimizeLegibility;
    -webkit-tap-highlight-color: transparent;
    overscroll-behavior-y: contain;
}

html[data-theme="dark"] body.erp-body {
    background:
        radial-gradient(circle at 12% -10%, rgba(37, 99, 235, 0.2), transparent 42%),
        radial-gradient(circle at 88% 0%, rgba(16, 185, 129, 0.16), transparent 40%),
        var(--erp-bg);
}

.erp-bg-orb {
    position: fixed;
    border-radius: 999px;
    pointer-events: none;
    filter: blur(14px);
    z-index: 0;
}

.erp-bg-orb-1 {
    width: 340px;
    height: 340px;
    left: -120px;
    top: -120px;
    background: rgba(37, 99, 235, 0.16);
}

.erp-bg-orb-2 {
    width: 280px;
    height: 280px;
    right: -80px;
    top: 180px;
    background: rgba(16, 185, 129, 0.14);
}

html[data-theme="dark"] .erp-bg-orb-1 {
    background: rgba(37, 99, 235, 0.22);
}

html[data-theme="dark"] .erp-bg-orb-2 {
    background: rgba(16, 185, 129, 0.2);
}

.erp-bg-grid {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.18;
    background-image:
        linear-gradient(rgba(148, 163, 184, 0.2) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.2) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(circle at center, black 30%, transparent 85%);
}

html[data-theme="dark"] .erp-bg-grid {
    opacity: 0.14;
    background-image:
        linear-gradient(rgba(148, 163, 184, 0.14) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.14) 1px, transparent 1px);
}

.erp-shell {
    position: relative;
    z-index: 1;
    display: flex;
    min-height: 100vh;
}

.erp-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 280px;
    background: linear-gradient(180deg, var(--erp-sidebar-deep) 0%, var(--erp-sidebar) 62%, #0d1322 100%);
    color: #dbe3ef;
    z-index: 1050;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    transition: transform 0.26s ease, width 0.22s ease;
    border-right: 1px solid rgba(148, 163, 184, 0.2);
    box-shadow: 16px 0 40px -28px rgba(2, 6, 23, 0.75);
}

.erp-sidebar::-webkit-scrollbar {
    width: 9px;
}

.erp-sidebar::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.3);
    border-radius: 999px;
}

.erp-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1.1rem 1rem 0.95rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
    color: #f8fafc;
    text-decoration: none;
}

.erp-sidebar-brand:hover {
    color: #ffffff;
}

.erp-brand-logo {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    object-fit: contain;
    background: #ffffff;
    border: 1px solid rgba(148, 163, 184, 0.45);
    padding: 3px;
    box-shadow: 0 8px 20px -14px rgba(2, 6, 23, 0.9);
}

.erp-brand-fallback {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(145deg, rgba(37, 99, 235, 0.55), rgba(16, 185, 129, 0.45));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    box-shadow: 0 8px 20px -14px rgba(2, 6, 23, 0.85);
}

.erp-brand-title {
    font-family: "Space Grotesk", "Plus Jakarta Sans", sans-serif;
    font-weight: 700;
    letter-spacing: 0.01em;
    line-height: 1.2;
    font-size: 0.96rem;
}

.erp-brand-subtitle {
    font-size: 0.74rem;
    color: #93a8c6;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.erp-sidebar-nav {
    padding: 1rem 0.75rem;
    display: grid;
    gap: 0.32rem;
}

.erp-sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.78rem;
    border-radius: 12px;
    color: #dbe3ef;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    font-weight: 600;
    font-size: 0.9rem;
    position: relative;
}

.erp-sidebar-link::before {
    content: "";
    position: absolute;
    left: 7px;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 999px;
    background: transparent;
    transition: background-color 0.2s ease;
}

.erp-sidebar-link i {
    font-size: 1.02rem;
    width: 18px;
    text-align: center;
}

.erp-sidebar-link:hover {
    color: #ffffff;
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.2), rgba(37, 99, 235, 0.05));
    border-color: rgba(37, 99, 235, 0.42);
    transform: translateX(2px);
}

.erp-sidebar-link.active {
    color: #ffffff;
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.35), rgba(59, 130, 246, 0.12));
    border-color: rgba(96, 165, 250, 0.58);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06), 0 10px 20px -18px rgba(37, 99, 235, 0.95);
}

.erp-sidebar-link.active::before {
    background: #bfdbfe;
}

.erp-sidebar-link.disabled {
    opacity: 0.4;
    pointer-events: none;
}

.erp-sidebar-divider {
    margin: 0.8rem 0.75rem;
    border-top: 1px dashed rgba(148, 163, 184, 0.3);
}

.erp-sidebar-footer {
    margin-top: auto;
    padding: 0.9rem 0.85rem 1rem;
    font-size: 0.76rem;
    color: #94a3b8;
    border-top: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(2, 6, 23, 0.16);
}

.erp-main {
    flex: 1;
    min-width: 0;
    margin-left: 280px;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.22s ease;
}

.erp-topbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    padding: calc(0.55rem + env(safe-area-inset-top, 0px)) 1rem 0;
    background: transparent;
}

.erp-topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.8rem 1rem;
    border-radius: 16px;
    border: 1px solid rgba(203, 213, 225, 0.65);
    background: rgba(255, 255, 255, 0.84);
    backdrop-filter: blur(14px);
    box-shadow: var(--erp-shadow-sm);
}

.erp-topbar-title h1 {
    margin: 0;
    font-family: "Space Grotesk", "Plus Jakarta Sans", sans-serif;
    font-size: 1.18rem;
    font-weight: 700;
    color: #0f172a;
}

.erp-topbar-title p {
    margin: 0.1rem 0 0;
    color: var(--erp-muted);
    font-size: 0.84rem;
}

.erp-topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.erp-search {
    min-width: 260px;
    max-width: 360px;
    position: relative;
}

.erp-search .bi-search {
    position: absolute;
    top: 50%;
    left: 0.85rem;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 0.9rem;
}

.erp-search input {
    border-radius: 12px;
    border: 1px solid #dbe5ef;
    height: 40px;
    padding-left: 2.3rem;
    background: #ffffff;
}

.erp-search input:focus {
    border-color: rgba(37, 99, 235, 0.5);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.erp-icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid #dbe5ef;
    background: #ffffff;
    color: #334155;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.18s ease;
    position: relative;
    touch-action: manipulation;
}

.erp-icon-btn:hover {
    color: var(--erp-primary);
    border-color: rgba(37, 99, 235, 0.45);
    transform: translateY(-1px);
}

.erp-badge-dot {
    position: absolute;
    top: -2px;
    right: -1px;
    min-width: 18px;
    height: 18px;
    border-radius: 999px;
    background: var(--erp-danger);
    color: #ffffff;
    font-size: 0.64rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    font-weight: 700;
}

.erp-user-btn {
    border: 1px solid #dbe5ef;
    background: #ffffff;
    border-radius: 12px;
    padding: 0.3rem 0.55rem 0.3rem 0.3rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: inherit;
}

.erp-user-btn:hover {
    border-color: rgba(37, 99, 235, 0.38);
}

.erp-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: linear-gradient(135deg, #2563eb 0%, #10b981 100%);
    color: #ffffff;
    font-size: 0.76rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
}

.erp-user-text {
    line-height: 1.05;
    text-align: left;
}

.erp-user-name {
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
}

.erp-user-role {
    font-size: 0.72rem;
    color: var(--erp-muted);
}

.erp-content {
    padding: 1rem;
    padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
}

.erp-content > * {
    max-width: 1540px;
    margin-left: auto;
    margin-right: auto;
}

.ui-fade-in {
    animation: ui-fade-up 0.33s ease;
}

@keyframes ui-fade-up {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ui-card {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #e2e8f0;
    border-radius: var(--erp-radius-lg);
    box-shadow: var(--erp-shadow-sm);
    overflow: hidden;
}

.ui-card + .ui-card {
    margin-top: 1rem;
}

.ui-card-header {
    padding: 0.95rem 1.1rem;
    border-bottom: 1px solid #e9edf3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(248, 250, 252, 0.9));
}

.ui-card-title {
    font-family: "Space Grotesk", "Plus Jakarta Sans", sans-serif;
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
}

.ui-card-subtitle {
    font-size: 0.82rem;
    color: var(--erp-muted);
}

.ui-card-body {
    padding: 1.1rem;
}

.ui-card-footer {
    padding: 0.95rem 1.1rem;
    border-top: 1px solid #e9edf3;
    background: #fbfdff;
}

.ui-kpi-card {
    border-radius: var(--erp-radius-lg);
    border: 1px solid #dfe7f1;
    background: linear-gradient(180deg, #ffffff, #f8fbff);
    padding: 1rem;
    box-shadow: var(--erp-shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.ui-kpi-card::after {
    content: "";
    position: absolute;
    inset: auto -28px -42px auto;
    width: 110px;
    height: 110px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.15), transparent 70%);
}

.ui-kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--erp-shadow-md);
    border-color: #cfdceb;
}

.ui-kpi-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.7rem;
}

.ui-kpi-icon {
    width: 42px;
    height: 42px;
    border-radius: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    border: 1px solid rgba(148, 163, 184, 0.22);
}

.ui-kpi-icon.primary {
    background: rgba(37, 99, 235, 0.12);
    color: var(--erp-primary);
}

.ui-kpi-icon.secondary {
    background: rgba(16, 185, 129, 0.12);
    color: var(--erp-secondary);
}

.ui-kpi-icon.warning {
    background: rgba(245, 158, 11, 0.15);
    color: #d97706;
}

.ui-kpi-icon.muted {
    background: rgba(100, 116, 139, 0.12);
    color: #475569;
}

.ui-kpi-label {
    color: var(--erp-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
}

.ui-kpi-value {
    font-family: "Space Grotesk", "Plus Jakarta Sans", sans-serif;
    font-size: 1.85rem;
    font-weight: 700;
    line-height: 1.06;
    color: #0f172a;
}

.ui-section-title {
    margin: 0;
    font-family: "Space Grotesk", "Plus Jakarta Sans", sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
}

.ui-section-subtitle {
    margin: 0.26rem 0 0;
    color: var(--erp-muted);
    font-size: 0.89rem;
}

.ui-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    margin-bottom: 0.95rem;
}

.ui-toolbar-filters {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.ui-table-card {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid #e2e8f0;
    border-radius: var(--erp-radius-lg);
    box-shadow: var(--erp-shadow-sm);
    overflow: hidden;
}

.ui-table-wrap {
    max-height: calc(100vh - 285px);
    overflow: auto;
}

.ui-table {
    margin: 0;
}

.ui-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f8fafd;
    color: #334155;
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
    border-bottom: 1px solid #dfe6f0;
    padding: 0.84rem 0.9rem;
}

.ui-table tbody td {
    padding: 0.84rem 0.9rem;
    border-color: #edf2f7;
    vertical-align: middle;
}

.ui-table tbody tr {
    transition: background-color 0.18s ease;
}

.ui-table tbody tr:hover {
    background: #f8fbff;
}

.ui-empty-state {
    text-align: center;
    padding: 2.15rem 1rem;
    color: var(--erp-muted);
}

.ui-empty-state i {
    display: inline-flex;
    width: 52px;
    height: 52px;
    border-radius: 999px;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, rgba(37, 99, 235, 0.15), rgba(16, 185, 129, 0.12));
    color: var(--erp-primary);
    font-size: 1.24rem;
    margin-bottom: 0.66rem;
}

.ui-empty-state h5 {
    margin: 0;
    color: #334155;
    font-size: 1rem;
}

.ui-empty-state p {
    margin: 0.2rem 0 0;
    font-size: 0.86rem;
}

.ui-status-badge {
    font-size: 0.71rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    padding: 0.36rem 0.6rem;
    border-radius: 999px;
    border: 1px solid transparent;
}

.ui-status-draft,
.ui-status-inactive,
.ui-status-expired {
    background: #e5e7eb;
    color: #374151;
}

.ui-status-confirmed,
.ui-status-validated,
.ui-status-active,
.ui-status-invoiced {
    background: rgba(37, 99, 235, 0.13);
    color: var(--erp-primary);
    border-color: rgba(37, 99, 235, 0.2);
}

.ui-status-delivered,
.ui-status-paid,
.ui-status-ok,
.ui-status-success {
    background: rgba(16, 185, 129, 0.16);
    color: #047857;
    border-color: rgba(16, 185, 129, 0.22);
}

.ui-status-cancelled,
.ui-status-danger,
.ui-status-low,
.ui-status-low_stock {
    background: rgba(239, 68, 68, 0.14);
    color: #b91c1c;
    border-color: rgba(239, 68, 68, 0.2);
}

.ui-status-pending,
.ui-status-warning,
.ui-status-pending_validation,
.ui-status-partially_paid,
.ui-status-unpaid {
    background: rgba(245, 158, 11, 0.17);
    color: #b45309;
    border-color: rgba(245, 158, 11, 0.25);
}

.form-label {
    font-weight: 700;
    color: #334155;
    margin-bottom: 0.45rem;
    font-size: 0.86rem;
}

.form-control,
.form-select,
textarea.form-control {
    border-radius: 12px;
    border-color: #dbe5ef;
    min-height: 46px;
    padding: 0.62rem 0.78rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background-color: #ffffff;
}

textarea.form-control {
    min-height: auto;
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(37, 99, 235, 0.55);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.13);
}

.ui-form-group {
    margin-bottom: 1rem;
}

.ui-form-section {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid #e2e8f0;
    border-radius: var(--erp-radius-lg);
    padding: 1rem;
    box-shadow: var(--erp-shadow-sm);
}

.ui-form-section-title {
    margin: 0;
    font-size: 0.96rem;
    font-weight: 700;
    color: #1e293b;
}

.ui-form-section-subtitle {
    margin-top: 0.2rem;
    color: var(--erp-muted);
    font-size: 0.82rem;
}

.btn {
    border-radius: 12px;
    font-weight: 700;
    padding: 0.52rem 0.9rem;
    transition: all 0.18s ease;
    min-height: 42px;
    touch-action: manipulation;
}

.btn-sm {
    border-radius: 10px;
}

.btn-primary {
    background: linear-gradient(140deg, var(--erp-primary), #3b82f6);
    border-color: var(--erp-primary);
    box-shadow: 0 10px 22px -16px rgba(37, 99, 235, 0.9);
}

.btn-primary:hover,
.btn-primary:focus {
    background: linear-gradient(140deg, var(--erp-primary-hover), #2563eb);
    border-color: var(--erp-primary-hover);
    transform: translateY(-1px);
}

.btn-success {
    background: linear-gradient(140deg, var(--erp-secondary), #34d399);
    border-color: var(--erp-secondary);
}

.btn-success:hover,
.btn-success:focus {
    background: linear-gradient(140deg, var(--erp-secondary-hover), #10b981);
    border-color: var(--erp-secondary-hover);
}

.btn-outline-secondary {
    color: #475569;
    border-color: #cbd5e1;
}

.btn-outline-secondary:hover {
    background: #f8fafc;
    color: #334155;
    border-color: #b9c6d6;
}

.btn-danger,
.btn-outline-danger:hover {
    background: var(--erp-danger);
    border-color: var(--erp-danger);
}

.alert {
    border-radius: 14px;
    border: 1px solid transparent;
    box-shadow: var(--erp-shadow-sm);
}

.alert-success {
    border-color: rgba(16, 185, 129, 0.26);
    background: rgba(16, 185, 129, 0.11);
    color: #065f46;
}

.alert-danger {
    border-color: rgba(239, 68, 68, 0.24);
    background: rgba(239, 68, 68, 0.11);
    color: #991b1b;
}

.dropdown-menu {
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: var(--erp-shadow-lg);
    padding: 0.4rem;
}

.dropdown-item {
    border-radius: 9px;
    font-size: 0.88rem;
    padding: 0.52rem 0.65rem;
}

.dropdown-item:active,
.dropdown-item:focus,
.dropdown-item:hover {
    background: rgba(37, 99, 235, 0.08);
    color: var(--erp-text);
}

.pagination {
    gap: 0.35rem;
}

.page-link {
    border: 1px solid #dbe5ef;
    color: #334155;
    border-radius: 10px;
    min-width: 36px;
    text-align: center;
    padding: 0.45rem 0.72rem;
}

.page-link:hover {
    color: var(--erp-primary);
    background: rgba(37, 99, 235, 0.08);
    border-color: rgba(37, 99, 235, 0.35);
}

.page-item.active .page-link {
    background: var(--erp-primary);
    border-color: var(--erp-primary);
    color: #ffffff;
}

.modal-content {
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: var(--erp-shadow-lg);
}

.table-responsive {
    -webkit-overflow-scrolling: touch;
}

.erp-sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.54);
    z-index: 1040;
    display: none;
}

.chart-container,
canvas {
    max-width: 100%;
}

@media (display-mode: standalone) {
    .erp-topbar {
        padding-top: calc(0.35rem + env(safe-area-inset-top, 0px));
    }
}

html[data-theme="dark"] .erp-topbar-inner,
html[data-theme="dark"] .ui-card,
html[data-theme="dark"] .ui-table-card,
html[data-theme="dark"] .ui-form-section,
html[data-theme="dark"] .erp-icon-btn,
html[data-theme="dark"] .erp-user-btn {
    background: rgba(15, 23, 42, 0.82);
    border-color: rgba(148, 163, 184, 0.22);
    color: var(--erp-text);
}

html[data-theme="dark"] .ui-card-header {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.96), rgba(15, 23, 42, 0.92));
    border-bottom-color: #334155;
}

html[data-theme="dark"] .ui-card-footer {
    background: rgba(15, 23, 42, 0.88);
    border-top-color: #334155;
}

html[data-theme="dark"] .ui-kpi-card {
    background: linear-gradient(180deg, #111c31, #0f172a);
    border-color: #2a3a53;
    box-shadow: 0 18px 35px -24px rgba(2, 6, 23, 0.9);
}

html[data-theme="dark"] .ui-kpi-card::after {
    background: radial-gradient(circle, rgba(37, 99, 235, 0.2), transparent 70%);
}

html[data-theme="dark"] .ui-kpi-label {
    color: #9bb0cd;
}

html[data-theme="dark"] .ui-kpi-icon.primary {
    background: rgba(37, 99, 235, 0.2);
    border-color: rgba(96, 165, 250, 0.35);
    color: #93c5fd;
}

html[data-theme="dark"] .ui-kpi-icon.secondary {
    background: rgba(16, 185, 129, 0.2);
    border-color: rgba(52, 211, 153, 0.35);
    color: #6ee7b7;
}

html[data-theme="dark"] .ui-kpi-icon.warning {
    background: rgba(245, 158, 11, 0.2);
    border-color: rgba(245, 158, 11, 0.35);
    color: #fbbf24;
}

html[data-theme="dark"] .erp-topbar-title h1,
html[data-theme="dark"] .ui-card-title,
html[data-theme="dark"] .ui-kpi-value,
html[data-theme="dark"] .ui-section-title,
html[data-theme="dark"] .erp-user-name {
    color: #f8fafc;
}

html[data-theme="dark"] .erp-topbar-title p,
html[data-theme="dark"] .ui-card-subtitle,
html[data-theme="dark"] .ui-section-subtitle,
html[data-theme="dark"] .erp-user-role,
html[data-theme="dark"] .text-muted {
    color: var(--erp-muted) !important;
}

html[data-theme="dark"] .ui-table thead th {
    background: #172033;
    color: #cbd5e1;
    border-bottom-color: #334155;
}

html[data-theme="dark"] .ui-table tbody td {
    border-color: #253247;
    color: #e2e8f0;
}

html[data-theme="dark"] .ui-table tbody tr:hover {
    background: #1a2538;
}

html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select,
html[data-theme="dark"] textarea.form-control {
    background-color: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}

html[data-theme="dark"] .form-control::placeholder,
html[data-theme="dark"] .form-select::placeholder {
    color: #8ca0bc;
}

html[data-theme="dark"] .form-label {
    color: #cbd5e1;
}

html[data-theme="dark"] .dropdown-menu {
    background: #111827;
    border-color: #334155;
}

html[data-theme="dark"] .dropdown-item,
html[data-theme="dark"] .dropdown-item-text {
    color: #e2e8f0;
}

html[data-theme="dark"] .dropdown-item:active,
html[data-theme="dark"] .dropdown-item:focus,
html[data-theme="dark"] .dropdown-item:hover {
    background: rgba(37, 99, 235, 0.2);
    color: #f8fafc;
}

html[data-theme="dark"] .page-link {
    background: #0f172a;
    border-color: #334155;
    color: #cbd5e1;
}

html[data-theme="dark"] .page-link:hover {
    color: #dbeafe;
    border-color: #3b82f6;
}

html[data-theme="dark"] .table,
html[data-theme="dark"] .table > :not(caption) > * > * {
    color: #e2e8f0;
}

html[data-theme="dark"] .table-light,
html[data-theme="dark"] .table-light > th,
html[data-theme="dark"] .table-light > td {
    --bs-table-bg: #172033;
    --bs-table-color: #cbd5e1;
    --bs-table-border-color: #334155;
}

html[data-theme="dark"] .table-hover > tbody > tr:hover > * {
    --bs-table-accent-bg: #1a2538;
    color: #f1f5f9;
}

html[data-theme="dark"] .alert-success {
    color: #d1fae5;
    background: rgba(16, 185, 129, 0.18);
    border-color: rgba(16, 185, 129, 0.32);
}

html[data-theme="dark"] .alert-danger {
    color: #fecaca;
    background: rgba(239, 68, 68, 0.18);
    border-color: rgba(239, 68, 68, 0.35);
}

html[data-theme="dark"] .card {
    background: rgba(15, 23, 42, 0.88);
    border-color: #334155;
    color: #e2e8f0;
}

html[data-theme="dark"] .card-header,
html[data-theme="dark"] .card-footer {
    background: rgba(23, 32, 51, 0.92);
    border-color: #334155;
    color: #f1f5f9;
}

html[data-theme="dark"] .list-group-item {
    background: rgba(15, 23, 42, 0.88);
    border-color: #334155;
    color: #e2e8f0;
}

@media (min-width: 992px) {
    .erp-shell.sidebar-collapsed .erp-sidebar {
        width: 92px;
    }

    .erp-shell.sidebar-collapsed .erp-main {
        margin-left: 92px;
    }

    .erp-shell.sidebar-collapsed .erp-brand-title,
    .erp-shell.sidebar-collapsed .erp-brand-subtitle,
    .erp-shell.sidebar-collapsed .erp-sidebar-link span,
    .erp-shell.sidebar-collapsed .erp-sidebar-footer {
        display: none;
    }

    .erp-shell.sidebar-collapsed .erp-sidebar-brand {
        justify-content: center;
        padding-left: 0.6rem;
        padding-right: 0.6rem;
    }

    .erp-shell.sidebar-collapsed .erp-sidebar-nav {
        padding-left: 0.55rem;
        padding-right: 0.55rem;
    }

    .erp-shell.sidebar-collapsed .erp-sidebar-link {
        justify-content: center;
        padding-left: 0.65rem;
        padding-right: 0.65rem;
    }

    .erp-shell.sidebar-collapsed .erp-sidebar-link::before {
        display: none;
    }
}

@media (max-width: 1199.98px) {
    .erp-search {
        min-width: 190px;
    }

    .erp-topbar-title p {
        display: none;
    }
}

@media (max-width: 991.98px) {
    .erp-sidebar {
        transform: translateX(-100%);
    }

    .erp-main {
        margin-left: 0;
    }

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

    .erp-shell.sidebar-open .erp-sidebar-overlay {
        display: block;
    }

    .erp-topbar {
        padding: calc(0.45rem + env(safe-area-inset-top, 0px)) 0.55rem 0;
    }

    .erp-topbar-inner {
        padding: 0.72rem 0.78rem;
    }

    .erp-topbar-actions {
        gap: 0.45rem;
    }

    .erp-topbar-actions .dropdown-menu {
        max-width: min(92vw, 360px);
    }

    .erp-search {
        display: none;
    }

    .erp-content {
        padding: 0.8rem 0.55rem 1rem;
    }

    .ui-table-wrap {
        max-height: none;
    }

    .ui-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .ui-toolbar .btn,
    .ui-toolbar a.btn {
        width: 100%;
    }

    .ui-table thead th,
    .ui-table tbody td {
        white-space: nowrap;
    }
}

@media (max-width: 575.98px) {
    .btn,
    .form-control,
    .form-select,
    textarea.form-control {
        min-height: 46px;
    }

    .erp-user-text {
        display: none !important;
    }
}
