/* EDR Console — Black / orange theme */

:root {
    --bg-dark: #0d0d0d;
    --bg-card: #141414;
    --bg-hover: #1a1a1a;
    --border: #262626;
    --text: #e5e5e5;
    --text-muted: #737373;
    --accent: #f97316;
    --accent-hover: #ea580c;
    --accent-dim: rgba(249, 115, 22, 0.15);
    --danger: #dc2626;
    --danger-hover: #b91c1c;
    --success: #22c55e;
    --radius: 8px;
    --font-sans: "Outfit", system-ui, sans-serif;
    --font-mono: "JetBrains Mono", monospace;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg-dark);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.5;
    display: flex;
    flex-direction: column;
}

/* Icons */
.icon {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
}
.icon-sm {
    width: 1rem;
    height: 1rem;
}
.btn .icon,
.btn .icon-sm {
    margin-right: 0.35rem;
}

/* Layout with sidebar */
body.layout-sidebar {
    flex-direction: row;
}
.sidebar {
    width: 220px;
    min-height: 100vh;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}
.sidebar-brand {
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--accent);
    text-decoration: none;
    letter-spacing: 0.02em;
    padding: 1.25rem 1.25rem 1rem;
    display: block;
}
.sidebar-brand:hover {
    color: var(--accent-hover);
}
.sidebar-nav {
    flex: 1;
    padding: 0.5rem 0.75rem;
}
.sidebar-section {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    padding: 0.75rem 0.5rem 0.35rem;
}
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}
.sidebar-link:hover {
    color: var(--text);
    background: var(--bg-hover);
}
.sidebar-link.active {
    color: var(--accent);
    background: var(--accent-dim);
}
.sidebar-link .icon {
    width: 1.1rem;
    height: 1.1rem;
    opacity: 0.9;
}
.sidebar-badge {
    margin-left: auto;
    background: var(--danger);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.4rem;
    border-radius: 10px;
    min-width: 1.1rem;
    text-align: center;
}
.sidebar-footer {
    padding: 1rem 1rem 1.25rem;
    border-top: 1px solid var(--border);
}
.sidebar-user-name {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
}
.sidebar-user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.app-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    background: var(--bg-dark);
    border-bottom: 1px solid var(--border);
}
.breadcrumb {
    font-size: 0.85rem;
    color: var(--text-muted);
}
.topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.btn-icon {
    padding: 0.4rem 0.5rem;
}
.btn-icon .icon {
    margin-right: 0;
}

/* Main (with sidebar) */
.layout-sidebar .main {
    flex: 1;
    padding: 1.5rem 2rem;
    max-width: none;
    margin: 0;
    overflow-x: hidden;
}

/* Dashboard hero */
.dashboard-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.dashboard-hero-title {
    margin: 0 0 0.25rem;
    font-size: 1.5rem;
    font-weight: 600;
}
.dashboard-hero-subtitle {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-muted);
}
.dashboard-hero-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* KPI grid */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.1rem 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}
.kpi-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.kpi-icon .icon {
    width: 1.35rem;
    height: 1.35rem;
}
.kpi-icon-org {
    background: rgba(249, 115, 22, 0.15);
    color: var(--accent);
}
.kpi-icon-endpoint {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}
.kpi-icon-threat {
    background: rgba(220, 38, 38, 0.15);
    color: #f87171;
}
.kpi-icon-health {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
}
.kpi-card-alert .kpi-value {
    color: #f87171;
}
.kpi-body {
    min-width: 0;
}
.kpi-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--text);
}
.kpi-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.kpi-status {
    font-size: 0.8rem;
    color: var(--text-muted);
}
.kpi-status-ok {
    color: var(--success);
}

/* Panels */
.dashboard-panels {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}
.panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
}
.panel-wide {
    grid-column: 1 / -1;
}
@media (min-width: 900px) {
    .panel-wide {
        grid-column: span 1;
    }
    .dashboard-panels:has(.panel-wide) {
        grid-template-columns: 2fr 1fr;
    }
}
.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.panel-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}
.panel-badge {
    font-size: 0.75rem;
    color: var(--text-muted);
}
.panel-badge.live {
    color: var(--success);
}
.panel-badge.live::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success);
    margin-right: 0.35rem;
    vertical-align: middle;
    animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
.panel-footer-link {
    margin-top: 0.75rem;
    font-size: 0.85rem;
}
.panel-footer-link a {
    color: var(--accent);
    text-decoration: none;
}
.panel-footer-link a:hover {
    text-decoration: underline;
}

/* Activity chart */
.activity-chart {
    display: flex;
    align-items: flex-end;
    gap: 0.35rem;
    height: 80px;
}
.activity-bar-wrap {
    flex: 1;
    height: 100%;
    display: flex;
    align-items: flex-end;
    min-width: 0;
}
.activity-bar {
    width: 100%;
    max-width: 24px;
    margin: 0 auto;
    background: var(--accent);
    border-radius: 4px 4px 0 0;
    min-height: 4px;
    transition: height 0.2s ease;
}
.activity-labels {
    display: flex;
    gap: 0.35rem;
    margin-top: 0.5rem;
}
.activity-label {
    flex: 1;
    font-size: 0.7rem;
    color: var(--text-muted);
    text-align: center;
    min-width: 0;
}

/* Severity bars */
.severity-bars {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}
.severity-row {
    display: grid;
    grid-template-columns: 70px 1fr 28px;
    align-items: center;
    gap: 0.5rem;
}
.severity-name {
    font-size: 0.85rem;
    color: var(--text-muted);
}
.severity-track {
    height: 8px;
    background: var(--bg-hover);
    border-radius: 4px;
    overflow: hidden;
}
.severity-fill {
    height: 100%;
    border-radius: 4px;
    min-width: 4px;
    transition: width 0.3s ease;
}
.severity-critical { background: #dc2626; }
.severity-high { background: #ea580c; }
.severity-medium { background: var(--accent); }
.severity-low { background: var(--success); }
.severity-count {
    font-size: 0.85rem;
    font-family: var(--font-mono);
    color: var(--text-muted);
    text-align: right;
}

/* Fleet bars */
.fleet-bars {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}
.fleet-row {
    display: grid;
    grid-template-columns: 60px 1fr 28px;
    align-items: center;
    gap: 0.5rem;
}
.fleet-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}
.fleet-track {
    height: 8px;
    background: var(--bg-hover);
    border-radius: 4px;
    overflow: hidden;
}
.fleet-fill {
    height: 100%;
    border-radius: 4px;
    min-width: 4px;
    transition: width 0.3s ease;
}
.fleet-online { background: var(--success); }
.fleet-offline { background: var(--text-muted); }
.fleet-count {
    font-size: 0.85rem;
    font-family: var(--font-mono);
    color: var(--text-muted);
    text-align: right;
}

/* Endpoints by organization chart */
.panel-endpoints-by-org .panel-header { display: flex; justify-content: space-between; align-items: center; }
.endpoints-by-org-chart {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}
.endpoints-org-row {
    display: grid;
    grid-template-columns: minmax(100px, 1fr) 2fr 52px;
    align-items: center;
    gap: 0.75rem;
}
.endpoints-org-name {
    font-size: 0.9rem;
    color: var(--text);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.endpoints-org-name:hover { color: var(--accent); }
.endpoints-org-bar-wrap { min-width: 0; }
.endpoints-org-bar {
    display: flex;
    height: 10px;
    border-radius: 4px;
    overflow: hidden;
    background: var(--bg-hover);
}
.endpoints-org-seg { min-width: 2px; transition: width 0.2s ease; }
.endpoints-org-online { background: var(--success); }
.endpoints-org-offline { background: var(--text-muted); }
.endpoints-org-count {
    font-size: 0.85rem;
    font-family: var(--font-mono);
    color: var(--text-muted);
    text-align: right;
}

/* Playbook list */
.playbook-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.playbook-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}
.playbook-item:last-child {
    border-bottom: none;
}
.playbook-item-body {
    flex: 1;
    min-width: 0;
}
.playbook-item-title {
    display: block;
    font-weight: 500;
    font-size: 0.95rem;
}
.playbook-item-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}
.playbook-item .badge {
    flex-shrink: 0;
}

/* Nav (legacy / when no sidebar) */
.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
}

.nav-brand {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--accent);
    text-decoration: none;
    letter-spacing: 0.02em;
}

.nav-brand:hover {
    color: var(--accent-hover);
}

.nav-links {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0.5rem;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    font-weight: 500;
}

.nav-links a:hover {
    color: var(--text);
    background: var(--bg-hover);
}

.nav-links a.active {
    color: var(--accent);
    background: var(--accent-dim);
}

/* Main */
.main {
    flex: 1;
    padding: 1.5rem 2rem;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

/* Typography */
.page-title {
    margin: 0 0 1.25rem;
    font-size: 1.5rem;
    font-weight: 600;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.page-header .page-title {
    margin-bottom: 0;
}

.back-link {
    display: inline-block;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.back-link:hover {
    color: var(--accent);
}

/* Cards */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
}

.card-title {
    margin: 0 0 1rem;
    font-size: 1rem;
    font-weight: 600;
}

.card-stat {
    text-align: center;
}

.card-stat-value {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--accent);
    font-family: var(--font-mono);
}

.card-stat-alert .card-stat-value {
    color: var(--danger);
}

.card-stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
}

/* Lists */
.list {
    list-style: none;
    margin: 0 0 1rem;
    padding: 0;
}

.list-organisations .list-item,
.list-alerts .list-item {
    display: block;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    color: inherit;
}

.list-organisations .list-item:last-child,
.list-alerts .list-item:last-child {
    border-bottom: none;
}

.list-organisations .list-item:hover {
    background: var(--bg-hover);
    margin: 0 -1rem;
    padding-left: 1rem;
    padding-right: 1rem;
    border-radius: var(--radius);
}

.list-item-name {
    display: block;
    font-weight: 500;
}

.list-item-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.list-item-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.list-item-alert {
    padding: 0.75rem 0;
}

.list-item-alert .btn-small {
    margin-top: 0.5rem;
}

.list-alerts-page {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.list-item-alert.resolved {
    opacity: 0.7;
}

.list-item-alert.resolved .list-item-name {
    text-decoration: line-through;
}

.list-item-desc {
    margin: 0.5rem 0 0;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.list-cards {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.list-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.list-card-body {
    flex: 1;
    min-width: 0;
}

.list-card-title {
    margin: 0 0 0.25rem;
    font-size: 1.1rem;
}

.list-card-meta {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.list-card-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
}

.badge-low {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
}

.badge-medium {
    background: rgba(249, 115, 22, 0.2);
    color: var(--accent);
}

.badge-high {
    background: rgba(234, 88, 12, 0.25);
    color: #fb923c;
}

.badge-critical {
    background: rgba(220, 38, 38, 0.25);
    color: #f87171;
}

.badge-online {
    background: rgba(34, 197, 94, 0.2);
    color: var(--success);
}

.badge-offline {
    background: var(--bg-hover);
    color: var(--text-muted);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.btn-primary {
    background: var(--accent);
    color: #000;
}

.btn-primary:hover {
    background: var(--accent-hover);
    color: #000;
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
}

.btn-ghost:hover {
    background: var(--bg-hover);
    color: var(--text);
}

.btn-secondary {
    background: var(--bg-hover);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--border);
    color: var(--text);
}

.btn-danger {
    background: transparent;
    color: var(--danger);
}

.btn-danger:hover {
    background: rgba(220, 38, 38, 0.15);
    color: var(--danger-hover);
}

.btn-small {
    padding: 0.35rem 0.65rem;
    font-size: 0.8rem;
}

.inline-form {
    display: inline;
}

/* Edit/Delete in endpoint cards & tables: proper button look */
.endpoint-card-actions .btn,
.table-actions .btn {
    min-height: 32px;
    border: 1px solid var(--border);
    font-weight: 500;
}
.endpoint-card-actions .btn:not(.btn-danger),
.table-actions .btn:not(.btn-danger) {
    background: var(--bg-hover);
    color: var(--text);
}
.endpoint-card-actions .btn:not(.btn-danger):hover,
.table-actions .btn:not(.btn-danger):hover {
    background: var(--border);
    color: var(--text);
}
.endpoint-card-actions .btn-danger,
.table-actions .btn-danger {
    border-color: rgba(220, 38, 38, 0.4);
}
.endpoint-card-actions .btn-danger:hover,
.table-actions .btn-danger:hover {
    border-color: var(--danger);
}
.endpoint-card-actions .inline-form,
.table-actions .inline-form {
    display: inline-flex;
}
.endpoint-card-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}
.table-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

/* Forms */
.form {
    max-width: 420px;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 500;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-family: inherit;
    font-size: 0.95rem;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-dim);
}

.form-group-checkbox label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.form-group input[type="checkbox"] {
    width: auto;
}

.form-row-two { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-hint { font-size: 0.85rem; margin: -0.5rem 0 1rem; }
.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

/* Table */
.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.table th,
.table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.table th {
    background: var(--bg-hover);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.table tr:last-child td {
    border-bottom: none;
}

.table tbody tr:hover {
    background: var(--bg-hover);
}

.table code {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--accent);
}

.table-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* Filter bar */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.filter-bar label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.filter-bar select {
    padding: 0.5rem 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-family: inherit;
    font-size: 0.9rem;
}
.filter-bar-alerts { flex-wrap: wrap; }
.filter-bar input[type="text"],
.filter-bar input[type="search"],
.filter-bar input[type="date"] {
    padding: 0.5rem 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.9rem;
}
.checkbox-label { display: inline-flex; align-items: center; gap: 0.5rem; cursor: pointer; }

/* Alerts page cards */
.list-alerts-page .card {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.list-item-alert-body {
    flex: 1;
    min-width: 0;
}

.resolved-label {
    font-size: 0.85rem;
    color: var(--success);
}

/* Flash messages */
.flash-messages {
    list-style: none;
    margin: 0 0 1rem;
    padding: 0;
}

.flash {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
}

.flash-success {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.flash-error {
    background: rgba(220, 38, 38, 0.15);
    color: #f87171;
    border: 1px solid rgba(220, 38, 38, 0.3);
}

/* Empty state */
.empty {
    color: var(--text-muted);
    margin: 0;
}

.empty a {
    color: var(--accent);
    text-decoration: none;
}

.empty a:hover {
    text-decoration: underline;
}

/* Footer */
.footer {
    padding: 0.75rem 1.5rem;
    border-top: 1px solid var(--border);
    background: var(--bg-card);
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Login page (standalone, no sidebar/menu) */
body.layout-login {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
}
.login-page {
    width: 100%;
    max-width: 400px;
}
.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}
.login-brand {
    display: block;
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--accent);
    text-decoration: none;
    letter-spacing: 0.02em;
    margin-bottom: 1.5rem;
    text-align: center;
}
.login-brand:hover {
    color: var(--accent-hover);
}
.login-title {
    margin: 0 0 0.25rem;
    font-size: 1.5rem;
    font-weight: 600;
    text-align: center;
}
.login-subtitle {
    margin: 0 0 1.5rem;
    font-size: 0.95rem;
    color: var(--text-muted);
    text-align: center;
}
.login-form .form-group {
    margin-bottom: 1.1rem;
}
.login-flash {
    margin-bottom: 1rem;
}
.login-flash .flash {
    margin-bottom: 0.5rem;
}
.btn-block {
    width: 100%;
}
.login-footer {
    margin: 1rem 0 0;
    text-align: center;
    font-size: 0.9rem;
}
.login-footer a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.15s ease;
}
.login-footer a:hover {
    color: var(--accent);
}

/* Login (when embedded in main layout, kept for compatibility) */
.login-box {
    max-width: 360px;
    margin: 2rem 0;
}

/* Agent install & code */
.code-block {
    display: block;
    padding: 1rem;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    overflow-x: auto;
    margin: 0.5rem 0;
}
.token-display {
    display: block;
    padding: 0.75rem;
    background: var(--bg-dark);
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    word-break: break-all;
    margin: 0.5rem 0;
}
.panel-token {
    border-color: var(--accent);
}

.agent-id-result {
    margin-top: 1rem;
}
.agent-id-result .label { margin-bottom: 0.5rem; }
.agent-id-result .token-display { margin: 0.5rem 0; }

.panel-create-agent .create-agent-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
    margin: 1rem 0;
}
.panel-create-agent .btn-lg { padding: 0.6rem 1.2rem; font-size: 1rem; }
.panel-create-agent .agent-config-block {
    margin-top: 1rem;
}
.panel-create-agent .agent-config-block .label { margin-bottom: 0.5rem; }
.panel-create-agent .deployment-block {
    max-height: 16rem;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: normal;
}
.panel-create-agent .small { font-size: 0.85rem; }
.panel-create-agent .config-format-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}
.panel-create-agent .format-tab.active { background: var(--accent); color: var(--bg); border-color: var(--accent); }

/* OS choice cards */
.os-choice {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin: 1rem 0;
}
.os-card {
    flex: 1;
    min-width: 140px;
    padding: 1.25rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-dark);
    color: var(--text);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    transition: border-color 0.2s, background 0.2s;
}
.os-card:hover { border-color: var(--text-muted); }
.os-card.active { border-color: var(--accent); background: rgba(255, 102, 0, 0.08); }
.os-icon { font-size: 2rem; }
.os-label { font-weight: 600; }

/* Progress bar */
.progress-container {
    margin: 1.5rem 0;
}
.progress-bar-wrap {
    height: 8px;
    background: var(--bg-dark);
    border-radius: 4px;
    overflow: hidden;
}
.progress-bar {
    height: 100%;
    width: 0%;
    background: var(--accent);
    border-radius: 4px;
    transition: width 0.4s ease;
}
.progress-label {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Result block */
.agent-result { margin-top: 1rem; }
.agent-result .result-success { font-weight: 600; color: var(--accent); margin-bottom: 0.5rem; }
.agent-result .label { margin: 0.5rem 0; }
.result-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin: 0.75rem 0;
}
.agent-result .deployment-block { max-height: 12rem; overflow-y: auto; white-space: pre-wrap; }
.panel-gpo .deployment-block { max-height: 10rem; overflow-y: auto; white-space: pre-wrap; }

.form-inline {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}
.form-inline .input-inline {
    padding: 0.5rem 0.75rem;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-family: inherit;
    min-width: 180px;
}
.list-tokens .list-card {
    margin-top: 0.5rem;
}
.text-muted {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0.5rem 0 0;
}
.topbar-user {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-right: 0.5rem;
}
.view-toggle { display: flex; gap: 0.25rem; }
.view-toggle .btn-small { padding: 0.4rem 0.75rem; }
.page-header-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

/* Endpoints: grid view (cards) */
.endpoints-view-grid .endpoint-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}
.endpoint-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.endpoint-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}
.endpoint-card-hostname { font-weight: 600; }
.endpoint-card-meta {
    font-size: 0.9rem;
    color: var(--text-muted);
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.endpoint-card-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* EDR actions dropdown (list + grid) — menu must overflow outside table */
.endpoints-view-list {
    overflow: visible;
}
.endpoints-view-list .table,
.endpoints-view-list .table td,
.endpoints-view-list .table th {
    overflow: visible;
}
.endpoint-actions-cell {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}
.dropdown-edr-actions {
    position: relative;
    display: inline-block;
}
.dropdown-edr-trigger {
    white-space: nowrap;
}
.dropdown-edr-menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 100;
    min-width: 200px;
    margin-top: 2px;
    padding: 0.25rem 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}
.dropdown-edr-form {
    display: block;
    margin: 0;
}
.dropdown-edr-item {
    display: block;
    width: 100%;
    padding: 0.4rem 1rem;
    text-align: left;
    background: none;
    border: none;
    color: var(--text);
    font-size: 0.9rem;
    cursor: pointer;
    font-family: inherit;
}
.dropdown-edr-item:hover {
    background: var(--bg-hover);
}

/* Endpoint edit: action results */
.action-result-text {
    margin: 0;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    max-height: 8rem;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

/* Endpoints: map view (network nodes & edges) — full space + dynamic edges */
.endpoints-view-map {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: calc(100vh - 10rem);
}
.endpoints-view-map .endpoints-map-container {
    width: 100%;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-dark);
}
.endpoints-network-map-wrapper {
    position: relative;
    flex: 1;
    min-height: 420px;
    display: flex;
    flex-direction: column;
    border-radius: var(--radius);
    overflow: hidden;
    background: linear-gradient(160deg, #0d0d0d 0%, #0a0a0a 50%, #050505 100%);
    border: 1px solid var(--border);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255,255,255,0.03);
}
.endpoints-network-map {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-height: 380px;
}
.endpoints-network-svg {
    width: 100%;
    height: 100%;
    min-height: 380px;
}
/* Edges: paths from edge nodes to EDR center */
.network-edge {
    transition: opacity 0.2s ease;
}
.network-edge-offline {
    stroke: rgba(115, 115, 115, 0.2);
    stroke-width: 1.2;
}
/* Dynamic edges for online nodes: flowing dash animation */
.network-edge-online {
    stroke-width: 2.5;
    stroke-dasharray: 8 14;
    animation: network-edge-flow 1.4s linear infinite;
}
@keyframes network-edge-flow {
    to { stroke-dashoffset: -22; }
}
.network-node-wrap:hover .network-edge,
.network-edge:hover {
    opacity: 0.95;
}
/* Nodes */
.network-node {
    transition: transform 0.2s ease, filter 0.2s ease;
}
.network-node-edr {
    stroke: rgba(251, 146, 60, 0.7);
    stroke-width: 2.5;
    filter: url(#node-glow-strong);
    animation: network-edr-pulse 3s ease-in-out infinite;
}
@keyframes network-edr-pulse {
    0%, 100% { filter: url(#node-glow-strong); opacity: 1; }
    50% { filter: url(#node-glow-strong); opacity: 0.92; }
}
.network-node-edge {
    stroke-width: 2;
}
.network-node-online {
    fill: #22c55e;
    stroke: rgba(74, 222, 128, 0.7);
    animation: network-node-online-pulse 2.5s ease-in-out infinite;
}
@keyframes network-node-online-pulse {
    0%, 100% { filter: url(#node-glow); }
    50% { filter: url(#node-glow); opacity: 0.95; }
}
.network-node-offline {
    fill: var(--text-muted);
    stroke: rgba(115, 115, 115, 0.4);
}
.network-node-wrap:hover .network-node-edge {
    transform: scale(1.15);
    filter: brightness(1.25);
}
.network-node-wrap:focus {
    outline: none;
}
.network-node-wrap:focus .network-node-edge {
    filter: drop-shadow(0 0 10px var(--accent));
}
/* Labels */
.network-label {
    font-size: 11px;
    fill: var(--text-muted);
    font-family: inherit;
    pointer-events: none;
}
.network-label-edr {
    font-size: 13px;
    font-weight: 600;
    fill: var(--text);
}
.network-node-wrap:hover .network-label {
    fill: var(--text);
}
/* Legend under map */
.endpoints-network-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 0.75rem;
    padding: 0.5rem 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.network-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}
.network-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.network-legend-dot-edr { background: var(--accent); }
.network-legend-dot-online { background: #22c55e; }
.network-legend-dot-offline { background: var(--text-muted); }
.endpoints-map-legend {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}
.endpoints-map-legend a { color: var(--accent); }
.pagination-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}
.pagination-info {
    font-size: 0.9rem;
    color: var(--text-muted);
}
.event-type {
    font-size: 0.8rem;
    color: var(--accent);
    text-transform: lowercase;
}
