/* ==========================================
   RESET
========================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, Helvetica, sans-serif;
}


/* ==========================================
   LOGIN
========================================== */

.login-body {
    min-height: 100vh;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 20px;

    background:
        radial-gradient(circle at top left,
            #243b55 0%,
            #141e30 45%,
            #0b1120 100%);

    color: #ffffff;
}


/* ==========================================
   CONTENEDOR
========================================== */

.login-container {
    width: 100%;
    max-width: 430px;
}


/* ==========================================
   CARD
========================================== */

.login-card {
    width: 100%;

    background: rgba(255, 255, 255, 0.97);

    border-radius: 18px;

    overflow: hidden;

    box-shadow:
        0 25px 60px rgba(0, 0, 0, 0.35);

    color: #1f2937;
}


/* ==========================================
   HEADER
========================================== */

.login-header {
    text-align: center;

    padding: 38px 30px 28px;

    background:
        linear-gradient(135deg,
            #111827,
            #1e3a5f);

    color: white;
}


.login-logo {
    width: 220px;
    height: 68px;
    margin: 0 auto 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.login-logo img {
    width: 100%;
    height: 100%;

    object-fit: contain;

    padding: 8px;
}


.login-header h1 {
    font-size: 28px;

    letter-spacing: 4px;

    margin-bottom: 7px;
}


.login-header p {
    font-size: 14px;

    color: rgba(255, 255, 255, 0.7);
}


/* ==========================================
   CONTENT
========================================== */

.login-content {
    padding: 32px;
}


.login-content h2 {
    font-size: 23px;

    margin-bottom: 6px;
}


.login-description {
    color: #6b7280;

    font-size: 14px;

    margin-bottom: 25px;
}


/* ==========================================
   ERROR
========================================== */

.login-error {
    display: flex;
    align-items: center;
    gap: 9px;

    padding: 12px 14px;

    margin-bottom: 20px;

    border-radius: 9px;

    background: #fef2f2;

    border: 1px solid #fecaca;

    color: #b91c1c;

    font-size: 13px;
}


/* ==========================================
   FORM
========================================== */

.form-group {
    margin-bottom: 20px;
}


.form-group label {
    display: block;

    margin-bottom: 8px;

    font-size: 14px;

    font-weight: 600;

    color: #374151;
}


/* ==========================================
   INPUT
========================================== */

.input-wrapper {
    position: relative;

    display: flex;
    align-items: center;
}


.input-icon {
    position: absolute;

    left: 14px;

    font-size: 16px;

    opacity: 0.65;

    pointer-events: none;
}


.input-wrapper input {
    width: 100%;

    height: 48px;

    padding: 0 45px;

    border: 1px solid #d1d5db;

    border-radius: 10px;

    outline: none;

    font-size: 14px;

    color: #111827;

    background: #ffffff;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}


.input-wrapper input::placeholder {
    color: #9ca3af;
}


.input-wrapper input:focus {
    border-color: #2563eb;

    box-shadow:
        0 0 0 3px rgba(37, 99, 235, 0.12);
}


/* ==========================================
   PASSWORD
========================================== */

.password-toggle {
    position: absolute;

    right: 10px;

    width: 35px;
    height: 35px;

    border: none;

    background: transparent;

    cursor: pointer;

    border-radius: 7px;

    opacity: 0.65;

    transition: 0.2s;
}


.password-toggle:hover {
    background: #f3f4f6;

    opacity: 1;
}


/* ==========================================
   BUTTON
========================================== */

.login-button {
    width: 100%;

    height: 49px;

    margin-top: 5px;

    border: none;

    border-radius: 10px;

    background:
        linear-gradient(135deg,
            #2563eb,
            #1d4ed8);

    color: white;

    font-size: 15px;

    font-weight: 600;

    cursor: pointer;

    box-shadow:
        0 8px 18px rgba(37, 99, 235, 0.25);

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}


.login-button:hover {
    transform: translateY(-1px);

    box-shadow:
        0 10px 22px rgba(37, 99, 235, 0.35);
}


.login-button:active {
    transform: translateY(0);
}


/* ==========================================
   FOOTER
========================================== */

.login-footer {
    display: flex;

    justify-content: center;

    gap: 8px;

    padding: 0 25px 25px;

    font-size: 11px;

    color: #9ca3af;
}


.login-footer span:first-child {
    font-weight: 700;

    color: #6b7280;
}


/* ==========================================
   APP / PANEL
========================================== */

.app-body {
    min-height: 100vh;

    background: #f3f4f6;

    color: #1f2937;
}


/* ==========================================
   SIDEBAR
========================================== */

.sidebar {
    position: fixed;

    top: 0;
    left: 0;

    width: 250px;
    height: 100vh;

    display: flex;
    flex-direction: column;

    background:
        linear-gradient(180deg,
            #111827 0%,
            #172033 100%);

    color: white;

    z-index: 1000;
}


/* ==========================================
   SIDEBAR HEADER
========================================== */

.sidebar-header {
    display: flex;
    align-items: center;

    gap: 12px;

    padding: 22px 20px;

    border-bottom:
        1px solid rgba(255, 255, 255, 0.08);
}


.sidebar-logo {
    width: 42px;
    height: 42px;

    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 10px;

    background: rgba(255, 255, 255, 0.1);

    overflow: hidden;
}


.sidebar-logo img {
    width: 100%;
    height: 100%;

    object-fit: contain;

    padding: 5px;
}


.sidebar-brand {
    display: flex;
    flex-direction: column;
}


.sidebar-brand strong {
    font-size: 17px;

    letter-spacing: 2px;
}


.sidebar-brand span {
    margin-top: 3px;

    font-size: 11px;

    color: #9ca3af;
}


/* ==========================================
   MENU
========================================== */

.sidebar-menu {
    flex: 1;

    padding: 20px 12px;
}


.menu-item {
    display: flex;
    align-items: center;

    gap: 12px;

    padding: 12px 14px;

    margin-bottom: 6px;

    border-radius: 9px;

    color: #cbd5e1;

    text-decoration: none;

    font-size: 14px;

    transition: 0.2s;
}


.menu-item:hover {
    background: rgba(255, 255, 255, 0.07);

    color: white;
}


.menu-item.active {
    background: #2563eb;

    color: white;

    box-shadow:
        0 5px 15px rgba(37, 99, 235, 0.25);
}


.menu-icon {
    width: 22px;

    text-align: center;

    font-size: 17px;
}


/* ==========================================
   SIDEBAR FOOTER
========================================== */

.sidebar-footer {
    padding: 15px 12px;

    border-top:
        1px solid rgba(255, 255, 255, 0.08);
}


.logout-button {
    display: flex;
    align-items: center;

    gap: 12px;

    padding: 12px 14px;

    border-radius: 9px;

    color: #cbd5e1;

    text-decoration: none;

    font-size: 14px;

    transition: 0.2s;
}


.logout-button:hover {
    background: rgba(239, 68, 68, 0.12);

    color: #fca5a5;
}


/* ==========================================
   WRAPPER
========================================== */

.app-wrapper {
    min-height: 100vh;

    margin-left: 250px;

    display: flex;
    flex-direction: column;
}


/* ==========================================
   HEADER
========================================== */

.app-header {
    height: 76px;

    display: flex;
    align-items: center;

    justify-content: space-between;

    padding: 0 30px;

    background: white;

    border-bottom:
        1px solid #e5e7eb;
}


.header-title {
    display: flex;
    flex-direction: column;
}


.header-title h1 {
    font-size: 20px;

    color: #111827;
}


.header-title span {
    margin-top: 3px;

    font-size: 12px;

    color: #9ca3af;
}


/* ==========================================
   USER
========================================== */

.header-user {
    display: flex;
    align-items: center;

    gap: 10px;
}


.user-avatar {
    width: 38px;
    height: 38px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: #2563eb;

    color: white;

    font-weight: 700;
}


.user-info {
    display: flex;
    flex-direction: column;
}


.user-info strong {
    font-size: 13px;
}


.user-info span {
    margin-top: 2px;

    font-size: 11px;

    color: #9ca3af;
}


/* ==========================================
   CONTENIDO
========================================== */

.app-content {
    flex: 1;

    padding: 30px;
}


/* ==========================================
   FOOTER
========================================== */

.app-footer {
    display: flex;
    justify-content: center;

    gap: 7px;

    padding: 18px;

    color: #9ca3af;

    font-size: 11px;
}


.app-footer span:first-child {
    font-weight: 700;
}


/* ==========================================
   MENU MOBILE
========================================== */

.menu-toggle {
    display: none;

    width: 40px;
    height: 40px;

    border: none;

    border-radius: 8px;

    background: #f3f4f6;

    font-size: 20px;

    cursor: pointer;
}


.sidebar-overlay {
    display: none;
}


/* ==========================================
   DASHBOARD
========================================== */

.dashboard {
    width: 100%;
}


/* ==========================================
   PAGE HEADING
========================================== */

.page-heading {
    margin-bottom: 25px;
}


.page-heading h2 {
    font-size: 24px;

    color: #111827;
}


.page-heading p {
    margin-top: 5px;

    font-size: 13px;

    color: #6b7280;
}


/* ==========================================
   DASHBOARD CARDS
========================================== */

.dashboard-cards {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 18px;

    margin-bottom: 22px;
}


.dashboard-card {
    padding: 20px;

    background: white;

    border: 1px solid #e5e7eb;

    border-radius: 12px;

    box-shadow:
        0 2px 6px rgba(0, 0, 0, 0.03);
}


.card-top {
    display: flex;

    align-items: flex-start;

    justify-content: space-between;

    gap: 15px;
}


.card-label {
    display: block;

    margin-bottom: 7px;

    font-size: 12px;

    color: #6b7280;
}


.card-top h3 {
    font-size: 21px;

    color: #111827;
}


.card-icon {
    width: 42px;
    height: 42px;

    display: flex;

    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    border-radius: 10px;

    font-size: 19px;

    background: #f3f4f6;
}


.card-icon.whatsapp {
    background: #ecfdf5;
}


.card-icon.bot {
    background: #eff6ff;
}


.card-icon.messages {
    background: #f5f3ff;
}


.card-icon.activity {
    background: #fff7ed;
}


.card-status {
    display: flex;

    align-items: center;

    gap: 7px;

    margin-top: 17px;

    font-size: 12px;

    color: #6b7280;
}


/* ==========================================
   STATUS DOT
========================================== */

.status-dot {
    width: 8px;
    height: 8px;

    display: inline-block;

    border-radius: 50%;
}


.status-dot.success {
    background: #22c55e;
}


.status-dot.warning {
    background: #f59e0b;
}


.status-dot.danger {
    background: #ef4444;
}


/* ==========================================
   DASHBOARD GRID
========================================== */

.dashboard-grid {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr) minmax(0, 1fr);

    gap: 22px;
}


/* ==========================================
   PANEL
========================================== */

.dashboard-panel {
    background: white;

    border: 1px solid #e5e7eb;

    border-radius: 12px;

    overflow: hidden;
}


.panel-header {
    display: flex;

    align-items: center;

    justify-content: space-between;

    padding: 20px;

    border-bottom:
        1px solid #f1f5f9;
}


.panel-header h3 {
    font-size: 15px;

    color: #111827;
}


.panel-header p {
    margin-top: 4px;

    font-size: 12px;

    color: #9ca3af;
}


.panel-header a {
    font-size: 12px;

    color: #2563eb;

    text-decoration: none;
}


.panel-header a:hover {
    text-decoration: underline;
}


/* ==========================================
   SYSTEM STATUS
========================================== */

.system-status-list {
    padding: 5px 20px;
}


.system-status-item {
    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 15px;

    padding: 15px 0;

    border-bottom:
        1px solid #f1f5f9;
}


.system-status-item:last-child {
    border-bottom: none;
}


.system-status-info {
    display: flex;

    align-items: center;

    gap: 12px;
}


.system-status-icon {
    width: 36px;
    height: 36px;

    display: flex;

    align-items: center;
    justify-content: center;

    border-radius: 8px;

    background: #f8fafc;
}


.system-status-info div {
    display: flex;

    flex-direction: column;
}


.system-status-info strong {
    font-size: 13px;

    color: #374151;
}


.system-status-info span {
    margin-top: 3px;

    font-size: 11px;

    color: #9ca3af;
}


/* ==========================================
   BADGES
========================================== */

.badge {
    padding: 5px 9px;

    border-radius: 20px;

    font-size: 10px;

    font-weight: 600;

    white-space: nowrap;
}


.badge.success {
    background: #dcfce7;

    color: #15803d;
}


.badge.warning {
    background: #fef3c7;

    color: #b45309;
}


.badge.danger {
    background: #fee2e2;

    color: #b91c1c;
}


/* ==========================================
   EMPTY ACTIVITY
========================================== */

.empty-activity {
    min-height: 240px;

    display: flex;

    flex-direction: column;

    align-items: center;
    justify-content: center;

    padding: 30px;

    text-align: center;
}


.empty-icon {
    width: 55px;
    height: 55px;

    display: flex;

    align-items: center;
    justify-content: center;

    margin-bottom: 12px;

    border-radius: 50%;

    background: #f3f4f6;

    font-size: 22px;
}


.empty-activity strong {
    font-size: 14px;

    color: #374151;
}


.empty-activity span {
    max-width: 230px;

    margin-top: 6px;

    font-size: 12px;

    line-height: 1.5;

    color: #9ca3af;
}


/* ==========================================
   DASHBOARD RESPONSIVE
========================================== */

@media (max-width: 1100px) {

    .dashboard-cards {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

}


@media (max-width: 768px) {

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

}


@media (max-width: 520px) {

    .dashboard-cards {
        grid-template-columns: 1fr;
    }


    .page-heading h2 {
        font-size: 21px;
    }


    .dashboard-card {
        padding: 17px;
    }


    .system-status-item {
        align-items: flex-start;
    }

}



/* ==========================================
   RESPONSIVE
========================================== */

@media (max-width: 768px) {

    .sidebar {
        transform: translateX(-100%);

        transition: transform 0.25s ease;
    }


    .sidebar.open {
        transform: translateX(0);
    }


    .app-wrapper {
        margin-left: 0;
    }


    .menu-toggle {
        display: flex;

        align-items: center;
        justify-content: center;
    }


    .app-header {
        padding: 0 18px;

        gap: 15px;
    }


    .header-title {
        flex: 1;
    }


    .header-user .user-info {
        display: none;
    }


    .app-content {
        padding: 20px;
    }


    .sidebar-overlay {
        position: fixed;

        inset: 0;

        background: rgba(0, 0, 0, 0.45);

        z-index: 999;
    }


    .sidebar-overlay.active {
        display: block;
    }

}


@media (max-width: 480px) {

    .header-title h1 {
        font-size: 17px;
    }


    .header-title span {
        display: none;
    }


    .app-content {
        padding: 15px;
    }

}

@media (max-width: 480px) {

    .login-body {
        padding: 15px;
    }

    .login-header {
        padding: 30px 20px 24px;
    }

    .login-content {
        padding: 26px 22px;
    }

    .login-header h1 {
        font-size: 24px;
    }

    .login-logo {
        width: 60px;
        height: 60px;
        font-size: 30px;
    }

}

/* ==========================================
CONFIGURACIÓN
========================================== */

.configuration {
    width: 100%;
}

.configuration-form {
    width: 100%;
}

.configuration-panel {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.configuration-fields {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.config-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.config-field label {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
}

.config-field>span,
.config-switch-field span {
    font-size: 13px;
    color: var(--text-muted);
}

.config-field input,
.config-field textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: 0.2s;
    box-sizing: border-box;
}

.config-field input,
.config-field textarea {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.10);
}

.config-field textarea {
    resize: vertical;
    min-height: 110px;
}

.config-switch-field {
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fafafa;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}

.config-switch-field>div {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.switch {
    position: relative;
    width: 52px;
    height: 28px;
    flex-shrink: 0;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-slider {
    position: absolute;
    inset: 0;
    cursor: pointer;
    background: #cbd5e1;
    border-radius: 30px;
    transition: 0.2s;
}

.switch-slider::before {
    content: "";
    position: absolute;
    width: 22px;
    height: 22px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: 0.2s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}

.switch input+.switch-slider {
    background: var(--primary);
}

.switch input+.switch-slider::before {
    transform: translateX(24px);
}

.configuration-success {
    margin: 0 24px;
    padding: 13px 15px;
    border-radius: 10px;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #047857;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
}

.configuration-actions {
    padding: 20px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
}

.primary-button {
    border: 0;
    border-radius: 10px;
    padding: 12px 20px;
    background: var(--primary);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
}

.primary-button {
    transform: translateY(-1px);
    opacity: 0.92;
}

@media (max-width: 600px) {

    .configuration-fields {
        padding: 18px;
    }

    .configuration-actions {
        padding: 18px;
    }

    .configuration-success {
        margin: 0 18px;
    }

    .config-switch-field {
        align-items: flex-start;
        gap: 18px;
    }

    .primary-button {
        width: 100%;
    }

}

/* ==========================================
   BOTÓN GUARDAR CONFIGURACIÓN
========================================== */

.configuration-save-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 12px 22px;

    border: none;
    border-radius: 10px;

    background: #2563eb;
    color: #ffffff;

    font-size: 14px;
    font-weight: 700;

    cursor: pointer;

    min-height: 44px;

    transition: all 0.2s ease;
}

.configuration-save-button:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
}

.configuration-save-button:active {
    transform: translateY(0);
}

@media (max-width: 600px) {

    .configuration-save-button {
        width: 100%;
    }

}

/* ==========================================
ACTIVIDAD
========================================== */

.activity-page {
    width: 100%;
}

.activity-panel {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.activity-list {
    display: flex;
    flex-direction: column;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 24px;
    border-top: 1px solid var(--border);
}

.activity-item {
    border-top: none;
}

.activity-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    font-size: 17px;
    font-weight: 700;

}

.activity-icon.success {
    background: #dcfce7;
    color: #15803d;
}

.activity-icon.info {
    background: #dbeafe;
    color: #1d4ed8;
}

.activity-icon.warning {
    background: #fef3c7;
    color: #b45309;
}

.activity-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.activity-content strong {
    font-size: 14px;
    color: var(--text);
}

.activity-content span {
    font-size: 13px;
    color: var(--text-muted);
}

.activity-item time {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
}

@media (max-width: 600px) {

    .activity-item {
        align-items: flex-start;
        padding: 16px 18px;
    }

    .activity-item time {
        display: none;
    }

}



.whatsapp-panel {
    margin-top: 24px;
    padding: 24px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #fff;
}

.whatsapp-panel h2 {
    margin-top: 0;
}

#whatsapp-qr-container {
    margin-top: 20px;
    text-align: center;
}

#whatsapp-qr-container[hidden] {
    display: none;
}

#whatsapp-qr {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 16px auto;
    padding: 10px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}