/**
 * TELÃO LINKAÊ - Design System & UI Administrativa
 * Padrão SaaS Premium, Mobile-First, Limpo, Sofisticado e sem Dependências
 */

:root {
    /* Paleta de Cores Sofisticada */
    --bg-page: #f8fafc;
    --bg-sidebar: #0f172a;
    --bg-sidebar-nav: #1e293b;
    --bg-sidebar-hover: rgba(255, 255, 255, 0.06);
    --bg-sidebar-active: #2563eb;
    --bg-card: #ffffff;
    --bg-card-subtle: #f8fafc;
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-light: #cbd5e1;
    --text-white: #ffffff;
    
    --border: #e2e8f0;
    --border-subtle: #f1f5f9;
    --border-focus: #3b82f6;
    
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #eff6ff;
    --primary-border: #bfdbfe;
    
    --success: #16a34a;
    --success-hover: #15803d;
    --success-light: #f0fdf4;
    --success-border: #bbf7d0;
    
    --danger: #dc2626;
    --danger-hover: #b91c1c;
    --danger-light: #fef2f2;
    --danger-border: #fecaca;
    
    --warning: #d97706;
    --warning-hover: #b45309;
    --warning-light: #fffbeb;
    --warning-border: #fde68a;
    
    --info: #0284c7;
    --info-light: #e0f2fe;
    --info-border: #bae6fd;
    
    /* Geometria e Espaçamento */
    --radius-xs: 4px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-full: 9999px;
    
    --shadow-xs: 0 1px 2px 0 rgba(15, 23, 42, 0.04);
    --shadow-card: 0 1px 3px 0 rgba(15, 23, 42, 0.06), 0 1px 2px -1px rgba(15, 23, 42, 0.04);
    --shadow-hover: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
    --shadow-modal: 0 25px 50px -12px rgba(15, 23, 42, 0.25);
    
    --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Reset e Configurações Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-page);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}
a:hover {
    color: var(--primary-hover);
}

img, video {
    display: block;
    max-width: 100%;
}

/* Ícones SVG */
.svg-icon {
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
}

/* Layout Geral */
.app-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

@media (min-width: 992px) {
    .app-layout {
        flex-direction: row;
    }
}

/* ==========================================================
   SIDEBAR (DESKTOP)
   ========================================================== */
.sidebar {
    background-color: var(--bg-sidebar);
    color: var(--text-light);
    width: 100%;
    display: flex;
    flex-direction: column;
    z-index: 40;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

@media (min-width: 992px) {
    .sidebar {
        width: 260px;
        min-height: 100vh;
        height: 100vh;
        position: sticky;
        top: 0;
        border-bottom: none;
        border-right: 1px solid rgba(255, 255, 255, 0.06);
    }
}

.sidebar-header {
    padding: 22px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.brand-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-symbol {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.brand-details {
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-size: 15px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.2px;
    line-height: 1.2;
}

.brand-tagline {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.mobile-menu-trigger {
    background: transparent;
    border: none;
    color: var(--text-light);
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-xs);
}

@media (min-width: 992px) {
    .mobile-menu-trigger {
        display: none;
    }
}

.sidebar-nav {
    display: none;
    flex-direction: column;
    padding: 16px 12px;
    gap: 4px;
    flex: 1;
    overflow-y: auto;
}

.sidebar-nav.is-open {
    display: flex;
}

@media (min-width: 992px) {
    .sidebar-nav {
        display: flex;
    }
}

.nav-section-title {
    font-size: 10px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 8px 12px 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    color: #94a3b8;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    text-decoration: none;
}

.nav-item:hover {
    background-color: var(--bg-sidebar-hover);
    color: #ffffff;
    text-decoration: none;
}

.nav-item.active {
    background-color: var(--bg-sidebar-active);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.nav-item .nav-badge {
    margin-left: auto;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

.sidebar-footer {
    padding: 16px 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-full);
    background: #334155;
    color: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
}

.user-role {
    font-size: 11px;
    color: var(--text-muted);
}

.btn-logout {
    color: #94a3b8;
    padding: 6px;
    border-radius: var(--radius-xs);
    transition: var(--transition);
}
.btn-logout:hover {
    color: #f87171;
    background: rgba(239, 68, 68, 0.1);
}

/* ==========================================================
   MOBILE BOTTOM BAR NAVIGATION (TOUCH FIRST)
   ========================================================== */
.mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 62px;
    background: #0f172a;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 50;
    align-items: center;
    justify-content: space-around;
    padding: 0 4px;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.2);
}

@media (min-width: 992px) {
    .mobile-bottom-nav {
        display: none;
    }
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    text-decoration: none;
    flex: 1;
    height: 100%;
    font-size: 11px;
    font-weight: 500;
    gap: 3px;
    transition: var(--transition);
}

.bottom-nav-item:hover, .bottom-nav-item.active {
    color: #ffffff;
    text-decoration: none;
}

.bottom-nav-item.active {
    color: #38bdf8;
}

.bottom-nav-item.active .svg-icon {
    transform: scale(1.1);
}

/* ==========================================================
   ÁREA PRINCIPAL DE CONTEÚDO
   ========================================================== */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding-bottom: 70px; /* Espaço para a barra inferior no mobile */
}

@media (min-width: 992px) {
    .main-content {
        padding-bottom: 0;
    }
}

.page-header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

@media (min-width: 640px) {
    .page-header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 24px 32px;
    }
}

.page-heading h1 {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.4px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-heading p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.page-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.content-body {
    padding: 20px 16px;
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

@media (min-width: 640px) {
    .content-body {
        padding: 28px 24px;
    }
}

@media (min-width: 1024px) {
    .content-body {
        padding: 32px;
    }
}

/* ==========================================================
   CARDS E CONTAINER
   ========================================================== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    margin-bottom: 24px;
    overflow: hidden;
    transition: var(--transition);
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 400;
}

.card-body {
    padding: 20px;
}

/* ==========================================================
   HERO STATUS CARD (DASHBOARD)
   ========================================================== */
.hero-screen-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-card);
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

@media (min-width: 768px) {
    .hero-screen-card {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 28px;
    }
}

.hero-screen-main {
    display: flex;
    align-items: center;
    gap: 18px;
}

.hero-screen-icon-box {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.hero-screen-icon-box.online {
    background: var(--success-light);
    color: var(--success);
    border: 1px solid var(--success-border);
}

.hero-screen-icon-box.offline {
    background: var(--danger-light);
    color: var(--danger);
    border: 1px solid var(--danger-border);
}

.hero-screen-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.hero-screen-meta {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

/* Badges e Status Pills */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.2px;
}

.status-pill.online {
    background: var(--success-light);
    color: var(--success);
    border: 1px solid var(--success-border);
}

.status-pill.offline {
    background: var(--danger-light);
    color: var(--danger);
    border: 1px solid var(--danger-border);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
}

.status-dot.online {
    background: var(--success);
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.25);
    animation: pulse-emerald 2s infinite;
}

.status-dot.offline {
    background: var(--danger);
}

@keyframes pulse-emerald {
    0% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.6); }
    70% { box-shadow: 0 0 0 6px rgba(22, 163, 74, 0); }
    100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); }
}

/* ==========================================================
   METRIC STATS GRID
   ========================================================== */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

@media (min-width: 576px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 992px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-xs);
    transition: var(--transition);
}

.stat-card:hover {
    box-shadow: var(--shadow-card);
    transform: translateY(-2px);
}

.stat-icon-wrapper {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon-wrapper.blue   { background: var(--primary-light); color: var(--primary); }
.stat-icon-wrapper.green  { background: var(--success-light); color: var(--success); }
.stat-icon-wrapper.amber  { background: var(--warning-light); color: var(--warning); }
.stat-icon-wrapper.slate  { background: #f1f5f9; color: #475569; }

.stat-content {
    flex: 1;
    min-width: 0;
}

.stat-value {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==========================================================
   BOTÕES E COMPONENTES INTERATIVOS
   ========================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
    user-select: none;
    line-height: 1.25;
}

.btn:hover {
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary);
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}
.btn-primary:hover {
    background-color: var(--primary-hover);
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
}

.btn-success {
    background-color: var(--success);
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(22, 163, 74, 0.2);
}
.btn-success:hover {
    background-color: var(--success-hover);
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(22, 163, 74, 0.3);
}

.btn-danger {
    background-color: var(--danger);
    color: #ffffff;
}
.btn-danger:hover {
    background-color: var(--danger-hover);
    color: #ffffff;
}

.btn-outline {
    background-color: #ffffff;
    border-color: var(--border);
    color: var(--text-primary);
    box-shadow: var(--shadow-xs);
}
.btn-outline:hover {
    background-color: #f8fafc;
    border-color: #cbd5e1;
    color: var(--text-primary);
}

.btn-ghost {
    background: transparent;
    border-color: transparent;
    color: var(--text-secondary);
}
.btn-ghost:hover {
    background: #f1f5f9;
    color: var(--text-primary);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
    gap: 6px;
}

.btn-lg {
    padding: 13px 24px;
    font-size: 15px;
    font-weight: 700;
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

/* ==========================================================
   FORMULÁRIOS E INPUTS
   ========================================================== */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 11px 14px;
    font-size: 14px;
    font-family: inherit;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background-color: #ffffff;
    color: var(--text-primary);
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.form-control::placeholder {
    color: var(--text-muted);
}

/* Barra de Busca com Ícone */
.search-wrapper {
    position: relative;
    width: 100%;
    max-width: 340px;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.search-input {
    padding-left: 38px;
}

/* Filtros de Pílulas / Chips */
.filter-bar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 600;
    background: #f1f5f9;
    color: var(--text-secondary);
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
}

.filter-chip:hover {
    background: #e2e8f0;
    color: var(--text-primary);
    text-decoration: none;
}

.filter-chip.active {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

/* ==========================================================
   GRID DE MÍDIAS (CARDS)
   ========================================================== */
.media-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
}

@media (min-width: 576px) {
    .media-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 992px) {
    .media-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1200px) {
    .media-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.media-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-xs);
    transition: var(--transition);
}

.media-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
    border-color: #cbd5e1;
}

.media-card.is-inactive {
    opacity: 0.6;
    background: #f8fafc;
}

.media-preview-container {
    width: 100%;
    aspect-ratio: 16 / 9;
    background-color: #0f172a;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.media-preview-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.media-card:hover .media-preview-container img {
    transform: scale(1.04);
}

.media-preview-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-video-badge {
    position: absolute;
    width: 36px;
    height: 36px;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(4px);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.media-type-tag {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 3px 8px;
    border-radius: var(--radius-xs);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    background: rgba(15, 23, 42, 0.8);
    color: #ffffff;
    backdrop-filter: blur(4px);
}

.media-body {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.media-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.media-origin-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-xs);
    margin-bottom: 10px;
    width: fit-content;
}

.media-origin-badge.upload {
    background: var(--success-light);
    color: var(--success);
}

.media-origin-badge.url {
    background: var(--info-light);
    color: var(--info);
}

.media-metadata-row {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-bottom: 14px;
}

.media-footer-actions {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

/* ==========================================================
   PLAYLIST CONTAINER & ITENS
   ========================================================== */
.playlist-header-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 18px 22px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: var(--shadow-card);
}

@media (min-width: 768px) {
    .playlist-header-card {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

.playlist-status-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.playlist-status-title {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.playlist-status-desc {
    font-size: 13px;
    color: var(--text-secondary);
}

.playlist-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.playlist-row {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--shadow-xs);
    transition: var(--transition);
    user-select: none;
}

.playlist-row:hover {
    border-color: #cbd5e1;
    box-shadow: var(--shadow-card);
}

.playlist-row.dragging {
    opacity: 0.45;
    background: #f1f5f9;
    border-style: dashed;
}

.playlist-grip-handle {
    cursor: grab;
    color: var(--text-muted);
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-xs);
    transition: var(--transition);
}

.playlist-grip-handle:hover {
    color: var(--text-primary);
    background: #f1f5f9;
}

.playlist-grip-handle:active {
    cursor: grabbing;
}

.playlist-index {
    width: 30px;
    height: 30px;
    background: #f1f5f9;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 800;
    color: var(--text-primary);
    flex-shrink: 0;
}

.playlist-thumbnail {
    width: 64px;
    height: 48px;
    background: #0f172a;
    border-radius: var(--radius-sm);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.playlist-thumbnail img, .playlist-thumbnail video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.playlist-info-box {
    flex: 1;
    min-width: 0;
}

.playlist-item-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.playlist-item-sub {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.playlist-duration-box {
    display: flex;
    align-items: center;
    gap: 8px;
}

.duration-chip-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.duration-select-styled {
    padding: 6px 10px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #ffffff;
    color: var(--text-primary);
}

.video-full-pill {
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    background: var(--info-light);
    color: var(--info);
    border: 1px solid var(--info-border);
    white-space: nowrap;
}

.playlist-reorder-mobile {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.btn-move-touch {
    width: 28px;
    height: 22px;
    background: #f1f5f9;
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
}

.btn-move-touch:hover {
    background: #e2e8f0;
    color: var(--text-primary);
}

/* ==========================================================
   ESTADOS VAZIOS (EMPTY STATES)
   ========================================================== */
.empty-state-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 56px 24px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-card);
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-full);
    background: #f1f5f9;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.empty-state-title {
    font-size: 17px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.empty-state-text {
    font-size: 14px;
    color: var(--text-secondary);
    max-width: 420px;
    margin-bottom: 22px;
    line-height: 1.5;
}

/* ==========================================================
   MODAIS E SEGMENTED TABS
   ========================================================== */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 16px;
}

.modal-backdrop.is-active {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 520px;
    box-shadow: var(--shadow-modal);
    border: 1px solid var(--border);
    overflow: hidden;
    animation: modalScaleIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalScaleIn {
    from { opacity: 0; transform: scale(0.96) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.modal-close-btn:hover {
    color: var(--text-primary);
    background: #f1f5f9;
}

.segmented-control {
    display: flex;
    background: #f1f5f9;
    padding: 4px;
    border-radius: var(--radius-md);
    margin: 18px 24px 0;
    gap: 4px;
}

.segmented-btn {
    flex: 1;
    padding: 9px 12px;
    border: none;
    background: transparent;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: var(--transition);
}

.segmented-btn.active {
    background: #ffffff;
    color: var(--primary);
    box-shadow: var(--shadow-xs);
}

.modal-body {
    padding: 22px 24px;
}

.modal-footer {
    padding: 16px 24px;
    background: var(--bg-card-subtle);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Área de Upload Drag & Drop */
.upload-dropzone {
    border: 2px dashed #cbd5e1;
    border-radius: var(--radius-md);
    padding: 32px 20px;
    text-align: center;
    background: #f8fafc;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.upload-dropzone:hover, .upload-dropzone.dragover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.upload-dropzone-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    background: #eff6ff;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.upload-dropzone-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.upload-dropzone-hint {
    font-size: 12px;
    color: var(--text-muted);
}

.upload-selected-file {
    margin-top: 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    background: #ffffff;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    border: 1px solid var(--primary-border);
}

/* ==========================================================
   ALERTAS, NOTIFICAÇÕES & TOASTS
   ========================================================== */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-md);
    font-size: 14px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    line-height: 1.4;
}

.alert-success { background: var(--success-light); color: #14532d; border: 1px solid var(--success-border); }
.alert-danger, .alert-error { background: var(--danger-light); color: #7f1d1d; border: 1px solid var(--danger-border); }
.alert-warning { background: var(--warning-light); color: #78350f; border: 1px solid var(--warning-border); }
.alert-info { background: var(--info-light); color: #0c4a6e; border: 1px solid var(--info-border); }

.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 360px;
    width: 100%;
}

@media (max-width: 576px) {
    .toast-container {
        bottom: 74px; /* Acima da barra mobile */
        right: 16px;
        left: 16px;
        max-width: none;
    }
}

.toast {
    background: #0f172a;
    color: #ffffff;
    padding: 14px 18px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
    box-shadow: var(--shadow-modal);
    display: flex;
    align-items: center;
    gap: 12px;
    border-left: 4px solid var(--primary);
    animation: toastSlideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast-success { border-left-color: var(--success); }
.toast-error   { border-left-color: var(--danger); }
.toast-warning { border-left-color: var(--warning); }
.toast-info    { border-left-color: var(--info); }

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

/* ==========================================================
   TELA DE LOGIN (SAAS PREMIUM)
   ========================================================== */
.login-screen-body {
    background: radial-gradient(circle at 50% 20%, #1e293b 0%, #0f172a 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-box {
    width: 100%;
    max-width: 400px;
    background: #ffffff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-modal);
    padding: 38px 32px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.login-brand-header {
    text-align: center;
    margin-bottom: 28px;
}

.login-brand-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    box-shadow: 0 8px 16px rgba(37, 99, 235, 0.3);
    margin-bottom: 14px;
}

.login-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.4px;
}

.login-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.login-footer-text {
    text-align: center;
    margin-top: 24px;
    font-size: 12px;
    color: var(--text-muted);
}
