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

:root {
    --erp-space-1: 0.5rem;
    --erp-space-2: 1rem;
    --erp-space-3: 1.5rem;
    --erp-space-4: 2rem;
    --erp-space-5: 2.5rem;

    --erp-radius-sm: 0.75rem;
    --erp-radius-md: 1rem;
    --erp-radius-lg: 1.25rem;
    --erp-radius-xl: 1.5rem;

    --erp-font-sans: "Manrope", "Segoe UI", sans-serif;
}

/* =========================
   VARIABLES DE TEMA
========================= */
:root[data-bs-theme="dark"] {
    --erp-bg:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.12), transparent 28%),
        radial-gradient(circle at bottom right, rgba(16, 185, 129, 0.10), transparent 25%),
        #0f172a;
    --erp-main-bg: #0f172a;
    --erp-surface: rgba(17, 24, 39, 0.92);
    --erp-surface-2: #0b1220;
    --erp-surface-3: rgba(15, 23, 42, 0.88);
    --erp-border: rgba(255, 255, 255, 0.08);
    --erp-border-strong: rgba(255, 255, 255, 0.16);
    --erp-text: #e5e7eb;
    --erp-muted: #94a3b8;
    --erp-primary: #2563eb;
    --erp-primary-hover: #1d4ed8;
    --erp-secondary: #334155;
    --erp-secondary-hover: #3c4c61;
    --erp-success: #10b981;
    --erp-danger: #ef4444;
    --erp-warning: #f59e0b;
    --erp-info: #06b6d4;
    --erp-sidebar-gradient: linear-gradient(180deg, #16325f 0%, #102347 100%);
    --erp-topbar-bg: rgba(15, 23, 42, 0.9);
    --erp-avatar: #2563eb;
    --erp-shadow: 0 20px 48px rgba(0, 0, 0, 0.28);
    --erp-input-bg: #0b1220;
    --erp-input-text: #e5e7eb;
    --erp-input-border: rgba(255, 255, 255, 0.12);
    --erp-dropdown-bg: #111827;
    --erp-dropdown-hover: rgba(255, 255, 255, 0.06);
    --erp-table-hover: rgba(255, 255, 255, 0.035);
    --erp-hero-bg:
        radial-gradient(circle at top right, rgba(16, 185, 129, 0.18), transparent 32%),
        linear-gradient(135deg, #0f766e 0%, #155e75 58%, #1d4ed8 100%);
    --erp-glass-bg: rgba(255, 255, 255, 0.06);
}

:root[data-bs-theme="light"] {
    --erp-bg:
        radial-gradient(circle at top left, rgba(59, 130, 246, 0.14), transparent 28%),
        radial-gradient(circle at bottom right, rgba(16, 185, 129, 0.10), transparent 25%),
        linear-gradient(180deg, #eef4ff 0%, #f8fbff 100%);
    --erp-main-bg: #f3f7fd;
    --erp-surface: rgba(255, 255, 255, 0.88);
    --erp-surface-2: #ffffff;
    --erp-surface-3: rgba(248, 250, 252, 0.92);
    --erp-border: rgba(15, 23, 42, 0.08);
    --erp-border-strong: rgba(15, 23, 42, 0.16);
    --erp-text: #172033;
    --erp-muted: #667085;
    --erp-primary: #2563eb;
    --erp-primary-hover: #1d4ed8;
    --erp-secondary: #e2e8f0;
    --erp-secondary-hover: #cbd5e1;
    --erp-success: #059669;
    --erp-danger: #dc2626;
    --erp-warning: #d97706;
    --erp-info: #0284c7;
    --erp-sidebar-gradient: linear-gradient(180deg, #2952a3 0%, #1f3d79 100%);
    --erp-topbar-bg: rgba(255, 255, 255, 0.78);
    --erp-avatar: #2563eb;
    --erp-shadow: 0 18px 42px rgba(15, 23, 42, 0.10);
    --erp-input-bg: #ffffff;
    --erp-input-text: #172033;
    --erp-input-border: rgba(15, 23, 42, 0.10);
    --erp-dropdown-bg: #ffffff;
    --erp-dropdown-hover: rgba(37, 99, 235, 0.08);
    --erp-table-hover: rgba(37, 99, 235, 0.045);
    --erp-hero-bg:
        radial-gradient(circle at top right, rgba(16, 185, 129, 0.18), transparent 28%),
        linear-gradient(135deg, #e7f7f2 0%, #e4efff 100%);
    --erp-glass-bg: rgba(255, 255, 255, 0.7);
}

/* =========================
   BASE
========================= */
body.erp-body {
    background: var(--erp-bg);
    color: var(--erp-text);
    min-height: 100vh;
    font-family: var(--erp-font-sans);
    transition: background 0.25s ease, color 0.25s ease;
}

body.erp-body,
body.erp-body .btn,
body.erp-body .form-control,
body.erp-body .form-select,
body.erp-body .dropdown-menu {
    font-family: var(--erp-font-sans);
}

.erp-layout {
    display: flex;
    min-height: 100vh;
    height: 100vh;
    overflow: hidden;
}

.erp-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    height: 100vh;
    overflow: hidden;
}

.erp-content {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: var(--erp-space-4) var(--erp-space-2) var(--erp-space-4);
}

.container-fluid.erp-content {
    max-width: 100%;
}

.erp-page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--erp-space-2);
    margin-bottom: var(--erp-space-4);
}

.erp-page-title {
    margin: 0;
    font-size: clamp(1.75rem, 2vw, 2.2rem);
    font-weight: 800;
    letter-spacing: -0.025em;
}

.erp-page-subtitle {
    margin: 0.25rem 0 0;
    color: var(--erp-muted);
}

.page-transition {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.page-transition.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.text-secondary,
.text-muted {
    color: var(--erp-muted) !important;
}

h1,
h2,
h3,
h4,
h5,
h6,
p,
label,
span,
div,
td,
th,
a {
    color: inherit;
}

/* =========================
   SIDEBAR
========================= */
.erp-sidebar {
    width: 272px !important;
    border-right: 1px solid var(--erp-border);
    background: var(--erp-sidebar-gradient) !important;
    position: sticky;
    top: 0;
    align-self: flex-start;
    height: 100vh;
    min-height: 100vh;
    overflow: hidden;
    flex: 0 0 272px;
}

.erp-sidebar-inner {
    min-height: 100%;
    background: transparent !important;
    box-shadow: var(--erp-shadow);
}

.erp-sidebar .offcanvas-body,
.erp-sidebar-scroll {
    height: 100%;
    background: transparent !important;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-gutter: stable;
    position: relative;
    scroll-behavior: smooth;
    overscroll-behavior: contain;
    scrollbar-width: auto;
    scrollbar-color: rgba(255, 255, 255, 0.34) rgba(255, 255, 255, 0.06);
    padding-bottom: 5.5rem !important;
}

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

.erp-sidebar-scroll::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 999px;
    margin-block: 10px;
}

.erp-sidebar-scroll::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.18));
    border-radius: 999px;
    border: 2px solid rgba(11, 23, 48, 0.18);
    background-clip: padding-box;
    min-height: 48px;
}

.erp-sidebar-scroll::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.46), rgba(255, 255, 255, 0.26));
}

:root[data-bs-theme="light"] .erp-sidebar-scroll {
    scrollbar-color: rgba(255, 255, 255, 0.52) rgba(255, 255, 255, 0.14);
}

:root[data-bs-theme="light"] .erp-sidebar-scroll::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.14);
}

:root[data-bs-theme="light"] .erp-sidebar-scroll::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.38));
    border-color: rgba(41, 82, 163, 0.18);
}

.erp-sidebar-scroll::before,
.erp-sidebar-scroll::after {
    content: "";
    position: sticky;
    left: 0;
    display: block;
    width: 100%;
    height: 18px;
    pointer-events: none;
    z-index: 3;
    opacity: 0;
    transition: opacity 0.18s ease;
}

.erp-sidebar-scroll::before {
    top: 0;
    margin-bottom: -18px;
    background: linear-gradient(180deg, rgba(23, 49, 95, 0.96), rgba(23, 49, 95, 0));
}

.erp-sidebar-scroll::after {
    bottom: 0;
    margin-top: -18px;
    background: linear-gradient(0deg, rgba(23, 49, 95, 0.96), rgba(23, 49, 95, 0));
}

:root[data-bs-theme="light"] .erp-sidebar-scroll::before {
    background: linear-gradient(180deg, rgba(41, 82, 163, 0.94), rgba(41, 82, 163, 0));
}

:root[data-bs-theme="light"] .erp-sidebar-scroll::after {
    background: linear-gradient(0deg, rgba(41, 82, 163, 0.94), rgba(41, 82, 163, 0));
}

.erp-sidebar-scroll.has-scroll-top::before,
.erp-sidebar-scroll.has-scroll-bottom::after {
    opacity: 1;
}

.erp-sidebar-brand {
    margin-bottom: var(--erp-space-4);
}

.erp-sidebar-profile-card {
    display: block;
    text-decoration: none;
    border-radius: var(--erp-radius-lg);
    padding: var(--erp-space-2);
    margin-bottom: var(--erp-space-2);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.06));
    border: 1px solid rgba(255, 255, 255, 0.12);
    transition: transform 0.18s ease, background 0.18s ease;
}

.erp-sidebar-profile-card:hover {
    transform: translateY(-1px);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.08));
}

.erp-sidebar-profile-media,
.erp-sidebar-profile-placeholder {
    width: 56px;
    height: 56px;
    flex: 0 0 56px;
    object-fit: cover;
}

.erp-sidebar-profile-placeholder {
    background: rgba(255, 255, 255, 0.12);
}

.sidebar-title {
    color: rgba(255, 255, 255, 0.58);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.sidebar-section {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.sidebar-section-body {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.erp-sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    border-radius: 0.95rem;
    padding: 0.8rem 0.95rem;
    color: rgba(255, 255, 255, 0.94) !important;
    font-weight: 600;
    transition: background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.erp-sidebar .nav-link:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(2px);
}

.erp-sidebar .nav-link.active {
    background: rgba(255, 255, 255, 0.14);
    box-shadow: inset 3px 0 0 rgba(255, 255, 255, 0.78);
}

/* =========================
   TOPBAR
========================= */
.erp-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--erp-space-2);
    position: sticky;
    top: 0;
    z-index: 1020;
    padding: var(--erp-space-2) 1.25rem;
    background: var(--erp-topbar-bg);
    border-bottom: 1px solid var(--erp-border);
    backdrop-filter: blur(12px);
    transition: background 0.25s ease, border-color 0.25s ease;
    flex: 0 0 auto;
}

.erp-topbar-welcome strong {
    display: inline-block;
    margin-right: 0.375rem;
}

.erp-topbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.erp-avatar {
    width: 42px;
    height: 42px;
    border-radius: 999px;
    background: var(--erp-avatar);
    color: #fff;
    font-weight: 800;
    box-shadow: var(--erp-shadow);
}

/* =========================
   TARJETAS Y PANELES
========================= */
.card,
.erp-panel,
.erp-stat-card,
.erp-card-link {
    background: var(--erp-surface) !important;
    border: 1px solid var(--erp-border) !important;
    color: var(--erp-text) !important;
    border-radius: var(--erp-radius-lg) !important;
    box-shadow: var(--erp-shadow) !important;
    overflow: hidden;
    backdrop-filter: blur(8px);
    transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease, transform 0.18s ease;
}

.card-header,
.card-header.bg-white {
    background: transparent !important;
    color: var(--erp-text) !important;
    border-bottom: 1px solid var(--erp-border) !important;
    padding: 1rem 1.25rem !important;
    font-weight: 800;
}

.card-body {
    padding: 1.25rem !important;
}

.erp-card-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.erp-card-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 800;
}

.erp-card-subtitle {
    margin: 0.15rem 0 0;
    color: var(--erp-muted);
    font-size: 0.92rem;
}

.erp-dashboard-hero,
.rh-hero {
    position: relative;
    overflow: hidden;
    border-radius: var(--erp-radius-xl);
    background: var(--erp-hero-bg);
    color: #fff;
}

.erp-dashboard-hero .card-body,
.rh-hero {
    padding: 1.75rem !important;
}

.erp-dashboard-hero::after,
.rh-hero::after {
    content: "";
    position: absolute;
    inset: auto -8% -35% auto;
    width: 16rem;
    height: 16rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    filter: blur(10px);
    pointer-events: none;
}

.erp-dashboard-hero .text-secondary,
.rh-hero .text-secondary {
    color: rgba(255, 255, 255, 0.74) !important;
}

.erp-hero-chip,
.rh-stat-chip {
    border-radius: 999px;
    padding: 0.625rem 0.875rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(6px);
}

.erp-hero-chip-label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.72);
}

.erp-hero-chip-value {
    display: block;
    margin-top: 0.125rem;
    font-size: 1.05rem;
    font-weight: 800;
}

.erp-stat-card,
.rh-panel,
.rh-card-link {
    height: 100%;
}

.erp-stat-card .card-body {
    height: 100%;
}

.dashboard-kpi-card,
.rh-kpi {
    position: relative;
    height: 100%;
}

.dashboard-kpi-icon,
.rh-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(37, 99, 235, 0.14);
    color: var(--erp-primary);
    font-size: 1.3rem;
    flex: 0 0 52px;
}

.erp-surface-muted {
    background: var(--erp-surface-3);
    border: 1px solid var(--erp-border);
    border-radius: var(--erp-radius-md);
}

.erp-readonly-field {
    min-height: 72px;
    display: flex;
    align-items: flex-start;
    background: var(--erp-input-bg);
    color: var(--erp-input-text);
    border: 1px solid var(--erp-input-border);
    border-radius: 0.875rem;
    padding: 0.85rem 1rem;
}

.erp-readonly-field-lg {
    min-height: 96px;
}

.erp-progress-thin {
    height: 12px;
    background: var(--erp-dropdown-hover);
}

.erp-auth-shell {
    min-height: calc(100vh - 180px);
}

/* =========================
   FORMULARIOS
========================= */
form {
    min-width: 0;
}

.form-label {
    margin-bottom: 0.5rem;
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--erp-text);
}

.form-text {
    color: var(--erp-muted) !important;
}

.form-control,
.form-select,
textarea {
    min-height: 46px;
    background: var(--erp-input-bg) !important;
    color: var(--erp-input-text) !important;
    border: 1px solid var(--erp-input-border) !important;
    border-radius: 0.875rem !important;
    padding: 0.7rem 0.95rem !important;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

textarea.form-control,
textarea {
    min-height: 120px;
}

.form-control::placeholder,
textarea::placeholder {
    color: var(--erp-muted) !important;
}

.form-control:focus,
.form-select:focus,
textarea:focus,
.form-check-input:focus {
    background: var(--erp-input-bg) !important;
    color: var(--erp-input-text) !important;
    border-color: var(--erp-primary) !important;
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.15) !important;
}

.form-check-input {
    width: 1.15rem;
    height: 1.15rem;
    border-color: var(--erp-input-border);
}

.form-check-label {
    font-weight: 600;
}

.is-invalid,
.form-control.is-invalid,
.form-select.is-invalid,
textarea.is-invalid {
    border-color: rgba(220, 38, 38, 0.7) !important;
}

.invalid-feedback,
.text-danger.small,
.text-danger.small.fw-semibold {
    display: block;
    margin-top: 0.45rem;
    font-size: 0.82rem !important;
    font-weight: 700;
}

.erp-filter-form,
form.row.g-3,
form.row.g-2 {
    row-gap: 1rem;
}

.erp-form-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.75rem;
    padding-top: 0.5rem;
}

.erp-form-section + .erp-form-section {
    margin-top: var(--erp-space-4);
}

/* =========================
   BOTONES
========================= */
.btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 42px;
    padding: 0.68rem 1rem !important;
    border-radius: 0.875rem !important;
    font-weight: 700 !important;
    border-width: 1px !important;
    transition: transform 0.15s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease, opacity 0.18s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:disabled,
.btn.disabled {
    transform: none;
    opacity: 0.72;
}

.btn-sm {
    min-height: 36px;
    padding: 0.52rem 0.8rem !important;
    border-radius: 0.75rem !important;
}

.btn-primary {
    background: var(--erp-primary) !important;
    border-color: var(--erp-primary) !important;
    color: #fff !important;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background: var(--erp-primary-hover) !important;
    border-color: var(--erp-primary-hover) !important;
}

.btn-secondary,
.btn-outline-secondary:hover {
    background: var(--erp-secondary) !important;
    border-color: var(--erp-secondary) !important;
    color: var(--erp-text) !important;
}

.btn-secondary:hover,
.btn-secondary:focus,
.btn-secondary:active {
    background: var(--erp-secondary-hover) !important;
    border-color: var(--erp-secondary-hover) !important;
}

.btn-outline-secondary,
.btn-outline-primary,
.btn-outline-success,
.btn-outline-danger,
.btn-outline-warning,
.btn-outline-info {
    background: transparent !important;
}

.btn-outline-secondary {
    color: var(--erp-text) !important;
    border-color: var(--erp-border-strong) !important;
}

.btn-outline-secondary:hover {
    color: var(--erp-text) !important;
}

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

.btn-outline-primary:hover {
    background: var(--erp-primary) !important;
    border-color: var(--erp-primary) !important;
    color: #fff !important;
}

.btn-outline-success:hover {
    background: var(--erp-success) !important;
    border-color: var(--erp-success) !important;
    color: #fff !important;
}

.btn-outline-warning:hover {
    background: var(--erp-warning) !important;
    border-color: var(--erp-warning) !important;
    color: #111827 !important;
}

.btn-outline-info:hover {
    background: var(--erp-info) !important;
    border-color: var(--erp-info) !important;
    color: #fff !important;
}

.btn.is-submitting {
    pointer-events: none;
}

.btn-spinner {
    width: 0.95rem;
    height: 0.95rem;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 999px;
    animation: erp-spin 0.8s linear infinite;
}

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

/* =========================
   TABLAS
========================= */
.table-responsive {
    border: 1px solid var(--erp-border);
    border-radius: var(--erp-radius-md);
    overflow: auto;
    background: transparent;
}

.table {
    margin-bottom: 0 !important;
    color: var(--erp-text) !important;
    --bs-table-bg: transparent;
    --bs-table-color: var(--erp-text);
    --bs-table-border-color: var(--erp-border);
    --bs-table-hover-color: var(--erp-text);
    --bs-table-hover-bg: var(--erp-table-hover);
}

.table > :not(caption) > * > * {
    padding: 0.95rem 1rem;
    background-color: transparent !important;
    color: var(--erp-text) !important;
    border-bottom-color: var(--erp-border) !important;
    vertical-align: middle;
}

.table > thead > tr > th {
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--erp-muted) !important;
    white-space: nowrap;
}

.table > tbody > tr {
    transition: background-color 0.16s ease;
}

.table > tbody > tr:hover {
    background: var(--erp-table-hover);
}

.erp-empty-row td,
.table tbody tr td.text-center.text-secondary {
    padding-top: 2rem;
    padding-bottom: 2rem;
    color: var(--erp-muted) !important;
}

.priority-urgent-row {
    box-shadow: inset 4px 0 0 var(--erp-danger);
}

.priority-high-row {
    box-shadow: inset 4px 0 0 var(--erp-warning);
}

/* =========================
   PAGINACIÓN, BADGES, ALERTAS
========================= */
.pagination {
    --bs-pagination-bg: transparent;
    --bs-pagination-border-color: var(--erp-border);
    --bs-pagination-color: var(--erp-text);
    --bs-pagination-hover-color: var(--erp-text);
    --bs-pagination-hover-bg: var(--erp-dropdown-hover);
    --bs-pagination-hover-border-color: var(--erp-border-strong);
    --bs-pagination-active-bg: var(--erp-primary);
    --bs-pagination-active-border-color: var(--erp-primary);
    --bs-pagination-disabled-bg: transparent;
    --bs-pagination-disabled-border-color: var(--erp-border);
}

.page-link {
    border-radius: 0.75rem !important;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
}

.badge {
    border-radius: 999px;
    padding: 0.45rem 0.7rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

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

.alert-dismissible .btn-close {
    padding: 1rem;
}

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

.erp-empty-state-icon {
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1rem;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    background: var(--erp-dropdown-hover);
    color: var(--erp-primary);
}

/* =========================
   DROPDOWNS
========================= */
.dropdown-menu {
    background: var(--erp-dropdown-bg) !important;
    border: 1px solid var(--erp-border) !important;
    box-shadow: var(--erp-shadow) !important;
    border-radius: 0.9rem !important;
    padding: 0.45rem;
}

.dropdown-item {
    color: var(--erp-text) !important;
    border-radius: 0.7rem;
    padding: 0.6rem 0.8rem;
}

.dropdown-item:hover {
    background: var(--erp-dropdown-hover) !important;
    color: var(--erp-text) !important;
}

/* =========================
   RH DASHBOARD
========================= */
.rh-dashboard {
    --rh-primary: var(--erp-primary);
    --rh-accent: var(--erp-warning);
    --rh-border: var(--erp-border);
}

.rh-panel {
    padding: 1.25rem;
}

.rh-kpi {
    display: block;
    text-decoration: none;
    color: inherit;
    padding: 1.25rem;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.rh-kpi:hover,
.erp-card-link:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--erp-primary) 34%, var(--erp-border));
}

.rh-tone-primary { background: rgba(59, 130, 246, 0.16); color: #60a5fa; }
.rh-tone-warning { background: rgba(245, 158, 11, 0.16); color: #fbbf24; }
.rh-tone-info { background: rgba(6, 182, 212, 0.16); color: #22d3ee; }
.rh-tone-success { background: rgba(16, 185, 129, 0.16); color: #34d399; }
.rh-tone-danger { background: rgba(239, 68, 68, 0.16); color: #f87171; }
.rh-tone-secondary { background: rgba(148, 163, 184, 0.16); color: #cbd5e1; }

.rh-list {
    display: grid;
    gap: 0.75rem;
}

.rh-list-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 0;
    border-top: 1px solid var(--rh-border);
}

.rh-list-item:first-child {
    border-top: 0;
    padding-top: 0;
}

.rh-action-group {
    border: 1px solid var(--rh-border);
    border-radius: 1rem;
    padding: 1rem;
    background: var(--erp-surface-3);
}

.rh-action-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0.85rem;
    border-radius: 0.9rem;
    text-decoration: none;
    color: inherit;
    transition: background-color 0.18s ease, transform 0.18s ease;
}

.rh-action-link:hover {
    background: color-mix(in srgb, var(--erp-primary) 12%, transparent);
    transform: translateX(2px);
}

.rh-mini-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.rh-mini-card {
    border-radius: 1rem;
    padding: 1rem;
    border: 1px solid var(--rh-border);
    background: var(--erp-surface-3);
}

/* =========================
   PRODUCT IMAGES
========================= */
.product-thumb-link,
.product-preview-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.product-thumb {
    width: 34px;
    height: 34px;
    object-fit: cover;
    border-radius: 0.55rem;
    border: 1px solid rgba(15, 23, 42, 0.12);
    background: #f8fafc;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.06);
}

.product-thumb-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    min-height: 34px;
    padding: 0.2rem;
    border-radius: 0.55rem;
    border: 1px dashed rgba(100, 116, 139, 0.38);
    color: #64748b;
    background: #f8fafc;
    font-size: 0.62rem;
    line-height: 1.1;
    text-align: center;
}

.product-form-preview {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 0.8rem;
    border: 1px solid rgba(15, 23, 42, 0.12);
    background: #f8fafc;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

/* =========================
   OFFCANVAS / MOBILE
========================= */
.offcanvas {
    background: transparent !important;
}

.offcanvas-lg.offcanvas-start {
    border-right: none !important;
}

@media (max-width: 991.98px) {
    body.erp-body,
    .erp-layout,
    .erp-main {
        height: auto;
        overflow: visible;
    }

    .erp-sidebar {
        width: auto !important;
        position: fixed;
        height: auto;
        min-height: 0;
        overflow: visible;
        flex: initial;
    }

    .erp-sidebar-inner {
        width: min(88vw, 320px);
        min-height: 100%;
    }

    .erp-sidebar .offcanvas-body,
    .erp-sidebar-scroll {
        max-height: 100dvh;
        padding-bottom: 4.5rem !important;
    }

    .erp-topbar {
        padding: 0.9rem 1rem;
    }

    .erp-content,
    .container-fluid.erp-content {
        padding-top: 1rem !important;
        padding-left: 0.35rem;
        padding-right: 0.35rem;
        padding-bottom: 1.25rem;
        overflow: visible;
    }

    .erp-page-header {
        margin-bottom: 1.25rem;
    }

    .rh-mini-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767.98px) {
    .erp-topbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .erp-topbar-actions {
        width: 100%;
        justify-content: stretch;
    }

    .erp-topbar .dropdown,
    .erp-topbar a.btn,
    .erp-topbar form,
    .erp-topbar .erp-avatar {
        width: 100%;
    }

    .erp-topbar a.btn,
    .erp-topbar .dropdown > button,
    .erp-topbar form .btn {
        width: 100%;
        justify-content: center;
    }

    .table > :not(caption) > * > * {
        padding: 0.85rem 0.8rem;
    }
}
