:root {
    --color-navy: #0f172a;
    --color-navy-2: #111c3a;
    --color-blue: #1d4ed8;
    --color-royal: #2563eb;
    --color-indigo: #4338ca;
    --color-violet: #5b21b6;
    --color-gold: #d4a017;
    --color-gold-dark: #a16207;

    --color-success: #16a34a;
    --color-success-soft: #ecfdf5;
    --color-warning: #f59e0b;
    --color-warning-soft: #fff7ed;
    --color-danger: #dc2626;
    --color-danger-soft: #fff1f2;
    --color-info: #0284c7;
    --color-info-soft: #eff6ff;

    --color-white: #ffffff;
    --color-page: #f8fafc;
    --color-page-2: #eef2f7;
    --color-surface: #ffffff;
    --color-surface-2: #f8fafc;

    --color-border: #dbe2ea;
    --color-border-soft: #e2e8f0;
    --color-text: #0f172a;
    --color-text-soft: #475569;
    --color-muted: #64748b;
    --color-placeholder: #94a3b8;

    --shadow-sm: 0 8px 20px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 14px 34px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 22px 50px rgba(15, 23, 42, 0.14);

    --radius-xs: 10px;
    --radius-sm: 14px;
    --radius-md: 18px;
    --radius-lg: 24px;
    --radius-xl: 28px;

    --transition: all 0.22s ease;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: "Segoe UI", Inter, Roboto, Arial, sans-serif;
    background: linear-gradient(180deg, var(--color-page) 0%, var(--color-page-2) 100%);
    color: var(--color-text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    max-width: 100%;
    display: block;
}

button,
input,
select,
textarea {
    font: inherit;
}

a {
    color: inherit;
    text-decoration: none;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    margin-top: 0;
    color: var(--color-text);
}

p {
    margin-top: 0;
}

.system-layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 280px 1fr;
}

.sidebar {
    background: linear-gradient(180deg, var(--color-navy) 0%, var(--color-navy-2) 55%, var(--color-indigo) 100%);
    color: var(--color-white);
    padding: 26px 20px;
    position: sticky;
    top: 0;
    height: 100vh;
    box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.04);
}

.sidebar__brand {
    padding: 8px 10px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 18px;
}

.sidebar__brand h2 {
    margin: 0 0 6px;
    font-size: 2rem;
    font-weight: 800;
    color: #ffffff;
}

.sidebar__brand p {
    margin: 0;
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.96rem;
}

.sidebar__nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sidebar__link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    border-radius: 18px;
    color: rgba(255, 255, 255, 0.92);
    font-weight: 700;
    transition: var(--transition);
}

.sidebar__link:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(2px);
}

.sidebar__link.active {
    background: linear-gradient(135deg, var(--color-blue) 0%, var(--color-indigo) 100%);
    color: #ffffff;
    box-shadow: 0 14px 28px rgba(37, 99, 235, 0.24);
}

.sidebar__link.is-hidden-by-permission {
    display: none !important;
}

.main-content {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    padding: 22px 28px 12px;
}

.topbar__left h1 {
    margin: 0 0 6px;
    font-size: 2.1rem;
    font-weight: 800;
}

.topbar__left p {
    margin: 0;
    color: var(--color-muted);
    font-size: 1rem;
}

.topbar__right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.topbar__right > span,
.topbar__user {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 18px;
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid var(--color-border-soft);
    color: var(--color-text-soft);
    font-weight: 800;
    box-shadow: var(--shadow-sm);
}

.page-content {
    padding: 0 28px 28px;
}

.card,
.section-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border-soft);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 22px;
}

.section-title {
    margin-bottom: 16px;
}

.section-title h2,
.section-title h3 {
    margin-bottom: 6px;
    font-weight: 800;
}

.section-title p {
    color: var(--color-muted);
    margin-bottom: 0;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 0 18px;
    border-radius: 16px;
    border: 1px solid transparent;
    font-weight: 800;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-blue) 0%, var(--color-indigo) 100%);
    color: #fff;
    border: none;
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.18);
}

.btn-primary:hover {
    filter: brightness(1.03);
}

.btn-secondary {
    background: linear-gradient(180deg, #ffffff 0%, #f1f5f9 100%);
    color: var(--color-text-soft);
    border: 1px solid var(--color-border);
}

.btn-secondary:hover {
    background: linear-gradient(180deg, #ffffff 0%, #e9eef6 100%);
}

.btn-success {
    background: linear-gradient(135deg, var(--color-gold) 0%, var(--color-gold-dark) 100%);
    color: #fff;
    border: none;
    box-shadow: 0 12px 24px rgba(212, 160, 23, 0.18);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
    color: #fff;
    border: none;
}

.btn-sm {
    min-height: 38px;
    padding: 0 14px;
    border-radius: 12px;
    font-size: 0.92rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.form-group label {
    font-weight: 800;
    color: var(--color-text);
    font-size: 0.95rem;
}

input,
select,
textarea {
    width: 100%;
    min-height: 48px;
    border-radius: 16px;
    border: 1px solid var(--color-border);
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    color: var(--color-text);
    padding: 12px 14px;
    outline: none;
    transition: var(--transition);
}

textarea {
    min-height: 120px;
    resize: vertical;
}

input::placeholder,
textarea::placeholder {
    color: var(--color-placeholder);
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--color-blue);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
    background: #ffffff;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.table-wrapper {
    width: 100%;
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    min-width: 900px;
}

.table thead th {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    color: var(--color-text);
    font-weight: 800;
    font-size: 0.92rem;
    text-align: left;
    padding: 16px 14px;
    border-bottom: 1px solid var(--color-border-soft);
    position: sticky;
    top: 0;
    z-index: 1;
}

.table tbody td {
    padding: 15px 14px;
    border-bottom: 1px solid #eef2f7;
    color: var(--color-text-soft);
    vertical-align: middle;
    background: rgba(255, 255, 255, 0.8);
}

.table tbody tr:hover td {
    background: #f8fbff;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    font-weight: 800;
    font-size: 0.82rem;
    border: 1px solid transparent;
    white-space: nowrap;
}

.badge-success {
    background: var(--color-success-soft);
    color: var(--color-success);
    border-color: #bbf7d0;
}

.badge-warning {
    background: #fff7ed;
    color: #b45309;
    border-color: #fed7aa;
}

.badge-danger {
    background: var(--color-danger-soft);
    color: var(--color-danger);
    border-color: #fecdd3;
}

.badge-info {
    background: var(--color-info-soft);
    color: var(--color-info);
    border-color: #bfdbfe;
}

.actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.actions button,
.actions .edit,
.actions .delete {
    min-height: 36px;
    padding: 0 12px;
    border-radius: 12px;
    border: none;
    font-weight: 800;
    cursor: pointer;
    transition: var(--transition);
}

.actions .edit {
    background: linear-gradient(135deg, var(--color-blue) 0%, var(--color-indigo) 100%);
    color: #fff;
}

.actions .delete {
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
    color: #fff;
}

.actions button:hover,
.actions .edit:hover,
.actions .delete:hover {
    filter: brightness(1.04);
    transform: translateY(-1px);
}

.alert,
.message-box,
.status-box {
    padding: 14px 16px;
    border-radius: 16px;
    font-weight: 700;
    border: 1px solid transparent;
}

.alert-success {
    background: var(--color-success-soft);
    color: var(--color-success);
    border-color: #bbf7d0;
}

.alert-error {
    background: var(--color-danger-soft);
    color: var(--color-danger);
    border-color: #fecdd3;
}

.alert-warning {
    background: #fff7ed;
    color: #b45309;
    border-color: #fed7aa;
}

.alert-info {
    background: var(--color-info-soft);
    color: var(--color-info);
    border-color: #bfdbfe;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.stat-card {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid var(--color-border-soft);
    border-radius: 22px;
    padding: 22px;
    box-shadow: var(--shadow-sm);
}

.stat-card__label {
    color: var(--color-muted);
    font-weight: 700;
    margin-bottom: 10px;
}

.stat-card__value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--color-text);
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.08), transparent 24%),
        radial-gradient(circle at bottom right, rgba(67, 56, 202, 0.08), transparent 24%),
        linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
}

.login-card {
    width: 100%;
    max-width: 460px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid var(--color-border-soft);
    border-radius: 28px;
    box-shadow: var(--shadow-lg);
    padding: 34px;
}

.login-card h1,
.login-card h2 {
    margin-bottom: 10px;
    font-size: 2rem;
    font-weight: 800;
}

.login-card p {
    color: var(--color-muted);
    margin-bottom: 24px;
}

.login-card .btn {
    width: 100%;
}

.premium-banner,
.module-banner {
    position: relative;
    overflow: hidden;
    border-radius: 28px;
    padding: 28px 30px;
    background:
        radial-gradient(circle at top right, rgba(255,255,255,0.16), transparent 24%),
        radial-gradient(circle at bottom left, rgba(255,255,255,0.08), transparent 20%),
        linear-gradient(135deg, var(--color-navy) 0%, var(--color-blue) 58%, var(--color-indigo) 100%);
    color: #ffffff;
    box-shadow: var(--shadow-lg);
}

.premium-banner h2,
.module-banner h2 {
    color: #ffffff;
    margin-bottom: 8px;
    font-size: 2rem;
    font-weight: 800;
}

.premium-banner p,
.module-banner p {
    color: rgba(255, 255, 255, 0.92);
    margin-bottom: 0;
}

.premium-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255,255,255,0.14);
    border: 1px solid rgba(255,255,255,0.18);
    color: #ffffff;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.82rem;
    margin-bottom: 14px;
}

.mini-card {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid var(--color-border-soft);
    border-radius: 20px;
    padding: 18px;
    box-shadow: var(--shadow-sm);
}

.mini-card h3,
.mini-card h4 {
    margin-bottom: 8px;
    font-weight: 800;
}

.mini-card p {
    margin-bottom: 0;
    color: var(--color-muted);
}

.text-muted {
    color: var(--color-muted);
}

.text-center {
    text-align: center;
}

.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mb-24 { margin-bottom: 24px; }

.hidden {
    display: none !important;
}

@media (max-width: 1280px) {
    .system-layout {
        grid-template-columns: 240px 1fr;
    }

    .grid-4,
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .grid-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.btn-sidebar-toggle {
    display: none;
}

.sidebar-overlay {
    display: none !important;
}

.btn-sidebar-close {
    display: none;
}

@media (max-width: 992px) {
    .system-layout {
        grid-template-columns: 1fr;
    }

    .btn-sidebar-toggle {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        margin-bottom: 10px;
        padding: 10px 14px;
        border: 1px solid #cbd5e1;
        border-radius: 12px;
        background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
        color: #0f172a;
        font-weight: 700;
        font-size: 0.9rem;
        cursor: pointer;
        box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
    }

    .btn-sidebar-toggle:focus-visible {
        outline: 2px solid #2563eb;
        outline-offset: 2px;
    }

    .btn-sidebar-toggle__icon {
        display: block;
        width: 18px;
        height: 2px;
        background: #0f172a;
        position: relative;
        border-radius: 2px;
    }

    .btn-sidebar-toggle__icon::before,
    .btn-sidebar-toggle__icon::after {
        content: '';
        position: absolute;
        left: 0;
        width: 18px;
        height: 2px;
        background: #0f172a;
        border-radius: 2px;
    }

    .btn-sidebar-toggle__icon::before {
        top: -6px;
    }

    .btn-sidebar-toggle__icon::after {
        top: 6px;
    }

    body.sidebar-open {
        overflow: hidden;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        z-index: 9998;
        background: rgba(15, 23, 42, 0.45);
    }

    body.sidebar-open .sidebar-overlay {
        display: block !important;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        z-index: 9999;
        width: min(300px, 88vw);
        height: 100vh;
        height: 100dvh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        transform: translateX(-110%);
        transition: transform 0.25s ease;
        border-radius: 0;
        box-shadow: 8px 0 32px rgba(15, 23, 42, 0.18);
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    .btn-sidebar-close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        margin-left: auto;
        border: 1px solid rgba(255, 255, 255, 0.12);
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.08);
        color: #fff;
        font-size: 1.35rem;
        line-height: 1;
        cursor: pointer;
    }

    .sidebar__nav-header {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        margin-bottom: 4px;
    }

    .topbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .page-content {
        padding: 0 18px 18px;
    }

    .topbar {
        padding: 18px 18px 10px;
    }

    .grid-2,
    .grid-3,
    .grid-4,
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar__brand h2 {
        font-size: 1.8rem;
    }

    .sidebar__brand-name {
        font-size: 0.92rem;
        line-height: 1.25;
    }

    .topbar__left h1 {
        font-size: 1.8rem;
    }

    .login-card {
        padding: 26px 22px;
    }

    .premium-banner,
    .module-banner {
        padding: 24px 20px;
    }

    .premium-banner h2,
    .module-banner h2 {
        font-size: 1.6rem;
    }

    .table {
        min-width: 760px;
    }

    .topbar__right {
        width: 100%;
    }
}

/* ========================================
   Inversiones Del Norte — Sistema IDN (chrome lateral)
   ======================================== */

.sidebar__brand--idn {
    padding: 4px 6px 18px;
}

.sidebar__brand-mark {
    display: flex;
    align-items: center;
    gap: 14px;
}

.sidebar__brand-icon {
    flex-shrink: 0;
    border-radius: 12px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
}

.sidebar__brand-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.sidebar__brand-name {
    display: block;
    font-size: 0.95rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: 0.02em;
    color: #ffffff;
}

.sidebar__brand-product {
    display: block;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.72);
}

.sidebar__brand-tagline {
    margin: 14px 2px 0;
    font-size: 0.78rem;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 600;
}

.sidebar__link {
    border: 1px solid transparent;
}

.sidebar__link:hover {
    border-color: rgba(255, 255, 255, 0.07);
}

.sidebar__link.active {
    border-color: rgba(255, 255, 255, 0.14);
}

/* B3-C: deep link desde Alertas hacia Productos */
.prod-deep-link-banner {
    margin: 0 0 1rem;
    padding: 0.65rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
}

.prod-deep-link-banner--success {
    background: #ecfdf3;
    border: 1px solid #6ee7a0;
    color: #065f46;
}

.prod-deep-link-banner--warning {
    background: #fffbeb;
    border: 1px solid #fcd34d;
    color: #92400e;
}

tr.prod-row-highlight {
    outline: 2px solid #2563eb;
    outline-offset: -2px;
    background-color: rgba(37, 99, 235, 0.08) !important;
}

/* ========================================
   D4L-R3 — Responsive tablas globales + polish móvil
   ======================================== */

.idn-table-scroll-hint,
.registro-table-scroll-hint,
.facturas-table-scroll-hint {
    display: none;
    margin: 0 0 10px;
    padding: 8px 12px;
    border-radius: 10px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
    font-size: 0.84rem;
    line-height: 1.4;
}

@media (max-width: 992px) {
    .idn-table-scroll-hint,
    .registro-table-scroll-hint,
    .facturas-table-scroll-hint {
        display: block;
    }
}

.idn-table-responsive-wrap,
.pending-table-wrapper,
.alertas-table-wrapper,
.reports-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.idn-table-compact thead th {
    font-size: 0.76rem;
    padding: 7px 5px;
}

.idn-table-compact tbody td {
    font-size: 0.8rem;
    padding: 7px 5px;
}

.idn-table-compact th:first-child,
.idn-table-compact td:first-child,
.idn-col-sticky-first {
    position: sticky;
    left: 0;
    z-index: 3;
    background: #f8fafc;
    box-shadow: 2px 0 4px rgba(15, 23, 42, 0.06);
}

.idn-table-compact tbody td:first-child,
.idn-table-compact tbody .idn-col-sticky-first {
    background: #fff;
    z-index: 2;
}

.idn-table-compact tbody tr:nth-child(even) td:first-child,
.idn-table-compact tbody tr:nth-child(even) .idn-col-sticky-first {
    background: #fcfdff;
}

.pending-table-wrapper .table.idn-table-compact,
.alertas-table-wrapper .table.idn-table-compact,
.reports-table-wrapper .table.idn-table-compact {
    min-width: 1100px;
}

.reports-table-wrapper .table.idn-table-compact {
    min-width: 1280px;
}

@media (max-width: 768px) {
    .pending-table-wrapper .table.idn-table-compact {
        min-width: 980px;
    }

    .alertas-table-wrapper .table.idn-table-compact {
        min-width: 900px;
    }

    .reports-table-wrapper .table.idn-table-compact {
        min-width: 1080px;
    }

    .idn-table-compact thead th {
        font-size: 0.72rem;
        padding: 6px 4px;
    }

    .idn-table-compact tbody td {
        font-size: 0.76rem;
        padding: 6px 4px;
    }
}

@media (max-width: 640px) {
    .topbar--premium .topbar__left {
        width: 100%;
        min-width: 0;
    }

    .topbar--premium .topbar__left h1 {
        font-size: 1.35rem;
        line-height: 1.2;
        padding-right: 4px;
    }

    .topbar--premium .topbar__left p {
        font-size: 0.84rem;
        line-height: 1.45;
        margin-top: 4px;
    }

    .topbar--premium .topbar__right {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        align-items: stretch;
        gap: 8px;
        justify-content: flex-start;
    }

    .topbar__pill--date {
        flex: 1 1 100%;
        justify-content: center;
        min-height: 40px;
        padding: 0 10px;
        font-size: 0.78rem;
    }

    .topbar__pill--user {
        flex: 1 1 calc(100% - 88px);
        min-width: 0;
        max-width: none;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 0.76rem;
        padding: 0 10px;
        justify-content: flex-start;
    }

    .btn-logout {
        flex: 0 0 auto;
        min-height: 44px;
        padding: 0 12px;
        font-size: 0.8rem;
    }

    .btn-sidebar-toggle {
        min-height: 44px;
        margin-bottom: 8px;
    }

    .page-content {
        padding: 0 14px 16px;
    }
}

@media (max-width: 420px) {
    .topbar--premium {
        padding: 14px 14px 8px;
    }

    .topbar--premium .topbar__left h1 {
        font-size: 1.2rem;
    }

    .topbar--premium .topbar__left p {
        display: none;
    }

    .topbar__pill--user {
        flex: 1 1 100%;
    }

    .btn-logout {
        flex: 1 1 100%;
        width: 100%;
        justify-content: center;
    }
}

/* D4L-R6 — campos compactos, dinero y calculados (patrón compartido) */
.idn-input-money {
    position: relative;
    display: block;
}

.idn-input-money__sym {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    font-weight: 800;
    font-size: 0.9rem;
    pointer-events: none;
    z-index: 1;
}

.idn-input-money input {
    padding-left: 30px;
    text-align: right;
    font-variant-numeric: tabular-nums;
    width: 100%;
    box-sizing: border-box;
}

.idn-field-calculado input,
.idn-field-calculado select {
    background: linear-gradient(180deg, #f0f9ff 0%, #e0f2fe 100%);
    border-color: #7dd3fc;
    color: #0c4a6e;
    font-weight: 800;
}

/* D4L-R5 — acciones tabla compactas (patrón compartido) */
@media (max-width: 992px) {
    .idn-table-actions-compact {
        flex-direction: row !important;
        flex-wrap: wrap;
        max-width: 118px;
        gap: 4px;
    }

    .idn-table-actions-compact .btn {
        width: auto !important;
        min-height: 32px;
        padding: 5px 7px;
        font-size: 0.68rem;
    }
}

@media (max-width: 768px) {
    .btn,
    .btn-logout,
    .btn-sidebar-toggle {
        min-height: 44px;
    }

    input:not([type="checkbox"]):not([type="radio"]),
    select,
    textarea {
        min-height: 44px;
        font-size: 16px;
    }

    textarea {
        min-height: 88px;
    }
}