/* ==========================================================================
   ESCÚCHAME V3.2 - Bento Dashboard UI (Ancho Completo, 1 Renglón, Alturas Iguales)
   ========================================================================== */
:root {
    --dash-bg: #12141a;
    --dash-sidebar: #171921;
    --dash-card: #1d202a;
    --dash-card-inner: #151820;
    --dash-border: rgba(255, 255, 255, 0.06);
    --mint: #a8dcd9;
    --mint-strong: #6ee7b7;
    --amber: #f59e0b;
    --pink: #ec4899;
    --blue: #38bdf8;
    --purple: #c084fc;
    --danger: #f87171;
    --text-main: #f8fafc;
    --text-dim: #94a3b8;
    --text-muted: #64748b;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--dash-bg);
    color: var(--text-main);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
}

.hidden {
    display: none !important;
}

/* Layout Principal con Sidebar más amplio para evitar saltos de línea */
.dash-layout {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

.dash-sidebar {
    width: 268px;
    background: var(--dash-sidebar);
    border-right: 1px solid var(--dash-border);
    padding: 26px 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 10px 24px;
    border-bottom: 1px solid var(--dash-border);
    margin-bottom: 20px;
}

.sidebar-brand img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--mint);
    background: #0d0f12;
    flex-shrink: 0;
}

.sidebar-brand-info {
    min-width: 0;
}

.sidebar-brand-info h2 {
    font-size: 0.96rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-brand-info span {
    font-size: 0.76rem;
    color: var(--mint);
    font-weight: 600;
    white-space: nowrap;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.nav-item svg {
    width: 19px;
    height: 19px;
    flex-shrink: 0;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-main);
}

.nav-item.active {
    background: var(--mint);
    color: #11161b;
    font-weight: 700;
    box-shadow: 0 6px 20px rgba(168, 220, 217, 0.25);
}

.nav-badge {
    margin-left: auto;
    background: rgba(248, 113, 113, 0.2);
    color: var(--danger);
    border: 1px solid rgba(248, 113, 113, 0.4);
    font-size: 0.72rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 99px;
}

.nav-item.active .nav-badge {
    background: #11161b;
    color: var(--mint);
    border-color: transparent;
}

/* Contenido Principal aprovecha todo el ancho disponible */
.dash-main {
    flex: 1;
    padding: 28px 36px;
    max-width: 1760px;
    width: 100%;
    overflow-x: hidden;
}

.dash-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 26px;
    flex-wrap: wrap;
}

.dash-topbar-title h1 {
    font-size: 1.55rem;
    font-weight: 800;
    color: var(--text-main);
}

.dash-topbar-title p {
    font-size: 0.88rem;
    color: var(--text-dim);
    margin-top: 2px;
}

.dash-topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* Bento Cards y Grillas con LA MISMA ALTURA (align-items: stretch) */
.bento-grid-top {
    display: grid;
    grid-template-columns: 2fr 1.1fr;
    gap: 22px;
    margin-bottom: 22px;
    align-items: stretch;
}

.bento-grid-mid {
    display: grid;
    grid-template-columns: 2fr 1.1fr;
    gap: 22px;
    margin-bottom: 22px;
    align-items: stretch;
}

.bento-grid-bot {
    display: grid;
    grid-template-columns: 1.1fr 2fr;
    gap: 22px;
    margin-bottom: 22px;
    align-items: stretch;
}

.widget-card {
    background: var(--dash-card);
    border: 1px solid var(--dash-border);
    border-radius: 18px;
    padding: 24px 26px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
    display: flex;
    flex-direction: column;
}

.bento-grid-top > .widget-card,
.bento-grid-mid > .widget-card,
.bento-grid-bot > .widget-card {
    height: 100%;
}

.widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    gap: 16px;
}

.widget-header h3 {
    font-size: 1.12rem;
    font-weight: 700;
    color: var(--text-main);
}

.widget-header p {
    font-size: 0.84rem;
    color: var(--text-dim);
    margin-top: 3px;
}

/* 4 Mini KPI Cards con la misma altura */
.kpi-subgrid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    align-items: stretch;
    flex: 1;
}

.kpi-mini-card {
    background: var(--dash-card-inner);
    border: 1px solid var(--dash-border);
    border-radius: 14px;
    padding: 18px 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 8px;
    height: 100%;
}

.kpi-mini-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
}

.kpi-mini-val {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
    white-space: nowrap;
}

.kpi-mini-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-dim);
    white-space: nowrap;
}

.kpi-mini-trend {
    font-size: 0.76rem;
    font-weight: 600;
    white-space: nowrap;
}

/* Tablas */
.bento-table {
    width: 100%;
    border-collapse: collapse;
}

.bento-table th {
    text-align: left;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    padding: 10px 12px;
    border-bottom: 1px solid var(--dash-border);
    white-space: nowrap;
}

.bento-table td {
    padding: 14px 12px;
    font-size: 0.9rem;
    color: var(--text-main);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    vertical-align: middle;
}

.bento-table tr:last-child td {
    border-bottom: none;
}

.pop-bar-track {
    width: 100%;
    max-width: 180px;
    height: 5px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 99px;
    overflow: hidden;
}

.pop-bar-fill {
    height: 100%;
    border-radius: 99px;
}

.pill-outline {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 700;
    border: 1px solid currentColor;
    white-space: nowrap;
}

/* Cabina en Vivo (2 Columnas amplias y de la MISMA ALTURA) */
.studio-live-grid {
    display: grid;
    grid-template-columns: 470px 1fr;
    gap: 24px;
    align-items: stretch;
}

.studio-live-grid > .widget-card {
    height: 100%;
}

.form-field {
    margin-bottom: 16px;
}

.form-field label {
    display: block;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text-dim);
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.form-field input,
.form-field select,
.form-field textarea {
    width: 100%;
    background: var(--dash-card-inner);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 11px 14px;
    color: var(--text-main);
    font-size: 0.92rem;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: border-color 0.2s;
}

.form-field input:focus,
.form-field select:focus {
    border-color: var(--mint);
}

/* Botones siempre en 1 solo renglón (white-space: nowrap) */
.btn-mint {
    background: var(--mint);
    color: #11161b;
    border: none;
    padding: 11px 18px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    white-space: nowrap;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-mint:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(168, 220, 217, 0.28);
}

.btn-ghost {
    background: var(--dash-card-inner);
    color: var(--text-main);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 11px 16px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.86rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s;
}

.btn-ghost:hover {
    border-color: var(--mint);
    color: var(--mint);
}

.btn-danger-outline {
    background: rgba(248, 113, 113, 0.1);
    color: var(--danger);
    border: 1px solid rgba(248, 113, 113, 0.35);
    padding: 11px 16px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.86rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    white-space: nowrap;
}

/* Tarjetas de Mensajes de Voz en la Cabina */
.audio-queue-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    flex: 1;
}

.audio-item-card {
    background: var(--dash-card-inner);
    border: 1px solid var(--dash-border);
    border-radius: 14px;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    flex-wrap: nowrap;
    transition: border-color 0.2s, background 0.2s;
}

.audio-item-card.unplayed {
    border-left: 4px solid var(--mint-strong);
}

.audio-item-card.played {
    opacity: 0.78;
}

.audio-item-card.obs-active {
    border-color: var(--mint);
    box-shadow: 0 0 22px rgba(168, 220, 217, 0.18);
}

.audio-meta-col {
    flex: 1;
    min-width: 0;
}

.audio-sender-line {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
    margin-bottom: 6px;
}

.sender-nick {
    font-size: 1.02rem;
    font-weight: 800;
    color: var(--text-main);
    white-space: nowrap;
}

.amount-tag {
    background: rgba(245, 158, 11, 0.14);
    color: var(--amber);
    border: 1px solid rgba(245, 158, 11, 0.3);
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 0.76rem;
    font-weight: 700;
    white-space: nowrap;
}

.status-pill-new {
    background: rgba(110, 231, 183, 0.15);
    color: var(--mint-strong);
    border: 1px solid rgba(110, 231, 183, 0.35);
    padding: 3px 10px;
    border-radius: 99px;
    font-size: 0.74rem;
    font-weight: 800;
    text-transform: uppercase;
    white-space: nowrap;
}

.status-pill-played {
    background: rgba(148, 163, 184, 0.12);
    color: var(--text-dim);
    border: 1px solid rgba(148, 163, 184, 0.25);
    padding: 3px 10px;
    border-radius: 99px;
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    white-space: nowrap;
}

.audio-submeta {
    display: flex;
    align-items: center;
    gap: 16px;
    color: var(--text-dim);
    font-size: 0.82rem;
    white-space: nowrap;
}

.audio-actions-col {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.btn-obs-launch {
    background: linear-gradient(135deg, var(--mint) 0%, var(--mint-strong) 100%);
    color: #0d1317;
    border: none;
    padding: 11px 18px;
    border-radius: 10px;
    font-weight: 800;
    font-size: 0.86rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
    transition: all 0.2s;
}

.btn-obs-launch:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(110, 231, 183, 0.3);
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

.alert-banner {
    background: rgba(110, 231, 183, 0.12);
    border: 1px solid rgba(110, 231, 183, 0.35);
    color: var(--mint-strong);
    padding: 13px 18px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.alert-banner.error {
    background: rgba(248, 113, 113, 0.12);
    border-color: rgba(248, 113, 113, 0.35);
    color: var(--danger);
}

@media (max-width: 1200px) {
    .bento-grid-top,
    .bento-grid-mid,
    .bento-grid-bot,
    .studio-live-grid {
        grid-template-columns: 1fr;
    }
    .kpi-subgrid {
        grid-template-columns: repeat(2, 1fr);
    }
    .audio-item-card {
        flex-wrap: wrap;
    }
}

@media (max-width: 780px) {
    .dash-layout {
        flex-direction: column;
    }
    .dash-sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    .kpi-subgrid {
        grid-template-columns: 1fr;
    }
}
