:root {
    --bg-dark: #09090b;
    --bg-carbon: #121212;
    --surface: #1c1c1c;
    --border: #2a2a2a;
    --text-main: #ededed;
    --text-muted: #a1a1aa;
    --accent: #ffffff;
    --accent-hover: #d4d4d8;
    --crit: #ef4444;
    --high: #f97316;
    --med: #eab308;
    --low: #3b82f6;
    --ok: #22c55e;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Inter', system-ui, sans-serif; }
body { background-color: var(--bg-dark); color: var(--text-main); line-height: 1.6; }

/* ================= COMPONENTES GLOBAIS DASHBOARD ================= */
.btn {
    display: inline-flex; justify-content: center; align-items: center;
    padding: 10px 18px; border-radius: 8px; font-weight: 600; font-size: 14px;
    background-color: var(--text-main); color: var(--bg-dark); border: 1px solid transparent;
    cursor: pointer; transition: 0.2s; text-decoration: none; width: 100%;
}
.btn:hover { background-color: var(--accent-hover); }
.btn-secondary { background-color: transparent; border-color: var(--border); color: var(--text-main); }
.btn-secondary:hover { background-color: var(--bg-carbon); border-color: var(--text-muted); }
.btn-inline { width: auto; margin: 0 5px; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

h1, h2, h3 { font-weight: 600; letter-spacing: -0.02em; }

/* ================= LANDING PAGE & AUTENTICAÇÃO ================= */
.landing-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 32px;
    background-color: var(--bg-carbon);
    border-bottom: 1px solid var(--border);
}

.hero {
    max-width: 800px;
    margin: 100px auto 0 auto;
    text-align: center;
    padding: 0 20px;
}

.hero h1 {
    font-size: 2.75rem;
    margin-bottom: 20px;
    line-height: 1.2;
}

.hero p {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 35px;
}

.center-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: var(--bg-dark);
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 32px;
    width: 100%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: left;
}

label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

input[type="email"],
input[type="password"],
input[type="text"] {
    width: 100%;
    padding: 10px 14px;
    border-radius: 8px;
    background-color: var(--bg-carbon);
    border: 1px solid var(--border);
    color: var(--text-main);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

input[type="email"]:focus,
input[type="password"]:focus,
input[type="text"]:focus {
    border-color: var(--text-muted);
}

button[type="submit"] {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 10px 18px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    background-color: var(--text-main);
    color: var(--bg-dark);
    border: 1px solid transparent;
    cursor: pointer;
    transition: 0.2s;
    margin-top: 10px;
}

button[type="submit"]:hover {
    background-color: var(--accent-hover);
}

/* ================= DASHBOARD LAYOUT ================= */
.dashboard-layout { display: flex; flex-direction: column; min-height: 100vh; }
.topbar { position: sticky; top: 0; z-index: 10; display: flex; justify-content: space-between; align-items: center; padding: 12px 24px; background-color: var(--bg-carbon); border-bottom: 1px solid var(--border); }
.topbar-brand { display: flex; align-items: center; gap: 12px; }
.topbar-brand h2 { font-size: 1.1rem; margin: 0; }
.topbar-brand h2 span { color: var(--text-muted); font-weight: 400; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }

.dashboard-content { padding: 24px; max-width: 1400px; margin: 0 auto; width: 100%; }

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 20px; }
.kpi-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px 20px; display: flex; flex-direction: column; }
.kpi-card span { font-size: 12px; color: var(--text-muted); text-transform: uppercase; font-weight: 600; margin: 0; }
.kpi-card strong { font-size: 1.75rem; margin-top: 6px; font-weight: 700; line-height: 1.2; }
.kpi-crit { color: var(--crit); }
.kpi-high { color: var(--high); }

.charts-grid { display: grid; grid-template-columns: 1fr 2fr; gap: 16px; margin-bottom: 20px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 20px; margin-bottom: 20px; }
.charts-grid .panel { margin-bottom: 0; }
.panel h3 { font-size: 13px; color: var(--text-muted); text-transform: uppercase; border-bottom: 1px solid var(--border); padding-bottom: 8px; margin-bottom: 14px; margin-top: 0; }
.chart-wrap { position: relative; height: 240px; width: 100%; }

.feed-scroll { max-height: 600px; overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 720px; }
th, td { padding: 12px 10px; text-align: left; border-bottom: 1px solid var(--border); margin: 0; }
th { position: sticky; top: 0; background: var(--surface); color: var(--text-muted); font-size: 11px; text-transform: uppercase; }
.badge { display: inline-block; padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; text-transform: uppercase; }
.badge-crit { background: rgba(239, 68, 68, 0.1); color: var(--crit); border: 1px solid rgba(239, 68, 68, 0.2); }
.badge-high { background: rgba(249, 115, 22, 0.1); color: var(--high); border: 1px solid rgba(249, 115, 22, 0.2); }
.badge-med  { background: rgba(234, 179, 8, 0.1); color: var(--med); border: 1px solid rgba(234, 179, 8, 0.2); }
.badge-low  { background: rgba(59, 130, 246, 0.1); color: var(--low); border: 1px solid rgba(59, 130, 246, 0.2); }

.status-pill { font-size: 11px; font-weight: 600; padding: 6px 12px; border-radius: 20px; border: 1px solid var(--border); color: var(--text-muted); background: var(--surface); }
.status-pill.ok { color: var(--ok); border-color: rgba(34,197,94,.35); background: rgba(34,197,94,.08); }
.status-pill.bad { color: var(--crit); border-color: rgba(239,68,68,.35); background: rgba(239,68,68,.08); }

/* Modal */
.ai-modal { background: var(--surface); color: var(--text-main); border: 1px solid var(--border); border-radius: 12px; width: min(680px, 92vw); margin: auto; padding: 0; }
.ai-modal::backdrop { background: rgba(0,0,0,.7); }
.ai-modal-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--border); }

.markdown-content pre { background: var(--bg-dark); padding: 12px; border-radius: 8px; overflow-x: auto; font-family: monospace; border: 1px solid var(--border); margin: 8px 0; font-size: 12px; }
.markdown-content code { background: rgba(255,255,255,0.1); padding: 2px 4px; border-radius: 4px; font-family: monospace; }

/* ================= MODAL DETALHE TEMPORAL DO DIA ================= */
.day-timeline-modal {
    width: min(920px, 95vw);
}

.day-timeline-body {
    padding: 18px 22px 24px 22px;
}

.day-chart-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    width: 100%;
    padding-bottom: 6px;
}

/* ================= FILTRO INTERATIVO PATAMARES ML ================= */
.ml-bucket-card {
    transition: transform 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
    user-select: none;
}
.ml-bucket-card:hover {
    transform: translateY(-2px);
    border-color: var(--text-muted) !important;
}
.ml-bucket-card.active {
    background-color: #27272a !important;
    border-color: #ffffff !important;
    box-shadow: 0 0 0 1px #ffffff;
}

/* ================= DROP-DOWN DISTRIBUIÇÃO DE PROBABILIDADE ================= */
.ml-dropdown-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    list-style: none;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: -0.02em;
    user-select: none;
}
.ml-dropdown-summary::-webkit-details-marker {
    display: none;
}
.ml-dropdown[open] .ml-dropdown-summary {
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
}
.ml-chevron {
    transition: transform 0.2s ease;
    color: var(--text-muted);
}
.ml-dropdown[open] .ml-chevron {
    transform: rotate(180deg);
}

/* ================= MENU LATERAL (SIDEBAR + DROPBOX) ================= */
.app-shell {
    display: flex;
    flex: 1;
    min-height: calc(100vh - 57px);
}

.sidebar {
    width: 260px;
    background-color: var(--bg-carbon);
    border-right: 1px solid var(--border);
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-shrink: 0;
    transition: width 0.2s ease, padding 0.2s ease;
}

.sidebar.collapsed {
    width: 0;
    padding: 0;
    overflow: hidden;
    border-right: none;
}

.sidebar-toggle-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-main);
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.15s;
}
.sidebar-toggle-btn:hover {
    background: var(--surface);
    border-color: var(--text-muted);
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: 0.15s;
}
.sidebar-nav-item:hover {
    background: var(--surface);
    color: var(--text-main);
}
.sidebar-nav-item.active {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text-main);
    font-weight: 600;
}

.sidebar-dropbox {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-dark);
    overflow: hidden;
}

.sidebar-dropbox-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
    cursor: pointer;
    list-style: none;
    user-select: none;
}
.sidebar-dropbox-summary::-webkit-details-marker {
    display: none;
}
.sidebar-dropbox[open] .sidebar-dropbox-summary {
    border-bottom: 1px solid var(--border);
    color: var(--text-main);
}
.sidebar-dropbox[open] .sidebar-chevron {
    transform: rotate(180deg);
}
.sidebar-chevron {
    transition: transform 0.2s ease;
}

.sidebar-dropbox-body {
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.main-workspace {
    flex: 1;
    min-width: 0;
}

.badge-blocked {
    background: rgba(239, 68, 68, 0.14);
    color: var(--crit);
    border: 1px solid rgba(239, 68, 68, 0.3);
}
.badge-active-acc {
    background: rgba(34, 197, 94, 0.12);
    color: var(--ok);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

@media (max-width: 860px) {
    .app-shell {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    .sidebar.collapsed {
        display: none;
    }
}

/* =========================================================================
   LANDING PAGE: TELA DE LOADING INICIAL E BACKGROUND DINÂMICO
   ========================================================================= */

body.landing-page {
    background-color: #000000;
    overflow-x: hidden;
}

.scanlines {
    position: fixed;
    inset: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%),
                linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    background-size: 100% 2px, 3px 100%;
    z-index: 999998;
    pointer-events: none;
    opacity: 0.6;
}

#hacker-loader {
    position: fixed;
    inset: 0;
    background-color: #000000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 999999;
    transition: opacity 0.6s ease;
}

.scanline-banner {
    position: relative;
    width: 72%;
    max-width: 960px;
    padding: 45px 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: repeating-linear-gradient(to bottom, rgba(255,255,255,0.045) 0px, rgba(255,255,255,0.045) 1px, transparent 1px, transparent 4px);
    border-top: 1px solid rgba(255,255,255,0.05);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    overflow: hidden;
}

.scanline-banner::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.06), transparent);
    animation: bannerSweep 2.4s infinite linear;
    pointer-events: none;
}

.ascii-logo {
    font-family: 'Courier New', Courier, monospace !important;
    font-size: clamp(6px, 1.1vw, 11px);
    line-height: 1.15;
    color: #dedede;
    white-space: pre;
    text-align: left;
    letter-spacing: 0 !important;
    animation: glitch 2s infinite linear alternate-reverse;
}

.progress-wrapper {
    width: 42%;
    max-width: 540px;
    height: 2px;
    background-color: #1f1f1f;
    margin-top: 22px;
    position: relative;
}

.progress-bar {
    width: 0%;
    height: 100%;
    background-color: #d4d4d4;
    box-shadow: 0 0 10px rgba(255,255,255,0.8);
    transition: width 0.08s linear;
}

.boot-meta {
    font-family: 'Courier New', Courier, monospace !important;
    width: 42%;
    max-width: 540px;
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 10px;
    letter-spacing: 1.5px;
    color: #666666;
    text-transform: uppercase;
}

/* CONTAINER DO BACKGROUND */
#wallpaper-stage {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: radial-gradient(circle at center, #0a0a0a 0%, #000000 100%);
    overflow: hidden;
}

.anim-frame {
    position: absolute;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 2s ease-in-out, visibility 2s ease-in-out;
}
.anim-frame.active { opacity: 1; visibility: visible; }

/* FRAME 1: MWARE PURO */
#f1-wrapper {
    margin-top: 35vh;
    transform: scale(0.95);
    transition: transform 9s ease-out;
}
.anim-frame.active #f1-wrapper { transform: scale(1.02); }
.f1-ascii {
    font-family: 'Courier New', Courier, monospace !important;
    font-size: clamp(8px, 1.4vw, 15px);
    line-height: 1.2;
    letter-spacing: 0 !important;
    color: rgba(255, 255, 255, 0.9);
    white-space: pre;
    animation: gentlePulse 4s infinite ease-in-out;
}

/* FRAME 2: GRADE DIAGONAL */
#frame-2 { background-color: #050505; overflow: hidden; }
#frame-2::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 10%, #000 85%);
    pointer-events: none;
    z-index: 5;
}
.f2-wrapper {
    position: absolute;
    width: 250vw;
    height: 250vh;
    top: -75vh;
    left: -75vw;
    display: flex;
    justify-content: center;
    align-items: center;
    transform: rotate(-16deg);
}
#f2-grid {
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
    height: 100%;
    animation: panGrid 40s linear infinite;
}
.mware-row {
    display: flex;
    width: 100%;
    white-space: pre;
    margin: 10px 0;
}
.mware-row.offset { transform: translateX(-120px); }
.mware-tile {
    font-family: 'Courier New', Courier, monospace !important;
    font-size: clamp(5px, 0.6vw, 7px);
    line-height: 1.2;
    letter-spacing: 1px !important;
    color: rgba(255, 255, 255, 0.08);
    margin: 0 30px;
    white-space: pre;
}

/* FRAME 3: TEXTO MOTIVADOR */
#f3-quote-stage {
    margin-top: 35vh;
    width: 80%;
    max-width: 820px;
    text-align: left;
    padding: 20px;
    transform: translateY(15px);
    transition: transform 7s ease-out;
}
.anim-frame.active #f3-quote-stage { transform: translateY(-5px); }
.terminal-quote-line {
    font-family: 'Courier New', Courier, monospace !important;
    font-size: clamp(14px, 1.8vw, 22px);
    line-height: 2.2;
    letter-spacing: 2.5px;
    color: rgba(255, 255, 255, 0.7);
    min-height: 2.2em;
    text-transform: uppercase;
}
.terminal-quote-line.highlight { font-weight: normal; color: rgba(255, 255, 255, 1); }
.cursor-blink {
    display: inline-block;
    width: 2px;
    height: 1.2em;
    background-color: #ffffff;
    vertical-align: middle;
    margin-left: 6px;
    animation: blinkCursor 1s steps(2, end) infinite;
}

/* FRAME 5: LOGS */
#f5-ascii-bg {
    font-family: 'Courier New', Courier, monospace !important;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    font-size: 11px;
    line-height: 1.3;
    color: rgba(255, 255, 255, 0.07);
    white-space: pre-wrap;
    padding: 20px;
    transform: translateY(0);
    transition: transform 10s ease-out;
}
.anim-frame.active #f5-ascii-bg { transform: translateY(-20px); }

/* UI FRONT-END TRANSPARENTE SOBRE O PALCO */
.front-ui { position: relative; z-index: 10; }
.front-ui .landing-nav { background: transparent; border-bottom: none; }
.front-ui .hero { margin-top: 15vh; }

.btn-solid {
    padding: 14px 32px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 1rem;
    background: #fff;
    color: #000;
    text-decoration: none;
    display: inline-block;
    transition: 0.2s;
}
.btn-solid:hover { background: #d4d4d8; }

.btn-outline {
    padding: 10px 18px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.75);
    color: #fff;
    text-decoration: none;
    display: inline-block;
    transition: 0.2s;
}
.btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #fff;
}

/* ANIMAÇÕES GLOBAIS */
@keyframes bannerSweep { 0% { left: -60%; } 100% { left: 140%; } }
@keyframes gentlePulse {
    0%, 100% { opacity: 0.85; text-shadow: 0 0 2px rgba(255, 255, 255, 0.1); }
    50% { opacity: 1; text-shadow: 0 0 10px rgba(255, 255, 255, 0.3), 0 0 20px rgba(255, 255, 255, 0.15); }
}
@keyframes blinkCursor { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
@keyframes panGrid { 0% { transform: translate(0, 0); } 100% { transform: translate(-150px, -150px); } }
@keyframes glitch {
    0% { clip-path: inset(20% 0 80% 0); transform: translate(-2px, 2px); }
    20% { clip-path: inset(60% 0 10% 0); transform: translate(2px, -2px); }
    40% { clip-path: inset(40% 0 50% 0); transform: translate(2px, 2px); }
    60% { clip-path: inset(80% 0 5% 0); transform: translate(-2px, -2px); }
    80% { clip-path: inset(10% 0 70% 0); transform: translate(2px, 2px); }
    100% { clip-path: inset(30% 0 50% 0); transform: translate(-2px, -2px); }
}

/* ================= CORREÇÃO DE QUEBRA DE LINHA E GRELHA (INCIDENT DETAIL) ================= */
#ai-box,
#report-preview {
    white-space: normal !important;
    word-break: break-word;
    overflow-wrap: anywhere;
    overflow-x: hidden;
    max-width: 100%;
    min-width: 0;
}

#ai-box pre,
#report-preview pre,
#raw-data {
    white-space: pre-wrap !important;
    word-break: break-word;
    overflow-wrap: anywhere;
    max-width: 100%;
}

#ai-box code,
#report-preview code {
    white-space: pre-wrap;
    word-break: break-all;
}

.detail-grid > *,
.detail-layout > *,
.card,
.panel {
    min-width: 0;
}

/* ================= RADAR VISUAL DE DETEÇÃO DE ATAQUES ================= */
.threat-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 14px 20px;
    border-radius: 12px;
    margin-bottom: 18px;
    border: 1px solid var(--border);
    background: linear-gradient(90deg, rgba(34, 197, 94, 0.08), var(--surface));
    transition: all 0.25s ease;
}
.threat-banner.elevated {
    border-color: rgba(249, 115, 22, 0.45);
    background: linear-gradient(90deg, rgba(249, 115, 22, 0.14), var(--surface));
}
.threat-banner.critical {
    border-color: rgba(239, 68, 68, 0.65);
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.2), var(--surface));
    box-shadow: 0 0 24px rgba(239, 68, 68, 0.14);
}
.threat-banner-left {
    display: flex;
    align-items: center;
    gap: 14px;
}
.threat-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--ok);
    flex-shrink: 0;
}
.threat-banner.elevated .threat-dot {
    background-color: var(--high);
    box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.25);
}
.threat-banner.critical .threat-dot {
    background-color: var(--crit);
    animation: radarPulse 1.4s infinite;
}
.threat-title {
    font-weight: 700;
    font-size: 14px;
    color: var(--text-main);
}
.threat-sub {
    font-size: 12px;
    color: var(--text-muted);
}

@keyframes radarPulse {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.75); }
    70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.kpi-card-crit { border-top: 2px solid var(--crit); }
.kpi-card-high { border-top: 2px solid var(--high); }
.kpi-card-cve  { border-top: 2px solid #a855f7; }
.kpi-card-ok   { border-top: 2px solid #facc15; }

.badge-cve {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 5px;
    font-size: 10px;
    font-weight: 700;
    font-family: monospace;
    background: rgba(168, 85, 247, 0.16);
    color: #d8b4fe;
    border: 1px solid rgba(168, 85, 247, 0.4);
    margin-top: 5px;
    margin-right: 4px;
}

/* ================= WIDGETS QUADRADOS E EXPANSÍVEIS POR SETOR ================= */
.sectors-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px;
    margin-bottom: 16px;
}

.sector-widgets-board {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-start;
}

.sector-square-widget {
    width: 196px;
    height: 196px;
    aspect-ratio: 1 / 1;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    position: relative;
    user-select: none;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.sector-square-widget:hover {
    transform: translateY(-4px);
    border-color: var(--text-muted);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.55);
}
.sector-square-widget.dragging {
    opacity: 0.45;
    transform: scale(0.96);
}
.sector-square-widget.has-critical {
    border-color: rgba(239, 68, 68, 0.55);
    background: linear-gradient(160deg, rgba(239, 68, 68, 0.12), var(--bg-dark) 65%);
}
.sector-square-widget.has-high {
    border-color: rgba(249, 115, 22, 0.45);
    background: linear-gradient(160deg, rgba(249, 115, 22, 0.10), var(--bg-dark) 65%);
}

.sector-widget-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 6px;
}
.sector-widget-title {
    font-weight: 700;
    font-size: 14px;
    color: var(--text-main);
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.sector-widget-center {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}
.sector-widget-count {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
    color: var(--text-main);
}
.sector-widget-sub {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}
.sector-widget-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: var(--text-muted);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 8px;
}

.sector-modal {
    width: min(860px, 94vw);
}