﻿:root {
    --verde: #3f5d4b;
    --verde-dark: #2f4538;
    --verde-soft: #5f7f6a;
    --gris-bg: #f4f6f5;
    --gris-line: #dcdcdc;
    --gris-line-soft: #ececec;
    --rojo: #c0392b;
    --rojo-dark: #962d22;
    --amarillo: #f1c40f;
    --blanco: #fff;
    --sombra-suave: 0 4px 20px rgba(0,0,0,0.05);
    --sombra-hover: 0 8px 25px rgba(0,0,0,0.1);
}

/* =========================
   RESET & BASICS
========================= */
* {
    box-sizing: border-box;
    font-family: "Segoe UI", Roboto, Arial, sans-serif;
}

body {
    background: var(--gris-bg);
    margin: 0;
    color: #333;
}

/* =========================
   CONTENEDOR PRINCIPAL
========================= */
.container {
    max-width: 1200px;
    margin: 40px auto;
    background: var(--blanco);
    padding: 40px;
    border-radius: 16px;
    box-shadow: var(--sombra-suave);
}

h2 {
    color: var(--verde);
    margin-bottom: 30px;
    text-align: center;
    font-weight: 700;
}

/* =========================
   DASHBOARD (KPIs) - MODERNO
========================= */
.dashboard {
    display: flex;
    gap: 30px;
    margin-bottom: 40px;
    justify-content: center; /* Centrado */
    flex-wrap: wrap;
}

.card-dash {
    background: #fff;
    padding: 20px 30px;
    border-radius: 12px;
    box-shadow: var(--sombra-suave);
    text-align: center;
    min-width: 180px;
    border-top: 4px solid var(--verde); /* Borde arriba mas moderno */
    transition: transform 0.2s, box-shadow 0.2s;
}

    .card-dash:hover {
        transform: translateY(-5px);
        box-shadow: var(--sombra-hover);
    }

    .card-dash h3 {
        margin: 10px 0 5px 0;
        font-size: 32px;
        color: var(--verde-dark);
        font-weight: 800;
    }

    .card-dash span {
        font-size: 13px;
        color: #7f8c8d;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 1px;
    }

    .card-dash.danger {
        border-top-color: var(--rojo);
    }

        .card-dash.danger h3 {
            color: var(--rojo);
        }

/* =========================
   INPUTS & FORMULARIOS
========================= */
.input {
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid var(--gris-line);
    width: 100%; /* Ocupan todo el ancho de su contenedor */
    font-size: 14px;
    margin-bottom: 15px;
    transition: border-color 0.2s;
    background: #fdfdfd;
}

    .input:focus {
        outline: none;
        border-color: var(--verde);
        background: #fff;
    }

/* Label para inputs */
label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    font-size: 13px;
    color: #555;
}

/* =========================
   BOTONES
========================= */
.btn, .btn-main-add {
    background: var(--verde);
    color: var(--blanco);
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.2s;
}

    .btn:hover, .btn-main-add:hover {
        background: var(--verde-dark);
    }

.btn-main-add {
    background-color: #27ae60;
    display: inline-block;
    margin-bottom: 20px;
}

.btn-mini {
    padding: 6px 10px;
    border-radius: 6px;
    background: var(--verde);
    color: #fff;
    font-size: 12px;
    text-decoration: none;
    margin-right: 2px;
}

    .btn-mini.secondary {
        background: var(--verde-soft);
    }

    .btn-mini.danger {
        background: var(--rojo);
    }

/* Botón Cancelar (Rojo) */
.btn-cancel {
    background: #e74c3c;
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
}

    .btn-cancel:hover {
        background: #c0392b;
    }

/* =========================
   TABLAS (DataTables)
========================= */
table.dataTable {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
}

    table.dataTable thead th {
        background: var(--verde);
        color: #fff;
        padding: 14px;
        font-weight: 600;
        border: none;
    }

    table.dataTable tbody td {
        padding: 12px;
        border-bottom: 1px solid var(--gris-line-soft);
        vertical-align: middle;
    }

    table.dataTable tbody tr:hover {
        background: #f0f4f2;
    }

/* Botón Excel DataTable */
.dt-button.buttons-excel {
    background: #27ae60 !important;
    color: white !important;
    border: none !important;
    border-radius: 6px !important;
    padding: 6px 16px !important;
    font-size: 13px !important;
    margin-bottom: 15px;
    font-weight: bold;
}

/* =========================
   BADGES & ETIQUETAS
========================= */
.badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
}

    .badge.ACTIVO {
        background: #2ecc71;
    }

    .badge.NO_EXISTE {
        background: #e74c3c;
    }

    .badge.PRIVADO {
        background: #f1c40f;
        color: #333;
    }

    .badge.DESCONOCIDO {
        background: #95a5a6;
    }

    .badge.SIN_LINK {
        background: #34495e;
    }

/* Links como badges (MF/SF) */
.badge-link {
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 4px;
    color: #fff;
    font-size: 11px;
    font-weight: bold;
}

.mf {
    background-color: #3498db;
}

.sf {
    background-color: #9b59b6;
}

/* Tooltip Copy */
.badge-copy {
    background: #ecf0f1;
    color: #333;
    cursor: pointer;
    position: relative;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
}

    .badge-copy:hover {
        background: #bdc3c7;
    }

        .badge-copy:hover::after {
            content: attr(title);
            position: absolute;
            bottom: 120%;
            left: 50%;
            transform: translateX(-50%);
            background: #333;
            color: #fff;
            padding: 6px 10px;
            border-radius: 4px;
            font-size: 11px;
            white-space: nowrap;
            z-index: 1000;
        }

/* =========================
   MODALES (ESTRUCTURA GENERAL)
========================= */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6); /* Fondo oscuro mas suave */
    z-index: 999;
    align-items: center; /* Centrado vertical flex (si se usara flex) */
    justify-content: center;
    overflow-y: auto;
    padding: 20px;
    backdrop-filter: blur(2px); /* Efecto moderno */
}

/* Estilo Base del Contenido Modal */
.modal-content {
    background: #fff;
    margin: 5% auto; /* Centrado tradicional */
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.2);
    position: relative;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-content h3 {
    margin-top: 0;
    color: var(--verde);
    border-bottom: 2px solid var(--gris-line-soft);
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.modal-actions {
    margin-top: 25px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    border-top: 1px solid var(--gris-line-soft);
    padding-top: 20px;
}

/* =========================
   TAMAÑOS ESPECÍFICOS DE MODALES
========================= */

/* 1. Modal Agregar/Editar Banda (PEQUEÑO) */
#modalNuevaBanda .modal-content,
#modalEditarBanda .modal-content {
    width: 100%;
    max-width: 450px; /* Reducido */
    height: auto;
}

/* 2. Modal Agregar Album (MEDIANO) */
#modalAlbum .modal-content {
    width: 100%;
    max-width: 500px; /* Reducido y ajustado */
    height: auto;
}

/* 3. Modal Ver Albums (GRANDE / TABLA) */
#modalAlbums .modal-content {
    width: 95%;
    max-width: 1400px;
    height: 85vh; /* Altura fija para scroll interno */
    display: flex;
    flex-direction: column;
    padding: 20px;
}

/* Ajustes internos del Modal Ver Albums */
.filters {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

/* Contenedor de la tabla con scroll */
.table-scroll {
    flex: 1;
    overflow-y: auto;
    border: 1px solid var(--gris-line);
    border-radius: 4px;
}

/* Arreglo del Header Blanco que se perdía */
#modalAlbums table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

#modalAlbums th {
    position: sticky;
    top: 0;
    background-color: var(--verde); /* COLOR DE FONDO FIJO */
    color: #fff; /* TEXTO BLANCO */
    z-index: 10;
    padding: 12px;
    font-size: 13px;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.1); /* Borde sutil */
}

#modalAlbums td {
    padding: 8px;
    font-size: 13px;
    text-align: center;
    border-bottom: 1px solid #eee;
}

/* SweetAlert Z-Index Fix */
div:where(.swal2-container) {
    z-index: 99999 !important;
}
