/* public/assets/css/style.css */

body.app-body {
    background-color: #0b0f19;
    color: #e4e7f0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.app-body.theme-light {
    background-color: #f6f8fb;
    color: #0f172a;
}

.app-container {
    min-height: 100vh;
}

/* Sidebar */

.app-sidebar {
    width: 230px;
    background: #111827;
    color: #e5e7eb;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #1f2937;
}

.theme-light .app-sidebar {
    background: #ffffff;
    color: #0f172a;
    border-right-color: #e5e7eb;
}

.sidebar-header .logo {
    font-weight: 700;
    font-size: 1.2rem;
}

.sidebar-header .subtitle {
    font-size: 0.75rem;
    color: #9ca3af;
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
}

.sidebar-item {
    border: none;
    background: transparent;
    color: #9ca3af;
    text-align: left;
    padding: 0.75rem 1rem;
    width: 100%;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    border-radius: 0;
    transition: background 0.15s, color 0.15s;
}

.sidebar-item:hover {
    background: #1f2937;
    color: #e5e7eb;
}

.sidebar-item.active {
    background: linear-gradient(90deg, #2563eb, #4f46e5);
    color: #ffffff;
}

.theme-light .sidebar-item {
    color: #475569;
}

.theme-light .sidebar-item:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.theme-light .sidebar-item.active {
    background: linear-gradient(90deg, #2563eb, #4f46e5);
    color: #ffffff;
}

/* Topbar */

.app-topbar {
    height: 64px;
    background: #020617;
    border-bottom: 1px solid #1f2937;
}

.theme-light .app-topbar {
    background: #ffffff;
    border-bottom-color: #e2e8f0;
}

.theme-light .app-topbar h5,
.theme-light .app-topbar small {
    color: #0f172a !important;
}

/* Main content */

.app-main {
    display: flex;
    flex-direction: column;
}

.app-content {
    background: radial-gradient(circle at top, rgba(37, 99, 235, 0.12), transparent 55%);
}

.theme-light .app-content {
    background: radial-gradient(circle at top, rgba(37, 99, 235, 0.08), transparent 55%);
}

/* Views */

.view {
    display: none;
}

.view.active {
    display: block;
}

/* Cards */

.stat-card {
    background: #020617;
    border-radius: 0.75rem;
    padding: 1rem 1.2rem;
    border: 1px solid #1f2937;
}

.theme-light .stat-card {
    background: #ffffff;
    border-color: #e2e8f0;
}

.stat-card .label {
    font-size: 0.78rem;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.theme-light .stat-card .label {
    color: #475569;
}

.stat-card .value {
    font-size: 1.4rem;
    font-weight: 600;
    margin-top: .35rem;
}

.panel-card {
    background: #020617;
    border-radius: 0.75rem;
    border: 1px solid #1f2937;
    padding: 1rem 1.2rem;
}

.theme-light .panel-card {
    background: #ffffff;
    border-color: #e2e8f0;
}

/* Vulnerabilidades */
.vuln-hero h3 {
    color: #e4e7f0;
}

.theme-light .vuln-hero h3 {
    color: #0f172a;
}

.vuln-highlight {
    background: linear-gradient(135deg, rgba(59,130,246,0.15), rgba(79,70,229,0.2));
    border: 1px solid #1d4ed8;
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    min-width: 220px;
}

.theme-light .vuln-highlight {
    background: linear-gradient(135deg, rgba(59,130,246,0.12), rgba(79,70,229,0.12));
    border-color: #bfdbfe;
}

.vuln-highlight .label {
    text-transform: uppercase;
    letter-spacing: .05em;
    font-size: 0.75rem;
    color: #a5b4fc;
}

.theme-light .vuln-highlight .label {
    color: #4338ca;
}

.vuln-highlight .value {
    font-size: 2rem;
    font-weight: 700;
}

.vuln-highlight .muted {
    color: #cbd5e1;
}

.theme-light .vuln-highlight .muted {
    color: #475569;
}

.vuln-severity-card {
    background: #0b1224;
    border: 1px solid #1f2937;
    border-radius: 0.75rem;
    padding: 0.8rem 1rem;
    height: 100%;
}

.theme-light .vuln-severity-card {
    background: #ffffff;
    border-color: #e2e8f0;
}

.vuln-severity-card .title {
    font-size: 0.85rem;
    color: #cbd5e1;
}

.theme-light .vuln-severity-card .title {
    color: #475569;
}

.vuln-severity-card .count {
    font-size: 1.4rem;
    font-weight: 700;
}

.vuln-severity-card.sev-critical { border-color: #ef4444; box-shadow: inset 0 0 0 1px rgba(239,68,68,0.2); }
.vuln-severity-card.sev-high { border-color: #f59e0b; box-shadow: inset 0 0 0 1px rgba(245,158,11,0.25); }
.vuln-severity-card.sev-medium { border-color: #0ea5e9; box-shadow: inset 0 0 0 1px rgba(14,165,233,0.2); }
.vuln-severity-card.sev-low { border-color: #22c55e; box-shadow: inset 0 0 0 1px rgba(34,197,94,0.2); }
.vuln-severity-card.sev-unknown { border-color: #9ca3af; }
.vuln-severity-card.sev-pending { border-color: #cbd5e1; }

.vuln-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: rgba(148,163,184,0.15);
    border: 1px solid #1f2937;
    color: #e5e7eb;
    font-size: 0.85rem;
}

.theme-light .vuln-chip {
    background: #e2e8f0;
    border-color: #cbd5e1;
    color: #0f172a;
}

.vuln-topcard {
    background: #0b1224;
    border: 1px solid #1f2937;
    border-radius: 0.75rem;
    padding: 0.6rem;
}

.theme-light .vuln-topcard {
    background: #ffffff;
    border-color: #e2e8f0;
}

.vuln-topcard .subtitle {
    color: #cbd5e1;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.vuln-mini-card {
    background: #0b1224;
    border: 1px solid #1f2937;
    border-radius: 0.65rem;
    padding: 0.65rem 0.85rem;
    min-width: 110px;
}

.vuln-mini-card .title {
    font-size: 0.8rem;
    color: #cbd5e1;
}

.vuln-mini-card .count {
    font-size: 1.2rem;
    font-weight: 700;
}

.vuln-board {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.75rem;
}

/* Relatórios */
.report-highlight {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(59, 130, 246, 0.12));
    border: 1px solid #1f2937;
    border-radius: 0.85rem;
    padding: 0.9rem 1rem;
    height: 100%;
}

.report-highlight .label {
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #cbd5e1;
    font-size: 0.78rem;
}

.report-highlight .value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #e5e7eb;
    margin: 0.15rem 0;
}

.report-highlight .muted {
    color: #94a3b8;
    font-size: 0.85rem;
}

.report-highlight.sev-critical { border-color: rgba(239,68,68,0.35); box-shadow: inset 0 0 0 1px rgba(239,68,68,0.15); }
.report-highlight.sev-high { border-color: rgba(245,158,11,0.35); box-shadow: inset 0 0 0 1px rgba(245,158,11,0.15); }
.report-highlight.sev-medium { border-color: rgba(14,165,233,0.35); box-shadow: inset 0 0 0 1px rgba(14,165,233,0.12); }

.report-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.9rem;
}

.report-risk-card {
    background: #0b1224;
    border: 1px solid #1f2937;
    border-radius: 0.85rem;
    padding: 0.85rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.theme-light .report-risk-card {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}

.report-risk-title {
    font-weight: 700;
    color: #e5e7eb;
}

.theme-light .report-risk-title {
    color: #0f172a;
}

.report-risk-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.metric-label {
    color: #94a3b8;
    font-size: 0.82rem;
}

.theme-light .metric-label {
    color: #475569;
}

.metric-value {
    font-size: 1.2rem;
    font-weight: 700;
}

.report-risk-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.risk-chip {
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.4);
    color: #cbd5e1;
    border-radius: 999px;
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
    white-space: nowrap;
}

.theme-light .risk-chip {
    background: #e2e8f0;
    border-color: #cbd5e1;
    color: #0f172a;
}

.vuln-card {
    background: #0b1224;
    border: 1px solid #1f2937;
    border-radius: 0.75rem;
    padding: 0.85rem 0.95rem;
    height: 100%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.theme-light .vuln-card {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
}

.vuln-program-link,
.vuln-program-link.btn-link,
.vuln-card .vuln-program-link {
    color: #fff !important;
    text-decoration: none !important;
}

.theme-light .vuln-card .vuln-program-link,
.theme-light .vuln-program-link,
.theme-light .vuln-program-link.btn-link {
    color: #0f172a !important;
}

.vuln-program-link:hover,
.vuln-program-link:focus,
.vuln-program-link:active {
    color: #fff !important;
    text-decoration: none !important;
}

.vuln-card .vuln-chip {
    background: rgba(59, 130, 246, 0.08);
    border-color: #1f2937;
}

.vuln-chip-program {
    border-radius: 0;
    font-weight: 700;
}

.vuln-chip-row {
    gap: 0.5rem;
}

.vuln-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem 1rem;
}

.vuln-ref {
    color: #93c5fd;
    text-decoration: none;
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vuln-ref:hover {
    text-decoration: underline;
}

.vuln-meta-grid .label {
    color: #9ca3af;
    font-size: 0.78rem;
    letter-spacing: .02em;
    text-transform: uppercase;
}

.vuln-meta-grid .value {
    color: #e5e7eb;
    font-weight: 600;
}

.panel-header {
    font-size: 0.9rem;
    font-weight: 600;
    color: #e5e7eb;
    margin-bottom: .75rem;
}

.filter-box {
    background: #0f172a;
    border: 1px solid #1e293b;
}

#agent-tab-config .text-muted {
    color: #cbd5e1 !important;
}

#agent-tab-config .config-form-label {
    color: #cbd5e1;
    font-weight: 600;
}

/* Table dark */

.table-dark {
    --bs-table-bg: #020617;
    --bs-table-border-color: #1f2937;
    --bs-table-striped-bg: #020617;
    --bs-table-striped-color: #e5e7eb;
    --bs-table-hover-bg: #020617;
    --bs-table-hover-color: #e5e7eb;
}

/* Login */

body.login-body {
    background: radial-gradient(circle at top, #1d4ed8, #020617 60%);
    min-height: 100vh;
}

.login-wrapper {
    min-height: 100vh;
}

.login-card {
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid #1f2937;
    color: #e5e7eb;
    width: 100%;
    max-width: 360px;
}

/* Painel lateral JSON */
#json-panel {
    position: fixed;
    top: 0;
    right: -600px;
    width: 600px;
    height: 100vh;
    background: #101726;
    color: #fff;
    border-left: 2px solid #1f2a44;
    box-shadow: -4px 0 20px rgba(0,0,0,0.4);
    padding: 0;
    display: flex;
    flex-direction: column;
    z-index: 9999;
    transition: right 0.35s ease;
    overflow-y: auto;
}

#json-panel.open {
    right: 0;
}

#json-panel-header {
    background: #0e1522;
    padding: 15px;
    font-size: 18px;
    font-weight: bold;
    border-bottom: 1px solid #1f2a44;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#json-panel-close {
    background: none;
    color: #fff;
    border: none;
    font-size: 26px;
    cursor: pointer;
}

#json-panel-content {
    padding: 20px;
    white-space: pre-wrap;
    font-size: 14px;
}

#json-panel-table {
    padding: 20px;
}

.json-field {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid #1f2a44;
    padding: 8px 0;
    font-size: 15px;
}

.json-field span:first-child {
    color: #8fa3c8;
    font-weight: bold;
}

.json-field span:last-child {
    color: #fff;
}

.json-field .cve-label {
    color: #93c5fd;
    font-weight: 700;
}

.json-field .cve-link {
    color: #fff;
    text-decoration: none;
}

.json-field .cve-link:hover {
    color: #e5e7eb;
    text-decoration: none;
}

#json-panel-device {
    padding: 20px;
    font-size: 22px;
    font-weight: bold;
    color: #ffffff;
    border-bottom: 1px solid #1f2a44;
    background: #0f1623;
}

#json-panel-device {
    padding: 20px;
    font-size: 22px;
    font-weight: bold;
    color: #ffffff;
    border-bottom: 1px solid #1f2a44;
    background: #0f1623;
    display: flex;
    align-items: center;
    gap: 12px;
}

#json-panel-device img {
    width: 32px;
    height: 32px;
}

#copy-block-btn {
    margin: 15px;
    padding: 8px 14px;
    background: #1a2333;
    border: 1px solid #31405a;
    color: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

#copy-block-btn:hover {
    background: #233045;
}

.json-field {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid #1f2a44;
    padding: 8px 0;
}

.json-field span:first-child {
    color: #8fa3c8;
    font-weight: bold;
}

.json-field span:last-child {
    color: #ffffff;
}

.json-field.multiline-field {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.json-field.multiline-field span:last-child {
    width: 100%;
    white-space: pre-wrap;
    word-break: break-word;
    padding: 10px;
    background: #0b1220;
    border: 1px solid #1f2a44;
    border-radius: 4px;
}

.long-text-field {
    line-height: 1.5;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}

/* CORES POR LEVEL */
.level-gray { color: #a7a7a7; }
.level-orange { color: #ffa347; }
.level-yellow { color: #ffe066; }
.level-red-dark { color: #b30000; }
.level-red-light { color: #ff4d4d; }

#copy-container {
    width: 100%;
    padding: 20px;
    text-align: center;
    border-top: 1px solid #1f2a44;
}

#copy-block-btn {
    padding: 10px 20px;
    background: #1a2333;
    border: 1px solid #31405a;
    color: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
}

#copy-block-btn:hover {
    background: #233045;
}

.agent-card {
    background: #0f172a;
    border: 1px solid #1e293b;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: 0.2s;
}

.theme-light .agent-card {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}

.agent-card:hover {
    background: #1e293b;
}

.theme-light .agent-card:hover {
    background: #f8fafc;
}

.agent-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 1.1rem;
    font-weight: 600;
}

.agent-status {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.dot-green {
    background: #22c55e;
}

.dot-orange {
    background: #f97316;
}

.dot-red {
    background: #dc2626;
}

.agent-card-body {
    font-size: 0.9rem;
    color: #cbd5e1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.theme-light .agent-card-body {
    color: #334155;
}

.agent-name {
    color: #fff;
}

.agent-link {
    color: #fff;
    text-decoration: none;
    font-weight: 400;
}

.agent-link:hover {
    color: #e2e8f0;
    text-decoration: none;
}
#agents-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.agent-field {
    display: flex;
    gap: 6px;
    align-items: center;
}

.agent-field .label {
    color: #94a3b8;
    min-width: 135px;
}

.theme-light .agent-field .label {
    color: #475569;
}

.agents-filter input {
    min-width: 240px;
}

/* Tema claro - ajustes adicionais */
.theme-light .table-dark {
    --bs-table-bg: #ffffff;
    --bs-table-border-color: #e2e8f0;
    --bs-table-color: #0f172a;
    --bs-table-striped-bg: #f8fafc;
    --bs-table-striped-color: #0f172a;
    --bs-table-hover-bg: #e2e8f0;
    --bs-table-hover-color: #0f172a;
}

.theme-light .filter-box {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.theme-light #agent-logs-scroll {
    border-top-color: #e2e8f0 !important;
}

.theme-light #json-panel {
    background: #ffffff;
    color: #0f172a;
    border-left-color: #e2e8f0;
    box-shadow: -4px 0 20px rgba(0,0,0,0.12);
}

.theme-light .json-field span:first-child {
    color: #475569;
}

.theme-light .json-field span:last-child {
    color: #0f172a;
}

.theme-light .json-field.multiline-field span:last-child {
    background: #f8fafc;
    border-color: #e2e8f0;
}

.theme-light #json-panel-header {
    background: #f8fafc;
    color: #0f172a;
    border-bottom-color: #e2e8f0;
}

.theme-light #json-panel-close {
    color: #0f172a;
}

.theme-light #json-panel-device {
    background: #f8fafc;
    color: #0f172a;
    border-bottom-color: #e2e8f0;
}

.theme-light #copy-block-btn {
    background: #e2e8f0;
    border-color: #cbd5e1;
    color: #0f172a;
}

.theme-light .agent-name,
.theme-light .agent-link {
    color: #0f172a;
}

.theme-light .agent-link:hover {
    color: #1d4ed8;
}

.theme-light * {
    scrollbar-color: #cbd5e1 #e2e8f0;
}

.theme-light *::-webkit-scrollbar-track {
    background: #e2e8f0;
}

.theme-light *::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-color: #e2e8f0;
}
/* Scrollbar styling to match the dark theme */
* {
    scrollbar-width: thin;
    scrollbar-color: #1e293b #0f172a;
}

*::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

*::-webkit-scrollbar-track {
    background: #0f172a;
}

*::-webkit-scrollbar-thumb {
    background: #1e293b;
    border-radius: 10px;
    border: 2px solid #0f172a;
}

