/* =============================================================
 * Hope Channel дизайн система „Афиш" за таблото (admin.hopetv.bg)
 * Зарежда се СЛЕД dashboard.css: пренасочва неговите променливи към токените на сайта
 * (тъмна тема по подразбиране, светла чрез data-theme="light"), шрифтове Unbounded + Golos Text,
 * жълти pill бутони, заглавия на секции с линия, без focus пръстени.
 * ============================================================= */
:root,
:root[data-theme="dark"] {
    --hc-bg: #0a1220; --hc-card: #111a2e; --hc-card2: #1a2540; --hc-ink: #ffffff;
    --hc-ink2: rgba(255,255,255,.75); --hc-ink3: rgba(255,255,255,.58);
    --hc-line: rgba(255,255,255,.1); --hc-line2: rgba(255,255,255,.2);
    --hc-chip: rgba(255,255,255,.08); --hc-chip2: rgba(255,255,255,.16);
    --hc-hdr: rgba(10,18,32,.88); --hc-field: rgba(255,255,255,.04);
    --hc-accent-ink: #ffd133; --hc-red-text: #ff5c5c;
    --hc-blue: #0b4da2; --hc-yellow: #ffd133; --hc-yellow-hover: #ffdc5c; --hc-red: #d91c1c;
    --hc-ok: #4ade80; --hc-warn: #ffd133;
    --hc-font-display: Unbounded, system-ui, sans-serif;
    --hc-font-body: 'Golos Text', system-ui, sans-serif;
    --hc-ease: cubic-bezier(.2,.8,.2,1);

    /* пренасочване на старите променливи на dashboard.css */
    --primary-blue: #ffd133; --primary-blue-dark: #ffdc5c; --primary-blue-light: #ffd133;
    --bg-gray: var(--hc-bg); --card-white: var(--hc-card);
    --text-primary: var(--hc-ink); --text-secondary: var(--hc-ink2); --text-tertiary: var(--hc-ink3);
    --border-gray: var(--hc-line);
    --green: #4ade80; --green-bg: rgba(74,222,128,.14);
    --red: #ff5c5c; --red-bg: rgba(217,28,28,.2);
    --amber: #ffd133; --amber-bg: rgba(255,209,51,.14);
    --grey-bg: var(--hc-chip);
    --shadow-sm: none; --shadow-md: none; --shadow-lg: 0 18px 40px rgba(0,0,0,.35);
}
:root[data-theme="light"] {
    --hc-bg: #ffffff; --hc-card: #eef1f6; --hc-card2: #e2e7ef; --hc-ink: #0a1220;
    --hc-ink2: rgba(10,18,32,.74); --hc-ink3: rgba(10,18,32,.6);
    --hc-line: rgba(10,18,32,.1); --hc-line2: rgba(10,18,32,.2);
    --hc-chip: rgba(10,18,32,.06); --hc-chip2: rgba(10,18,32,.12);
    --hc-hdr: rgba(255,255,255,.9); --hc-field: #ffffff;
    --hc-accent-ink: #0b4da2; --hc-red-text: #c41616;
    --hc-ok: #15803d; --hc-warn: #8a6100;

    --primary-blue: #0b4da2; --primary-blue-dark: #083a7a; --primary-blue-light: #0b4da2;
    --green: #15803d; --green-bg: rgba(21,128,61,.12);
    --red: #c41616; --red-bg: rgba(196,22,22,.1);
    --amber: #8a6100; --amber-bg: rgba(255,209,51,.28);
    --shadow-lg: 0 18px 40px rgba(10,18,32,.12);
}

/* Основа */
body { font-family: var(--hc-font-body); background: var(--hc-bg); color: var(--hc-ink); line-height: 1.6; }
h1, h2, h3, .logo-text, .card-value-large, .s-value, .section-title h2 {
    font-family: var(--hc-font-display); font-weight: 600; letter-spacing: -.01em;
}
a { text-underline-offset: 3px; }

/* Без focus пръстени (както на сайта) */
:is(a, button, input, select, textarea, summary, [tabindex]):is(:focus, :focus-visible, :active) {
    outline: none !important; box-shadow: none !important;
}
input:focus, select:focus, textarea:focus { border-color: var(--hc-yellow) !important; }
:root[data-theme="light"] input:focus, :root[data-theme="light"] select:focus, :root[data-theme="light"] textarea:focus { border-color: var(--hc-blue) !important; }

/* Хедър */
.header {
    background: var(--hc-hdr); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--hc-line); box-shadow: none;
}
.logo, [data-theme="dark"] .logo, :root:not([data-theme="light"]) .logo { background: transparent; padding: 6px 10px; border-radius: 999px; }
:root:not([data-theme="light"]) .logo img { background: #fff; border-radius: 8px; padding: 4px 8px; }
.logo:hover { background: var(--hc-chip); }
.logo-text { font-size: 15px; }
.theme-toggle { border-radius: 999px; background: var(--hc-chip); border: 1px solid var(--hc-line); color: var(--hc-ink); }
.theme-toggle:hover { background: var(--hc-chip2); border-color: var(--hc-line2); }

/* Карти, плочки */
.card, .server-card, .summary-tile, .tile, .section-card, .stream-card {
    background: var(--hc-card); border: 1px solid var(--hc-line); border-radius: 18px; box-shadow: none;
}
.tile { background: var(--hc-card2); border-radius: 12px; }
.server-card:hover { border-color: var(--hc-line2); transform: translateY(-2px); box-shadow: none; }
.card h3, .card h4 { color: var(--hc-ink); }
.card-label, .s-label, .tile-label { color: var(--hc-ink3); text-transform: uppercase; letter-spacing: .06em; font-size: 11px; font-weight: 600; }
.s-value, .card-value-large { color: var(--hc-ink); }

/* Заглавия на секции с линия */
.section-title { display: flex; align-items: center; gap: 16px; }
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--hc-line); order: 2; }
.section-title > :last-child:not(h2) { order: 3; }
.section-title h2 { font-size: 18px; text-transform: uppercase; letter-spacing: .02em; }
.section-title a { color: var(--hc-accent-ink); }
.section-subtitle { font-family: var(--hc-font-display); text-transform: uppercase; letter-spacing: .04em; color: var(--hc-ink2); }

/* Бутони: жълти pill */
.btn-primary, .btn-secondary, .btn-back, .btn-small {
    border-radius: 999px; font-weight: 600; text-decoration: none; transition: background .2s var(--hc-ease), transform .2s var(--hc-ease), border-color .2s;
}
.btn-primary { background: var(--hc-yellow); color: #0a1220; border: 1px solid var(--hc-yellow); }
.btn-primary:hover { background: var(--hc-yellow-hover); border-color: var(--hc-yellow-hover); color: #0a1220; }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }
:root[data-theme="light"] .btn-primary { background: var(--hc-blue); border-color: var(--hc-blue); color: #fff; }
:root[data-theme="light"] .btn-primary:hover { background: #083a7a; border-color: #083a7a; color: #fff; }
.btn-secondary, .btn-back, .btn-small { background: transparent; color: var(--hc-ink); border: 1px solid var(--hc-line2); }
.btn-secondary:hover, .btn-back:hover, .btn-small:hover { background: var(--hc-chip); color: var(--hc-ink); }
.btn-small.danger { color: var(--hc-red-text); border-color: var(--hc-red-text); }

/* Статуси */
.status-badge, .pill { border-radius: 999px; font-weight: 600; letter-spacing: .02em; }
.status-badge.online { background: var(--green-bg); color: var(--green); }
.status-badge.offline { background: var(--red-bg); color: var(--red); }
.chip { background: var(--hc-chip); border: 1px solid var(--hc-line); border-radius: 999px; color: var(--hc-ink); }
.chip.active { background: var(--hc-yellow); border-color: var(--hc-yellow); color: #0a1220; }
:root[data-theme="light"] .chip.active { background: var(--hc-blue); border-color: var(--hc-blue); color: #fff; }

/* Полета и таблици */
input[type="text"], input[type="email"], input[type="number"], input[type="password"], select, textarea {
    background: var(--hc-field); border: 1px solid var(--hc-line2); color: var(--hc-ink); border-radius: 12px;
}
table { color: var(--hc-ink); }
th { color: var(--hc-ink3); text-transform: uppercase; letter-spacing: .05em; font-size: 11px; }
th, td { border-color: var(--hc-line) !important; }
tr:hover td { background: var(--hc-chip); }
hr { border-color: var(--hc-line); }

/* Светла тема: карти и плочки без рамки (както на сайта: само светъл фон) */
:root[data-theme="light"] .card, :root[data-theme="light"] .server-card, :root[data-theme="light"] .summary-tile,
:root[data-theme="light"] .tile, :root[data-theme="light"] .section-card, :root[data-theme="light"] .stream-card,
:root[data-theme="light"] .sx-card, :root[data-theme="light"] .quick-form, :root[data-theme="light"] .monitoring-panel,
:root[data-theme="light"] .vu-container, :root[data-theme="light"] .stat-card, :root[data-theme="light"] .chip,
:root[data-theme="light"] .header { border-color: transparent; }
:root[data-theme="light"] .header { border-bottom-color: var(--hc-line); }

/* Status badge over the stream thumbnail: solid background so it stays readable on any video */
.stream-card .pill { --pill-base: #14171c; backdrop-filter: blur(6px); }
:root[data-theme="light"] .stream-card .pill { --pill-base: #ffffff; }
.stream-card .pill.st-ok    { background: linear-gradient(var(--green-bg), var(--green-bg)), var(--pill-base); }
.stream-card .pill.st-warn  { background: linear-gradient(var(--amber-bg), var(--amber-bg)), var(--pill-base); }
.stream-card .pill.st-bad   { background: linear-gradient(var(--red-bg), var(--red-bg)), var(--pill-base); }
.stream-card .pill.st-muted { background: linear-gradient(var(--grey-bg), var(--grey-bg)), var(--pill-base); }

/* Firewall zone badges: public = orange, work = blue, other zones (home…) = grey (.st-muted) */
.pill.zone-public { background: rgba(249,115,22,.16); color: #f97316; }
.pill.zone-work   { background: rgba(59,130,246,.16); color: #60a5fa; }
:root[data-theme="light"] .pill.zone-public { background: rgba(249,115,22,.16); color: #c2410c; }
:root[data-theme="light"] .pill.zone-work   { background: rgba(37,99,235,.13); color: #1d4ed8; }

/* Stream status badge on the left so it does not cover the channel logo in the top-right corner */
.stream-card .pill { left: 10px; right: auto; }

/* Hardware status tiles (iDRAC) */
.hw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-top: 8px; }
.hw-tile { position: relative; display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 14px; background: rgba(127,127,127,.10); }
.hw-icon svg { width: 34px; height: 34px; fill: none; stroke: var(--hc-blue, #60a5fa); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; display: block; }
:root:not([data-theme="light"]) .hw-icon svg { stroke: #60a5fa; }
.hw-text { display: flex; flex-direction: column; min-width: 0; }
.hw-label { font-weight: 600; font-size: 14px; }
.hw-detail { font-size: 12px; opacity: .65; margin-top: 2px; }
.hw-badge { position: absolute; top: -6px; left: 6px; width: 20px; height: 20px; border-radius: 5px; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: #fff; }
.hw-ok .hw-badge { background: #4caf00; }
.hw-warn .hw-badge { background: #f59e0b; }
.hw-bad .hw-badge { background: #e53935; }
.hw-na .hw-badge { background: #9aa0a6; }
.hw-na { opacity: .75; }

/* Меню в хедъра: на телефон е падащо (три чертички) */
.header-menu { display: flex; align-items: center; gap: 12px; }
.header-menu form { margin: 0; }
.menu-toggle { display: none; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--hc-line2); background: var(--hc-chip); cursor: pointer; padding: 0; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.menu-toggle span { display: block; width: 18px; height: 2px; border-radius: 2px; background: var(--hc-ink); transition: transform .2s, opacity .2s; }
.header.menu-open .menu-toggle span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.header.menu-open .menu-toggle span:nth-child(2) { opacity: 0; }
.header.menu-open .menu-toggle span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
@media (max-width: 720px) {
    .header { padding: 12px 16px; }
    .logo img { height: 32px; }
    .menu-toggle { display: flex; }
    .header-menu { display: none; position: absolute; top: 100%; right: 12px; left: 12px; flex-direction: column; align-items: stretch; gap: 8px; padding: 14px;
        background: var(--hc-card); border: 1px solid var(--hc-line2); border-radius: 18px; box-shadow: 0 12px 32px rgba(0,0,0,.28); }
    .header.menu-open .header-menu { display: flex; }
    .header-menu .btn-secondary, .header-menu button.btn-secondary { width: 100%; text-align: center; box-sizing: border-box; justify-content: center; }
    .header-menu span.btn-secondary { order: -1; }
}
