:root {
    --primary: #0d6efd;
    --secondary: #1f2d3d;
    --light: #f4f7fb;
    --sidebar: #12283b;
    --success: #198754;
    --warning: #fd7e14;
    --danger: #dc3545;
    --text: #1f2937;
    --muted: #64748b;
    --white: #fff;
    --heading-font: 'Manrope', 'Segoe UI', sans-serif;
    --body-font: 'Inter', 'Segoe UI', sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--body-font);
    background: #eef3f8;
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    margin: 0;
    font-family: var(--heading-font);
    line-height: 1.1;
    letter-spacing: -0.04em;
    color: #0f172a;
    font-weight: 800;
}

.app-body {
    display: grid;
    grid-template-areas:
        "topbar topbar"
        "sidebar main";
    grid-template-columns: 260px 1fr;
    grid-template-rows: 72px 1fr;
    min-height: 100vh;
}

.topbar {
    grid-area: topbar;
    background: linear-gradient(135deg, var(--secondary), #243b53);
    color: var(--white);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.12);
    position: sticky;
    top: 0;
    z-index: 10;
}

.brand {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.user-panel {
    display: flex;
    align-items: center;
    gap: 12px;
}

.welcome-text {
    font-size: 0.95rem;
    opacity: 0.96;
}

.badge-role {
    background: rgba(255, 255, 255, 0.18);
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 0.8rem;
    font-weight: 600;
}

.sidebar {
    grid-area: sidebar;
    background: var(--sidebar);
    padding: 22px 16px;
    min-height: calc(100vh - 72px);
}

.sidebar-title {
    color: rgba(255,255,255,0.6);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    padding: 0 10px 12px;
}

.sidebar .nav-link {
    color: rgba(255,255,255,0.8);
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    transition: 0.2s ease;
    letter-spacing: 0.01em;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    background: rgba(255,255,255,0.08);
    color: var(--white);
}

.btn,
.icon-action-btn,
.user-action-btn,
.sarita-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.nav-dropdown {
    margin-bottom: 6px;
}

.nav-dropdown summary {
    list-style: none;
    cursor: pointer;
}

.nav-dropdown summary::-webkit-details-marker {
    display: none;
}

.nav-summary {
    justify-content: space-between;
}

.nav-summary span {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.submenu {
    margin: 6px 0 0 18px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-subitem {
    color: rgba(255,255,255,0.74);
    text-decoration: none;
    padding: 8px 12px 8px 16px;
    border-left: 2px solid rgba(255,255,255,0.18);
    border-radius: 0 10px 10px 0;
    transition: 0.2s ease;
}

.nav-subitem:hover,
.nav-subitem.active {
    background: rgba(255,255,255,0.06);
    color: var(--white);
    border-left-color: rgba(255,255,255,0.8);
}

.main-content {
    grid-area: main;
    padding: 28px;
}

.public-page {
    margin: 0;
    min-height: 100vh;
    background: linear-gradient(135deg, #edf5ff 0%, #dfeaf3 38%, #eaf4f1 100%);
    color: var(--text);
}

.public-content {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
    background:
        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.12), transparent 32%),
        linear-gradient(135deg, #edf5ff 0%, #dfeaf3 38%, #eaf4f1 100%);
}

.login-shell {
    width: min(100%, 980px);
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 32px;
    overflow: hidden;
    box-shadow: 0 28px 60px rgba(15, 23, 42, 0.12);
    backdrop-filter: blur(16px);
}

.login-visual {
    background: linear-gradient(160deg, #0f172a 0%, #1e3a5f 42%, #1f6bb3 100%);
    color: #fff;
    padding: 42px 36px 32px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

.login-visual::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at bottom right, rgba(255,255,255,0.12), transparent 35%);
    pointer-events: none;
}

.login-badge {
    position: relative;
    z-index: 1;
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    font-size: 0.74rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 700;
    color: rgba(255,255,255,0.9);
}

.login-brand-wrap {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 26px;
    margin-bottom: 20px;
}

.login-brand-icon {
    width: 72px;
    height: 72px;
    flex-shrink: 0;
    border-radius: 20px;
    background: rgba(255,255,255,0.14);
    border: 1px solid rgba(255,255,255,0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.12);
}

.login-brand {
    margin: 0;
    font-size: clamp(2rem, 3vw, 3rem);
    line-height: 1;
    font-weight: 800;
    letter-spacing: -0.05em;
    color: #fff;
}

.login-visual-text {
    position: relative;
    z-index: 1;
    margin: 0 0 20px;
    max-width: 420px;
    font-size: 1rem;
    line-height: 1.7;
    color: rgba(255,255,255,0.78);
}

.login-feature-list {
    position: relative;
    z-index: 1;
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 12px;
    color: rgba(255,255,255,0.9);
    font-weight: 500;
}

.login-feature-list li {
    display: flex;
    align-items: center;
    gap: 10px;
}

.login-feature-list i {
    color: #7dd3fc;
    font-size: 0.9rem;
}

.login-card {
    background: rgba(255, 255, 255, 0.9);
    padding: 38px 30px 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-card-header {
    margin-bottom: 22px;
}

.login-card-kicker {
    display: inline-block;
    margin-bottom: 8px;
    color: #2563eb;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.login-card-header h2 {
    margin: 0;
    font-size: clamp(1.8rem, 2vw, 2.4rem);
    color: #0f172a;
    font-weight: 800;
    letter-spacing: -0.04em;
}

.login-alert {
    margin-bottom: 20px;
    border-radius: 12px;
}

.login-form {
    display: block;
}

.login-field-group {
    margin-bottom: 18px;
}

.login-label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.92rem;
    color: #1f2937;
    font-weight: 600;
}

.login-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.login-input-wrap i {
    position: absolute;
    left: 16px;
    color: #64748b;
    font-size: 0.95rem;
}

.login-input {
    width: 100%;
    border: 1px solid rgba(148, 163, 184, 0.6);
    border-radius: 14px;
    background: rgba(248, 250, 252, 0.9);
    color: #0f172a;
    padding: 14px 16px 14px 42px;
    font-size: 0.98rem;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.login-input::placeholder {
    color: #94a3b8;
}

.login-input:focus {
    border-color: rgba(37, 99, 235, 0.8);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.login-submit-btn {
    width: 100%;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #fff;
    padding: 14px 16px;
    font-weight: 700;
    font-size: 1rem;
    margin-top: 12px;
    box-shadow: 0 16px 28px rgba(37, 99, 235, 0.22);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.login-submit-btn:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    transform: translateY(-1px);
    box-shadow: 0 18px 30px rgba(37, 99, 235, 0.28);
    filter: brightness(1.02);
}

@media (max-width: 820px) {
    .login-shell {
        grid-template-columns: 1fr;
    }

    .login-visual {
        padding: 30px 24px 24px;
    }

    .login-card {
        padding: 28px 20px 24px;
    }
}


.alert {
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 18px;
}

.card {
    border: none;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.06);
}

.stat-card {
    background: linear-gradient(135deg, #fff, #f5f9ff);
    border-radius: 16px;
    padding: 18px;
    border: 1px solid rgba(13,110,253,0.08);
    height: 100%;
}

.stat-card .icon {
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    font-size: 1.25rem;
    color: var(--primary);
    background: rgba(13, 110, 253, 0.1);
}

.global-toast {
    position: fixed;
    top: 18px;
    left: 50%;
    transform: translate(-50%, -20px);
    opacity: 0;
    background: #198754;
    color: #fff;
    padding: 12px 18px;
    border-radius: 12px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
    z-index: 2000;
    font-size: 0.92rem;
    font-weight: 600;
    transition: all 0.25s ease;
    min-width: 260px;
    text-align: center;
}

.global-toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

.global-toast.error {
    background: #dc3545;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 22px;
    padding: 18px 22px;
    background: linear-gradient(135deg, rgba(255,255,255,0.88), rgba(248,250,252,0.9));
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 20px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.04);
}

.table thead th {
    background: #f7f8fa;
    border-bottom: none;
}

.formulario-actions-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 120px;
    width: 120px;
    white-space: nowrap;
}

.formulario-actions-cell .icon-action-btn {
    width: 38px;
    min-width: 38px;
    height: 38px;
    padding: 0;
    justify-content: center;
    gap: 0;
}

.respuestas-actions-cell {
    min-width: 220px;
    white-space: nowrap;
    width: 220px;
}

.respuestas-actions-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.respuestas-actions-group .icon-action-btn {
    flex-shrink: 0;
}

.btn-action {
    border-radius: 10px;
    font-size: 0.8rem;
    padding: 6px 10px;
}

.user-action-btn,
.icon-action-btn {
    position: relative;
    min-width: 38px;
    width: 38px;
    min-height: 38px;
    padding: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.04);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.user-action-btn .btn-label,
.icon-action-btn .btn-label {
    position: absolute;
    left: 50%;
    top: calc(100% + 8px);
    transform: translateX(-50%);
    opacity: 0;
    visibility: hidden;
    background: rgba(15, 23, 42, 0.9);
    color: #fff;
    padding: 5px 8px;
    border-radius: 8px;
    font-size: 0.68rem;
    line-height: 1.2;
    white-space: nowrap;
    pointer-events: none;
    z-index: 30;
    transition: opacity 0.18s ease, visibility 0.18s ease;
}

.user-action-btn:hover,
.icon-action-btn:hover,
.user-action-btn:focus-visible,
.icon-action-btn:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 10px 18px rgba(15, 23, 42, 0.08);
}

.user-action-btn:hover .btn-label,
.icon-action-btn:hover .btn-label,
.user-action-btn:focus-visible .btn-label,
.icon-action-btn:focus-visible .btn-label {
    opacity: 1;
    visibility: visible;
}

.status-pill {
    display: inline-block;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-pill.active {
    background: rgba(25, 135, 84, 0.12);
    color: var(--success);
}

.status-pill.inactive {
    background: rgba(220, 53, 69, 0.12);
    color: var(--danger);
}

.sarita-dashboard {
    display: flex;
    flex-direction: column;
    gap: 22px;
    color: var(--text);
}

.sarita-header {
    margin-bottom: 0;
}

.section-kicker {
    display: inline-block;
    color: #4f46e5;
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-weight: 800;
    margin-bottom: 8px;
}

.section-subtitle {
    color: #64748b;
    font-size: 0.92rem;
    max-width: 620px;
}

.envio-dashboard {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.dashboard-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(180px, 1fr));
    gap: 18px;
}

.metric-card {
    background: linear-gradient(135deg, #ffffff, #f8fbff);
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 18px;
    padding: 18px 18px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.04);
}

.metric-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: #fff;
    flex-shrink: 0;
}

.metric-primary .metric-icon { background: linear-gradient(135deg, #4f46e5, #4338ca); }
.metric-success .metric-icon { background: linear-gradient(135deg, #10b981, #059669); }
.metric-warning .metric-icon { background: linear-gradient(135deg, #f59e0b, #ea580c); }
.metric-info .metric-icon { background: linear-gradient(135deg, #38bdf8, #2563eb); }

.metric-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.metric-content span {
    font-size: 0.76rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #64748b;
    font-weight: 700;
}

.metric-content strong {
    font-size: 1.55rem;
    line-height: 1.1;
    color: #0f172a;
}

.panel-surface {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 22px;
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.06);
    overflow: hidden;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 20px 22px 18px;
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.9), rgba(255,255,255,1));
    border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.panel-header-text {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.panel-kicker {
    display: inline-block;
    color: #475569;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.check-toggle {
    font-size: 0.82rem;
    color: #334155;
    font-weight: 600;
}

.envio-table {
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
    width: 100%;
}

.envio-table thead th {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    color: #475569;
    font-size: 0.64rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border-bottom: 1px solid rgba(148, 163, 184, 0.15);
    padding: 10px 10px;
}

.envio-table thead th:nth-child(3),
.envio-table tbody td:nth-child(3) {
    width: 18%;
    max-width: 18%;
}

.envio-table thead th:nth-child(10),
.envio-table tbody td:nth-child(10) {
    width: 132px;
    min-width: 132px;
}

.envio-table tbody td {
    padding: 10px 8px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
    vertical-align: middle;
    word-break: break-word;
    overflow-wrap: anywhere;
    font-size: 0.74rem;
    line-height: 1.35;
}

.envio-name-cell {
    max-width: 200px;
    line-height: 1.35;
    color: #1f2937;
    white-space: normal;
}

.envio-table tbody tr:hover {
    background: rgba(79, 70, 229, 0.02);
}

.envio-id {
    display: inline-block;
    border-radius: 999px;
    background: rgba(79, 70, 229, 0.08);
    color: #4338ca;
    padding: 6px 10px;
    font-weight: 700;
    font-size: 0.8rem;
}

.table-actions {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.table-actions .btn {
    border-radius: 9px;
    padding: 6px 10px;
    font-size: 0.74rem;
    font-weight: 600;
}

.table-icon-btn {
    position: relative;
    width: 32px;
    min-width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    font-size: 0.82rem;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.table-icon-btn::after {
    content: attr(title);
    position: absolute;
    left: 50%;
    top: calc(100% + 8px);
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.9);
    color: #fff;
    padding: 5px 8px;
    border-radius: 8px;
    font-size: 0.65rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.18s ease, visibility 0.18s ease;
    z-index: 25;
}

.table-icon-btn:hover::after,
.table-icon-btn:focus-visible::after,
.table-icon-btn:hover,
.table-icon-btn:focus-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.panel-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 16px 22px 20px;
    background: #fff;
    border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.pagination .page-link {
    border-radius: 10px;
    margin-left: 4px;
    padding: 7px 11px;
    color: #334155;
}

.pagination .page-item.active .page-link {
    background: linear-gradient(135deg, #4f46e5, #4338ca);
    border-color: transparent;
}

@media (max-width: 1200px) {
    .dashboard-metrics {
        grid-template-columns: repeat(2, minmax(180px, 1fr));
    }
}

@media (max-width: 768px) {
    .dashboard-metrics {
        grid-template-columns: 1fr;
    }

    .panel-header,
    .panel-footer {
        flex-direction: column;
        align-items: flex-start;
    }

    .header-actions {
        width: 100%;
        justify-content: flex-start;
    }
}

.section-kicker {
    display: inline-block;
    margin-bottom: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #168A68;
}

.page-header h3 {
    margin: 0;
    display: inline-block;
    font-size: clamp(1.35rem, 1.8vw, 1.8rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.1;
    text-wrap: balance;
    background: linear-gradient(135deg, #0f172a 0%, #334155 42%, #2563eb 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 1px 0 rgba(255,255,255,0.4);
}

.header-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(22, 138, 104, 0.08);
    border: 1px solid rgba(22, 138, 104, 0.18);
    color: #146a52;
    font-size: 0.8rem;
    font-weight: 700;
}

.sarita-actionbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 18px 20px;
    background: linear-gradient(180deg, rgba(255,255,255,0.9), rgba(248,250,252,0.75));
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 18px;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.04);
}

.sarita-btn,
.mini-btn {
    appearance: none;
    border: 1px solid transparent;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 44px;
    padding: 10px 16px;
    font-weight: 700;
    font-size: 0.92rem;
    letter-spacing: -0.01em;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, width 0.2s ease, padding 0.2s ease, background 0.18s ease;
}

.sarita-btn {
    position: relative;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    color: #243247;
    border-color: rgba(148, 163, 184, 0.2);
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.04);
    min-width: 46px;
    width: 46px;
    padding: 10px;
    overflow: visible;
}

.sarita-btn .btn-label {
    position: absolute;
    left: 50%;
    top: calc(100% + 10px);
    transform: translateX(-50%);
    display: inline-block;
    opacity: 0;
    visibility: hidden;
    padding: 6px 8px;
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.9);
    color: #ffffff;
    font-size: 0.7rem;
    letter-spacing: 0.02em;
    white-space: nowrap;
    pointer-events: none;
    z-index: 20;
    transition: opacity 0.18s ease, visibility 0.18s ease;
}

.sarita-btn:hover,
.sarita-btn:focus-visible,
.mini-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 18px rgba(15, 23, 42, 0.08);
}

.sarita-btn:hover .btn-label,
.sarita-btn:focus-visible .btn-label {
    opacity: 1;
    visibility: visible;
}

.monitor-modal-dialog {
    max-width: 76vw;
    width: 76vw;
}

.carga-modal-content,
.monitor-modal-content {
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 22px;
    overflow: hidden;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
}

.carga-modal-header,
.monitor-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1.25rem 1rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(8px);
}

.carga-kicker,
.monitor-kicker {
    display: inline-block;
    margin-bottom: 0.35rem;
    padding: 0.3rem 0.6rem;
    border-radius: 999px;
    background: rgba(124, 58, 237, 0.08);
    border: 1px solid rgba(124, 58, 237, 0.15);
    color: #5f3ec7;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.monitor-modal-header .modal-title,
.carga-modal-header .modal-title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 800;
    color: #1f2937;
}

.carga-modal-body,
.monitor-modal-body {
    padding: 1.2rem 1.25rem 1.4rem;
    background: rgba(248, 250, 252, 0.6);
}

.carga-hero-card {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 1rem 1.1rem;
    border: 1px solid rgba(59, 130, 246, 0.15);
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(239, 246, 255, 0.95), rgba(240, 253, 250, 0.9));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.carga-hero-icon {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: linear-gradient(135deg, #2563eb, #0ea5e9);
    color: #fff;
    font-size: 1.2rem;
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.18);
}

.carga-hero-title {
    font-size: 1rem;
    font-weight: 800;
    color: #1e293b;
}

.carga-hero-text {
    font-size: 0.8rem;
    color: #475569;
    margin-top: 0.15rem;
}

.carga-form-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.8rem 0.9rem;
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.58);
}

.carga-form-field .form-label {
    margin: 0;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #475569;
}

.carga-form-field .form-control,
.carga-form-field .form-select {
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.34);
    background: #fff;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.02);
    min-height: 44px;
}

.carga-upload-wrap {
    position: relative;
    padding: 0.6rem;
    border: 1.5px dashed rgba(37, 99, 235, 0.28);
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.9), rgba(239, 246, 255, 0.5));
}

.carga-upload-input {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0.25rem 0.35rem;
}

.carga-preview-box,
.carga-loading-box {
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(248, 250, 252, 0.95));
    padding: 1rem 1.1rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.carga-loading-box {
    border-color: rgba(59, 130, 246, 0.18);
    background: linear-gradient(180deg, rgba(239, 246, 255, 0.82), rgba(240, 249, 255, 0.9));
}

.carga-modal-footer {
    padding-top: 0.85rem;
    border-top: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(248, 250, 252, 0.7);
}

.monitor-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    padding: 0.9rem 1rem;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.82);
}

.monitor-filter-group {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    font-weight: 600;
    color: #334155;
}

.monitor-filter-group .form-label {
    font-size: 0.85rem;
    color: #475569;
}

.monitor-date-input {
    min-width: 170px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.45);
    background: #fff;
    box-shadow: none;
}

.monitor-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.42rem 0.8rem;
    border-radius: 999px;
    border: 1px solid rgba(16, 185, 129, 0.2);
    background: rgba(16, 185, 129, 0.08);
    color: #0f766e;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.monitor-table-panel {
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 18px;
    background: #fff;
    overflow: hidden;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.monitor-table {
    background: #fff;
    margin: 0;
    border-collapse: separate;
    border-spacing: 0;
}

.monitor-table thead th {
    background: linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
    color: #334155;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.8rem 0.6rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
    white-space: nowrap;
}

.monitor-table tbody td {
    padding: 0.7rem 0.6rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.14);
    color: #334155;
    font-size: 0.82rem;
    vertical-align: middle;
}

.monitor-table tbody tr:hover {
    background: rgba(59, 130, 246, 0.03);
}

.monitor-empty-state {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border-color: rgba(148, 163, 184, 0.25);
    color: #475569;
    border-radius: 14px;
    padding: 1rem 1.1rem;
}

.sarita-btn i {
    font-size: 0.9rem;
}

.btn-purple {
    background: linear-gradient(180deg, rgba(124, 58, 237, 0.08), rgba(124, 58, 237, 0.04));
    border-color: rgba(124, 58, 237, 0.18);
    color: #5f3ec7;
}

.btn-green {
    background: linear-gradient(180deg, rgba(16, 185, 129, 0.09), rgba(16, 185, 129, 0.04));
    border-color: rgba(16, 185, 129, 0.2);
    color: #0f8a67;
}

.btn-redlight {
    background: linear-gradient(180deg, rgba(239, 68, 68, 0.09), rgba(239, 68, 68, 0.04));
    border-color: rgba(239, 68, 68, 0.15);
    color: #c93b3b;
}

.btn-neutral {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border-color: rgba(148, 163, 184, 0.2);
    color: #243247;
}

.btn-monitor {
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.10), rgba(59, 130, 246, 0.04));
    border-color: rgba(59, 130, 246, 0.18);
    color: #1d4ed8;
}

.btn-envios {
    background: linear-gradient(180deg, rgba(245, 158, 11, 0.10), rgba(245, 158, 11, 0.04));
    border-color: rgba(245, 158, 11, 0.15);
    color: #b96a00;
}

.btn-emerald {
    background: linear-gradient(180deg, rgba(16, 185, 129, 0.09), rgba(16, 185, 129, 0.04));
    border-color: rgba(16, 185, 129, 0.18);
    color: #0f6d52;
}

.sarita-filter-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 18px;
    flex-wrap: nowrap;
}

.campaign-select {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex: 1 1 auto;
    max-width: 620px;
    min-height: 52px;
    background: #fff;
    border: 1px solid #E5EAF1;
    border-radius: 14px;
    color: #718096;
    font-weight: 600;
    padding: 0 18px;
    box-shadow: 0 10px 20px rgba(36, 50, 71, 0.04);
}

.campaign-select span {
    font-size: 1rem;
}

.sarita-inline-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
    margin-left: 0;
    flex-shrink: 0;
}

.mini-btn {
    position: relative;
    min-height: 40px;
    min-width: 40px;
    width: 40px;
    padding: 8px;
    font-size: 0.83rem;
    white-space: nowrap;
    overflow: visible;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 12px;
    border: 1px solid transparent;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.04);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.mini-btn .btn-label {
    position: absolute;
    left: 50%;
    top: calc(100% + 10px);
    transform: translateX(-50%);
    opacity: 0;
    visibility: hidden;
    background: rgba(15, 23, 42, 0.9);
    color: #ffffff;
    padding: 6px 8px;
    border-radius: 8px;
    font-size: 0.7rem;
    letter-spacing: 0.02em;
    white-space: nowrap;
    pointer-events: none;
    z-index: 20;
    transition: opacity 0.18s ease, visibility 0.18s ease;
}

.mini-btn:hover,
.mini-btn:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 10px 18px rgba(15, 23, 42, 0.08);
}

.mini-btn:hover .btn-label,
.mini-btn:focus-visible .btn-label {
    opacity: 1;
    visibility: visible;
}

.btn-danger {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.14);
    color: #c93b3b;
}

.btn-success {
    background: rgba(22, 138, 104, 0.08);
    border-color: rgba(22, 138, 104, 0.18);
    color: #0f775a;
}

.btn-info {
    background: rgba(59, 130, 246, 0.08);
    border-color: rgba(59, 130, 246, 0.16);
    color: #1d4ed8;
}

.btn-amber {
    background: rgba(245, 158, 11, 0.08);
    border-color: rgba(245, 158, 11, 0.12);
    color: #b96a00;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(150px, 1fr));
    gap: 16px;
}

.summary-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #fff;
    border: 1px solid #E5EAF1;
    border-radius: 18px;
    padding: 18px 16px;
    box-shadow: 0 10px 20px rgba(36, 50, 71, 0.04);
}

.summary-icon {
    width: 46px;
    height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 1.05rem;
}

.summary-icon.dark { background: rgba(36, 50, 71, 0.08); color: #243247; }
.summary-icon.blue { background: rgba(59, 130, 246, 0.08); color: #2563eb; }
.summary-icon.amber { background: rgba(245, 158, 11, 0.08); color: #b96a00; }
.summary-icon.gray { background: rgba(148, 163, 184, 0.15); color: #475569; }
.summary-icon.green { background: rgba(22, 138, 104, 0.08); color: #168A68; }

.summary-copy {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.summary-label {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #718096;
}

.summary-copy strong {
    font-size: 1.1rem;
    color: #243247;
    line-height: 1.2;
}

.status-inline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.dot-green {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.12);
}

.stats-layout {
    display: grid;
    grid-template-columns: 1.2fr 2.4fr 2.4fr;
    gap: 18px;
    align-items: start;
}

.stats-panel {
    background: #fff;
    border: 1px solid #E5EAF1;
    border-radius: 18px;
    padding: 18px 16px 16px;
    box-shadow: 0 10px 20px rgba(36, 50, 71, 0.04);
}

.panel-header {
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #EDF2F7;
}

.panel-header span {
    color: #718096;
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    font-weight: 800;
    text-transform: uppercase;
}

.stat-list {
    display: grid;
    gap: 12px;
}

.two-up {
    grid-template-columns: 1fr;
}

.five-up {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mini-stat {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px 10px 10px;
    border-radius: 14px;
    background: #F8FAFC;
    border: 1px solid #EEF3F8;
}

.mini-stat-head {
    display: flex;
    align-items: center;
    gap: 12px;
}

.icon-box {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
}

.icon-box.blue-soft { background: rgba(59,130,246,0.12); color: #2563eb; }
.icon-box.red-soft { background: rgba(239,68,68,0.11); color: #dc2626; }
.icon-box.amber-soft { background: rgba(245,158,11,0.12); color: #b96a00; }
.icon-box.green-soft { background: rgba(22,138,104,0.11); color: #168A68; }
.icon-box.purple-soft { background: rgba(168,85,247,0.12); color: #7c3aed; }
.icon-box.purple-deep { background: rgba(109,40,217,0.12); color: #6d28d9; }
.icon-box.gray-soft { background: rgba(100,116,139,0.12); color: #475569; }
.icon-box.blue { background: rgba(59,130,246,0.12); color: #2563eb; }
.icon-box.danger { background: rgba(239,68,68,0.11); color: #dc2626; }

.mini-label {
    margin: 0 0 2px;
    color: #718096;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 700;
}

.mini-stat h4 {
    margin: 0;
    font-size: 1.7rem;
    color: #243247;
    letter-spacing: -0.04em;
}

.mini-percent {
    color: #718096;
    font-size: 0.8rem;
    font-weight: 600;
}

.analytics-section {
    background: rgba(255,255,255,0.55);
    border: 1px solid #E5EAF1;
    border-radius: 20px;
    padding: 18px;
    box-shadow: 0 10px 20px rgba(36, 50, 71, 0.04);
}

.section-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.section-title-row h4 {
    margin: 0;
    font-size: 1.35rem;
    color: #243247;
    font-weight: 800;
}

.charts-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr 1fr;
    gap: 18px;
}

.chart-card {
    background: #fff;
    border: 1px solid #E5EAF1;
    border-radius: 18px;
    padding: 18px 16px 16px;
    box-shadow: 0 10px 20px rgba(36, 50, 71, 0.04);
}

.chart-card-header {
    margin-bottom: 16px;
}

.chart-card-header h5 {
    margin: 0;
    color: #243247;
    font-size: 1.04rem;
    font-weight: 800;
}

.bar-chart {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bar-row {
    display: grid;
    grid-template-columns: 120px 1fr 42px;
    align-items: center;
    gap: 12px;
    color: #243247;
}

.bar-row span {
    font-size: 0.78rem;
    font-weight: 700;
    color: #4a5d78;
}

.bar-track {
    width: 100%;
    height: 12px;
    background: #EDF2F7;
    border-radius: 999px;
    overflow: hidden;
}

.bar-track i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #168A68 0%, #36B39E 100%);
}

.bar-row strong {
    font-size: 0.76rem;
    text-align: right;
    color: #243247;
}

.donut-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
}

.donut-chart {
    position: relative;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: conic-gradient(
        #168A68 0 38%,
        #7C3AED 38% 38%,
        #F59E0B 38% 68%,
        #718096 68% 100%
    );
    display: grid;
    place-items: center;
}

.donut-chart::before {
    content: "";
    position: absolute;
    inset: 18px;
    background: #fff;
    border-radius: 50%;
}

.donut-center {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #243247;
}

.donut-center strong {
    font-size: 1.8rem;
    line-height: 1;
}

.donut-center span {
    font-size: 0.7rem;
    color: #718096;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-top: 4px;
}

.legend-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 150px;
}

.legend-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #4a5d78;
    font-size: 0.82rem;
    font-weight: 600;
}

.legend-list em {
    margin-left: auto;
    font-style: normal;
    color: #243247;
    font-weight: 800;
}

.legend-swatch {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.legend-swatch.green { background: #168A68; }
.legend-swatch.purple { background: #7C3AED; }
.legend-swatch.amber { background: #F59E0B; }
.legend-swatch.gray { background: #718096; }
.legend-swatch.slate { background: #CBD5E1; }

.funnel-steps {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}

.funnel-step {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 14px;
    border-radius: 12px;
    color: #243247;
    font-weight: 700;
    border: 1px solid rgba(36, 50, 71, 0.05);
}

.step-1 { background: rgba(22, 138, 104, 0.09); }
.step-2 { background: rgba(124, 58, 237, 0.08); }
.step-3 { background: rgba(245, 158, 11, 0.08); }
.step-4 { background: rgba(148, 163, 184, 0.12); }
.step-5 { background: rgba(226, 232, 240, 0.9); }

.funnel-step span {
    font-size: 0.82rem;
    color: #243247;
}

.funnel-step strong {
    font-size: 0.96rem;
}

@media (max-width: 1200px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }

    .stats-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 992px) {
    .app-body {
        grid-template-areas:
            "topbar"
            "sidebar"
            "main";
        grid-template-columns: 1fr;
        grid-template-rows: auto auto 1fr;
    }

    .sidebar {
        min-height: auto;
    }

    .summary-grid {
        grid-template-columns: repeat(2, minmax(150px, 1fr));
    }
}

@media (max-width: 640px) {
    .sarita-actionbar {
        padding: 14px 12px;
    }

    .sarita-btn {
        flex: 1 1 calc(50% - 8px);
    }

    .summary-grid,
    .five-up {
        grid-template-columns: 1fr;
    }

    .bar-row {
        grid-template-columns: 100px 1fr 32px;
    }

    .campaign-select {
        max-width: none;
        width: 100%;
    }
}
