/* =============================================================================
   style.css — Estilo tipo Apple: superficies claras, tipografía del sistema,
   negros como color de acción, sombras suaves en capas, esquinas redondeadas.
   ============================================================================= */

:root {
    --font-sistema: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

    --negro: #1d1d1f;
    --negro-hover: #000000;
    --gris-texto: #6e6e73;
    --gris-borde: #d2d2d7;
    --gris-fondo: #f5f5f7;
    --blanco: #ffffff;

    --azul: #0071e3;
    --verde: #1e8e3e;
    --rojo: #d70015;
    --amarillo: #b7791f;

    --sombra-sm: 0 1px 2px rgba(0,0,0,0.04), 0 1px 1px rgba(0,0,0,0.03);
    --sombra-md: 0 4px 12px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.04);
    --sombra-lg: 0 12px 32px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06);

    --radio-sm: 8px;
    --radio-md: 14px;
    --radio-lg: 20px;

    --sidebar-ancho: 232px;
    --sidebar-ancho-movil: 68px;
    --topbar-alto: 64px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    background: var(--gris-fondo);
    color: var(--negro);
    font-family: var(--font-sistema);
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: var(--font-sistema); }

/* ---------------------------------------------------------------------------
   Botones estilo Apple — negros, redondeados, con estados claros
   --------------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--negro);
    color: var(--blanco);
    border: none;
    border-radius: 980px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
    white-space: nowrap;
}
.btn:hover { background: var(--negro-hover); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-secundario {
    background: var(--blanco);
    color: var(--negro);
    border: 1px solid var(--gris-borde);
}
.btn-secundario:hover { background: var(--gris-fondo); }

.btn-peligro { background: var(--rojo); }
.btn-peligro:hover { background: #a30010; }

.btn-exito { background: var(--verde); }
.btn-exito:hover { background: #166b30; }

.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-block { width: 100%; }

/* ---------------------------------------------------------------------------
   Layout general del dashboard
   --------------------------------------------------------------------------- */
.app-shell {
    display: grid;
    grid-template-columns: var(--sidebar-ancho) 1fr;
    grid-template-rows: var(--topbar-alto) 1fr;
    grid-template-areas:
        "topbar topbar"
        "sidebar main";
    height: 100vh;
    overflow: hidden;
}

/* ---------------------------------------------------------------------------
   Topbar
   --------------------------------------------------------------------------- */
.topbar {
    grid-area: topbar;
    background: rgba(255,255,255,0.85);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--gris-borde);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    min-width: 0;
    z-index: 20;
}

.topbar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 17px;
    letter-spacing: -0.02em;
    min-width: 0;
}
.topbar-logo .punto {
    width: 10px; height: 10px; border-radius: 50%;
    background: var(--negro); flex-shrink: 0;
}

.topbar-derecha {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.topbar-empresa {
    font-size: 14px;
    color: var(--gris-texto);
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.avatar-btn {
    position: relative;
    width: 36px; height: 36px;
    border-radius: 50%;
    overflow: hidden;
    border: 1px solid var(--gris-borde);
    cursor: pointer;
    background: var(--gris-fondo);
    flex-shrink: 0;
    padding: 0;
}
.avatar-btn img { width: 100%; height: 100%; object-fit: cover; display: block; }

.dropdown-perfil {
    position: absolute;
    top: 52px;
    right: 24px;
    background: var(--blanco);
    border-radius: var(--radio-md);
    box-shadow: var(--sombra-lg);
    border: 1px solid var(--gris-borde);
    min-width: 190px;
    overflow: hidden;
    display: none;
    z-index: 50;
}
.dropdown-perfil.abierto { display: block; }
.dropdown-perfil a, .dropdown-perfil button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    font-size: 14px;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    color: var(--negro);
}
.dropdown-perfil a:hover, .dropdown-perfil button:hover { background: var(--gris-fondo); }
.dropdown-perfil hr { border: none; border-top: 1px solid var(--gris-borde); margin: 0; }

/* ---------------------------------------------------------------------------
   Sidebar
   --------------------------------------------------------------------------- */
.sidebar {
    grid-area: sidebar;
    background: var(--blanco);
    border-right: 1px solid var(--gris-borde);
    padding: 20px 12px;
    overflow-y: auto;
    min-width: 0;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border-radius: var(--radio-sm);
    color: var(--negro);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
    transition: background 0.15s ease;
}
.sidebar-item i { width: 20px; text-align: center; font-size: 16px; color: var(--gris-texto); }
.sidebar-item:hover { background: var(--gris-fondo); }
.sidebar-item.activo { background: var(--negro); color: var(--blanco); }
.sidebar-item.activo i { color: var(--blanco); }

/* ---------------------------------------------------------------------------
   Contenido principal — nunca se sale por la derecha
   --------------------------------------------------------------------------- */
.main-content {
    grid-area: main;
    min-width: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 32px;
}

.contenedor {
    background: var(--blanco);
    border: 1px solid var(--gris-borde);
    border-radius: var(--radio-lg);
    box-shadow: var(--sombra-sm);
    padding: 28px;
    max-width: 100%;
    overflow-x: hidden;
    margin-bottom: 24px;
}

.contenedor-titulo {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0 0 6px 0;
}
.contenedor-subtitulo {
    font-size: 14px;
    color: var(--gris-texto);
    margin: 0 0 20px 0;
}

/* ---------------------------------------------------------------------------
   Formularios
   --------------------------------------------------------------------------- */
.campo { margin-bottom: 18px; max-width: 100%; }
.campo label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--negro);
}
.campo input[type="text"],
.campo input[type="email"],
.campo input[type="password"],
.campo input[type="file"],
.campo select {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--gris-borde);
    border-radius: var(--radio-sm);
    font-size: 14px;
    background: var(--blanco);
    color: var(--negro);
    max-width: 100%;
}
.campo input:focus, .campo select:focus {
    outline: none;
    border-color: var(--negro);
    box-shadow: 0 0 0 3px rgba(0,0,0,0.08);
}
.campo-ayuda { font-size: 12px; color: var(--gris-texto); margin-top: 6px; }

.input-grupo { display: flex; align-items: center; gap: 8px; max-width: 100%; }

/* ---------------------------------------------------------------------------
   Tablas
   --------------------------------------------------------------------------- */
.tabla-wrap { width: 100%; overflow-x: auto; border-radius: var(--radio-md); border: 1px solid var(--gris-borde); }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 560px; }
thead th {
    text-align: left;
    padding: 12px 16px;
    background: var(--gris-fondo);
    font-weight: 600;
    color: var(--gris-texto);
    border-bottom: 1px solid var(--gris-borde);
    white-space: nowrap;
}
tbody td { padding: 12px 16px; border-bottom: 1px solid #ececec; vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fafafa; }

/* ---------------------------------------------------------------------------
   Badges de estado
   --------------------------------------------------------------------------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 980px;
    font-size: 12px;
    font-weight: 600;
}
.badge-verde { background: #e7f6ec; color: var(--verde); }
.badge-rojo { background: #fdeaea; color: var(--rojo); }
.badge-amarillo { background: #fbf1e0; color: var(--amarillo); }
.badge-gris { background: var(--gris-fondo); color: var(--gris-texto); }

/* ---------------------------------------------------------------------------
   Auth (login / registro / recuperación)
   --------------------------------------------------------------------------- */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gris-fondo);
    padding: 24px;
}
.auth-card {
    background: var(--blanco);
    border-radius: var(--radio-lg);
    box-shadow: var(--sombra-lg);
    padding: 40px 36px;
    width: 100%;
    max-width: 400px;
}
.auth-logo {
    display: flex; align-items: center; gap: 10px;
    font-weight: 700; font-size: 20px; margin-bottom: 28px; justify-content: center;
}
.auth-logo .punto { width: 12px; height: 12px; border-radius: 50%; background: var(--negro); }
.auth-titulo { font-size: 22px; font-weight: 700; text-align: center; margin: 0 0 6px 0; letter-spacing: -0.02em; }
.auth-subtitulo { font-size: 14px; color: var(--gris-texto); text-align: center; margin: 0 0 28px 0; }
.auth-links { text-align: center; margin-top: 18px; font-size: 13.5px; color: var(--gris-texto); }
.auth-links a { color: var(--azul); font-weight: 500; }
.alerta {
    padding: 12px 14px;
    border-radius: var(--radio-sm);
    font-size: 13.5px;
    margin-bottom: 18px;
}
.alerta-error { background: #fdeaea; color: var(--rojo); }
.alerta-exito { background: #e7f6ec; color: var(--verde); }
.alerta-info { background: #eaf3fe; color: var(--azul); }

/* ---------------------------------------------------------------------------
   Suspensión de cuenta
   --------------------------------------------------------------------------- */
.pantalla-suspendida {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--gris-fondo);
    text-align: center;
    padding: 24px;
}
.pantalla-suspendida i { font-size: 46px; color: var(--rojo); margin-bottom: 18px; }
.pantalla-suspendida h1 { font-size: 22px; margin: 0 0 10px 0; }
.pantalla-suspendida p { color: var(--gris-texto); max-width: 380px; margin: 0 0 24px 0; }

/* ---------------------------------------------------------------------------
   Perfil / avatar grande en Ajustes
   --------------------------------------------------------------------------- */
.perfil-avatar-grande {
    width: 88px; height: 88px; border-radius: 50%;
    object-fit: cover; border: 1px solid var(--gris-borde);
    background: var(--gris-fondo);
}
.fila-flex { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }

/* ---------------------------------------------------------------------------
   Subdominios — preview y búsqueda de artista
   --------------------------------------------------------------------------- */
.preview-subdominio {
    margin-top: 8px;
    padding: 10px 14px;
    background: var(--gris-fondo);
    border-radius: var(--radio-sm);
    font-size: 14px;
    font-weight: 600;
    color: var(--negro);
    display: inline-block;
}
.preview-subdominio span.parte-fija { color: var(--gris-texto); font-weight: 500; }

.buscador-artista { position: relative; max-width: 100%; }
.resultados-artista {
    position: absolute;
    top: calc(100% + 6px);
    left: 0; right: 0;
    background: var(--blanco);
    border: 1px solid var(--gris-borde);
    border-radius: var(--radio-md);
    box-shadow: var(--sombra-lg);
    max-height: 260px;
    overflow-y: auto;
    z-index: 30;
    display: none;
}
.resultados-artista.abierto { display: block; }
.resultado-artista-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 14px; cursor: pointer;
}
.resultado-artista-item:hover { background: var(--gris-fondo); }
.resultado-artista-item img {
    width: 34px; height: 34px; border-radius: 50%; object-fit: cover; background: var(--gris-fondo);
}
.artista-seleccionado {
    display: flex; align-items: center; gap: 10px;
    margin-top: 10px; padding: 8px 12px;
    background: #eaf3fe; border-radius: var(--radio-sm);
    font-size: 13.5px; max-width: 100%;
}
.artista-seleccionado img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; }

/* ---------------------------------------------------------------------------
   Responsive — sidebar solo íconos en móvil
   --------------------------------------------------------------------------- */
@media (max-width: 768px) {
    .app-shell { grid-template-columns: var(--sidebar-ancho-movil) 1fr; }
    .sidebar { padding: 16px 8px; }
    .sidebar-item { justify-content: center; padding: 12px 0; }
    .sidebar-item span.etiqueta { display: none; }
    .sidebar-item i { width: auto; font-size: 18px; }
    .topbar { padding: 0 14px; }
    .topbar-empresa { display: none; }
    .btn-crear-smartlink span.texto-boton { display: none; }
    .main-content { padding: 16px; }
    .contenedor { padding: 18px; }
}

@media (max-width: 480px) {
    .auth-card { padding: 30px 22px; }
}
