/* ==========================================================
   KastIPTV - Ultra Modern Dark Design System (PHP & MySQL Edition)
   ========================================================== */

:root {
    --bg-base: #07090f;
    --bg-sidebar: #0b101c;
    --bg-card: #121727;
    --bg-card-hover: #161e33;
    --bg-input: #0e1322;
    
    --border-subtle: rgba(255, 255, 255, 0.07);
    --border-hover: rgba(255, 255, 255, 0.15);
    --border-focus: #6366f1;
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --accent-cyan: #00f2fe;
    --accent-blue: #38bdf8;
    --accent-emerald: #10b981;
    --accent-amber: #f59e0b;
    --accent-rose: #f43f5e;
    --whatsapp-color: #25d366;
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.25);
    --shadow-cyan: 0 0 20px rgba(0, 242, 254, 0.2);
}

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

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-base);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ==========================================================
   LAYOUT STRUCTURE
   ========================================================== */

.app-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* ==========================================================
   SIDEBAR & LOGO COM REMOÇÃO DE FUNDO BRANCO VIA CSS
   ========================================================== */

.sidebar {
    width: 260px;
    min-width: 260px;
    height: 100vh;
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-subtle);
    z-index: 100;
}

/* Container do Logo */
.kast-brand-logo {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--border-subtle);
    background: rgba(0, 0, 0, 0.25);
    min-height: 76px;
    overflow: hidden;
}

/* Logo KastIPTV com remoção de fundo branco via CSS puro */
.kast-logo-img {
    max-height: 46px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    /* CSS para remover fundo branco tornando-o 100% transparente no dark mode */
    filter: invert(1) hue-rotate(180deg);
    mix-blend-mode: screen;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.kast-logo-img:hover {
    transform: scale(1.04);
}

/* Status Quick Box na Sidebar */
.sidebar-status-box {
    margin: 12px 14px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
}

.status-indicator-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.76rem;
}

.pulse-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.pulse-dot.green {
    background-color: var(--accent-emerald);
    box-shadow: 0 0 8px var(--accent-emerald);
}

.pulse-dot.cyan {
    background-color: var(--accent-cyan);
    box-shadow: 0 0 8px var(--accent-cyan);
}

.status-title {
    color: var(--text-secondary);
    font-weight: 500;
    flex: 1;
}

.status-state {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
}

.status-state.online {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-emerald);
}

.status-state.active {
    background: rgba(0, 242, 254, 0.15);
    color: var(--accent-cyan);
}

/* Sidebar Nav */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 10px 12px;
}

.nav-section-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    padding: 14px 12px 6px;
}

.nav-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.nav-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.18s ease;
    text-align: left;
}

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

.nav-btn.active {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.18) 0%, rgba(99, 102, 241, 0.04) 100%);
    border-color: rgba(99, 102, 241, 0.3);
    color: #ffffff;
    font-weight: 600;
}

.nav-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.nav-btn.active .nav-icon {
    color: var(--accent-cyan);
}

.nav-text {
    flex: 1;
}

.nav-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
}

.nav-badge.hot {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-amber);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.nav-badge.success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-emerald);
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 14px 16px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.15);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4f46e5, #06b6d4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
}

.user-info {
    flex: 1;
    overflow: hidden;
}

.user-info h4 {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-info p {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.icon-action-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.icon-action-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    transform: rotate(45deg);
}

/* ==========================================================
   MAIN WRAPPER & TOP HEADER
   ========================================================== */

.main-wrapper {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg-base);
}

.top-header {
    height: 64px;
    padding: 0 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-subtle);
    background: rgba(11, 16, 28, 0.85);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 90;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.breadcrumb-root {
    color: var(--text-muted);
    font-weight: 500;
}

.breadcrumb-sep {
    color: rgba(255, 255, 255, 0.2);
}

.breadcrumb-active {
    color: var(--text-primary);
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    font-size: 1.05rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-box-header {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 6px 12px;
    cursor: text;
    transition: all 0.2s;
}

.search-box-header:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.search-box-header input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 0.82rem;
    width: 180px;
}

.search-box-header input::placeholder {
    color: var(--text-muted);
}

.search-badge {
    font-size: 0.65rem;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    padding: 2px 5px;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
}

.header-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.header-btn.primary {
    background: linear-gradient(135deg, #6366f1, #3b82f6);
    color: #fff;
    box-shadow: 0 2px 10px rgba(99, 102, 241, 0.3);
}

.header-btn.primary:hover {
    opacity: 0.92;
    transform: translateY(-1px);
}

.header-btn.secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
}

.header-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

.header-status-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent-emerald);
}

/* ==========================================================
   CONTENT BODY & TAB PANES
   ========================================================== */

.content-body {
    padding: 28px;
    flex: 1;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
    animation: fadeIn 0.2s ease-out;
}

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

/* ==========================================================
   CARDS & COMMON COMPONENTS
   ========================================================== */

.data-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.section-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.section-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.45rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.2;
}

.section-subtitle {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.card-header-styled {
    margin-bottom: 18px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.card-header-styled h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: #ffffff;
}

.card-header-styled p {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-top: 3px;
}

/* ==========================================================
   DASHBOARD SECTION
   ========================================================== */

.welcome-banner {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(0, 242, 254, 0.08) 100%);
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: var(--radius-md);
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 20px;
    flex-wrap: wrap;
}

.welcome-text h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
}

.welcome-text h2 span {
    color: var(--accent-cyan);
}

.welcome-text p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    max-width: 650px;
    margin-top: 6px;
}

.welcome-actions {
    display: flex;
    gap: 10px;
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.metric-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 18px;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.metric-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-hover);
}

.metric-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.metric-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.metric-icon.indigo { background: rgba(99, 102, 241, 0.15); color: var(--primary); }
.metric-icon.amber { background: rgba(245, 158, 11, 0.15); color: var(--accent-amber); }
.metric-icon.rose { background: rgba(244, 63, 94, 0.15); color: var(--accent-rose); }
.metric-icon.cyan { background: rgba(0, 242, 254, 0.15); color: var(--accent-cyan); }
.metric-icon.emerald { background: rgba(16, 185, 129, 0.15); color: var(--accent-emerald); }

.metric-value {
    font-family: 'Outfit', sans-serif;
    font-size: 1.85rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 6px;
}

.metric-footer {
    font-size: 0.74rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.metric-footer.success { color: var(--accent-emerald); }
.metric-footer.info { color: var(--text-muted); }

/* Dashboard Split Grid */
.dashboard-split-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 20px;
}

@media (max-width: 1100px) {
    .dashboard-split-grid {
        grid-template-columns: 1fr;
    }
}

.dash-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 20px;
}

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

.dash-card-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dash-card-title .icon {
    font-size: 1.2rem;
}

.dash-card-title h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.05rem;
    font-weight: 600;
    color: #ffffff;
}

.dash-card-title p {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.dash-channel-select {
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    outline: none;
    max-width: 200px;
}

/* Video Preview Wrapper */
.video-preview-wrapper {
    position: relative;
    width: 100%;
    background: #000;
    border-radius: var(--radius-sm);
    overflow: hidden;
    aspect-ratio: 16 / 9;
    box-shadow: var(--shadow-sm);
}

.video-preview-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.video-overlay-loading {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 0.85rem;
    color: var(--accent-cyan);
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(0, 242, 254, 0.2);
    border-top-color: var(--accent-cyan);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.video-preview-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border-subtle);
}

.video-meta h4 {
    font-size: 0.95rem;
    font-weight: 600;
}

.video-meta span {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* Shortcuts in Dashboard */
.dash-shortcuts-section {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--border-subtle);
}

.dash-shortcuts-section h4 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.shortcuts-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.shortcut-box {
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 12px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-primary);
}

.shortcut-box:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.4);
    transform: translateY(-2px);
}

.shortcut-icon {
    font-size: 1.3rem;
}

.shortcut-name {
    font-size: 0.72rem;
    font-weight: 600;
    text-align: center;
}

/* ==========================================================
   TABLES & DATA CARDS
   ========================================================== */

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    text-align: left;
}

.custom-table thead th {
    padding: 12px 14px;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.custom-table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: background 0.15s;
}

.custom-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.custom-table td {
    padding: 14px;
    vertical-align: middle;
}

.badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-pill.success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-emerald);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-pill.danger {
    background: rgba(244, 63, 94, 0.15);
    color: var(--accent-rose);
    border: 1px solid rgba(244, 63, 94, 0.3);
}

.badge-pill.warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-amber);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-pill.cyan {
    background: rgba(0, 242, 254, 0.15);
    color: var(--accent-cyan);
    border: 1px solid rgba(0, 242, 254, 0.3);
}

.badge-pill.info {
    background: rgba(99, 102, 241, 0.15);
    color: #818cf8;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.badge-pill.live {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-emerald);
}

/* Filter Bar */
.filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.filter-tabs {
    display: flex;
    gap: 6px;
    background: var(--bg-card);
    padding: 4px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
}

.filter-tab-btn {
    padding: 6px 14px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.18s;
}

.filter-tab-btn.active {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-weight: 600;
}

.filter-search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 6px 12px;
    min-width: 280px;
}

.filter-search-box input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 0.82rem;
    width: 100%;
}

/* ==========================================================
   BUTTONS & ACTIONS
   ========================================================== */

.btn-primary-gradient {
    background: linear-gradient(135deg, #6366f1 0%, #3b82f6 100%);
    color: #fff;
    border: none;
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 10px rgba(99, 102, 241, 0.3);
    transition: all 0.2s;
}

.btn-primary-gradient:hover {
    transform: translateY(-1px);
    opacity: 0.94;
}

.btn-accent {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-accent:hover {
    background: var(--primary-hover);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-hover);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.3);
}

.btn-sm-outline {
    background: transparent;
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-sm-outline:hover {
    background: rgba(255, 255, 255, 0.08);
}

.btn-whatsapp {
    background: var(--whatsapp-color);
    color: #fff;
    border: none;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.25);
    transition: all 0.2s;
}

.btn-whatsapp:hover {
    transform: translateY(-1px);
    opacity: 0.95;
}

.btn-copy-mini {
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: var(--text-secondary);
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.72rem;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-copy-mini:hover {
    background: var(--primary);
    color: #fff;
}

.action-icon-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.78rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.15s;
}

.action-icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.action-icon-btn.wa {
    background: rgba(37, 211, 102, 0.12);
    border-color: rgba(37, 211, 102, 0.3);
    color: #25d366;
}

.action-icon-btn.wa:hover {
    background: #25d366;
    color: #fff;
}

/* ==========================================================
   TEST GENERATOR SECTION
   ========================================================== */

.test-creator-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 900px) {
    .test-creator-layout {
        grid-template-columns: 1fr;
    }
}

.duration-options {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.duration-pill {
    flex: 1;
    min-width: 80px;
    cursor: pointer;
}

.duration-pill input {
    display: none;
}

.duration-pill span {
    display: block;
    text-align: center;
    padding: 8px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.2s;
}

.duration-pill input:checked + span {
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--primary);
    color: #fff;
    font-weight: 600;
}

.credential-box {
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cred-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 0.85rem;
}

.cred-row.flex-col {
    flex-direction: column;
    align-items: flex-start;
}

.cred-flex-row {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.cred-label {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.cred-val {
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
}

.cred-val.highlight {
    color: var(--accent-cyan);
    font-weight: 600;
}

.cred-val.small-text {
    font-size: 0.76rem;
    word-break: break-all;
}

.test-result-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
}

/* ==========================================================
   STATUS & DIAGNOSTICS SECTION
   ========================================================== */

.status-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.status-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.status-icon-box {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.status-icon-box.green { background: rgba(16, 185, 129, 0.15); }
.status-icon-box.cyan { background: rgba(0, 242, 254, 0.15); }
.status-icon-box.indigo { background: rgba(99, 102, 241, 0.15); }

.status-specs-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 0.84rem;
}

.spec-item {
    display: flex;
    justify-content: space-between;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.spec-item span {
    color: var(--text-secondary);
}

.spec-item strong {
    color: var(--text-primary);
    font-weight: 500;
}

/* ==========================================================
   SOURCES & WHATSAPP GRIDS
   ========================================================== */

.sources-grid,
.whatsapp-layout-grid,
.api-cards-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 900px) {
    .sources-grid,
    .whatsapp-layout-grid,
    .api-cards-grid {
        grid-template-columns: 1fr;
    }
}

.source-stats-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.source-stat-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.88rem;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-subtle);
}

.source-stat-item span {
    color: var(--text-secondary);
}

.progress-bar-bg {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #00f2fe);
    border-radius: 4px;
    transition: width 0.3s;
}

.channels-scroll-container {
    max-height: 400px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 10px;
}

.channel-entry-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid transparent;
    transition: all 0.15s;
}

.channel-entry-row:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border-subtle);
}

/* WhatsApp Session Box */
.wa-session-box {
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(37, 211, 102, 0.08);
    border: 1px solid rgba(37, 211, 102, 0.25);
    border-radius: var(--radius-sm);
    padding: 14px;
    margin-bottom: 20px;
}

.wa-session-icon {
    font-size: 1.8rem;
}

.wa-session-meta h4 {
    font-size: 0.95rem;
    color: var(--whatsapp-color);
}

.wa-session-meta p {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

/* Update Hero Card */
.update-hero-card {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(16, 185, 129, 0.1) 100%);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: var(--radius-md);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.update-hero-icon {
    font-size: 2.2rem;
}

.update-hero-info h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
}

.update-hero-info p {
    color: var(--text-secondary);
    font-size: 0.88rem;
    margin-top: 4px;
}

/* ==========================================================
   FORMS & INPUTS
   ========================================================== */

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

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-row {
    display: flex;
    gap: 12px;
}

.flex-1 { flex: 1; }
.w-100 { width: 100%; }

.form-control {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 9px 12px;
    color: var(--text-primary);
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

textarea.form-control {
    resize: vertical;
    line-height: 1.5;
}

/* ==========================================================
   MODAL WINDOWS
   ========================================================== */

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-backdrop.open {
    display: flex;
    animation: fadeIn 0.2s ease-out;
}

.modal-window {
    background: var(--bg-card);
    border: 1px solid var(--border-hover);
    border-radius: var(--radius-md);
    width: 100%;
    max-width: 520px;
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

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

.modal-header h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.15rem;
    font-weight: 600;
}

.modal-close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.4rem;
    cursor: pointer;
    line-height: 1;
}

.modal-close-btn:hover {
    color: #fff;
}

.modal-body {
    padding: 20px;
    max-height: 70vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: rgba(0, 0, 0, 0.1);
}

/* ==========================================================
   TOAST NOTIFICATION
   ========================================================== */

.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 8px;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.empty-state-text {
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.5;
    padding: 12px 0;
}
