/* Agonist Web UI — FortiGate-style admin panel */

:root {
    --sidebar-bg: #1e293b;
    --sidebar-hover: #334155;
    --sidebar-active: #0ea5e9;
    --sidebar-text: #94a3b8;
    --sidebar-text-active: #ffffff;
    --sidebar-width: 240px;

    --content-bg: #f8fafc;
    --card-bg: #ffffff;
    --border: #e2e8f0;

    --accent: #0ea5e9;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;

    --text: #1e293b;
    --text-muted: #64748b;
    --text-light: #94a3b8;

    --topbar-height: 48px;
    --topbar-bg: #0f172a;

    --radius: 6px;
    --shadow: 0 1px 3px rgba(0,0,0,.1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    color: var(--text);
    background: var(--content-bg);
}

/* ── Top Bar ─────────────────────────────────────────────── */
.top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--topbar-height);
    background: var(--topbar-bg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 150;
    gap: 16px;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.top-bar-logo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0;
}

.brand-icon {
    display: inline-block;
    width: 26px;
    height: 26px;
    object-fit: contain;
    flex: 0 0 auto;
    /* Koyu üst-bar (#0f172a) için açık/beyaz-çizgi nav varyantı → çip gerekmez */
}

.login-brand-icon {
    width: 72px;
    height: 72px;
    object-fit: contain;
    display: block;
    margin: 0 auto 12px;
}

.top-bar-version {
    font-size: 11px;
    color: #64748b;
    white-space: nowrap;
}

.top-bar-center {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    min-width: 0;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* Global / Campaign toggle */
.top-bar-ctx-form { display: inline-flex; }

.top-bar-ctx-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: var(--radius);
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.12);
    color: #cbd5e1;
    font-size: 13px;
    cursor: pointer;
    transition: background .15s, border-color .15s, opacity .15s;
    white-space: nowrap;
}

.top-bar-ctx-btn.active {
    background: rgba(14,165,233,.2);
    border-color: var(--accent);
    color: #fff;
}

.top-bar-ctx-btn:not(.active) {
    opacity: 0.5;
}
.top-bar-ctx-btn:not(.active):hover {
    opacity: 0.8;
}

.top-bar-ctx-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.top-bar-dropdown-wrap.dimmed .top-bar-campaign-btn {
    opacity: 0.5;
}
.top-bar-dropdown-wrap.dimmed .top-bar-campaign-btn:hover {
    opacity: 0.8;
}

/* Campaign selector button */
.top-bar-campaign-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: var(--radius);
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.12);
    font-size: 13px;
    color: #e2e8f0;
    cursor: pointer;
    transition: background .15s, border-color .15s;
    white-space: nowrap;
}

.top-bar-campaign-btn:hover {
    background: rgba(255,255,255,.14);
    border-color: rgba(255,255,255,.2);
}

.top-bar-campaign-btn .campaign-name {
    font-weight: 600;
    color: #fff;
}

.top-bar-campaign-btn .topbar-no-campaign-text {
    color: #94a3b8;
    font-weight: 500;
}

.dropdown-caret {
    font-size: 10px;
    color: #64748b;
    transition: transform .2s;
    margin-left: 2px;
}

.top-bar-dropdown-wrap {
    position: relative;
}

.top-bar-dropdown-wrap.open .dropdown-caret {
    transform: rotate(180deg);
}

/* Dropdown panels */
.top-bar-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    min-width: 260px;
    background: #1e293b;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0,0,0,.35);
    z-index: 200;
    overflow: hidden;
}

.top-bar-dropdown-right {
    left: auto;
    right: 0;
    transform: none;
}

.top-bar-dropdown-wrap.open .top-bar-dropdown {
    display: block;
}

/* Campaign items inside dropdown */
.campaign-dropdown-form {
    display: block;
}

.campaign-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 14px;
    background: none;
    border: none;
    color: #cbd5e1;
    font-size: 13px;
    cursor: pointer;
    text-align: left;
    transition: background .15s;
}

.campaign-dropdown-btn:hover {
    background: rgba(255,255,255,.08);
}

.campaign-dropdown-btn.active {
    background: rgba(14,165,233,.15);
    color: #fff;
    font-weight: 500;
}

.dropdown-empty {
    padding: 12px 14px;
    color: #64748b;
    font-size: 12px;
    text-align: center;
}

.dropdown-action-btn {
    display: block;
    width: 100%;
    padding: 10px 14px;
    background: none;
    border: none;
    border-top: 1px solid rgba(255,255,255,.08);
    color: var(--accent);
    font-size: 13px;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: background .15s;
}

.dropdown-action-btn:hover {
    background: rgba(255,255,255,.06);
}

.dropdown-logout-btn {
    color: var(--danger);
}

/* User button */
.top-bar-user-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: var(--radius);
    background: none;
    border: 1px solid transparent;
    color: #cbd5e1;
    font-size: 13px;
    cursor: pointer;
    transition: background .15s;
}

.top-bar-user-btn:hover {
    background: rgba(255,255,255,.08);
}

.top-bar-user-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Language button */
.top-bar-lang-btn {
    padding: 5px 10px;
    border-radius: var(--radius);
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.12);
    color: #cbd5e1;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
}

.top-bar-lang-btn:hover {
    background: var(--sidebar-active);
    color: #fff;
}

/* Layout */
.layout {
    display: flex;
    min-height: 100vh;
    padding-top: var(--topbar-height);
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    position: fixed;
    top: var(--topbar-height);
    left: 0;
    height: calc(100vh - var(--topbar-height));
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    z-index: 100;
}

/* (topbar moved to top-bar in header) */

.nav-links {
    list-style: none;
    padding: 8px 0;
    flex: 1;
}

.nav-links li a {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 13px;
    transition: background .15s, color .15s;
}

.nav-links li a:hover {
    background: var(--sidebar-hover);
    color: #fff;
}

.nav-links li a.active {
    background: var(--sidebar-active);
    color: #fff;
    font-weight: 500;
}

.nav-divider {
    height: 1px;
    background: rgba(255,255,255,.08);
    margin: 6px 0;
}

/* ── Nav icons ─────────────────────────────────────────────── */
.nav-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    vertical-align: -2px;
    margin-right: 8px;
}

/* ── Nav groups (always open) ──────────────────────────────── */
.nav-group { position: relative; }

.nav-group-label {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    color: var(--sidebar-text);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    user-select: none;
    opacity: 0.6;
}

.nav-group-items {
    list-style: none;
    padding: 0;
    display: block;
}
.nav-group-items li a {
    padding-left: 28px;
    font-size: 12.5px;
}

/* ── Ayarlar sayfa-içi dikey navigasyon rayı (İş #40) ─────────── */
.settings-layout {
    display: flex;
    gap: 28px;
    align-items: flex-start;
}
.settings-nav {
    flex: 0 0 220px;
    position: sticky;
    top: 24px;
}
.settings-nav-group + .settings-nav-group { margin-top: 20px; }
.settings-nav-label {
    display: block;
    padding: 4px 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    opacity: 0.75;
}
.settings-nav-group ul {
    list-style: none;
    margin: 6px 0 0;
    padding: 0;
}
.settings-nav-group li a {
    display: block;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13.5px;
    color: var(--text);
    text-decoration: none;
    border-left: 2px solid transparent;
}
.settings-nav-group li a:hover { background: var(--surface-hover, rgba(127,127,127,.08)); }
.settings-nav-group li a.active {
    background: var(--surface-hover, rgba(127,127,127,.10));
    border-left-color: var(--primary);
    color: var(--primary);
    font-weight: 600;
}
.settings-layout .settings-content { flex: 1; min-width: 0; }

@media (max-width: 860px) {
    .settings-layout { flex-direction: column; }
    .settings-nav { position: static; flex-basis: auto; width: 100%; }
    .settings-nav-group ul { display: flex; flex-wrap: wrap; gap: 4px; }
    .settings-nav-group li a { border-left: none; }
}

.nav-bottom {
    padding-top: 0;
    border-top: 1px solid rgba(255,255,255,.08);
}

/* (sidebar-footer, lang-btn moved to top-bar) */

/* Content */
.content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 24px 32px;
    min-width: 0;
}

/* Page header */
.page-header {
    margin-bottom: 24px;
}

.page-header h1 {
    font-size: 22px;
    font-weight: 600;
    color: var(--text);
}

/* Card */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.card h2 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text);
}

/* Widget grid */
.widget-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.widget {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow);
}

.widget-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--accent);
    line-height: 1.2;
}

.widget-phase .widget-value {
    font-size: 18px;
    text-transform: uppercase;
}

.widget-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Data table */
.data-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.data-table th,
.data-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Auto-layout tablolar icin (kolon genisligi iceriye gore) */
.data-table.table-auto {
    table-layout: auto;
}

/* Truncation utility — tek satir, tasarsa ... */
.cell-truncate {
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Wrap utility — icerik sarilar ama max-width ile sinirli */
.cell-wrap {
    max-width: 250px;
    word-break: break-word;
}

/* Port tag container — tasmayi onle */
.cell-ports {
    max-width: 200px;
    overflow: hidden;
    line-height: 1.6;
}

.data-table th {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #f8fafc;
    cursor: default;
}

.data-table th[data-sort] { cursor: pointer; }
.data-table th[data-sort]:hover { color: var(--accent); }

.data-table tbody tr:hover {
    background: #f1f5f9;
}

.data-table a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

.data-table a:hover { text-decoration: underline; }

/* Column width hints — campaign table */
.col-id { width: 5%; }
.col-name { width: 23%; }
.col-subnet { width: 15%; }
.col-phase { width: 13%; }
.col-status { width: 10%; }
.col-actions { width: 34%; }
.col-ip { width: 130px; }
.col-vendor { width: 15%; }
.col-model { width: 15%; }
.col-ports-col { width: 18%; }
.col-risk { width: 10%; }
.col-cpu { width: 8%; }
.col-vulns { width: 8%; }
.col-desc { width: 30%; }

/* Badge — text-transform yok (Türkçe İ sorunu) */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.badge-running { background: #dcfce7; color: #166534; }
.badge-completed { background: #dbeafe; color: #1e40af; }
.badge-aborted { background: #fee2e2; color: #991b1b; }
.badge-critical { background: #fee2e2; color: #991b1b; }
.badge-high { background: #ffedd5; color: #9a3412; }
.badge-medium { background: #fef9c3; color: #854d0e; }
.badge-low { background: #dcfce7; color: #166534; }

/* Semantic security badges — defense perspective */
.badge-vuln { background: #fee2e2; color: #991b1b; }    /* Red — vulnerable */
.badge-safe { background: #dcfce7; color: #166534; }     /* Green — defended */
.badge-neutral { background: #e2e8f0; color: #475569; }  /* Gray — inconclusive */

/* Port tag */
.port-tag {
    display: inline-block;
    padding: 1px 6px;
    background: #e2e8f0;
    border-radius: 3px;
    font-size: 11px;
    margin: 1px 2px;
    font-family: monospace;
}

/* Detail grid */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 8px;
}

.detail-grid div {
    padding: 4px 0;
    font-size: 13px;
}

/* Forms */
.form-inline {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.form-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 480px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.form-input {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
    color: var(--text);
    background: #fff;
    min-width: 200px;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(14,165,233,.15);
}

/* Buttons */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background .15s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #0284c7; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #16a34a; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-warning { background: #f59e0b; color: #fff; }
.btn-warning:hover { background: #d97706; }
.btn-sm { padding: 4px 10px; font-size: 12px; }

/* Flash messages */
.flash-container {
    margin-bottom: 20px;
}

.flash {
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    animation: flashIn .3s ease;
}

@keyframes flashIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.flash-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.flash-error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.flash-warning { background: #fef9c3; color: #854d0e; border: 1px solid #fde68a; }
.flash-info { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }

.flash-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: inherit;
    opacity: .6;
    padding: 0 4px;
}

.flash-close:hover { opacity: 1; }

/* Progress */
.progress-area {
    margin-top: 16px;
    padding: 12px;
    background: #f1f5f9;
    border-radius: var(--radius);
}

.progress-text {
    font-size: 13px;
    color: var(--text-muted);
}

/* Page subtitle */
.page-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Card header row — title + KC badge */
.card-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.card-header-row h2 {
    margin-bottom: 0;
}

/* Kill Chain phase badges */
.kc-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.kc-weaponization { background: #ede9fe; color: #5b21b6; }
.kc-delivery { background: #fce7f3; color: #9d174d; }
.kc-exploitation { background: #ffedd5; color: #9a3412; }
.kc-installation { background: #fef9c3; color: #854d0e; }
.kc-c2 { background: #dbeafe; color: #1e40af; }
.kc-impact { background: #fee2e2; color: #991b1b; }

/* Smaller form input */
.form-input-sm {
    min-width: 100px;
}

/* Progress bar */
.progress-bar-container {
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
    margin: 8px 0;
}

.progress-bar {
    height: 100%;
    background: var(--accent);
    transition: width 0.3s ease;
    border-radius: 4px;
}

.progress-stats {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

.progress-stats span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.live-count {
    font-weight: 600;
    color: var(--accent);
}

.progress-section {
    padding: 12px 0;
}
.progress-label {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 6px;
}
.progress-bar-error {
    background: var(--danger, #e74c3c) !important;
}

/* Multi-target group progress */
.group-progress-area {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.group-progress-item {
    display: grid;
    grid-template-columns: 200px 1fr 120px;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.group-label {
    font-family: monospace;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.group-stats {
    color: var(--text-muted);
    text-align: right;
    white-space: nowrap;
}

.progress-bar-sm {
    height: 5px;
}

/* Textarea form input */
textarea.form-input,
.form-textarea {
    min-height: 60px;
    resize: vertical;
    font-family: monospace;
    font-size: 13px;
}

.form-help {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

.required-mark { color: var(--danger); margin-left: 2px; }

.field-error {
    display: none;
    font-size: 11px;
    color: var(--danger);
    margin-top: 2px;
}
.field-error:not(:empty) { display: block; }

.form-input.has-error {
    border-color: var(--danger);
    box-shadow: 0 0 0 2px rgba(239,68,68,.12);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 13px;
}

/* ── Modal ── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}
.modal-box {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 24px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 8px 32px rgba(0,0,0,.3);
}
.modal-title {
    margin: 0 0 16px;
    font-size: 16px;
}

/* ── Toast Notifications ── */
.toast-container {
    position: fixed;
    top: 60px;
    right: 16px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}
.toast {
    padding: 10px 16px;
    border-radius: var(--radius);
    font-size: 13px;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,.2);
    opacity: 0;
    transform: translateX(40px);
    transition: opacity .3s, transform .3s;
    pointer-events: auto;
    max-width: 360px;
}
.toast-visible { opacity: 1; transform: translateX(0); }
.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-warning { background: var(--warning); color: #1e293b; }
.toast-info { background: var(--info); }

/* ── Keyboard shortcut badge ── */
kbd {
    display: inline-block;
    padding: 2px 6px;
    font-size: 12px;
    font-family: monospace;
    background: var(--content-bg);
    border: 1px solid var(--border);
    border-radius: 3px;
    box-shadow: 0 1px 0 rgba(0,0,0,.1);
}

/* ── Form Row (inline form layout) ── */
.form-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: flex-end;
}
.form-row > .form-group { flex: 1; min-width: 150px; }

/* ── Utility Classes ── */
.d-none { display: none; }
.d-flex { display: flex; }
.d-block { display: block; }
.d-inline-flex { display: inline-flex; }
.flex-wrap { flex-wrap: wrap; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.justify-end { justify-content: flex-end; }
.justify-between { justify-content: space-between; }
.gap-4 { gap: 4px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.p-8 { padding: 8px; }
.p-12 { padding: 12px; }
.w-100 { width: 100%; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.font-mono { font-family: monospace; }
.overflow-y-auto { overflow-y: auto; }
.max-h-150 { max-height: 150px; }
.max-h-400 { max-height: 400px; }
.max-h-600 { max-height: 600px; }

/* Live device table (scanning) */
.live-devices {
    margin-top: 12px;
    max-height: 300px;
    overflow-y: auto;
}

.live-devices .data-table {
    font-size: 12px;
}

/* Result area (operations) */
.result-area {
    margin-top: 12px;
    padding: 12px;
    background: #f1f5f9;
    border-radius: var(--radius);
    font-size: 13px;
    display: none;
}

.result-area.visible {
    display: block;
}

.result-area pre {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-all;
    font-family: monospace;
    font-size: 12px;
}

.result-area.result-success {
    background: #dcfce7;
    color: #166534;
}

.result-area.result-error {
    background: #fee2e2;
    color: #991b1b;
}

/* Monitor live area */
.monitor-area {
    margin-top: 12px;
    padding: 12px;
    background: #0f172a;
    color: #22c55e;
    border-radius: var(--radius);
    font-family: monospace;
    font-size: 12px;
    max-height: 300px;
    overflow-y: auto;
    display: none;
}

.monitor-area.visible {
    display: block;
}

.monitor-line {
    padding: 2px 0;
    border-bottom: 1px solid rgba(255,255,255,.05);
}

/* Action bar (device detail) */
.action-bar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

/* Bulk action bar */
.bulk-action-bar {
    background: var(--accent);
    color: #fff;
    padding: 8px 16px;
    border-radius: var(--radius);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
}
.bulk-action-bar .btn-primary {
    background: rgba(255,255,255,.25);
    border-color: rgba(255,255,255,.4);
    color: #fff;
}
.bulk-action-bar .btn-primary:hover { background: rgba(255,255,255,.4); }
.bulk-action-bar .btn-warning {
    background: #f59e0b;
    border-color: #f59e0b;
    color: #fff;
}
.bulk-action-bar .btn-warning:hover { background: #d97706; }
.bulk-action-bar .result-area {
    color: var(--text, #1e293b);
    font-weight: 400;
}

/* Select column */
.col-select { width: 32px; text-align: center; }
.col-select input[type="checkbox"] { cursor: pointer; width: 16px; height: 16px; }

/* Action cell (device table) */
.action-cell {
    white-space: normal;
    overflow: visible !important;
    text-overflow: clip !important;
    min-width: 220px;
}

.action-cell .btn {
    margin: 2px;
    display: inline-block;
}

.action-cell .result-area {
    white-space: normal;
    margin-top: 4px;
}

/* Campaign action cell — butonlar yan yana, gerekirse alt satira */
.action-cell-wrap {
    white-space: normal;
    min-width: 120px;
}

.action-cell-wrap form {
    display: inline-block;
    margin: 2px 2px;
}

/* Widget grid columns */
.widget-grid-4 {
    grid-template-columns: repeat(4, 1fr);
}
.widget-grid-5 {
    grid-template-columns: repeat(5, 1fr);
}

/* Distribution grid (severity + vendor side by side) */
.dist-grid {
    display: grid;
    grid-template-columns: 2fr 3fr;
    gap: 20px;
    margin-bottom: 20px;
}

/* Bar chart */
.bar-chart {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bar-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bar-label {
    width: 80px;
    min-width: 80px;
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 600;
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Vendor chart etiketleri için geniş alan */
.bar-label-wide {
    width: 120px;
    min-width: 120px;
}

.bar-track {
    flex: 1;
    height: 24px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width .3s ease;
    min-width: 2px;
}

.bar-critical { background: var(--danger); }
.bar-high { background: #f97316; }
.bar-medium { background: var(--warning); }
.bar-low { background: var(--success); }
.bar-vendor { background: var(--accent); }

.bar-value {
    min-width: 36px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

/* Active task rows */
.active-task-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    margin-bottom: 8px;
    background: rgba(14,165,233,0.04);
    border-left: 3px solid var(--accent, #0ea5e9);
    border-radius: 6px;
    font-size: 13px;
    transition: background 0.2s;
}

.active-task-row:hover {
    background: rgba(14,165,233,0.08);
}

.task-spinner {
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(14,165,233,0.2);
    border-top-color: var(--accent, #0ea5e9);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
}

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

.task-info {
    flex: 1; min-width: 0;
}

.task-info-top {
    display: flex; align-items: baseline; gap: 8px;
}

.task-type {
    font-weight: 700; font-size: 0.95em;
}

.task-target {
    font-family: monospace; font-size: 0.85em; color: #94a3b8;
    background: rgba(255,255,255,0.06); padding: 2px 8px; border-radius: 4px;
}

.task-info-detail {
    display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; align-items: baseline;
}
.task-detail-msg {
    font-size: 0.8em; color: #94a3b8;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    max-width: 280px;
}
.task-detail-stat {
    font-size: 0.8em; font-weight: 600; color: #0ea5e9;
    background: rgba(14,165,233,0.1); padding: 1px 6px; border-radius: 3px;
}
.task-detail-found {
    font-size: 0.8em; font-weight: 600; color: #22c55e;
    background: rgba(34,197,94,0.1); padding: 1px 6px; border-radius: 3px;
}
.task-detail-ip {
    font-size: 0.78em; font-family: monospace; color: #64748b;
    background: rgba(255,255,255,0.04); padding: 1px 6px; border-radius: 3px;
}

.task-progress-wrap {
    display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}

.task-progress-bar {
    width: 140px;
    height: 10px;
    background: rgba(255,255,255,0.06);
    border-radius: 5px;
    overflow: hidden;
}

.task-progress-bar .progress-bar {
    height: 100%;
    border-radius: 5px;
    background: linear-gradient(90deg, #0ea5e9, #38bdf8);
    transition: width 0.4s ease;
}

.task-percent {
    font-weight: 700;
    color: var(--accent, #0ea5e9);
    min-width: 38px;
    font-size: 0.92em;
}

.task-elapsed {
    font-size: 0.82em; flex-shrink: 0; min-width: 52px; text-align: right;
    color: #64748b;
    background: rgba(255,255,255,0.04); padding: 2px 8px; border-radius: 4px;
}

/* Export bar */
.export-bar {
    display: flex;
    gap: 8px;
}

/* Filter bar */
.filter-bar .form-inline {
    flex-wrap: wrap;
    gap: 8px;
    align-items: flex-end;
}
.filter-bar .form-group {
    margin-bottom: 0;
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 16px;
    justify-content: center;
}

.page-link {
    display: inline-block;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
    color: var(--text);
    text-decoration: none;
    cursor: pointer;
    background: var(--card-bg);
    transition: background .15s, color .15s;
}

.page-link:hover:not(.disabled):not(.active) {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.page-link.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    font-weight: 600;
}

.page-link.disabled {
    color: var(--text-light);
    cursor: default;
    background: var(--content-bg);
}

.page-info {
    font-size: 12px;
    color: var(--text-muted);
    margin-left: 8px;
}

/* Breadcrumb */
.breadcrumb {
    font-size: 13px;
    margin-bottom: 16px;
    color: var(--text-muted);
}

.breadcrumb a {
    color: var(--accent);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb-sep {
    margin: 0 6px;
    color: var(--text-light);
}

.breadcrumb-current {
    color: var(--text);
    font-weight: 500;
}

/* (sidebar-user, logout-btn moved to top-bar) */

/* Utility */
.text-muted { color: var(--text-muted); }

/* ── Hamburger menu button ───────────────────────────────── */
.hamburger {
    display: none;
    position: fixed;
    top: calc(var(--topbar-height) + 12px);
    left: 12px;
    z-index: 200;
    background: var(--sidebar-bg);
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 1.2em;
    cursor: pointer;
}

/* ── Sidebar overlay (mobile) ─────────────────────────────── */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: var(--topbar-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,.4);
    z-index: 110;
}

/* ── Mobile Responsive ────────────────────────────────────── */
@media (max-width: 768px) {
    .hamburger {
        display: block;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform .25s ease;
    }
    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay.visible {
        display: block;
    }

    .content {
        margin-left: 0;
        padding: 16px 12px 16px;
    }

    .top-bar-version { display: none; }
    .top-bar-user-btn span { display: none; }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .form-inline {
        flex-direction: column;
    }
    .form-group {
        width: 100%;
    }
    .form-input {
        width: 100%;
    }

    .widget-grid-4, .widget-grid-5 {
        grid-template-columns: repeat(2, 1fr);
    }

    .task-progress-wrap { display: none; }

    .data-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }

    .card-header-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .filter-bar .form-inline {
        flex-direction: column;
    }

    .export-bar {
        flex-wrap: wrap;
    }

    .action-bar {
        flex-direction: column;
        gap: 6px;
    }

    .card-row { flex-direction: column; }
}

/* ── Passive Monitoring — Layout ──────────────────────────── */
.card-row { display: flex; gap: 20px; flex-wrap: wrap; }
.card.half { flex: 1; min-width: 280px; }
.card.third { flex: 1; min-width: 200px; }

.stat-big {
    font-size: 32px;
    font-weight: 700;
    color: var(--accent);
    line-height: 1.2;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 8px;
}

.stat-item { text-align: center; }
.stat-label { font-size: 11px; text-transform: uppercase; color: var(--text-muted); display: block; }
.stat-value { font-size: 18px; font-weight: 600; display: block; }

.capture-controls { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.capture-stats { display: flex; gap: 16px; font-size: 13px; }
.status-badge { display: inline-block; padding: 4px 12px; border-radius: 10px; font-size: 12px; font-weight: 600; }
.status-running { background: #dcfce7; color: #166534; }
.live-packets { margin-top: 16px; max-height: 500px; overflow-y: auto; }
.tag { display: inline-block; padding: 1px 6px; background: #e2e8f0; border-radius: 3px; font-size: 11px; margin: 1px 2px; }

/* ── Utility classes ──────────────────────────────────────── */
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.checkbox-label { display: flex; align-items: center; gap: 6px; cursor: pointer; font-size: 13px; }
.btn-secondary { background: var(--border); color: var(--text); }
.btn-secondary:hover { background: #cbd5e1; }

/* ── Device class badges ──────────────────────────────────── */
.badge-ot { background: #dbeafe; color: #1e40af; font-weight: 600; }
.badge-it { background: #f3e8ff; color: #6b21a8; font-weight: 600; }
.badge-unknown { background: #f3f4f6; color: #6b7280; }

/* ── Severity badge extras ────────────────────────────────── */
.badge-info { background: #dbeafe; color: #1e40af; }
.badge-warning { background: #fef9c3; color: #854d0e; }

/* ── Anomaly row highlight ────────────────────────────────── */
.row-anomaly { background: #fff7ed !important; }
.row-anomaly:hover { background: #ffedd5 !important; }

/* ── Proxy / table row states ────────────────────────────── */
.row-danger { background: #fee2e2 !important; }
.row-danger:hover { background: #fecaca !important; }
.row-warning { background: #fff3cd !important; }
.row-warning:hover { background: #fef08a !important; }
.row-success { background: #dcfce7 !important; }
.row-success:hover { background: #bbf7d0 !important; }

.progress-bar-wrapper {
    background: var(--border);
    border-radius: 4px;
    height: 24px;
    overflow: hidden;
}
.progress-bar-wrapper > div {
    height: 100%;
    background: var(--accent);
    transition: width .3s ease;
}

/* ── Intent badges ────────────────────────────────────────── */
.intent-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.intent-reconnaissance { background: #dbeafe; color: #1e40af; }
.intent-actuation { background: #ffedd5; color: #9a3412; }
.intent-disruption { background: #fee2e2; color: #991b1b; }
.intent-exfiltration { background: #ede9fe; color: #5b21b6; }
.intent-persistence { background: #fef9c3; color: #854d0e; }
.intent-lateral { background: #fce7f3; color: #9d174d; }

/* ── Expandable observation detail row ────────────────────── */
.obs-clickable { cursor: pointer; }
.obs-clickable:hover { background: #e2e8f0 !important; }

.detail-row { display: none; }
.detail-row.open { display: table-row; }
.detail-row td {
    padding: 12px 20px;
    background: #f1f5f9;
    border-bottom: 2px solid var(--border);
}

.detail-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 8px 24px;
    font-size: 12px;
}

.detail-content .detail-item {
    display: flex;
    gap: 6px;
}

.detail-content .detail-key {
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 10px;
    min-width: 80px;
    flex-shrink: 0;
}

.detail-content .detail-val {
    font-family: monospace;
    word-break: break-all;
}

/* ── Register Monitor ──────────────────────────────────────────────── */

.register-flash { animation: regFlash 0.6s ease; }
@keyframes regFlash { 0% { background: #fef08a; } 100% { background: transparent; } }
.register-active { font-weight: 600; color: var(--warning); }
.register-static { color: var(--text-muted); }
.monitor-status { display: inline-block; padding: 4px 12px; border-radius: 10px; font-size: 12px; font-weight: 600; }
.monitor-running { background: #dcfce7; color: #166534; }

/* ── Operations page — card descriptions, warnings, results ──── */
.card-description { color: var(--text-muted); font-size: 0.9em; margin: 4px 0 12px; line-height: 1.5; }
.card-warning { background: rgba(255,152,0,0.1); border-left: 3px solid #ff9800; padding: 8px 12px; margin: 8px 0; font-size: 0.85em; color: #9a3412; }
.badge-beta { background: #ff9800; color: #fff; padding: 2px 8px; border-radius: 4px; font-size: 0.75em; font-weight: 600; vertical-align: middle; }

.result-card { padding: 12px; border-radius: var(--radius); background: var(--content-bg); }
.result-row { display: flex; gap: 8px; padding: 4px 0; border-bottom: 1px solid var(--border); align-items: baseline; }
.result-row:last-child { border-bottom: none; }
.result-row span:first-child { font-weight: 600; min-width: 100px; color: var(--text-muted); flex-shrink: 0; }
.result-actions { margin-top: 8px; }

.pkt-field { display: flex; gap: 8px; padding: 2px 4px; font-family: monospace; font-size: 0.85em; align-items: baseline; }
.pkt-field .pkt-label { color: var(--text-muted); min-width: 130px; flex-shrink: 0; font-weight: 600; }
.pkt-field .pkt-hex { word-break: break-all; }

/* ── Operations Tab Layout ── */
.ops-tabs { display: flex; border-bottom: 2px solid var(--border); margin-bottom: 16px; }
.ops-tab-btn {
    padding: 10px 20px; border: none; background: none; cursor: pointer;
    font-weight: 600; font-size: 13px; color: var(--text-muted);
    border-bottom: 2px solid transparent; margin-bottom: -2px;
    transition: color 0.15s, border-color 0.15s;
}
.ops-tab-btn:hover { color: var(--text); }
.ops-tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
.ops-tab-pane { display: none; }
.ops-tab-pane.active { display: block; }

/* ── Loading spinner on buttons ── */
.btn.loading { position: relative; pointer-events: none; }
.btn.loading::after {
    content: ''; display: inline-block; width: 14px; height: 14px;
    border: 2px solid rgba(255,255,255,0.3); border-top-color: #fff;
    border-radius: 50%; animation: btn-spin 0.6s linear infinite;
    margin-left: 6px; vertical-align: middle;
}
@keyframes btn-spin { to { transform: rotate(360deg); } }

/* ── PLC Stop/Start button colors ── */
.btn-success { background: #16a34a; color: #fff; border: none; }
.btn-success:hover { background: #15803d; }

.monitor-redirect-card { text-align: center; padding: 24px; }
.monitor-redirect-card p { margin-bottom: 16px; }

/* ── Communication Map ─────────────────────────────────────────────── */

.map-controls { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.map-controls select { padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 13px; background: var(--card-bg); }

.map-layout { display: flex; gap: 16px; }

.cy-container {
    flex: 1;
    min-height: 400px;
    height: calc(100vh - 310px);
    background: #f1f5f9;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    position: relative;
}

.map-sidebar {
    width: 280px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: calc(100vh - 320px);
    overflow-y: auto;
}

.map-sidebar .card { margin-bottom: 0; }
.map-sidebar h3 { font-size: 13px; margin-bottom: 8px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }

.legend-item { display: flex; align-items: center; gap: 8px; padding: 3px 0; font-size: 13px; }
.legend-color { width: 16px; height: 16px; border-radius: 50%; flex-shrink: 0; border: 2px solid transparent; }
.legend-icon { width: 22px; height: 20px; flex-shrink: 0; }
.legend-line { width: 24px; height: 3px; border-radius: 2px; flex-shrink: 0; }
.legend-line-dashed { width: 24px; height: 0; border-top: 3px dashed var(--danger); flex-shrink: 0; }

.map-info-panel { display: none; }
.map-info-panel.active { display: block; }
.info-row { display: flex; justify-content: space-between; padding: 4px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.info-row:last-child { border-bottom: none; }
.info-key { color: var(--text-muted); font-weight: 600; }
.info-val { text-align: right; word-break: break-all; max-width: 160px; }

.talker-item { display: flex; justify-content: space-between; align-items: center; padding: 4px 0; font-size: 13px; border-bottom: 1px solid var(--border); }
.talker-item:last-child { border-bottom: none; }
.talker-ip { font-family: monospace; font-size: 12px; }
.talker-count { font-weight: 600; color: var(--accent); }

.map-empty { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.map-empty svg { width: 64px; height: 64px; margin-bottom: 12px; opacity: 0.4; }

@media (max-width: 768px) {
    .map-layout { flex-direction: column; }
    .map-sidebar { width: 100%; max-height: none; }
    .cy-container { min-height: 400px; }
}

/* ── Kill Chain Stepper ── */
.kc-stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 12px 0;
    overflow-x: auto;
}
.kc-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
}
.kc-step-dot {
    width: 32px; height: 32px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.85em;
    background: var(--card-bg, #1e293b);
    border: 2px solid #475569;
    color: #94a3b8;
    transition: all 0.3s;
}
.kc-step.completed .kc-step-dot {
    background: #22c55e; border-color: #22c55e; color: #fff;
}
.kc-step.active .kc-step-dot {
    background: #0ea5e9; border-color: #0ea5e9; color: #fff;
    animation: kc-pulse 2s infinite;
}
@keyframes kc-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(14,165,233,0.4); }
    50% { box-shadow: 0 0 0 8px rgba(14,165,233,0); }
}
.kc-step-label {
    font-size: 0.72em; margin-top: 6px; color: #94a3b8;
    text-align: center; white-space: nowrap;
}
.kc-step.completed .kc-step-label { color: #22c55e; }
.kc-step.active .kc-step-label { color: #0ea5e9; font-weight: 600; }
.kc-step-line {
    flex: 1; height: 2px; min-width: 20px;
    background: #475569; margin: 0 4px; margin-bottom: 20px;
}
.kc-step-line.completed { background: #22c55e; }
.widget-sub { font-size: 0.75em; margin-top: 4px; }

/* ── Attack Flow — Stepper count ── */
.kc-step-count {
    font-size: 0.65em; color: #64748b; text-align: center; margin-top: 2px;
}
.kc-step.completed .kc-step-count { color: #22c55e; }
.kc-step.active .kc-step-count { color: #0ea5e9; }

/* ── Attack Flow — Filter bar ── */
.af-filter-bar { display: flex; gap: 4px; flex-wrap: wrap; }
.af-filter-btn {
    padding: 4px 12px; font-size: 0.78em; border-radius: 999px; cursor: pointer;
    background: var(--card-bg, #1e293b); color: #94a3b8;
    border: 1px solid var(--border, #334155); transition: all 0.2s;
}
.af-filter-btn:hover { background: rgba(255,255,255,0.06); }
.af-filter-btn.active {
    background: #0ea5e9; color: #fff; border-color: #0ea5e9;
}

/* ── Attack Flow — Timeline ── */
.af-timeline-scroll { max-height: 400px; overflow-y: auto; }
.af-tl-entry {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.04);
}
.af-tl-entry:last-child { border-bottom: none; }
.af-tl-time {
    flex-shrink: 0; width: 140px; font-size: 0.78em; color: #64748b;
    font-family: monospace;
}
.af-tl-dot {
    flex-shrink: 0; width: 10px; height: 10px; border-radius: 50%;
    margin-top: 5px; background: #475569;
}
.af-tl-dot-completed { background: #22c55e; }
.af-tl-dot-active { background: #0ea5e9; }
.af-tl-dot-pending { background: #475569; }
.af-tl-body { flex: 1; display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; }
.af-tl-badge {
    display: inline-block; padding: 1px 8px; border-radius: 4px;
    font-size: 0.72em; font-weight: 600; white-space: nowrap;
}
.af-tl-action { font-size: 0.88em; }
.af-tl-target {
    font-size: 0.8em; color: #94a3b8; font-family: monospace;
    background: rgba(255,255,255,0.04); padding: 1px 6px; border-radius: 3px;
}
.af-tl-details {
    font-size: 0.75em; width: 100%; margin-top: 2px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Phase badge renkleri */
.af-tl-phase-recon { background: #1e3a5f; color: #93c5fd; }
.af-tl-phase-weaponization { background: #422006; color: #fde68a; }
.af-tl-phase-delivery { background: #431407; color: #fed7aa; }
.af-tl-phase-exploitation { background: #450a0a; color: #fca5a5; }
.af-tl-phase-installation { background: #3b0764; color: #d8b4fe; }
.af-tl-phase-c2 { background: #1e1b4b; color: #a5b4fc; }
.af-tl-phase-impact { background: #500724; color: #f9a8d4; }

/* Filter butonlari icin ayni renkler */
.af-filter-btn.af-tl-phase-recon.active { background: #1e40af; border-color: #1e40af; color: #fff; }
.af-filter-btn.af-tl-phase-weaponization.active { background: #854d0e; border-color: #854d0e; color: #fff; }
.af-filter-btn.af-tl-phase-delivery.active { background: #9a3412; border-color: #9a3412; color: #fff; }
.af-filter-btn.af-tl-phase-exploitation.active { background: #991b1b; border-color: #991b1b; color: #fff; }
.af-filter-btn.af-tl-phase-installation.active { background: #6b21a8; border-color: #6b21a8; color: #fff; }
.af-filter-btn.af-tl-phase-c2.active { background: #3730a3; border-color: #3730a3; color: #fff; }
.af-filter-btn.af-tl-phase-impact.active { background: #9d174d; border-color: #9d174d; color: #fff; }

/* ── Attack Flow — Matrix ── */
.af-matrix { border-collapse: collapse; }
.af-matrix-header { text-align: center; font-size: 0.78em; padding: 6px 8px; }
.af-matrix-device { white-space: nowrap; }
.af-matrix-cell {
    text-align: center; padding: 8px 6px; min-width: 60px;
    transition: background 0.2s; vertical-align: middle;
}
.af-matrix-cell:hover { background: rgba(255,255,255,0.04); }
.af-matrix-done { background: rgba(34,197,94,0.08); }
.af-matrix-active { background: rgba(14,165,233,0.08); }
.af-matrix-selected { outline: 2px solid #facc15; outline-offset: -2px; }
.af-matrix-count { font-weight: 700; font-size: 1.1em; }
.af-matrix-done .af-matrix-count { color: #22c55e; }
.af-matrix-active .af-matrix-count { color: #0ea5e9; }
.af-matrix-icon { font-size: 0.7em; color: #64748b; margin-top: 2px; }
.af-matrix-done .af-matrix-icon { color: #22c55e; }
.af-matrix-active .af-matrix-icon { color: #0ea5e9; }
.af-matrix-empty { color: #334155; }

/* ── Command Suite decoded columns ─────────────────────────── */
.cell-hex { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.cell-decoded { max-width: 320px; font-size: 12px; cursor: help; }
.cell-hint { max-width: 220px; color: var(--text-muted, #64748b); font-size: 11px; font-style: italic; }

/* ── Command Suite Multi-Target Panel ── */
.cs-target-panel {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
    margin-bottom: 16px;
    background: rgba(14, 165, 233, 0.02);
}
.cs-target-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}
.cs-group-bar {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.cs-group-btn {
    font-size: 11px !important;
    padding: 2px 8px !important;
    border-radius: 12px !important;
    border: 1px solid var(--border) !important;
    background: var(--card-bg) !important;
    transition: all 0.15s;
}
.cs-group-btn:hover {
    border-color: var(--accent) !important;
    color: var(--accent) !important;
}
.cs-group-btn.active {
    background: var(--accent) !important;
    color: #fff !important;
    border-color: var(--accent) !important;
}
.cs-target-list {
    max-height: 180px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--card-bg);
    padding: 4px 0;
}
.cs-target-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 12px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.1s;
}
.cs-target-row:hover { background: rgba(14, 165, 233, 0.04); }
.cs-target-vendor { min-width: 80px; color: var(--text-muted); font-size: 12px; }
.cs-target-protos { font-size: 11px; }
.cs-target-manual { border-top: 1px dashed var(--border); }
.cs-manual-add {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}
.cs-target-count { margin-top: 6px; }

/* ── Relay Badge ── */
.relay-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
}
.relay-badge-direct {
    background: rgba(76, 175, 80, 0.12);
    color: #4caf50;
}
.relay-badge-agent {
    background: rgba(14, 165, 233, 0.12);
    color: var(--accent);
}
.relay-badge-offline {
    background: rgba(244, 67, 54, 0.12);
    color: #f44336;
}

@media (max-width: 768px) {
    .af-tl-time { width: 100px; font-size: 0.7em; }
    .af-filter-bar { gap: 2px; }
    .af-filter-btn { padding: 3px 8px; font-size: 0.7em; }
    .kc-stepper { justify-content: flex-start; overflow-x: auto; }
    .af-matrix-cell { min-width: 45px; padding: 6px 3px; }
}

/* ── Device Table (enterprise) ──────────────────────────────────── */
.dev-table-wrap {
    overflow-x: auto;
    position: relative;
}

.dev-table {
    width: 100%;
    table-layout: auto;
    border-collapse: collapse;
}

.dev-table th,
.dev-table td {
    padding: 7px 10px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dev-cell-protocols {
    white-space: normal;
    word-break: break-word;
}

.dev-table th {
    background: #f8fafc;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    position: relative;
    padding-right: 22px;
    user-select: none;
    cursor: default;
    overflow: visible;          /* filter dropdown'lar th dışına taşmalı */
}

.dev-table th[data-col="ip"],
.dev-table th[data-col="vendor"],
.dev-table th[data-col="model"],
.dev-table th[data-col="risk"],
.dev-table th[data-col="vulns"] {
    cursor: pointer;
}

.dev-table th[data-col]:hover { color: var(--accent); }

.dev-table tbody tr {
    cursor: pointer;
}

.dev-table tbody tr:hover {
    background: #f8fafc;
}

.dev-table a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

.dev-table a:hover { text-decoration: underline; }

/* IP column styling */
.dev-cell-ip,
.dev-th-ip {
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    white-space: nowrap;
}

/* Resize handle */
.col-resize-handle {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    cursor: col-resize;
    z-index: 3;
}

.col-resize-handle:hover,
.col-resize-handle:active {
    background: var(--accent);
}

/* Sort indicator */
.sort-indicator {
    font-size: 10px;
    color: var(--accent);
    margin-left: 2px;
}

/* Filter button (inline in th, SVG funnel icon) */
.col-filter-btn {
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0.45;
    padding: 1px 3px;
    vertical-align: middle;
    color: var(--text-muted);
    line-height: 1;
    display: inline-flex;
    align-items: center;
    margin-left: 2px;
    border-radius: 3px;
    transition: opacity .15s, background .15s;
}

.col-filter-btn:hover {
    opacity: 1;
    color: var(--accent);
    background: rgba(14, 165, 233, 0.08);
}

.col-filter-btn.active {
    opacity: 1;
    color: var(--accent);
}

.col-filter-btn svg { display: block; }

/* Filter dropdown (positioned under th) */
.col-filter-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 160px;
    max-height: 240px;
    overflow-y: auto;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 4px 12px rgba(0,0,0,.12);
    padding: 8px;
    z-index: 100;
    font-size: 12px;
    text-transform: none;
    letter-spacing: normal;
    font-weight: 400;
    white-space: normal;
}

.col-filter-dropdown.open { display: block; }

.col-filter-input {
    width: 100%;
    padding: 5px 8px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 12px;
    outline: none;
}

.col-filter-input:focus { border-color: var(--accent); }

.col-filter-option {
    display: block;
    padding: 3px 4px;
    cursor: pointer;
    font-size: 12px;
    color: var(--text);
    border-radius: 3px;
}

.col-filter-option:hover { background: #f1f5f9; }

.col-filter-option input { margin-right: 6px; vertical-align: middle; }

/* Filter chips (above table) */
.dev-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.dev-filter-chips:empty { display: none; }

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: #e0f2fe;
    color: #0369a1;
    border-radius: 4px;
    font-size: 12px;
    text-decoration: none;
}

.filter-chip a {
    color: #0369a1;
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
    line-height: 1;
}

.filter-chip a:hover { color: var(--danger); }

/* Risk text — compact colored text, not badge */
.dev-risk {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.dev-risk-critical { color: #dc2626; }
.dev-risk-high { color: #ea580c; }
.dev-risk-medium { color: #ca8a04; }
.dev-risk-low { color: #16a34a; }

/* Action dropdown */
.dev-action-cell {
    white-space: normal;
    overflow: visible !important;
    text-overflow: clip !important;
}

.dev-action-wrap { position: relative; display: inline-block; }

.dev-action-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 3px 10px;
    font-size: 12px;
    cursor: pointer;
    color: var(--text-muted);
}

.dev-action-btn:hover { border-color: var(--accent); color: var(--accent); }

.dev-action-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 130px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 4px 12px rgba(0,0,0,.12);
    z-index: 50;
    padding: 4px 0;
}

.dev-action-menu.open { display: block; }

.dev-action-menu a {
    display: block;
    padding: 6px 12px;
    font-size: 12px;
    color: var(--text);
    text-decoration: none;
    white-space: nowrap;
}

.dev-action-menu a:hover {
    background: #f1f5f9;
    color: var(--accent);
}

/* Bulk action bar (compact links) */
.dev-bulk-bar {
    background: var(--accent);
    color: #fff;
    padding: 6px 14px;
    border-radius: var(--radius);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 600;
}

.dev-bulk-link {
    color: rgba(255,255,255,.85);
    text-decoration: underline;
    font-size: 12px;
    font-weight: 400;
}

.dev-bulk-link:hover { color: #fff; }
.dev-bulk-link.dev-bulk-danger { color: #ffb4a2; }
.dev-bulk-link.dev-bulk-danger:hover { color: #ff6b52; }

.dev-bulk-bar .result-area { color: var(--text, #1e293b); font-weight: 400; }

/* Checkbox column */
.dev-th-check,
.dev-cell-check { width: 36px; max-width: 36px; text-align: center; padding: 7px 4px !important; }
.dev-cell-check input,
.dev-th-check input { cursor: pointer; width: 15px; height: 15px; }

/* Protocol cell */
.dev-cell-protocols {
    font-size: 12px;
    color: var(--text-muted);
}

/* Device Type labels */
.dev-dtype {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.dev-dtype-ot { color: #0d9488; }
.dev-dtype-it { color: #3b82f6; }
.dev-dtype-unknown { color: var(--text-light); }

/* Endpoint device subtype pills (camera, printer, router, firewall, nas, voip, iot) */
.dev-subtype {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 7px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    vertical-align: middle;
}
.dev-subtype-camera   { background: #0ea5e9; }
.dev-subtype-printer  { background: #10b981; }
.dev-subtype-router   { background: #f59e0b; }
.dev-subtype-firewall { background: #ef4444; }
.dev-subtype-nas      { background: #a855f7; }
.dev-subtype-voip     { background: #ec4899; }
.dev-subtype-iot      { background: #84cc16; }
/* OT alt-tipleri (İş #67) — her tip ayırt-edici renk */
.dev-subtype-plc              { background: #2563eb; }  /* kontrolcü — mavi */
.dev-subtype-rtu              { background: #0d9488; }  /* telekontrol — teal */
.dev-subtype-hmi              { background: #7c3aed; }  /* operatör paneli — mor */
.dev-subtype-power_meter      { background: #d97706; }  /* güç sayacı — amber */
.dev-subtype-protection_relay { background: #dc2626; }  /* koruma rölesi — kırmızı */
.dev-subtype-drive            { background: #ea580c; }  /* sürücü/VFD — turuncu */
.dev-subtype-servo            { background: #db2777; }  /* servo — pembe */
.dev-subtype-io_module        { background: #475569; }  /* I/O modül — slate */
.dev-subtype-gateway          { background: #0891b2; }  /* gateway — cyan */
.dev-subtype-switch           { background: #16a34a; }  /* switch — yeşil */

/* ── Tablet Responsive (769-1024px) ── */
@media (min-width: 769px) and (max-width: 1024px) {
    .widget-grid-4, .widget-grid-5 {
        grid-template-columns: repeat(2, 1fr);
    }

    .form-row {
        flex-wrap: wrap;
    }

    .data-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .detail-grid {
        grid-template-columns: 1fr 1fr;
    }

    .card-row {
        flex-direction: column;
    }
}

/* ── Large Desktop (>1440px) ── */
@media (min-width: 1441px) {
    .content {
        max-width: 1400px;
    }

    .widget-grid-5 {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* ── İş #40 web IA — kurumsal ortak sekme çubuğu (_macros.html section_tabs) ── */
.section-tabs {
    display: flex;
    align-items: center;
    gap: 0;
    border-bottom: 2px solid var(--border);
    margin-bottom: 1.5rem;
    overflow-x: auto;
}
.section-tab {
    padding: 10px 20px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    white-space: nowrap;
    transition: color .15s, border-color .15s;
}
.section-tab:hover { color: var(--text); }
.section-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}
/* Ayarlar alt-grup etiketi (W3): sekme çubuğunda görsel ayraç */
.section-tab-group {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    opacity: 0.7;
    padding: 0 6px 0 16px;
    align-self: center;
    white-space: nowrap;
    border-left: 1px solid var(--border);
    margin-left: 8px;
}
.section-tab-group:first-child { border-left: none; margin-left: 0; padding-left: 0; }
