:root {
    --app-primary: #5367df;
    --app-sidebar: #17213c;
    --app-accent: #13b7d0;
    --app-background: #f1f3f8;
    --app-panel: #ffffff;
    --app-text: #202a44;
    --app-muted: #76809a;
    --app-border: #e4e8f0;
    --app-shadow: 0 12px 32px rgba(27, 39, 73, .08);
}

html {
    min-height: 100%;
    scroll-behavior: smooth;
}

body {
    background-color: var(--app-background);
    color: var(--app-text);
    font-family: Inter, Roboto, Arial, sans-serif;
}

img,
video,
iframe {
    max-width: 100%;
}

.container {
    width: min(100% - 32px, 1320px);
    max-width: 1320px;
}

.card,
.panel,
.modal-content {
    border: 1px solid var(--app-border);
    border-radius: 14px;
    box-shadow: var(--app-shadow);
    overflow: hidden;
}

.card {
    background: var(--app-panel);
    margin-bottom: 20px;
}

.card-header,
.card-footer {
    background: var(--app-panel);
    border-color: var(--app-border);
}

.card-header {
    color: var(--app-text);
    font-weight: 700;
}

.btn,
button,
input[type="submit"],
input[type="button"] {
    border-radius: 8px;
    font-weight: 600;
    transition: filter .16s ease, transform .16s ease, box-shadow .16s ease;
}

.btn:hover,
button:hover,
input[type="submit"]:hover,
input[type="button"]:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
}

.form,
form.form {
    box-sizing: border-box;
    width: min(100% - 28px, 680px) !important;
    margin: 28px auto;
    padding: clamp(18px, 3vw, 32px);
    border: 1px solid var(--app-border);
    border-radius: 16px;
    background: var(--app-panel);
    box-shadow: var(--app-shadow);
}

.login-input,
input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="color"]),
select,
textarea {
    box-sizing: border-box;
    max-width: 100%;
    min-height: 42px;
    border: 1px solid #d5dbea;
    border-radius: 8px;
    background-color: #fff;
    color: var(--app-text);
}

textarea {
    min-height: 100px;
}

.login-input:focus,
input:focus,
select:focus,
textarea:focus {
    border-color: var(--app-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--app-primary) 16%, transparent);
    outline: 0;
}

table {
    max-width: 100%;
}

.table-responsive {
    border-radius: 10px;
}

.table thead th,
thead > tr:first-child {
    background-color: var(--app-sidebar);
    color: #fff;
}

.alert {
    border-radius: 10px;
}

.dashboard-quick-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: min(100% - 28px, 1320px);
    margin: 20px auto 14px;
    padding: 14px;
    border: 1px solid var(--app-border);
    border-left: 4px solid var(--app-sidebar);
    border-radius: 14px;
    background: var(--app-panel);
    box-shadow: var(--app-shadow);
    text-align: center;
}

.dashboard-quick-actions > a,
.dashboard-quick-actions .flotador,
.dashboard-quick-actions .flotadorpagina,
.dashboard-quick-actions .flotadorlistados,
.dashboard-quick-actions .flotadorbotontv1,
.dashboard-quick-actions .flotadorbotontv2,
.dashboard-quick-actions .manual {
    position: relative !important;
    inset: auto !important;
    display: inline-flex !important;
    float: none !important;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    text-align: center !important;
}

.dashboard-quick-actions .flotador,
.dashboard-quick-actions .flotadorpagina,
.dashboard-quick-actions .flotadorlistados,
.dashboard-quick-actions .flotadorbotontv1,
.dashboard-quick-actions .flotadorbotontv2,
.dashboard-quick-actions .manual {
    position: relative !important;
    inset: auto !important;
    display: inline-flex !important;
    float: none !important;
    margin: 6px !important;
    vertical-align: middle;
}

.dashboard-quick-actions [id^="siide"],
.dashboard-quick-actions #simanual {
    display: inline-flex;
    min-width: 128px;
    min-height: 74px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 10px 12px !important;
    border: 1px solid color-mix(in srgb, var(--app-primary) 24%, white) !important;
    border-radius: 10px !important;
    background: color-mix(in srgb, var(--app-primary) 8%, white) !important;
    color: var(--app-primary) !important;
    font-size: 13px !important;
    font-weight: 700;
    line-height: 1.25;
}

.dashboard-quick-actions [id^="siide"] img,
.dashboard-quick-actions #simanual img {
    width: 25px !important;
    height: 25px !important;
    object-fit: contain;
}

.dashboard-quick-actions .flotador #siide,
.dashboard-quick-actions .flotadorpagina #siidepagina,
.dashboard-quick-actions .flotadorlistados #siidelistados,
.dashboard-quick-actions .flotadorbotontv1 #siidebotontv1,
.dashboard-quick-actions .flotadorbotontv2 #siidebotontv2,
.dashboard-quick-actions .manual #simanual {
    display: inline-flex;
    min-width: 128px;
    min-height: 74px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 10px 12px !important;
    border: 1px solid color-mix(in srgb, var(--app-primary) 24%, white) !important;
    border-radius: 10px !important;
    background: color-mix(in srgb, var(--app-primary) 8%, white) !important;
    color: var(--app-primary) !important;
    font-size: 13px !important;
    font-weight: 700;
    line-height: 1.25;
}

.dashboard-quick-actions .flotador #siide img,
.dashboard-quick-actions .flotadorpagina #siidepagina img,
.dashboard-quick-actions .flotadorlistados #siidelistados img,
.dashboard-quick-actions .flotadorbotontv1 #siidebotontv1 img,
.dashboard-quick-actions .flotadorbotontv2 #siidebotontv2 img,
.dashboard-quick-actions .manual #simanual img {
    width: 25px !important;
    height: 25px !important;
    object-fit: contain;
}

.btn-primary,
.login-button {
    border-color: var(--app-primary) !important;
    background-color: var(--app-primary) !important;
    color: #fff !important;
}

.btn-info {
    border-color: var(--app-accent);
    background-color: var(--app-accent);
}

a:hover,
a:focus {
    color: var(--app-accent);
}

.flotadortv1,
.flotadortv2 {
    z-index: 1100 !important;
    width: 0;
    max-width: 100vw;
    background: var(--app-sidebar) !important;
}

.dashboard-header-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid var(--app-border);
    background: var(--app-panel);
    text-align: center;
}

.dashboard-header-actions a {
    float: none !important;
    margin: 0 !important;
}

.admin-dashboard .container {
    width: 100%;
    max-width: 100%;
}

.admin-dashboard .row {
    gap: 18px 0;
}

.admin-dashboard .card {
    height: 100%;
}

.theme-settings-panel {
    width: min(100% - 28px, 900px);
    margin: 22px auto;
    padding: clamp(18px, 3vw, 28px);
    border: 1px solid var(--app-border);
    border-radius: 16px;
    background: var(--app-panel);
    box-shadow: var(--app-shadow);
    text-align: left;
}

.theme-settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px;
    margin: 18px 0;
}

.theme-color-field {
    display: grid;
    grid-template-columns: 1fr 54px;
    align-items: center;
    gap: 10px;
}

.theme-color-field input[type="color"] {
    width: 54px;
    height: 42px;
    padding: 3px;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
}

.theme-preset-control {
    max-width: 100%;
    margin: 12px 0;
}

@media (max-width: 767.98px) {
    .container {
        width: min(100% - 20px, 100%);
        padding-right: 10px;
        padding-left: 10px;
    }

    .dashboard-quick-actions {
        width: calc(100% - 20px);
        gap: 8px;
        padding: 10px;
    }

    .dashboard-quick-actions [id^="siide"],
    .dashboard-quick-actions #simanual {
        min-width: 112px;
        min-height: 68px;
        padding: 8px !important;
        font-size: 12px !important;
    }

    .dashboard-quick-actions .flotador #siide,
    .dashboard-quick-actions .flotadorpagina #siidepagina,
    .dashboard-quick-actions .flotadorlistados #siidelistados,
    .dashboard-quick-actions .flotadorbotontv1 #siidebotontv1,
    .dashboard-quick-actions .flotadorbotontv2 #siidebotontv2,
    .dashboard-quick-actions .manual #simanual {
        min-width: 108px;
        min-height: 66px;
        padding: 8px !important;
        font-size: 12px !important;
    }

    .admin-dashboard .row > [class*="col"] {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .table-responsive table {
        min-width: 640px;
    }

    .dashboard-header-actions {
        gap: 8px;
    }

    .flotadortv1,
    .flotadortv2 {
        height: 100dvh !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}

body.app-shell-active {
    min-width: 320px;
    min-height: 100vh;
    overflow-x: hidden;
    background: #f3f6fa;
}

.app-shell {
    min-height: 100vh;
}

.app-topbar {
    position: fixed;
    z-index: 12000;
    inset: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 18px;
    height: 64px;
    padding: 0 24px;
    background: var(--app-primary, #2583c5);
    box-shadow: 0 2px 12px rgba(20, 42, 68, .18);
    color: #fff;
}

.app-menu-toggle {
    display: none;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 8px;
    background: rgba(255, 255, 255, .14);
    color: #fff;
    cursor: pointer;
}

.app-brand {
    overflow: hidden;
    max-width: min(34vw, 360px);
    color: #fff !important;
    font-size: 17px;
    font-weight: 700;
    text-decoration: none !important;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-topbar-spacer {
    flex: 1;
}

.app-account,
.app-logout {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: #fff !important;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none !important;
    white-space: nowrap;
}

.app-account-avatar {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .42);
    border-radius: 50%;
}

.app-sidebar {
    box-sizing: border-box;
    position: fixed;
    z-index: 11900;
    inset: 64px auto 0 0;
    width: 248px;
    overflow-y: auto;
    padding: 18px 12px 24px;
    background: #1d2938;
    color: #e6edf5;
    box-shadow: 4px 0 16px rgba(25, 39, 55, .08);
}

.app-sidebar-profile {
    display: grid;
    justify-items: center;
    gap: 7px;
    margin: 0 4px 18px;
    padding: 12px 10px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, .12);
    color: #fff;
    text-align: center;
}

.app-sidebar-profile strong {
    max-width: 100%;
    overflow: hidden;
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-sidebar-profile > span {
    color: #9eacbc;
    font-size: 12px;
}

.app-profile-avatar {
    display: grid;
    width: 56px;
    height: 56px;
    place-items: center;
    border: 2px solid rgba(255, 255, 255, .2);
    border-radius: 50%;
    background: #2a3a4e;
    color: #d8e6f5;
    font-size: 22px;
}

.app-navigation {
    display: grid;
    gap: 4px;
}

.app-navigation-group {
    margin: 13px 10px 5px;
    color: #8d9bad;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .12em;
}

.app-navigation-link {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 42px;
    padding: 9px 12px;
    border-radius: 7px;
    color: #d1d9e3 !important;
    font-size: 13px;
    text-decoration: none !important;
    transition: background-color .15s ease, color .15s ease;
}

.app-navigation-link .fa {
    width: 18px;
    color: #a7b6c8;
    font-size: 15px;
    text-align: center;
}

.app-navigation-link:hover,
.app-navigation-link.is-active {
    background: rgba(255, 255, 255, .11);
    color: #fff !important;
}

.app-navigation-link.is-active {
    box-shadow: inset 3px 0 0 var(--app-accent, #16b8d0);
}

.app-navigation-link.is-active .fa {
    color: #58d1df;
}

.app-main {
    min-height: 100vh;
    margin-left: 248px;
    padding: 88px 28px 34px;
}

.app-main > .container,
.app-main > .admin-dashboard,
.app-main .admin-dashboard {
    width: 100%;
    max-width: 1440px;
    margin-right: auto;
    margin-left: auto;
}

.app-main .dashboard-quick-actions {
    box-sizing: border-box;
    width: min(100%, 1440px);
    margin: 0 auto 22px;
    border-left: 0;
    padding: 14px 18px;
}

.app-sidebar-backdrop {
    display: none;
}

.admin-dashboard > div[style*="margin: 30px"] {
    margin: 0 0 18px !important;
    text-align: left;
}

.admin-dashboard > div[style*="margin: 30px"] h3 {
    text-align: left;
}

.admin-dashboard > .card {
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.admin-dashboard > .card > .card-body {
    padding: 0;
}

.admin-dashboard > .card .card-header[style*="border-radius:10px"] {
    margin-bottom: 20px;
    padding: 20px 24px !important;
    border: 0;
    border-radius: 12px !important;
    background: #fff !important;
    box-shadow: 0 4px 18px rgba(28, 48, 73, .06);
    color: #27374a !important;
    font-family: Inter, Arial, sans-serif !important;
    font-size: 20px !important;
    line-height: 1.5 !important;
    text-align: left !important;
    text-shadow: none !important;
}

.admin-dashboard > .card .card-header[style*="border-radius:10px"] span {
    color: #657487 !important;
    font-size: 13px !important;
    text-shadow: none !important;
}

.admin-dashboard #dynamic_content {
    overflow: visible;
    background: transparent !important;
}

.admin-dashboard #dynamic_content > .dashboard-header-actions {
    display: flex;
    justify-content: center;
    margin: 0 0 20px;
    border: 1px solid #e6ebf2;
    border-radius: 12px;
    background: #fff;
}

.admin-dashboard .dashboard-header-actions .btn {
    min-width: 150px;
}

.admin-dashboard #dynamic_content > .container {
    width: 100%;
    max-width: 100%;
    padding: 0;
}

.admin-dashboard #dynamic_content > .container > .row {
    gap: 18px 0;
    margin: 0 -9px;
    background: transparent !important;
}

.admin-dashboard #dynamic_content > .container > .row > [class*="col"] {
    padding: 0 9px;
}

.admin-dashboard #dynamic_content > .container > .row .card {
    border: 1px solid #e6ebf2;
    background: #fff;
    box-shadow: 0 4px 18px rgba(28, 48, 73, .05);
}

.admin-dashboard #dynamic_content > .container > .row .card-header {
    padding: 16px;
    background: #fff;
    color: #27374a;
}

.admin-dashboard #dynamic_content > .container > .row .card-header h4 {
    margin: 0;
    font-size: 14px;
}

.admin-dashboard #dynamic_content > .container > .row .card-body {
    padding: 16px;
}

.admin-dashboard #dynamic_content > .container > .row .card-footer {
    min-height: 8px;
    padding: 0;
}

.dashboard-overview {
    display: grid;
    gap: 18px;
    margin: 0 0 22px;
}

.dashboard-page-heading,
.dashboard-analysis-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.dashboard-page-heading {
    padding: 4px 2px 0;
}

.dashboard-eyebrow {
    display: block;
    margin-bottom: 5px;
    color: #8492a4;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .13em;
}

.dashboard-page-heading h2,
.dashboard-analysis-heading h3 {
    margin: 0;
    color: #27374a;
    font-weight: 700;
}

.dashboard-page-heading h2 {
    font-size: clamp(22px, 2.4vw, 29px);
}

.dashboard-page-heading p {
    margin: 5px 0 0;
    color: #77869a;
    font-size: 13px;
}

.dashboard-date {
    padding: 8px 12px;
    border: 1px solid #e3eaf1;
    border-radius: 8px;
    background: #fff;
    color: #66778a;
    font-size: 12px;
    white-space: nowrap;
}

.dashboard-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.dashboard-kpi {
    position: relative;
    display: grid;
    min-height: 150px;
    align-content: start;
    gap: 5px;
    overflow: hidden;
    padding: 19px;
    border: 1px solid transparent;
    border-radius: 11px;
    color: #24354a !important;
    text-decoration: none !important;
    transition: transform .16s ease, box-shadow .16s ease;
}

.dashboard-kpi:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(31, 48, 69, .1);
}

.dashboard-kpi-icon {
    position: absolute;
    top: 18px;
    right: 18px;
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border-radius: 11px;
    background: rgba(255, 255, 255, .72);
    font-size: 18px;
}

.dashboard-kpi-label {
    padding-right: 44px;
    color: #4b5c70;
    font-size: 12px;
    font-weight: 600;
}

.dashboard-kpi > strong {
    margin-top: 7px;
    color: #24354a;
    font-size: 30px;
    line-height: 1.15;
}

.dashboard-kpi-detail {
    color: #63758a;
    font-size: 11px;
}

.dashboard-kpi-blue {
    border-color: #d7e8f6;
    background: #e8f3fb;
}

.dashboard-kpi-blue .dashboard-kpi-icon {
    color: #2786c5;
}

.dashboard-kpi-green {
    border-color: #d8eee4;
    background: #e9f6ef;
}

.dashboard-kpi-green .dashboard-kpi-icon {
    color: #28a36a;
}

.dashboard-kpi-cyan {
    border-color: #d5edf0;
    background: #e7f6f7;
}

.dashboard-kpi-cyan .dashboard-kpi-icon {
    color: #159eaf;
}

.dashboard-kpi-orange {
    border-color: #f4e3d3;
    background: #fbf1e7;
}

.dashboard-kpi-orange .dashboard-kpi-icon {
    color: #d68a36;
}

.dashboard-analysis-grid {
    display: grid;
    grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
    gap: 16px;
}

.dashboard-analysis-panel {
    min-width: 0;
    padding: 20px;
    border: 1px solid #e6ebf2;
    border-radius: 11px;
    background: #fff;
    box-shadow: 0 4px 18px rgba(28, 48, 73, .04);
}

.dashboard-analysis-heading {
    margin-bottom: 22px;
}

.dashboard-analysis-heading h3 {
    font-size: 15px;
}

.dashboard-analysis-heading > strong {
    color: #5a6e83;
    font-size: 12px;
}

.dashboard-channel-bar,
.dashboard-content-track {
    height: 10px;
    overflow: hidden;
    border-radius: 8px;
    background: #edf1f5;
}

.dashboard-channel-bar > span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: #36ae7a;
}

.dashboard-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 10px 18px;
    margin-top: 17px;
    color: #66778a;
    font-size: 12px;
}

.dashboard-legend > span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.dashboard-legend b {
    color: #35485e;
}

.dashboard-legend > span > i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.dashboard-legend-active {
    background: #36ae7a;
}

.dashboard-legend-inactive {
    background: #e8a65a;
}

.dashboard-content-bars {
    display: grid;
    gap: 15px;
}

.dashboard-content-bar-row > div:first-child {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
    color: #66778a;
    font-size: 11px;
}

.dashboard-content-bar-row b {
    color: #35485e;
}

.dashboard-content-track {
    height: 7px;
}

.dashboard-content-track > span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--app-primary, #2583c5);
}

@media (max-width: 900px) {
    .app-sidebar {
        z-index: 12100;
        transform: translateX(-100%);
        transition: transform .22s ease;
    }

    .app-sidebar-open .app-sidebar {
        transform: translateX(0);
    }

    .app-menu-toggle {
        display: inline-grid;
        flex: 0 0 auto;
        place-items: center;
    }

    .app-main {
        margin-left: 0;
        padding: 84px 20px 28px;
    }

    .dashboard-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-analysis-grid {
        grid-template-columns: 1fr;
    }

    .app-sidebar-backdrop {
        position: fixed;
        z-index: 12000;
        inset: 64px 0 0;
        border: 0;
        background: rgba(13, 23, 36, .44);
    }

    .app-sidebar-open .app-sidebar-backdrop {
        display: block;
    }
}

@media (max-width: 560px) {
    .app-topbar {
        gap: 11px;
        height: 58px;
        padding: 0 12px;
    }

    .app-sidebar {
        inset-block-start: 58px;
        width: min(82vw, 280px);
    }

    .app-sidebar-backdrop {
        inset-block-start: 58px;
    }

    .app-brand {
        max-width: 42vw;
        font-size: 15px;
    }

    .app-account-name {
        display: none;
    }

    .app-logout {
        width: 36px;
        height: 36px;
        justify-content: center;
        border-radius: 8px;
        background: rgba(255, 255, 255, .14);
    }

    .app-logout span {
        display: none;
    }

    .app-main {
        padding: 74px 12px 20px;
    }

    .dashboard-page-heading {
        align-items: flex-start;
    }

    .dashboard-date {
        display: none;
    }

    .dashboard-kpi-grid {
        gap: 10px;
    }

    .dashboard-kpi {
        min-height: 132px;
        padding: 14px;
    }

    .dashboard-kpi-icon {
        top: 12px;
        right: 12px;
        width: 34px;
        height: 34px;
    }

    .dashboard-kpi > strong {
        font-size: 25px;
    }

    .dashboard-analysis-panel {
        padding: 16px;
    }

    .admin-dashboard > .card .card-header[style*="border-radius:10px"] {
        padding: 16px !important;
        font-size: 18px !important;
    }

    .admin-dashboard #dynamic_content > .dashboard-header-actions {
        flex-wrap: wrap;
        gap: 8px;
        padding: 12px;
    }

    .admin-dashboard .dashboard-header-actions .btn {
        flex: 1 1 140px;
        min-width: 0;
    }
}
