:root {
    --color-primary: #07162d;
    --color-secondary: #9e1428;
    --color-highlight: #ffc857;
    --color-background: #f5f5f5;
    --color-text-light: #f1f5f9;
    --color-text-dark: #1e293b;
    --color-secondary-rgb: 158, 20, 40;
}

body {
    font-family: 'Barlow', sans-serif;
    background-color: var(--color-background);
    color: var(--color-text-dark);
    overflow-x: hidden;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #e2e8f0;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

.btn,
.service-card,
.client-card,
.kanban-card,
.promo-card {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
}

.kanban-card,
.promo-card,
.sidebar-ad-image,
.tool-card-button {
    border-radius: 0.5rem;
}

.btn {
    color: white;
    transition: background-color 0.3s ease-in-out, transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}

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

.btn-primary {
    background-color: var(--color-primary);
    color: #f5f5f5;
}

.btn-primary:hover {
    background-color: #1a2b42;
    box-shadow: 0 10px 15px -3px rgba(7, 22, 45, 0.3), 0 4px 6px -2px rgba(7, 22, 45, 0.1);
}

.btn-secondary {
    background-color: var(--color-secondary);
    color: #f5f5f5;
}

.btn-secondary:hover {
    background-color: #7c1020;
    box-shadow: 0 10px 15px -3px rgba(158, 20, 40, 0.3), 0 4px 6px -2px rgba(158, 20, 40, 0.1);
}

.nav-link.active-button {
    background-color: var(--color-secondary);
    color: white;
    font-weight: 700;
    position: relative;
}

.nav-link.active-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: -4px;
    transform: translateY(-50%);
    width: 8px;
    height: 80%;
    background-color: var(--color-highlight);
    border-radius: 4px;
    transition: all 0.3s ease;
}

.main-title-part-1 {
    color: var(--color-primary);
}

.main-title-part-2 {
    color: var(--color-secondary);
}

.dashboard-section {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stat-card,
.client-card,
.service-card,
.tool-card {
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}

.stat-card:hover,
.client-card:hover,
.service-card:hover,
.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.1);
}

.sidebar-ad-image {
    width: 100%;
    height: auto;
    cursor: pointer;
    transition: transform 0.3s ease-in-out;
}

.sidebar-ad-image:hover {
    transform: scale(1.02);
}

.kanban-board {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(1, minmax(0, 1fr));
}

@media (min-width: 768px) {
    .kanban-board {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .kanban-board {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 1280px) {
    .kanban-board {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.kanban-column {
    background-color: #f8fafc;
    border-radius: 0.75rem;
    display: flex;
    flex-direction: column;
    min-height: 300px;
}

.kanban-column-header {
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.kanban-column-title {
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.875rem;
}

.kanban-column-body {
    padding: 0.5rem;
    flex-grow: 1;
    overflow-y: auto;
}

.kanban-card {
    background-color: white;
    padding: 1rem;
    margin-bottom: 0.75rem;
    cursor: pointer;
    border-left: 4px solid transparent;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.kanban-card:hover {
    transform: translateY(-3px);
}

.kanban-card-source-web { border-left-color: #3b82f6; }
.kanban-card-source-referencia { border-left-color: #8b5cf6; }
.kanban-card-source-llamada { border-left-color: #10b981; }
.kanban-card-source-redes { border-left-color: #ec4899; }

.view-toggle button {
    transition: background-color 0.2s ease, color 0.2s ease;
}

.view-toggle button.active {
    background-color: var(--color-primary);
    color: white;
}

.client-card {
    border: 1px solid #e2e8f0;
    transition-property: transform, box-shadow, border-color;
}

.client-card:hover {
    border-color: var(--color-primary);
}

.client-avatar {
    width: 64px;
    height: 64px;
    background-color: var(--color-primary);
    color: white;
    font-size: 1.875rem;
    font-weight: 600;
}

.service-card {
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.service-card:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

.service-card-header {
    background-color: var(--color-primary);
    color: var(--color-text-light);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.service-card-price {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--color-secondary);
    line-height: 1;
}

.service-card-body {
    padding: 1.5rem;
    flex-grow: 1;
}

.transaction-card {
    transition: background-color 0.3s ease-in-out, transform 0.3s ease-in-out;
}

.transaction-card:hover {
    background-color: #f8fafc;
    transform: translateX(4px);
}

.transaction-income .icon-container {
    background-color: #dcfce7;
    color: #16a34a;
}

.transaction-expense .icon-container {
    background-color: #fee2e2;
    color: #dc2626;
}

.calendar-day-header.today {
    background-color: var(--color-secondary);
    color: white;
}

.appointment-card {
    border-left: 4px solid var(--color-primary);
}

.appointment-card.cancelled {
    border-left-color: #9ca3af;
    background-color: #f3f4f6;
}

.appointment-card.cancelled p {
    text-decoration: line-through;
    color: #6b7280;
}

.appointment-list-item {
    transition: background-color 0.2s ease;
}

.appointment-list-item:hover {
    background-color: #f8fafc;
}

.tool-card {
    background-image: linear-gradient(to top right, var(--color-primary), #1e3a5f);
    color: var(--color-text-light);
    position: relative;
    overflow: hidden;
}

.tool-card:before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0) 60%);
    transform: scale(0);
    transition: transform 0.5s ease;
    pointer-events: none;
}

.tool-card:hover:before {
    transform: scale(2);
}

.tool-card:hover {
    box-shadow: 0 20px 25px -5px rgba(7, 22, 45, 0.3), 0 8px 10px -6px rgba(7, 22, 45, 0.2);
}

.tool-card-icon {
    background-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
}

.tool-card-button {
    background-color: var(--color-highlight);
    color: var(--color-primary);
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: background-color 0.3s ease-in-out, color 0.3s ease-in-out, transform 0.3s ease-in-out;
}

.tool-card-button:hover {
    background-color: white;
    transform: scale(1.05);
}

.tool-card-button .arrow-icon {
    transition: transform 0.2s ease-in-out;
}

.tool-card-button:hover .arrow-icon {
    transform: translateX(4px);
}

.promo-card {
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}

.promo-card:hover {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: translateY(-8px);
}

.promo-card-image {
    transition: transform 0.4s ease;
}

.promo-card:hover .promo-card-image {
    transform: scale(1.05);
}

.tab-container {
    display: flex;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 1.5rem;
    background-color: var(--color-primary);
    border-top-left-radius: 0.5rem;
    border-top-right-radius: 0.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tab-button {
    flex-shrink: 0;
    padding: 0.75rem 1.5rem;
    color: var(--color-text-light);
    font-weight: 600;
    text-transform: uppercase;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    background-color: var(--color-primary);
    position: relative;
    z-index: 1;
    border-top-left-radius: 0.5rem;
    border-top-right-radius: 0.5rem;
    transition: background-color 0.3s ease, color 0.3s ease, border-bottom-color 0.3s ease;
}

.tab-button:hover {
    background-color: #1a2b42;
    border-bottom-color: #94a3b8;
}

.active-tab {
    color: var(--color-highlight);
    font-weight: 800;
    border-bottom-color: var(--color-secondary);
    border-bottom-width: 4px;
    z-index: 2;
}

.contact-selection-group {
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.contact-selection-group.active-selection {
    border-color: var(--color-highlight);
    background-color: #fefce8;
}

.initial-hidden {
    display: none;
}

#main-app-header {
    background-color: white;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    padding: 10px 15px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    flex-wrap: nowrap;
    position: sticky;
    top: 0;
    z-index: 20;
}

#mobile-menu-button {
    display: block;
    color: #4b5563;
    flex-shrink: 0;
    margin-right: auto;
}

@media (min-width: 768px) {
    #mobile-menu-button {
        display: none;
    }
}

.page-header-container {
    flex-grow: 1;
    text-align: center;
    padding: 0;
    margin: 0 auto;
    width: 100%;
}

#page-title {
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1.2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    width: 100%;
    word-break: break-word;
}

#page-title i {
    width: 1.5rem;
    height: 1.5rem;
    margin-right: 0.25rem;
    flex-shrink: 0;
}

#page-title .main-title-part-1,
#page-title .main-title-part-2 {
    display: inline;
    line-height: 1.2;
    white-space: normal;
}

#page-subtitle {
    font-size: 0.8rem;
    font-weight: 600;
    color: #4b5563;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.15rem;
    display: none;
    width: 100%;
}

@media (min-width: 768px) {
    #main-app-header {
        justify-content: space-between;
        padding: 1rem;
    }
    #mobile-menu-button {
        margin-right: initial;
    }
    .page-header-container {
        text-align: left;
        flex-grow: 0;
        margin: 0;
        width: auto;
    }
    #page-title {
        font-size: 1.875rem;
        justify-content: flex-start;
        gap: 0.75rem;
        width: auto;
    }
    #page-title i {
        width: 1.75rem;
        height: 1.75rem;
        margin-right: initial;
    }
    #page-subtitle {
        display: block;
        font-size: 1rem;
        margin-top: 0.25rem;
        width: auto;
    }
}

/* Toast Notifications (adaptado de start.php) */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background-color: #333;
    color: #fff;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 1;
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
    transform: translateX(0);
    min-width: 280px; /* Ancho mínimo para el toast */
}

.toast.hide {
    opacity: 0;
    transform: translateX(100%);
}

.toast-icon {
    font-size: 20px;
}

.toast-message {
    flex-grow: 1;
    text-transform: uppercase; /* ¡NUEVO! */
    font-weight: 900; /* ¡NUEVO! */
}

.toast-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    margin-left: 10px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.toast-close:hover {
    opacity: 1;
}

/* Specific toast types */
.toast-success {
    background-color: #4CAF50; /* Verde */
}

.toast-error {
    background-color: #f44336; /* Rojo */
}

.toast-info {
    background-color: #2196F3; /* Azul */
}

.toast-warning {
    background-color: #ff9800; /* Naranja */
}

/* Aquí terminan las reglas de Toast. Las siguientes son las que ya tenías y se mantienen. */

.stat-card:nth-child(2) {
    border-color: var(--color-secondary);
}

.stat-card:nth-child(2) .rounded-full {
    background-color: rgba(var(--color-secondary-rgb), 0.1);
}

.stat-card:nth-child(2) .rounded-full i {
    color: var(--color-secondary);
    opacity: 0.7;
}

.stat-card:nth-child(2) #monthly-clients-count {
    color: var(--color-secondary);
}

.footer-dark-theme .footer-copyright,
.footer-dark-theme .footer-disclaimer {
    font-size: 12px;
    line-height: 1.1;
    margin-top: 0.1rem;
    margin-bottom: 0.1rem;
}

.footer-dark-theme .footer-disclaimer {
    margin-top: 0.5rem;
}