/* ============================================================
   Flow Console — Panel de control (página única)
   Tema oscuro IB-Scope
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

.fc-body {
    margin: 0; padding: 0;
    width: 100vw; min-height: 100vh;
    background: var(--bg-primary); color: var(--text-primary);
    font-family: var(--font-family);
}

/* ══════════ HEADER ══════════ */
.fc-header {
    height: 3.5rem;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 1.5rem;
    background: var(--bg-secondary); border-bottom: 2px solid var(--border-primary);
}
.fc-header__left { display: flex; align-items: center; gap: 0.6rem; }
.fc-header__logo { display: flex; align-items: center; text-decoration: none; }
.fc-header__logo-img { width: 1.8rem; height: 1.8rem; border-radius: 0.25rem; }
.fc-header__title { font-size: 1.3rem; font-weight: 300; color: var(--white); margin: 0; }
.fc-header__title-flow { font-weight: 700; color: var(--accent); }
.fc-header__turno {
    font-size: 0.85rem; font-weight: 700; color: var(--accent);
    background: var(--bg-hover); padding: 0.25rem 0.8rem; border-radius: 0.3rem;
}

/* ══════════ MAIN ══════════ */
.fc-main {
    padding: 1.2rem 1.5rem;
    display: flex; flex-direction: column; gap: 1.5rem;
    max-width: 1400px; margin: 0 auto; width: 100%;
}

/* ══════════ SECTIONS ══════════ */
.fc-section__title {
    font-size: 1rem; font-weight: 700; color: var(--text-secondary);
    text-transform: uppercase; letter-spacing: 0.04em;
    margin: 0 0 0.8rem 0; display: flex; align-items: center; gap: 0.5rem;
}
.fc-section__header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 0.8rem; flex-wrap: wrap; gap: 0.5rem;
}

/* ══════════ KPIs ══════════ */
.fc-kpis {
    display: flex; gap: 1rem; flex-wrap: wrap;
}
.fc-kpi {
    background: var(--bg-hover); border: 1px solid var(--border-primary); border-radius: 0.5rem;
    padding: 0.8rem 1.2rem; min-width: 10rem; text-align: center;
}
.fc-kpi__value { font-size: 1.3rem; font-weight: 800; color: var(--white); }
.fc-kpi__label { font-size: 0.7rem; color: var(--text-tertiary); margin-top: 0.2rem; text-transform: uppercase; letter-spacing: 0.03em; }
.fc-kpi--ok { border-left: 4px solid var(--success); }
.fc-kpi--danger { border-left: 4px solid var(--danger); }
.fc-kpi--warn { border-left: 4px solid var(--warning); }
.fc-kpi--action { display: flex; align-items: center; justify-content: center; }
.fc-kpi--loading { color: var(--text-muted); font-size: 0.9rem; }

/* ══════════ SCREENS ══════════ */
.fc-screens__controls { display: flex; align-items: center; gap: 0.4rem; }
.fc-screens__count-input {
    width: 3rem; padding: 0.25rem; font-size: 0.9rem; font-weight: 700;
    text-align: center; border: 1px solid var(--border-strong); border-radius: 0.3rem;
    background: var(--bg-primary); color: var(--text-primary); outline: none;
}
.fc-screens__grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: 0.8rem;
}
.fc-screen-tile {
    background: var(--bg-hover); border: 2px solid var(--border-primary); border-radius: 0.5rem;
    overflow: hidden; transition: border-color 0.2s;
}
.fc-screen-tile--disabled { opacity: 0.4; }
.fc-screen-tile__header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.4rem 0.6rem; background: var(--bg-secondary);
}
.fc-screen-tile__name {
    font-size: 0.8rem; font-weight: 700; color: var(--white);
    display: flex; align-items: center; gap: 0.3rem;
}
.fc-screen-tile__live-dot {
    width: 0.4rem; height: 0.4rem; border-radius: 50%; background: var(--success);
    animation: fc-pulse 1.5s ease-in-out infinite;
}
@keyframes fc-pulse {
    0%,100% { opacity:1; } 50% { opacity:0.5; }
}
.fc-screen-tile--disabled .fc-screen-tile__live-dot { background: #6b7280; /* audit:keep — disabled gray, no token */ animation: none; }
.fc-screen-tile__toggle {
    padding: 0.15rem 0.4rem; font-size: 0.65rem; font-weight: 600;
    border: 1px solid var(--border-strong); border-radius: 0.2rem;
    background: transparent; cursor: pointer;
}
.fc-screen-tile__toggle--active { color: var(--success); border-color: var(--success); }
.fc-screen-tile__toggle--disabled { color: var(--danger); border-color: var(--danger); }
.fc-screen-tile__preview {
    position: relative; width: 100%; height: 8rem; overflow: hidden; background: var(--bg-secondary);
}
.fc-screen-tile__iframe {
    width: 1920px; height: 1080px; border: none; transform-origin: 0 0; pointer-events: none;
}
.fc-screen-tile__disabled-overlay {
    position: absolute; top:0; left:0; width:100%; height:100%;
    display: flex; align-items: center; justify-content: center;
    background: rgba(12,26,58,0.8); /* audit:keep — custom opacity overlay */
    color: #6b7280; /* audit:keep — disabled gray, no token */
    font-size: 0.8rem; font-weight: 600;
}

/* ══════════ ALERTS ══════════ */
.fc-alerts__status { display: flex; align-items: center; gap: 0.4rem; font-size: 0.75rem; color: var(--text-secondary); }
.fc-alert-count {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 1.2rem; height: 1.2rem; padding: 0 0.3rem;
    font-size: 0.7rem; font-weight: 700; color: var(--white); background: var(--danger);
    border-radius: 0.6rem; animation: fc-pulse 2s ease-in-out infinite;
}
.fc-alerts__list { display: flex; flex-direction: column; gap: 0.6rem; }
.fc-alert-card {
    background: var(--bg-hover); border: 2px solid var(--border-strong); border-radius: 0.5rem;
    padding: 0.8rem 1rem; border-left: 4px solid var(--warning);
}
.fc-alert-card__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.5rem; }
.fc-alert-card__badge { font-size: 1.1rem; font-weight: 900; color: var(--white); }
.fc-alert-card__time { font-size: 0.75rem; color: var(--text-secondary); }
.fc-alert-card__actions { display: flex; gap: 0.4rem; }

/* ══════════ MODAL ══════════ */
.fc-modal-overlay {
    position: fixed; top:0; left:0; width:100vw; height:100vh;
    background: rgba(0,0,0,0.6); /* audit:keep — overlay with custom opacity */
    display: flex; align-items: center; justify-content: center; z-index: 900;
}
.fc-modal {
    background: var(--bg-hover); border: 2px solid var(--border-strong); border-radius: 0.6rem;
    width: 90%; max-width: 24rem; overflow: hidden;
}
.fc-modal__header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.8rem 1rem; background: var(--bg-secondary); border-bottom: 1px solid var(--border-primary);
}
.fc-modal__title { font-size: 1rem; font-weight: 700; color: var(--white); margin: 0; }
.fc-modal__close {
    background: none; border: none; color: var(--text-secondary); font-size: 1.3rem; cursor: pointer; padding: 0;
}
.fc-modal__body { padding: 1rem; display: flex; flex-direction: column; gap: 0.8rem; }
.fc-modal__badge-info { margin: 0; font-size: 0.9rem; color: var(--text-secondary); }
.fc-modal__badge-info strong { color: var(--accent); font-size: 1.1rem; }
.fc-modal__field { display: flex; flex-direction: column; gap: 0.2rem; }
.fc-modal__label { font-size: 0.7rem; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.04em; }
.fc-modal__select, .fc-modal__input {
    padding: 0.4rem 0.5rem; font-size: 0.85rem;
    border: 1px solid var(--border-strong); border-radius: 0.3rem;
    background: var(--bg-primary); color: var(--text-primary); outline: none;
}
.fc-modal__select:focus, .fc-modal__input:focus { border-color: var(--accent); }
.fc-modal__input--scan {
    font-size: 1rem; font-weight: 700; text-align: center;
    border-color: var(--accent); background: var(--bg-secondary) !important;
}
.fc-modal__hint { font-size: 0.75rem; margin: 0.3rem 0 0; min-height: 1rem; }
.fc-modal__divider {
    display: flex; align-items: center; gap: 0.8rem;
    color: var(--text-muted); font-size: 0.75rem; margin: 0.3rem 0;
}
.fc-modal__divider::before, .fc-modal__divider::after {
    content: ''; flex: 1; height: 1px; background: var(--border-primary);
}
.fc-modal__section { display: flex; flex-direction: column; gap: 0.5rem; }
.fc-modal__footer {
    padding: 0.8rem 1rem; display: flex; gap: 0.5rem; justify-content: flex-end;
    border-top: 1px solid var(--border-primary);
}

/* ══════════ BUTTONS ══════════ */
.fc-btn {
    padding: 0.35rem 0.7rem; font-size: 0.8rem; font-weight: 600;
    border: 1px solid var(--border-strong); border-radius: 0.3rem;
    background: var(--bg-hover); color: var(--text-primary); cursor: pointer;
    transition: background 0.15s;
}
.fc-btn:hover { background: var(--border-primary); border-color: var(--accent); }
.fc-btn--primary { background: #2563eb; /* audit:keep — primary button blue, no token */ border-color: #2563eb; /* audit:keep */ color: var(--white); }
.fc-btn--primary:hover { background: #1d4ed8; /* audit:keep — primary hover blue, no token */ }
.fc-btn--danger { background: #7f1d1d; /* audit:keep — danger bg, single-use */ border-color: #991b1b; /* audit:keep */ color: #fca5a5; /* audit:keep — danger text, single-use */ }
.fc-btn--danger:hover { background: #991b1b; /* audit:keep — danger hover, single-use */ }
.fc-btn--icon { width: 1.8rem; height: 1.8rem; padding: 0; display: inline-flex; align-items: center; justify-content: center; font-size: 1rem; }
.fc-btn--small { padding: 0.25rem 0.5rem; font-size: 0.75rem; }

/* ══════════ LIVE DOT ══════════ */
.fc-live-dot {
    display: inline-block; width: 0.45rem; height: 0.45rem; border-radius: 50%;
    background: var(--success); animation: fc-pulse 1.5s ease-in-out infinite;
}

/* ══════════ EMPTY STATE ══════════ */
.fc-empty-state { text-align: center; padding: 2rem; color: var(--text-muted); }
.fc-empty-state__icon { font-size: 2rem; }
.fc-empty-state__text { font-size: 0.9rem; margin: 0.3rem 0 0; }

/* ══════════ TOAST ══════════ */
.fc-toast {
    position: fixed; bottom: 1.5rem; right: 1.5rem;
    padding: 0.6rem 1rem; border-radius: 0.4rem;
    font-size: 0.8rem; font-weight: 600; color: var(--white); background: var(--success);
    box-shadow: 0 0.25rem 0.75rem rgba(0,0,0,0.3); /* audit:keep — custom shadow opacity */
    transform: translateY(3rem); opacity: 0;
    transition: transform 0.3s, opacity 0.3s; z-index: 1000; pointer-events: none;
}
.fc-toast--visible { transform: translateY(0); opacity: 1; }
.fc-toast--error { background: var(--danger); }

/* ══════════ SCROLLBAR ══════════ */
::-webkit-scrollbar { width: 0.375rem; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 0.1875rem; }
