﻿/* =========================================================
   APP.CSS (REFATORADO)
   - sem duplicações
   - botões e checkboxes menores globalmente
   ========================================================= */

/* =========================
   1) TOKENS / BASE
   ========================= */
:root {
    --bg: #0b1220;
    --panel: rgba(255,255,255,.06);
    --panel2: rgba(0,0,0,.14);                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          
    --border: rgba(255,255,255,.10);
    --border2: rgba(255,255,255,.08);
    --text: #eaf0ff;
    --muted: rgba(234,240,255,.70);
    --brand: rgba(124,58,237,.90);
    --brandBorder: rgba(124,58,237,.45);
    --ok: rgba(34,197,94,.85);
    --err: rgba(239,68,68,.12);
    --shadow: 0 18px 60px rgba(0,0,0,.35);
    --radius: 18px;
    --radiusSm: 12px;
    --inputBg: rgba(10,16,28,.55);
    --focusRing: 0 0 0 4px rgba(124,58,237,.18);
    /* tamanhos globais */
    --btnH: 34px;
    --btnPadX: 12px;
    --btnFont: 12px;
    --chkSize: 14px;
}

* {
    box-sizing: border-box;
}

#app {
    min-height: 100vh;
}

/* Tipografia base */
label {
    font-size: 11px;
    color: rgba(234,240,255,.78);
}

/* Inputs padrão (global) */
input, select, textarea {
    width: 100%;
    padding: 9px 10px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,.14);
    background: var(--inputBg);
    color: var(--text);
    outline: none;
    font-size: 13px;
}

input::placeholder,
textarea::placeholder {
    color: rgba(234,240,255,.45);
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(124,58,237,.55);
    box-shadow: var(--focusRing);
}

/* Select não ficar branco */
select {
    appearance: none;
    background-color: var(--inputBg);
    color: var(--text);
}

select option {
    background: #0a101c;
    color: var(--text);
}

/* =========================
   2) CHECKBOX / SWITCH (GLOBAL MENOR)
   ========================= */
input[type="checkbox"] {
    width: var(--chkSize) !important;
    height: var(--chkSize) !important;
    accent-color: rgba(124,58,237,.95);
    transform: translateY(1px);
}

/* Checkboxes em wrappers específicos */
.pager input[type="checkbox"],
.item input[type="checkbox"],
.modal input[type="checkbox"] {
    width: var(--chkSize);
    height: var(--chkSize);
}

/* =========================
   3) BOTÕES (GLOBAL MENOR) + VARIAÇÕES
   - Unifica .btn e .intp-btn estilos comuns
   ========================= */
/* estilos comuns para botões do app e do integration */
.btn,
.intp-btn {
    height: var(--btnH);
    padding: 0 var(--btnPadX);
    border-radius: 10px;
    font-weight: 900;
    cursor: pointer;
    white-space: nowrap;
    font-size: var(--btnFont);
    border: 1px solid var(--brandBorder);
    background: rgba(124,58,237,.85);
    color: #fff;
    transition: transform .08s ease, filter .15s ease, box-shadow .15s ease;
}

.btn:hover,
.intp-btn:hover {
    filter: brightness(1.06);
    box-shadow: 0 12px 28px rgba(0,0,0,.25);
}

.btn:active,
.intp-btn:active {
    transform: translateY(1px);
}

.btn:disabled,
.intp-btn:disabled {
    opacity: .6;
    cursor: not-allowed;
    box-shadow: none;
}

.btn.primary,
.intp-btn.primary {
    background: rgba(124,58,237,.92);
    border-color: rgba(124,58,237,.55);
}

.btn.ghost,
.intp-btn.ghost {
    background: rgba(255,255,255,.06);
    border-color: rgba(255,255,255,.14);
    color: #fff;
}

.btn.danger,
.intp-btn.danger {
    background: var(--err);
    border-color: rgba(239,68,68,.35);
    color: #ffb4b4;
}

/* variações pequenas */
.btn.sm,
.intp-btn.sm {
    height: 30px;
    padding: 0 10px;
    font-size: 11px;
    border-radius: 10px;
}

/* =========================
   4) LOADING (BLAZOR WASM / TV)
   - Agrupa animações e variações
   ========================= */
.app-loading,
.tv-loading {
    display: grid;
    place-items: center;
    color: var(--text);
}

.app-loading {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(1200px 800px at 20% 10%, rgba(124,58,237,.18), transparent 60%),
                radial-gradient(900px 700px at 80% 20%, rgba(34,197,94,.12), transparent 60%),
                var(--bg);
}

.app-loading-card {
    width: min(560px, calc(100% - 48px));
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 18px 18px 16px;
    border-radius: 18px;
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.10);
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
}

.loading-progress,
.tv-spinner {
    width: 64px;
    height: 64px;
    display: block;
    filter: drop-shadow(0 10px 28px rgba(0,0,0,.35));
    border-radius: 999px;
}

/* svg circular loader */
.loading-progress .lp-track {
    fill: none;
    stroke: rgba(255,255,255,.12);
    stroke-width: 10;
}

.loading-progress .lp-bar {
    fill: none;
    stroke: rgba(124,58,237,.90);
    stroke-width: 10;
    stroke-linecap: round;
    stroke-dasharray: 251;
    stroke-dashoffset: 160;
    transform-origin: 50% 50%;
    animation: lp-rotate 1.15s linear infinite, lp-dash 1.35s ease-in-out infinite;
}

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

@keyframes lp-dash {
    0% { stroke-dashoffset: 210; opacity: .7; }
    50% { stroke-dashoffset: 80; opacity: 1; }
    100% { stroke-dashoffset: 210; opacity: .85; }
}

/* TV spinner (border-based) */
.tv-spinner {
    border: 6px solid rgba(255,255,255,.14);
    border-top-color: rgba(124,58,237,.95);
    border-right-color: rgba(124,58,237,.45);
    animation: tvspin 1s linear infinite;
}

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

/* loading small helpers */
.loading-text { text-align: center; line-height: 1.2; }
.loading-title { font-size: 14px; font-weight: 900; letter-spacing: .2px; }
.loading-sub { margin-top: 6px; font-size: 12px; color: rgba(234,240,255,.70); }

.loading-dots,
.intp-progress-dots,
.tv-loading-card .dots {
    display: inline-flex;
    gap: 6px;
    height: 10px;
    align-items: center;
}

.loading-dots span,
.intp-progress-dots span {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: rgba(234,240,255,.65);
    animation: dot 1.05s infinite ease-in-out;
}

.loading-dots span:nth-child(2),
.intp-progress-dots span:nth-child(2) { animation-delay: .15s; opacity: .85; }
.loading-dots span:nth-child(3),
.intp-progress-dots span:nth-child(3) { animation-delay: .30s; opacity: .75; }

@keyframes dot {
    0%,100% { transform: translateY(0); opacity: .55; }
    50%    { transform: translateY(-5px); opacity: 1; }
}

/* =========================
   5) ADMIN LAYOUT (GLOBAL)
   ========================= */
.shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 240px 1fr;
    background: radial-gradient(1200px 800px at 20% 10%, rgba(124,58,237,.18), transparent 60%),
                radial-gradient(900px 700px at 80% 20%, rgba(34,197,94,.12), transparent 60%),
                var(--bg);
    color: var(--text);
}

/* sidebar */
.side {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 14px;
    border-right: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(15,26,48,.85), rgba(15,26,48,.60));
    backdrop-filter: blur(10px);
    transition: width .18s ease, padding .18s ease;
}

.shell.side-collapsed { grid-template-columns: 72px 1fr; }
.side.collapsed { padding: 12px 10px; }

.side-header { display: flex; align-items: center; gap: 10px; padding: 6px 2px 12px; margin-bottom: 12px; border-bottom: 1px solid var(--border); }

.side-toggle {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,.10);
    background: rgba(255,255,255,.04);
    cursor: pointer;
    display: grid;
    place-items: center;
}

.side-toggle:hover { background: rgba(255,255,255,.07); }

.burger { width: 18px; height: 2px; background: rgba(234,240,255,.85); border-radius: 999px; box-shadow: 0 -6px 0 rgba(234,240,255,.65), 0 6px 0 rgba(234,240,255,.65); }

.brand { font-weight: 950; letter-spacing: .2px; user-select: none; cursor: pointer; white-space: nowrap; }
.brand span { opacity: .85; font-weight: 900; }
.side.collapsed .brand { display: none; }

/* menu */
.menu { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }

.menu .menu-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(255,255,255,.025);
    border: 1px solid rgba(255,255,255,.07);
    font-weight: 850;
    color: var(--text);
    text-decoration: none;
    transition: background .15s ease, border-color .15s ease, transform .08s ease;
}

.menu .menu-link:hover { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.12); }
.menu .menu-link:active { transform: translateY(1px); }

.menu .menu-link::before {
    content: "";
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 18px;
    border-radius: 999px;
    background: var(--brand);
    opacity: 0;
}

.menu .menu-link:hover::before { opacity: .6; }
.menu .menu-link.active { background: rgba(124,58,237,.18); border-color: rgba(124,58,237,.40); box-shadow: 0 0 0 3px rgba(124,58,237,.12); }
.menu .menu-link.active::before { opacity: 1; }

.menu .ico { width: 22px; height: 22px; display: grid; place-items: center; opacity: .9; }
.menu .ico svg { width: 20px; height: 20px; }

/* collapsed menu tweaks */
.side.collapsed .menu .menu-link { justify-content: center; padding: 10px; }
.side.collapsed .menu .menu-link::before { left: 6px; }
.side.collapsed .menu .lbl { width: 0; opacity: 0; overflow: hidden; white-space: nowrap; transition: opacity .12s ease; }
.side.collapsed .menu .menu-link:hover::after {
    content: attr(data-title);
    position: absolute;
    left: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%);
    background: rgba(10,16,28,.92);
    border: 1px solid rgba(255,255,255,.12);
    color: var(--text);
    padding: 8px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
    box-shadow: var(--shadow);
    z-index: 50;
}

/* main / topbar */
.main { display: grid; grid-template-rows: auto 1fr; min-width: 0; }

.top {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    background: rgba(15,26,48,.45);
    backdrop-filter: blur(10px);
}

.content { padding: 18px; min-width: 0; }

.top-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.top-grid .btn { justify-self: end; }

.company-center {
    justify-self: center;
    font-weight: 800;
    letter-spacing: .02em;
    opacity: .95;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 50vw;
}

.pill {
    display: inline-block;
    font-size: 11px;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(124,58,237,.18);
    border: 1px solid rgba(124,58,237,.35);
    margin-top: 6px;
}

/* responsivo layout */
@media (max-width: 980px) {
    .shell { grid-template-columns: 1fr; }
    .side { position: relative; height: auto; border-right: 0; border-bottom: 1px solid var(--border); }
    .top { justify-content: space-between; }
}

/* =========================
   6) COMPONENTES (CARD / ALERT / LIST)
   ========================= */
.card,
.intp-card {
    width: min(1100px, 100%);
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
    color: var(--text);
}

.head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.head h2 { margin: 0; font-size: 18px; letter-spacing: .2px; }

.sub { margin: 4px 0 0; font-size: 12px; color: var(--muted); }

.divider { height: 1px; background: rgba(255,255,255,.10); margin: 10px 0 12px; }

.alert {
    padding: 9px 10px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,.12);
    margin: 10px 0 12px;
    background: rgba(255,255,255,.06);
    font-size: 12px;
}

.alert.warn { border-color: rgba(245,158,11,.35); background: rgba(245,158,11,.08); }
.alert.err { border-color: rgba(239,68,68,.35); background: rgba(239,68,68,.10); }

.list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }

.item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 12px;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.08);
}

.item.compact { padding: 7px 9px; }

.meta { min-width: 0; }

.name {
    font-weight: 900;
    letter-spacing: .2px;
    font-size: 13px;
    line-height: 1.2;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.metaLine { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 11px; color: var(--muted); }

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.10);
}

.price { margin-left: auto; font-weight: 900; color: rgba(234,240,255,.92); }

.empty {
    margin-top: 10px;
    padding: 10px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,.10);
    background: rgba(255,255,255,.04);
    color: rgba(234,240,255,.72);
    font-size: 12px;
}

/* =========================
   7) PAGE: PRODUTOS (compact)
   ========================= */
.page {
    min-height: calc(100vh - 44px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 18px 16px 28px;
}

.form {
    display: grid;
    grid-template-columns: 1fr 170px auto;
    gap: 10px;
    padding: 10px;
    border-radius: 14px;
    background: rgba(0,0,0,.18);
    border: 1px solid var(--border2);
    margin: 10px 0 12px;
}

.toolbar {
    display: grid;
    grid-template-columns: 1fr 160px auto;
    gap: 10px;
    padding: 10px;
    border-radius: 14px;
    background: rgba(0,0,0,.14);
    border: 1px solid var(--border2);
    margin-bottom: 12px;
    align-items: end;
}

.pager { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.pagerMeta { display: flex; align-items: center; gap: 8px; margin-left: 6px; font-size: 12px; color: rgba(234,240,255,.65); }
.actions { display: flex; align-items: center; gap: 8px; }

@media (max-width: 920px) {
    .form { grid-template-columns: 1fr; }
    .toolbar { grid-template-columns: 1fr; align-items: stretch; }
    .pager { justify-content: flex-start; }
    .price { margin-left: 0; }
}

/* =========================================================
   INTEGRAÇÃO DE PRODUTOS (ProductsIntegration.razor)
   - Mantido como subseção, mas sem duplicar estilos já definidos
   ========================================================= */
.intp-page { padding: 22px; display: flex; justify-content: center; }
.intp-top { display: grid; grid-template-columns: 1.05fr .95fr; gap: 16px; align-items: start; margin-bottom: 14px; }
.intp-title h2 { margin: 0; font-size: 22px; font-weight: 950; letter-spacing: .2px; }
.intp-sub { margin: 6px 0 0; color: rgba(234,240,255,.72); font-size: 13px; }

.intp-tip {
    margin-top: 12px;
    padding: 12px;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,.10);
    background: rgba(0,0,0,.14);
    color: rgba(234,240,255,.78);
    font-size: 12.5px;
}

.intp-presetbox {
    margin-top: 12px;
    padding: 14px;
    border-radius: 16px;
    background: rgba(0,0,0,.14);
    border: 1px solid rgba(255,255,255,.08);
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: end;
}

.intp-presets { width: 100%; padding: 12px; border-radius: 16px; border: 1px solid rgba(245,158,11,.35); background: rgba(245,158,11,.06); box-shadow: 0 0 0 1px rgba(245,158,11,.10) inset; }
.intp-presets b { display: block; font-size: 13px; margin-bottom: 10px; }

.intp-alert { margin: 10px 0 14px; padding: 12px; border-radius: 14px; border: 1px solid rgba(255,255,255,.10); background: rgba(255,255,255,.04); font-size: 13px; }
.intp-alert.err { border-color: rgba(239,68,68,.35); background: rgba(239,68,68,.12); }
.intp-alert.ok {
    border-color: rgba(34,197,94,.70);
    background: rgba(34,197,94,.08);
    box-shadow: 0 0 0 1px rgba(34,197,94,.22), 0 0 18px rgba(34,197,94,.28), 0 0 60px rgba(34,197,94,.14);
    backdrop-filter: blur(10px);
}
.intp-alert.warn { border-color: rgba(245,158,11,.45); background: rgba(245,158,11,.08); }

/* FORM / CAMPOS específicos integração */
.intp-form { margin-top: 10px; }
.intp-field { min-width: 0; }
.intp-field label { display: block; font-size: 12px; color: rgba(234,240,255,.75); margin: 0 0 8px; }
.intp-field textarea {
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,.14);
    background: var(--inputBg);
    color: var(--text);
    outline: none;
    resize: vertical;
}
.intp-help { display: block; margin-top: 6px; font-size: 12px; color: rgba(234,240,255,.65); }

.intp-grid,
.intp-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.intp-grid { padding: 14px; border-radius: 16px; background: rgba(0,0,0,.18); border: 1px solid var(--border2); }
.intp-grid2 { margin-top: 12px; }
.intp-span2 { grid-column: 1 / -1; }
.intp-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: flex-end; margin-top: 14px; }

/* Tabela */
.intp-tablewrap { overflow: auto; border-radius: 16px; border: 1px solid var(--border2); background: rgba(0,0,0,.12); }
.intp-table { width: 100%; border-collapse: collapse; }
.intp-table th, .intp-table td { padding: 10px; border-bottom: 1px solid var(--border2); text-align: left; font-size: 13px; }

/* debug/pre */
.intp-pre { white-space: pre-wrap; margin-top: 10px; background: rgba(0,0,0,.22); border: 1px solid rgba(255,255,255,.10); padding: 10px; border-radius: 12px; }

/* progress preview/import */
.intp-progress {
    margin: 10px 0 14px;
    padding: 12px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,.10);
    background: rgba(255,255,255,.04);
    backdrop-filter: blur(10px);
}
.intp-progress.preview { border-color: rgba(124,58,237,.35); box-shadow: 0 0 18px rgba(124,58,237,.18); }
.intp-progress.import { border-color: rgba(34,197,94,.30); box-shadow: 0 0 18px rgba(34,197,94,.14); }

.intp-progress-bar { height: 10px; border-radius: 999px; overflow: hidden; background: rgba(0,0,0,.22); border: 1px solid var(--border2); }
.intp-progress-bar > div { height: 100%; width: 0%; border-radius: 999px; transition: width .18s ease; background: var(--ok); box-shadow: 0 0 18px rgba(34,197,94,.25); }
.intp-progress.preview .intp-progress-bar > div { background: var(--brand); box-shadow: 0 0 18px rgba(124,58,237,.25); }
.intp-progress-meta { font-size: 12px; color: rgba(234,240,255,.75); white-space: nowrap; }
.intp-progress-sub { margin-top: 10px; font-size: 12px; color: rgba(234,240,255,.70); }

/* =========================
   MODAIS (genéricos + app-modal variantes)
   - Unifica modalCard / app-modalCard padrões
   ========================= */
.modal,
.intp-modal-backdrop,
.intp-confirm-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    backdrop-filter: blur(6px);
    z-index: 2000;
    display: grid;
    place-items: center;
    padding: 18px;
}

.modalCard,
.intp-modal,
.intp-confirm,
.app-modalCard {
    width: min(720px, 100%);
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    border-radius: 18px;
    background: rgba(15,26,48,.88);
    border: 1px solid rgba(255,255,255,.12);
    box-shadow: 0 18px 60px rgba(0,0,0,.45);
    overflow: hidden;
}

.modalHead,
.intp-modal-head {
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid rgba(255,255,255,.10);
    background: rgba(0,0,0,.18);
}

.modalBody,
.intp-modal-body {
    padding: 14px 16px;
    overflow: auto;
}

.modalActions,
.intp-modal-footer {
    padding: 12px 16px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    border-top: 1px solid rgba(255,255,255,.10);
    background: rgba(0,0,0,.14);
}

.intp-modal-title,
.intp-confirm-title { font-size: 14px; font-weight: 950; letter-spacing: .2px; }
.intp-modal-close,
.iconBtn {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(255,255,255,.06);
    color: rgba(234,240,255,.9);
    cursor: pointer;
}
.iconBtn:hover,
.intp-modal-close:hover { background: rgba(255,255,255,.10); }

/* app-modal com z-index máximo e overrides */
.app-modal {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: rgba(0,0,0,.55) !important;
    backdrop-filter: blur(6px) !important;
    z-index: 2147483647 !important;
}
.app-modalCard { width: min(720px, calc(100% - 24px)) !important; max-height: 88vh !important; overflow: auto !important; }

/* evita que app-loading capture cliques */
.app-loading { pointer-events: none; }

/* =========================
   DEPARTAMENTOS / TVs — checkbox “pill”
   ========================= */
.dept-list { display: grid; gap: 10px; padding: 10px; border-radius: 14px; background: rgba(0,0,0,.14); border: 1px solid rgba(255,255,255,.10); }

.dept-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,.10);
    background: rgba(255,255,255,.04);
    cursor: pointer;
    user-select: none;
    transition: transform .08s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.dept-item:hover { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.14); }
.dept-item:active { transform: translateY(1px); }

/* checkbox real escondido */
.dept-item input[type="checkbox"] { position: absolute; opacity: 0; pointer-events: none; width: 1px !important; height: 1px !important; }

.dept-check {
    width: 18px;
    height: 18px;
    border-radius: 6px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255,255,255,.18);
    background: rgba(0,0,0,.18);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.04);
    flex: 0 0 auto;
}

.dept-check::after {
    content: "";
    width: 9px;
    height: 5px;
    border-left: 3px solid transparent;
    border-bottom: 3px solid transparent;
    transform: rotate(-45deg);
    opacity: 0;
}

.dept-name { font-size: 13px; font-weight: 900; letter-spacing: .2px; color: rgba(234,240,255,.92); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.dept-item input[type="checkbox"]:checked ~ .dept-check { background: rgba(124,58,237,.35); border-color: rgba(124,58,237,.70); box-shadow: 0 0 0 4px rgba(124,58,237,.14); }
.dept-item input[type="checkbox"]:checked ~ .dept-check::after { border-left-color: rgba(234,240,255,.95); border-bottom-color: rgba(234,240,255,.95); opacity: 1; }
.dept-item input[type="checkbox"]:checked ~ .dept-name { color: rgba(255,255,255,.98); }

.dept-item:focus-within { outline: none; box-shadow: 0 0 0 4px rgba(124,58,237,.18); border-color: rgba(124,58,237,.55); }
.dept-list.compact .dept-item { padding: 8px 10px; border-radius: 12px; }
.dept-list.compact .dept-check { width: 16px; height: 16px; border-radius: 5px; }

/* =========================
   CHECKBOX BONITO (ui-check)
   ========================= */
.ui-check {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    user-select: none;
    cursor: pointer;
    line-height: 1.1;
}

.ui-check input { position: absolute; opacity: 0; pointer-events: none; }

.ui-check .ui-box {
    width: 18px;
    height: 18px;
    border-radius: 6px;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.18);
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.30);
    display: grid;
    place-items: center;
    transition: background .14s ease, border-color .14s ease, transform .08s ease, box-shadow .14s ease;
}

.ui-check .ui-box::after {
    content: "";
    width: 9px;
    height: 9px;
    border-radius: 3px;
    background: rgba(124,58,237,.95);
    transform: scale(0);
    transition: transform .12s ease;
}

.ui-check:hover .ui-box { border-color: rgba(255,255,255,.28); background: rgba(255,255,255,.08); }
.ui-check input:checked + .ui-box { border-color: rgba(124,58,237,.70); background: rgba(124,58,237,.18); box-shadow: 0 0 0 3px rgba(124,58,237,.12); }
.ui-check input:checked + .ui-box::after { transform: scale(1); }
.ui-check input:focus-visible + .ui-box { box-shadow: 0 0 0 4px rgba(124,58,237,.18); }

.ui-check .ui-label { font-size: 12px; color: rgba(234,240,255,.82); }

.ui-check.sm { gap: 8px; }
.ui-check.sm .ui-box { width: 16px; height: 16px; border-radius: 5px; }
.ui-check.sm .ui-box::after { width: 8px; height: 8px; border-radius: 3px; }

.ui-check.only { gap: 0; padding: 0; }
.ui-check.only .ui-label { display: none; }

.ui-check input:disabled + .ui-box { opacity: .45; filter: grayscale(.2); }
.ui-check input:disabled ~ .ui-label { opacity: .55; cursor: not-allowed; }

/* interop inside lists */
.item .ui-check { margin-right: 4px; }

/* =========================
   TV PROFILE / TV PICK / TV MEDIA
   ========================= */
.tvpick-list { display: grid; gap: 8px; margin-top: 10px; max-height: 180px; overflow: auto; padding: 10px; border-radius: 14px; background: rgba(0,0,0,.14); border: 1px solid rgba(255,255,255,.10); }

.tvpick {
    width: 100%;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,.08);
    background: rgba(255,255,255,.04);
    transition: background .15s ease, border-color .15s ease, transform .08s ease;
}
.tvpick:hover { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.14); }
.tvpick:active { transform: translateY(1px); }
.tvpick input:checked ~ .ui-label { color: rgba(255,255,255,.95); font-weight: 900; }

/* dentro do modal, NÃO usar o checkbox nativo com accent-color */
.app-modal input[type="checkbox"] { accent-color: initial !important; }

/* TV PROFILE layout */
.tvprof-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.tvprof-title h2 { margin: 0; font-size: 28px; font-weight: 950; letter-spacing: .2px; }
.tvprof-sub { margin-top: 6px; color: rgba(234,240,255,.70); font-size: 13px; }

.tvprof-current {
    min-width: 260px;
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(0,0,0,.14);
    border: 1px solid rgba(255,255,255,.10);
    box-shadow: 0 10px 30px rgba(0,0,0,.18);
    text-align: right;
}

.tvprof-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 900;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(124,58,237,.18);
    border: 1px solid rgba(124,58,237,.35);
}

.tvprof-tvname { margin-top: 8px; font-size: 14px; font-weight: 950; letter-spacing: .2px; color: rgba(234,240,255,.95); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tvprof-tvid { margin-top: 4px; font-size: 12px; opacity: .72; }

.tvprof-picker { max-width: 520px; margin-bottom: 16px; }
.tvprof-selectrow { display: grid; grid-template-columns: 1fr; gap: 8px; }
.tvprof-select {
    height: 42px;
    border-radius: 14px;
    padding: 10px 12px;
    background: rgba(10,16,28,.55);
    border: 1px solid rgba(255,255,255,.14);
    color: rgba(234,240,255,.95);
    font-weight: 800;
}

.tvprof-hint { font-size: 12px; padding: 8px 10px; border-radius: 12px; border: 1px solid rgba(255,255,255,.10); background: rgba(255,255,255,.04); color: rgba(234,240,255,.78); }
.tvprof-hint.ok { border-color: rgba(34,197,94,.30); background: rgba(34,197,94,.08); }
.tvprof-hint.warn { border-color: rgba(245,158,11,.35); background: rgba(245,158,11,.08); }

.tvprof-modalTitle h3 { margin: 0; }
.tvprof-modalMeta { margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; }

.tvprof-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
    background: rgba(124,58,237,.18);
    border: 1px solid rgba(124,58,237,.35);
    color: rgba(234,240,255,.95);
}
.tvprof-pill.ghost { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.12); font-weight: 800; opacity: .9; }

/* responsive tweaks */
@media (max-width: 900px) {
    .tvprof-head { flex-direction: column; align-items: stretch; }
    .tvprof-current { text-align: left; min-width: 0; }
}

/* TV PROFILE toolbar / actions */
.tvprof-card { max-width: 1100px; }
.tvprof-head { margin-bottom: 8px; }
.tvprof-context { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }

.tvprof-toolbar {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 14px;
    padding: 12px;
    border-radius: 16px;
    background: rgba(0,0,0,.14);
    border: 1px solid var(--border2);
    margin-top: 12px;
    align-items: end;
}

.tvprof-selectWrap { position: relative; }
.tvprof-select { height: 42px; border-radius: 14px; padding: 10px 40px 10px 12px; font-weight: 850; letter-spacing: .2px; background: rgba(10,16,28,.55); border: 1px solid rgba(255,255,255,.14); }
.tvprof-caret { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 14px; opacity: .7; pointer-events: none; }
.tvprof-help { margin-top: 8px; font-size: 12px; color: rgba(234,240,255,.70); }
.tvprof-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }

@media (max-width: 980px) {
    .tvprof-toolbar { grid-template-columns: 1fr; align-items: stretch; }
    .tvprof-actions { justify-content: flex-start; }
}

/* tvprof small variations */
.tvprof-select { height: 44px; padding: 10px 44px 10px 12px; font-weight: 900; }
.tvprof-select:focus { border-color: rgba(124,58,237,.55); box-shadow: 0 0 0 4px rgba(124,58,237,.18); }

/* tvprof badge styles */
.tvprof-badge { display: inline-flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 999px; border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.06); font-size: 12px; font-weight: 900; letter-spacing: .2px; }
.tvprof-badge b { font-weight: 950; }
.tvprof-badge .dot { width: 9px; height: 9px; border-radius: 999px; background: rgba(234,240,255,.55); box-shadow: 0 0 0 4px rgba(234,240,255,.10); }
.tvprof-badge.ok { border-color: rgba(34,197,94,.35); background: rgba(34,197,94,.08); }
.tvprof-badge.ok .dot { background: rgba(34,197,94,.95); box-shadow: 0 0 0 4px rgba(34,197,94,.16); animation: tvprofPulse 1.1s ease-in-out infinite; }
.tvprof-badge.warn { border-color: rgba(245,158,11,.40); background: rgba(245,158,11,.08); }
.tvprof-badge.warn .dot { background: rgba(245,158,11,.95); box-shadow: 0 0 0 4px rgba(245,158,11,.16); }

@keyframes tvprofPulse {
    0%,100% { transform: scale(1); opacity: .9; }
    50% { transform: scale(1.2); opacity: 1; }
}

/* =========================
   Scheduler / RunNow UI
   - Agrupa intp-scheduler related styles
   ========================= */
.intp-scheduler-top { margin-top: 10px; }
.intp-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.intp-head-left { min-width: 0; }
.intp-head-actions { display: flex; gap: 10px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.intp-sched-status { display: flex; align-items: center; gap: 10px; padding-top: 2px; }
.intp-sched-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.intp-sched-muted { opacity: .75; font-size: 12px; }
.intp-sched-list-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.intp-sched-title { display: flex; align-items: baseline; gap: 8px; }

.intp-sched-list .intp-sched-item { align-items: flex-start; }
.intp-sched-list .intp-sched-item .actions { align-items: flex-start; padding-top: 2px; }

.intp-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .2px;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(255,255,255,.06);
}
.intp-badge.run::before,
.intp-badge.idle::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 999px;
    box-shadow: 0 0 0 4px rgba(255,255,255,.10);
}
.intp-badge.run::before { background: rgba(34,197,94,.95); box-shadow: 0 0 0 4px rgba(34,197,94,.16); animation: intp-pulse 1.1s ease-in-out infinite; }
.intp-badge.idle::before { background: rgba(234,240,255,.55); box-shadow: 0 0 0 4px rgba(234,240,255,.10); }

@keyframes intp-pulse {
    0%,100% { transform: scale(1); opacity: .9; }
    50% { transform: scale(1.25); opacity: 1; }
}

.intp-sched-modal { width: min(820px, 100%); }

@media (max-width: 980px) {
    .intp-head { flex-direction: column; align-items: stretch; }
    .intp-head-actions { justify-content: flex-end; }
}

/* RunNow box / progress / messages */
.intp-runbox { margin-top: 10px; padding: 12px; border-radius: 14px; border: 1px solid rgba(255,255,255,.10); background: rgba(0,0,0,.18); }
.intp-runline { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.intp-runlabel b { font-size: 13px; letter-spacing: .2px; }
.intp-runmuted { margin-left: 8px; font-size: 12px; opacity: .72; }
.intp-runpct { font-weight: 950; font-size: 12px; opacity: .9; }

.intp-runbar { position: relative; height: 10px; border-radius: 999px; overflow: hidden; background: rgba(0,0,0,.25); border: 1px solid rgba(255,255,255,.10); }
.intp-runbar-fill { height: 100%; border-radius: 999px; width: 0%; transition: width .18s ease; background: rgba(34,197,94,.85); box-shadow: 0 0 18px rgba(34,197,94,.25); }

.intp-runbar-shine {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.22), transparent);
    transform: translateX(-120%);
    animation: intp-shine 1.2s ease-in-out infinite;
    pointer-events: none;
    mix-blend-mode: screen;
    opacity: .55;
}

@keyframes intp-shine { 0% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }

.intp-runsub { margin-top: 10px; font-size: 12px; opacity: .75; }

.intp-runmsg { margin-top: 10px; padding: 12px; border-radius: 14px; border: 1px solid rgba(255,255,255,.10); background: rgba(255,255,255,.04); }
.intp-runmsg-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.intp-runmsg-time { font-size: 12px; opacity: .7; }
.intp-runmsg-body { font-size: 13px; opacity: .92; }

.intp-runmsg.ok { border-color: rgba(34,197,94,.70); background: rgba(34,197,94,.08); box-shadow: 0 0 0 1px rgba(34,197,94,.22), 0 0 18px rgba(34,197,94,.28), 0 0 60px rgba(34,197,94,.14); backdrop-filter: blur(10px); }
.intp-runmsg.err { border-color: rgba(239,68,68,.50); background: rgba(239,68,68,.10); box-shadow: 0 0 18px rgba(239,68,68,.10); }

.intp-runstats { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.intp-runstats .chip.ok { border-color: rgba(34,197,94,.45); background: rgba(34,197,94,.10); }
.intp-runstats .chip.warn { border-color: rgba(245,158,11,.45); background: rgba(245,158,11,.10); }

/* defensivo: nada “decorativo” bloqueia clique */
.intp-runbar-shine,
.intp-runbar,
.intp-runbar-fill { pointer-events: none; }

/* garante que ações ficam clicáveis mesmo com efeitos */
.intp-sched-item .actions { position: relative; z-index: 5; }

.intp-live { border: 1px solid rgba(255,255,255,.10); background: rgba(255,255,255,.04); border-radius: 14px; padding: 14px 14px 12px; margin-top: 12px; }
.intp-live-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.intp-live-title { display: flex; align-items: center; gap: 10px; }
.intp-live-pill { font-size: 12px; padding: 3px 10px; border-radius: 999px; border: 1px solid rgba(255,255,255,.14); opacity: .9; }
.intp-live-meta { font-size: 13px; opacity: .9; white-space: nowrap; }
.intp-live-status { margin-top: 10px; font-size: 13px; opacity: .85; }

.intp-live-dots { margin-top: 10px; display: flex; gap: 6px; opacity: .8; }
.intp-live-dots span { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; animation: intpDot 1.2s infinite ease-in-out; }
.intp-live-dots span:nth-child(2) { animation-delay: .15s; }
.intp-live-dots span:nth-child(3) { animation-delay: .30s; }

@keyframes intpDot { 0%,80%,100% { transform: scale(.7); opacity: .5; } 40% { transform: scale(1); opacity: 1; } }

/* =========================
   UTILITY / SMALL HELPERS
   ========================= */
.kv-wrap { display: grid; gap: 8px; }
.kv-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; }

.intp-presets-list,
.tvpick-list { max-height: 420px; overflow: auto; padding-right: 6px; }

@media (max-width: 980px) {
    .intp-top { grid-template-columns: 1fr; }
    .intp-presets-list { max-height: 300px; }
    .intp-presetbox { grid-template-columns: 1fr; }
    .intp-preset-actions { justify-content: flex-start; }
}

@media (max-width: 900px) {
    .intp-grid, .intp-grid2 { grid-template-columns: 1fr; }
    .kv-row { grid-template-columns: 1fr 1fr auto; }
}