@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700&family=Space+Grotesk:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    --bg: #050508;
    --surface: #0a0a10;
    --card: #0f0f17;
    --card-hover: #13131d;
    --elevated: #161622;
    --border: rgba(255,255,255,0.05);
    --border-hover: rgba(255,255,255,0.10);
    --border-active: rgba(99,220,255,0.25);
    --text: #ecedf0;
    --text2: rgba(255,255,255,0.50);
    --text3: rgba(255,255,255,0.22);
    --accent: #63dcff;
    --accent-dim: rgba(99,220,255,0.12);
    --accent-glow: rgba(99,220,255,0.08);
    --green: #34d399;
    --green-dim: rgba(52,211,153,0.12);
    --red: #fb7185;
    --red-dim: rgba(251,113,133,0.10);
    --amber: #fbbf24;
    --heading: 'Space Grotesk', system-ui, sans-serif;
    --body: 'DM Sans', system-ui, sans-serif;
    --mono: 'JetBrains Mono', monospace;
    --radius: 14px;
    --radius-md: 10px;
    --radius-sm: 8px;
    --radius-xs: 6px;
    --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0 }
body { font-family: var(--body); background: var(--bg); color: var(--text); min-height: 100vh; font-size: 13px; -webkit-font-smoothing: antialiased }

::-webkit-scrollbar { width: 4px; height: 4px }
::-webkit-scrollbar-track { background: transparent }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.06); border-radius: 4px }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.12) }

/* ═══════════════════ LOGIN ═══════════════════ */

.login-wrap {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: var(--bg); position: relative; overflow: hidden;
}
.login-glow {
    position: fixed; width: 500px; height: 500px; border-radius: 50%;
    filter: blur(150px); opacity: .5; pointer-events: none;
}
.login-glow-1 { background: rgba(99,220,255,0.06); top: -15%; left: 10%; animation: glow-drift 30s ease-in-out infinite alternate }
.login-glow-2 { background: rgba(52,211,153,0.04); bottom: -15%; right: 5%; animation: glow-drift 30s ease-in-out infinite alternate-reverse }
@keyframes glow-drift {
    0% { transform: translate(0, 0) scale(1) }
    50% { transform: translate(30px, -20px) scale(1.1) }
    100% { transform: translate(-15px, 25px) scale(.95) }
}

.login-card {
    position: relative; width: 420px; max-width: 92vw; padding: 44px;
    background: rgba(15,15,23,0.80);
    backdrop-filter: blur(60px); -webkit-backdrop-filter: blur(60px);
    border: 1px solid var(--border); border-radius: 20px;
    animation: card-enter .6s var(--ease) both;
}
@keyframes card-enter {
    from { opacity: 0; transform: translateY(20px) scale(.97) }
    to { opacity: 1; transform: translateY(0) scale(1) }
}
.login-brand {
    display: flex; align-items: center; gap: 10px;
    justify-content: center; margin-bottom: 36px;
}
.login-brand-mark {
    width: 36px; height: 36px; border-radius: 10px;
    background: linear-gradient(135deg, var(--accent), #34d399);
    display: flex; align-items: center; justify-content: center;
    font-family: var(--heading); font-weight: 700; font-size: 14px; color: #000;
}
.login-brand-text { font-family: var(--heading); font-size: 18px; font-weight: 600; color: var(--text); letter-spacing: -.3px }
.login-brand-text span { color: var(--text3) }

.login-title { font-family: var(--heading); font-size: 22px; font-weight: 700; text-align: center; margin-bottom: 4px; letter-spacing: -.4px }
.login-sub { text-align: center; color: var(--text3); font-size: 13px; margin-bottom: 32px }

.login-field { margin-bottom: 16px }
.login-field label {
    display: block; font-size: 11px; font-weight: 600; letter-spacing: 1px;
    text-transform: uppercase; color: var(--text2); margin-bottom: 7px;
}
.login-field input {
    width: 100%; padding: 12px 14px;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: rgba(255,255,255,.03); color: var(--text);
    font-size: 14px; font-family: var(--body);
    transition: all .2s var(--ease);
}
.login-field input:focus {
    outline: none; border-color: var(--border-active);
    background: rgba(255,255,255,.05);
    box-shadow: 0 0 0 3px var(--accent-glow);
}
.login-field input::placeholder { color: var(--text3) }
.login-btn {
    width: 100%; padding: 12px; border: none; border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--accent), #5bc4e0);
    color: #050508; font-size: 14px; font-weight: 700; font-family: var(--heading);
    cursor: pointer; transition: all .2s var(--ease); margin-top: 6px;
    letter-spacing: .2px;
}
.login-btn:hover { filter: brightness(1.1); box-shadow: 0 4px 24px var(--accent-glow) }
.login-btn:active { transform: scale(.98) }
.login-err {
    color: var(--red); text-align: center; margin-top: 18px;
    font-size: 13px; font-weight: 500; display: none;
}
@keyframes fade-in { from { opacity: 0 } to { opacity: 1 } }

/* ═══════════════════ PANEL LAYOUT ═══════════════════ */

.topbar {
    position: sticky; top: 0; z-index: 100;
    background: rgba(5,5,8,.88); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 0 20px; height: 52px;
    display: flex; align-items: center; gap: 14px;
}
.topbar-brand { display: flex; align-items: center; gap: 8px }
.topbar-mark {
    width: 28px; height: 28px; border-radius: 7px;
    background: linear-gradient(135deg, var(--accent), #34d399);
    display: flex; align-items: center; justify-content: center;
    font-family: var(--heading); font-weight: 700; font-size: 10px; color: #000;
}
.topbar-name { font-family: var(--heading); font-size: 14px; font-weight: 700; letter-spacing: -.2px }
.topbar-name span { color: var(--text3); font-weight: 400 }

.topbar-stats { margin-left: auto; display: flex; gap: 6px; align-items: center }
.stat-pill {
    display: flex; align-items: center; gap: 6px;
    padding: 5px 12px; border-radius: 20px;
    background: var(--surface); border: 1px solid var(--border);
    font-size: 12px; color: var(--text2); font-weight: 500;
}
.stat-pill strong { color: var(--text); font-family: var(--mono); font-weight: 500; font-size: 12px }
.stat-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0 }
.stat-dot.on { background: var(--green); box-shadow: 0 0 8px rgba(52,211,153,.4); animation: blink 2.5s ease infinite }
.stat-dot.off { background: var(--text3) }
@keyframes blink { 0%,100% { opacity:1 } 50% { opacity:.35 } }

.topbar-logout {
    padding: 6px 14px; border: 1px solid var(--border); border-radius: var(--radius-xs);
    background: none; color: var(--text3); cursor: pointer;
    font-size: 11px; font-family: var(--body); font-weight: 500;
    transition: all .15s var(--ease); margin-left: 6px;
}
.topbar-logout:hover { color: var(--text); border-color: var(--border-hover); background: rgba(255,255,255,.03) }

/* ═══════════════════ TOOLBAR ═══════════════════ */

.toolbar {
    position: sticky; top: 52px; z-index: 99;
    background: rgba(10,10,16,.92); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    padding: 10px 20px;
    display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
}
.tb-section {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.tb-input {
    padding: 8px 12px;
    border: 1px solid var(--border); border-radius: var(--radius-xs);
    background: rgba(255,255,255,.03); color: var(--text);
    font-size: 12px; font-family: var(--body);
    transition: all .15s var(--ease);
    min-width: 0;
}
.tb-input:focus { outline: none; border-color: var(--border-active); background: rgba(255,255,255,.05) }
.tb-input::placeholder { color: var(--text3) }
.tb-url { width: 240px }
.tbtn {
    padding: 7px 12px; border: none; border-radius: var(--radius-xs);
    cursor: pointer; font-size: 11px; font-weight: 600; font-family: var(--body);
    white-space: nowrap; transition: all .15s var(--ease);
}
.tbtn:active { transform: scale(.97) }
.tbtn-p { background: linear-gradient(135deg, var(--accent), #5bc4e0); color: #050508 }
.tbtn-p:hover { filter: brightness(1.1) }
.tbtn-g { background: rgba(255,255,255,.04); color: var(--text2); border: 1px solid var(--border) }
.tbtn-g:hover { background: rgba(255,255,255,.07); color: var(--text); border-color: var(--border-hover) }
.tb-sep { width: 1px; height: 24px; background: var(--border); flex-shrink: 0 }
.tb-toggle-group { display: flex; align-items: center; gap: 8px }
.tb-label { font-size: 10px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--text3); white-space: nowrap }
.tb-muted { font-size: 11px; color: var(--text3) }

.shell { display: flex; height: calc(100vh - 52px - 50px) }

/* ═══════════════════ SIDEBAR ═══════════════════ */

.side {
    width: 220px; min-width: 220px;
    background: var(--surface); border-right: 1px solid var(--border);
    padding: 14px 12px; display: flex; flex-direction: column; gap: 14px;
    overflow-y: auto;
}
.side-group { display: flex; flex-direction: column; gap: 7px }
.side-label {
    font-family: var(--heading); font-size: 10px; font-weight: 600;
    letter-spacing: 1.5px; text-transform: uppercase; color: var(--text3);
    padding: 0 4px; margin-bottom: 1px;
}
.side-input {
    width: 100%; padding: 9px 12px;
    border: 1px solid var(--border); border-radius: var(--radius-xs);
    background: rgba(255,255,255,.025); color: var(--text);
    font-size: 12px; font-family: var(--body);
    transition: all .15s var(--ease);
}
.side-input:focus { outline: none; border-color: var(--border-active); background: rgba(255,255,255,.04) }
.side-input::placeholder { color: var(--text3) }
.side-row { display: flex; gap: 5px }

.sbtn {
    width: 100%; padding: 8px 12px; border: none; border-radius: var(--radius-xs);
    cursor: pointer; font-size: 12px; font-weight: 600; font-family: var(--body);
    white-space: nowrap; transition: all .15s var(--ease); text-align: center;
}
.sbtn:active { transform: scale(.97) }
.sbtn-p { background: linear-gradient(135deg, var(--accent), #5bc4e0); color: #050508 }
.sbtn-p:hover { filter: brightness(1.1) }
.sbtn-g { background: rgba(255,255,255,.04); color: var(--text2); border: 1px solid var(--border) }
.sbtn-g:hover { background: rgba(255,255,255,.07); color: var(--text); border-color: var(--border-hover) }
.sbtn-r { background: var(--red-dim); color: var(--red); border: 1px solid rgba(251,113,133,.12) }
.sbtn-r:hover { background: rgba(251,113,133,.18) }
.sbtn-half { width: calc(50% - 2.5px) }
.side-sel-info { font-size: 11px; color: var(--accent); text-align: center; min-height: 16px; font-weight: 500 }
.side-divider { height: 1px; background: var(--border); margin: 2px 0 }
.side-spacer { flex: 1 }

.filter-tabs { display: flex; gap: 3px; flex-wrap: wrap }
.filter-tab {
    flex: 1; padding: 6px 4px; border: 1px solid var(--border); border-radius: var(--radius-xs);
    background: rgba(255,255,255,.03); color: var(--text3); cursor: pointer;
    font-size: 10px; font-weight: 600; font-family: var(--body); text-align: center;
    transition: all .15s var(--ease); white-space: nowrap;
}
.filter-tab:hover { background: rgba(255,255,255,.06); color: var(--text2) }
.filter-tab.active { background: var(--accent-dim); color: var(--accent); border-color: var(--border-active) }

/* ═══════════════════ AGENT LIST ═══════════════════ */

.content { flex: 1; overflow-y: auto; padding: 14px }
.agent-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(480px, 1fr));
    gap: 8px;
}

/* ═══════════════════ ROW CARD ═══════════════════ */

.row {
    display: flex; align-items: stretch; gap: 0;
    background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden;
    transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.row:hover { border-color: var(--border-hover); box-shadow: 0 2px 20px rgba(0,0,0,.25) }
.row.selected { border-color: var(--border-active); box-shadow: 0 0 0 1px var(--border-active) }

.row-chk {
    width: 14px; height: 14px; accent-color: var(--accent); cursor: pointer;
    align-self: center; margin: 0 8px; flex-shrink: 0;
}

/* ── Thumbnail ── */

.row-thumb-area {
    width: 140px; min-width: 140px; flex-shrink: 0;
    display: flex; flex-direction: column;
    border-right: 1px solid var(--border);
    background: var(--surface);
    overflow: hidden;
}
.row-thumb-area .thumb-tabs { flex: 1 }
.row-thumb-area .thumb-tab { min-height: 0 }

.thumb-wrap {
    position: relative; width: 100%; flex: 1;
    cursor: pointer; overflow: hidden; background: #08080d;
}
.thumb-wrap:hover { opacity: .85 }
.thumb-loading {
    position: absolute; inset: 0;
    background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.02) 50%, transparent 70%);
    background-size: 250% 100%; animation: shine 2.5s ease-in-out infinite;
}
.thumb-wrap.has-img .thumb-loading { display: none }
@keyframes shine { 0% { background-position: 200% 0 } 100% { background-position: -200% 0 } }

.thumb-img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; transition: opacity .3s }
.thumb-img.loaded { opacity: 1 }

.thumb-tabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); height: 100% }
.thumb-tab { display: flex; flex-direction: column; min-width: 0 }
.thumb-label {
    padding: 2px 6px; font-size: 8px; font-weight: 600;
    color: var(--text3); font-family: var(--heading);
    text-transform: uppercase; letter-spacing: .5px;
    border-top: 1px solid var(--border); text-align: center;
    background: rgba(0,0,0,.2);
}

/* ── Info ── */

.row-info { flex: 1; padding: 8px 12px; display: flex; flex-direction: column; gap: 4px; min-width: 0 }

.row-header { display: flex; align-items: center; gap: 6px }
.row-os { display: flex; align-items: center; flex-shrink: 0 }
.os-icon { width: 14px; height: 14px; color: var(--accent); flex-shrink: 0 }
.row-name { font-family: var(--heading); font-weight: 700; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.row-status {
    font-size: 9px; font-weight: 700; padding: 1px 6px; border-radius: 10px;
    text-transform: uppercase; letter-spacing: .5px; flex-shrink: 0;
}
.row-status.on { background: var(--green-dim); color: var(--green) }
.row-status.off { background: rgba(255,255,255,.04); color: var(--text3) }

.fav-star { cursor: pointer; font-size: 13px; color: var(--text3); transition: color .15s; user-select: none; flex-shrink: 0 }
.fav-star:hover { color: #ffc107 }
.fav-star.is-fav { color: #ffc107 }

.badge {
    font-size: 9px; font-weight: 700; padding: 1px 5px; border-radius: 8px;
    text-transform: uppercase; letter-spacing: .3px; flex-shrink: 0;
}
.badge-termo { background: rgba(255,193,7,.15); color: #ffc107 }
.badge-baixar { background: rgba(33,150,243,.15); color: #2196f3 }
.badge-acordo { background: rgba(233,30,99,.15); color: #e91e63 }
.badge-nfe { background: rgba(255,152,0,.15); color: #ff9800 }
.badge-contrato { background: rgba(76,175,80,.15); color: #4caf50 }
.badge-ml { background: rgba(255,230,0,.15); color: #ffe600 }
.badge-new { background: rgba(76,175,80,.18); color: #4caf50; animation: pulse-new 2s infinite }
@keyframes pulse-new { 0%,100%{opacity:1} 50%{opacity:.5} }

.row-details {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px 8px;
}
.row-detail { display: flex; align-items: center; gap: 3px; overflow: hidden }
.detail-label { font-size: 9px; color: var(--text3); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; flex-shrink: 0 }
.detail-value { font-size: 10px; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.detail-value.mono { font-family: var(--mono); font-size: 9px }

.row-url {
    font-size: 9px; color: var(--text3); font-family: var(--mono);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    letter-spacing: .2px; margin-top: auto;
}

/* ── Row Actions ── */

.row-actions {
    display: flex; flex-direction: column; gap: 3px;
    padding: 6px; border-left: 1px solid var(--border);
    align-items: center; justify-content: center;
    flex-shrink: 0;
}

.cbtn {
    padding: 6px 10px; border: none; border-radius: var(--radius-xs);
    cursor: pointer; font-size: 12px; font-weight: 600; font-family: var(--body);
    transition: all .12s var(--ease); white-space: nowrap; min-width: 32px;
    text-align: center;
}
.cbtn:active { transform: scale(.96) }
.cbtn-p { background: var(--accent); color: #050508 }
.cbtn-p:hover { filter: brightness(1.15) }
.cbtn-g { background: rgba(255,255,255,.05); color: var(--text2) }
.cbtn-g:hover { background: rgba(255,255,255,.09); color: var(--text) }
.cbtn-r { background: var(--red-dim); color: var(--red) }
.cbtn-r:hover { background: rgba(251,113,133,.18) }
.cbtn-stop { background: rgba(251,191,36,.08); color: var(--amber); padding: 6px 10px; font-size: 16px; line-height: 1; border: 1px solid rgba(251,191,36,.15) }
.cbtn-stop:hover { background: rgba(251,191,36,.18) }
.cbtn-r-sm { background: var(--red-dim); color: var(--red); padding: 6px 10px; font-size: 14px; line-height: 1; border: 1px solid rgba(251,113,133,.12) }
.cbtn-r-sm:hover { background: rgba(251,113,133,.18) }

/* ═══════════════════ MODAL FULLSCREEN ═══════════════════ */

.modal-overlay {
    position: fixed; inset: 0; z-index: 300;
    background: rgba(0,0,0,.92);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transition: opacity .2s var(--ease);
}
.modal-overlay.open { opacity: 1; pointer-events: auto }

.modal-container {
    width: 92vw; max-width: 1200px; max-height: 92vh;
    display: flex; flex-direction: column;
    background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden;
    box-shadow: 0 16px 64px rgba(0,0,0,.6);
    animation: modal-in .25s var(--ease) both;
}
@keyframes modal-in { from { opacity: 0; transform: scale(.96) } to { opacity: 1; transform: scale(1) } }

.modal-header {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px; border-bottom: 1px solid var(--border);
    background: var(--surface);
}
.modal-title { font-family: var(--heading); font-weight: 700; font-size: 14px; flex-shrink: 0 }
.modal-tabs { display: flex; gap: 4px; flex: 1; overflow-x: auto }
.modal-tab {
    padding: 5px 12px; border-radius: var(--radius-xs);
    background: rgba(255,255,255,.04); border: 1px solid var(--border);
    color: var(--text2); font-size: 11px; font-weight: 600; font-family: var(--heading);
    cursor: pointer; transition: all .15s var(--ease); white-space: nowrap;
}
.modal-tab:hover { background: rgba(255,255,255,.07); color: var(--text) }
.modal-tab.active { background: var(--accent-dim); color: var(--accent); border-color: var(--border-active) }
.modal-close {
    padding: 4px 10px; background: none; border: 1px solid var(--border);
    border-radius: var(--radius-xs); color: var(--text3); cursor: pointer;
    font-size: 18px; line-height: 1; transition: all .15s var(--ease);
}
.modal-close:hover { color: var(--text); border-color: var(--border-hover) }

.modal-body {
    flex: 1; overflow: auto; display: flex; align-items: center; justify-content: center;
    background: #000; min-height: 300px;
}
.modal-body img { max-width: 100%; max-height: 75vh; object-fit: contain }

.modal-footer {
    display: flex; gap: 6px; padding: 10px 16px;
    border-top: 1px solid var(--border); background: var(--surface);
}
.modal-footer input {
    flex: 1; padding: 8px 12px;
    border: 1px solid var(--border); border-radius: var(--radius-xs);
    background: rgba(255,255,255,.025); color: var(--text);
    font-size: 12px; font-family: var(--body);
}
.modal-footer input:focus { outline: none; border-color: var(--border-active) }
.modal-footer input::placeholder { color: var(--text3) }

/* ═══════════════════ EMPTY & PAGINATION ═══════════════════ */

.empty-state {
    text-align: center; padding: 120px 20px;
    color: var(--text3); font-size: 14px;
}
.empty-state-icon {
    width: 48px; height: 48px; margin: 0 auto 16px;
    border-radius: 14px; background: var(--card);
    border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; color: var(--text3);
}

.pager {
    display: flex; align-items: center; justify-content: center;
    gap: 5px; padding: 20px;
}
.pager button {
    padding: 7px 13px; border: 1px solid var(--border); border-radius: var(--radius-xs);
    background: rgba(255,255,255,.03); color: var(--text2); cursor: pointer;
    font-size: 12px; font-family: var(--body); font-weight: 500;
    transition: all .15s var(--ease);
}
.pager button:hover { background: rgba(255,255,255,.07); color: var(--text) }
.pager button:disabled { opacity: .25; cursor: default; pointer-events: none }
.pager button.cur { background: var(--accent); color: #050508; border-color: var(--accent); font-weight: 700 }
.pager .pg-total { font-size: 11px; color: var(--text3); font-family: var(--mono); margin-left: 8px }

/* ═══════════════════ RESPONSIVE ═══════════════════ */

@media (max-width: 900px) {
    .side { display: none }
    .toolbar { padding: 6px 10px }
    .tb-url { width: 160px }
    .agent-list { grid-template-columns: 1fr }
    .row-thumb-area { width: 110px; min-width: 110px }
    .row-details { grid-template-columns: repeat(2, 1fr) }
}

.toggle-switch { position: relative; width: 36px; height: 20px; display: inline-block; flex-shrink: 0 }
.toggle-switch input { opacity: 0; width: 0; height: 0 }
.toggle-slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background: var(--surface2); border-radius: 20px; transition: .2s }
.toggle-slider:before { content: ''; position: absolute; width: 16px; height: 16px; left: 2px; bottom: 2px; background: var(--text3); border-radius: 50%; transition: .2s }
.toggle-switch input:checked + .toggle-slider { background: var(--green-dim) }
.toggle-switch input:checked + .toggle-slider:before { transform: translateX(16px); background: var(--green) }
.auto-redirect-status { font-size: 11px; color: var(--text3) }
.auto-redirect-status.active { color: var(--green) }
.side-hint { font-size: 10px; color: var(--text3); line-height: 1.3; margin-top: 2px }

/* ═══════════════════ CHANNELS PANEL ═══════════════════ */

.channels-overlay {
    position: fixed; inset: 0; z-index: 400;
    background: rgba(0,0,0,.7);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transition: opacity .2s var(--ease);
}
.channels-overlay.open { opacity: 1; pointer-events: auto }

.channels-panel {
    width: 480px; max-width: 94vw; max-height: 80vh;
    background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden;
    display: flex; flex-direction: column;
    box-shadow: 0 16px 64px rgba(0,0,0,.5);
    animation: modal-in .25s var(--ease) both;
}
.channels-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px; border-bottom: 1px solid var(--border);
    background: var(--surface);
}
.channels-title { font-family: var(--heading); font-weight: 700; font-size: 15px }
.channels-body { padding: 16px 18px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 12px }
.channels-hint { font-size: 11px; color: var(--text3); line-height: 1.4 }
.channels-add { display: flex; gap: 6px }
.channels-footer { padding: 12px 18px; border-top: 1px solid var(--border); background: var(--surface); display: flex; flex-direction: column; gap: 8px }

.ch-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 12px; background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.ch-priority {
    width: 22px; height: 22px; border-radius: 6px;
    background: var(--accent-dim); color: var(--accent);
    font-family: var(--mono); font-size: 11px; font-weight: 700;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.ch-url { flex: 1; font-size: 12px; color: var(--text); font-family: var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.ch-actions { display: flex; gap: 3px; flex-shrink: 0 }
.ch-btn {
    width: 24px; height: 24px; border: 1px solid var(--border); border-radius: var(--radius-xs);
    background: rgba(255,255,255,.03); color: var(--text3); cursor: pointer;
    font-size: 10px; display: flex; align-items: center; justify-content: center;
    transition: all .12s var(--ease);
}
.ch-btn:hover { background: rgba(255,255,255,.08); color: var(--text) }
.ch-btn-r:hover { background: var(--red-dim); color: var(--red) }
.ch-empty { text-align: center; padding: 20px; color: var(--text3); font-size: 12px }

.ch-status-row { display: flex; align-items: center; gap: 8px; font-size: 12px }
.ch-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0 }
.ch-live { background: var(--green); box-shadow: 0 0 6px rgba(52,211,153,.4) }
.ch-off { background: var(--red) }
.ch-unk { background: var(--text3) }

@media (max-width: 600px) {
    .row { flex-wrap: wrap }
    .row-thumb-area { width: 100%; min-width: 100%; border-right: none; border-bottom: 1px solid var(--border) }
    .row-actions { flex-direction: row; width: 100%; border-left: none; border-top: 1px solid var(--border); justify-content: flex-end }
    .row-details { grid-template-columns: repeat(3, 1fr) }
}
