/* ObviFlow Shared Stylesheet v3.1.10 */
:root {
  --bg:       #0a0e1a;
  --surface:  #111827;
  --surface2: #1a2235;
  --border:   rgba(255,255,255,0.07);
  --accent:   #00d4aa;
  --blue:     #3b82f6;
  --red:      #ef4444;
  --amber:    #f59e0b;
  --text:     #e2e8f0;
  --muted:    #64748b;
  --font:     'JetBrains Mono', 'Fira Code', monospace;
  --radius:   8px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--bg); color: var(--text); font-family: var(--font); font-size: 13px; min-height: 100vh; }
a { color: inherit; text-decoration: none; }
button { font-family: var(--font); }

/* HEADER */
.of-header { display:flex; align-items:center; justify-content:space-between; padding:10px 24px; border-bottom:1px solid var(--border); background:var(--surface); position:sticky; top:0; z-index:200; gap:16px; flex-wrap:wrap; }
.of-header-left   { display:flex; align-items:center; gap:20px; }
.of-header-center { display:flex; align-items:center; gap:4px; flex-wrap:wrap; }
.of-header-right  { display:flex; align-items:center; gap:8px; margin-left:auto; }
.of-logo { font-size:15px; font-weight:700; letter-spacing:0.12em; white-space:nowrap; cursor:pointer; }
.of-logo span { color:var(--accent); }

/* NAV */
.of-nav { display:flex; gap:2px; }
.of-nav-link { padding:4px 10px; border-radius:4px; font-size:10px; letter-spacing:0.06em; color:var(--muted); transition:all 0.15s; white-space:nowrap; cursor:pointer; background:transparent; border:none; }
.of-nav-link:hover { color:var(--text); background:var(--surface2); }
.of-nav-link.active { color:var(--accent); background:rgba(0,212,170,0.08); }

/* TIME CONTROLS */
.of-time-btn { background:transparent; border:1px solid var(--border); color:var(--muted); padding:4px 8px; border-radius:4px; cursor:pointer; font-family:var(--font); font-size:10px; transition:all 0.15s; white-space:nowrap; }
.of-time-btn:hover, .of-time-btn.active { border-color:var(--accent); color:var(--accent); background:rgba(0,212,170,0.06); }
.of-time-btn.accent { border-color:var(--accent); color:var(--accent); }
.of-date-input { background:var(--surface2); border:1px solid var(--border); color:var(--text); padding:4px 6px; border-radius:4px; font-family:var(--font); font-size:11px; width:185px; min-width:185px; }
.of-sep { color:var(--muted); font-size:10px; }
.of-icon-btn { background:transparent; border:1px solid var(--border); color:var(--muted); padding:4px 8px; border-radius:4px; cursor:pointer; font-family:var(--font); font-size:11px; transition:all 0.15s; display:inline-block; }
.of-icon-btn:hover { border-color:var(--accent); color:var(--accent); }
.of-status-dot { width:7px; height:7px; border-radius:50%; background:var(--accent); animation:pulse 2s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.4} }
.of-ts { font-size:10px; color:var(--muted); }

/* FILTER BAR */
.of-filter-bar { display:flex; align-items:center; gap:8px; padding:8px 24px; background:var(--surface2); border-bottom:1px solid var(--border); flex-wrap:wrap; }
.of-filter-tag { display:inline-flex; align-items:center; gap:4px; background:rgba(0,212,170,0.1); border:1px solid rgba(0,212,170,0.3); border-radius:4px; padding:3px 8px; font-size:10px; }
.of-filter-key { color:var(--muted); letter-spacing:0.06em; }
.of-filter-val { color:var(--accent); font-weight:600; }
.of-filter-remove { background:transparent; border:none; color:var(--muted); cursor:pointer; font-size:10px; padding:0 2px; }
.of-filter-remove:hover { color:var(--red); }
.of-filter-clear { background:transparent; border:1px solid var(--border); color:var(--muted); padding:3px 8px; border-radius:4px; cursor:pointer; font-family:var(--font); font-size:10px; margin-left:auto; }
.of-filter-clear:hover { border-color:var(--red); color:var(--red); }

/* PAGE */
.of-page { padding:18px 24px; max-width:1600px; margin:0 auto; }
.of-page-title { font-size:11px; color:var(--muted); letter-spacing:0.12em; margin-bottom:16px; display:flex; align-items:center; gap:12px; }
.of-page-title::after { content:''; flex:1; height:1px; background:var(--border); }

/* GRIDS */
.of-grid-2 { display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-bottom:12px; }
.of-grid-3 { display:grid; grid-template-columns:1fr 1fr 1fr; gap:12px; margin-bottom:12px; }
.of-grid-4 { display:grid; grid-template-columns:repeat(4,1fr); gap:10px; margin-bottom:12px; }
.of-grid-5 { display:grid; grid-template-columns:repeat(5,1fr); gap:10px; margin-bottom:12px; }
.of-col-2  { grid-column:span 2; }
.of-col-3  { grid-column:span 3; }

/* CARDS */
.of-card { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:14px; }
.of-card-title { font-size:9px; color:var(--muted); letter-spacing:0.12em; margin-bottom:12px; display:flex; align-items:center; gap:8px; }
.of-card-title::after { content:''; flex:1; height:1px; background:var(--border); }

/* METRICS */
.of-metric { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:12px 14px; position:relative; overflow:hidden; }
.of-metric::before { content:''; position:absolute; top:0; left:0; right:0; height:2px; background:var(--accent); opacity:0.5; }
.of-metric.red::before    { background:var(--red); }
.of-metric.amber::before  { background:var(--amber); }
.of-metric.blue::before   { background:var(--blue); }
.of-metric.accent::before { background:var(--accent); opacity:1; }
.of-metric-label { font-size:9px; color:var(--muted); letter-spacing:0.1em; margin-bottom:5px; }
.of-metric-value { font-size:22px; font-weight:700; color:var(--text); line-height:1; }
.of-metric-sub   { font-size:9px; color:var(--muted); margin-top:3px; }

/* TABLES */
.of-table { width:100%; border-collapse:collapse; }
.of-table th { text-align:left; font-size:9px; color:var(--muted); letter-spacing:0.08em; padding:0 8px 7px 0; border-bottom:1px solid var(--border); font-weight:500; }
.of-table td { padding:6px 8px 6px 0; border-bottom:1px solid var(--border); font-size:11px; }
.of-table tr:last-child td { border-bottom:none; }
.of-table tr.clickable { cursor:pointer; }
.of-table tr.clickable:hover td { background:rgba(0,212,170,0.03); }

/* BARS */
.of-bar-wrap { width:100%; background:rgba(255,255,255,0.05); border-radius:2px; height:3px; margin-top:2px; }
.of-bar      { height:3px; border-radius:2px; background:var(--accent); }
.of-bar.blue { background:var(--blue); }
.of-bar.red  { background:var(--red); }

/* MISC */
.of-ip      { font-family:monospace; color:#94a3b8; font-size:11px; }
.of-loading { color:var(--muted); text-align:center; padding:30px; font-size:11px; }
.of-chart-wrap { position:relative; width:100%; }

/* MODAL */
.of-modal-bg { display:none; position:fixed; inset:0; background:rgba(0,0,0,0.7); z-index:500; align-items:center; justify-content:center; }
.of-modal-bg.open { display:flex; }
.of-modal { background:var(--surface); border:1px solid var(--border); border-radius:10px; padding:20px; width:90%; max-width:800px; max-height:80vh; overflow-y:auto; }
.of-modal-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:16px; }
.of-modal-title { font-size:12px; color:var(--accent); letter-spacing:0.08em; }
.of-modal-close { background:transparent; border:1px solid var(--border); color:var(--muted); padding:3px 8px; border-radius:4px; cursor:pointer; font-family:var(--font); font-size:12px; }
.of-modal-close:hover { color:var(--red); border-color:var(--red); }

/* TOAST */
.of-toast { display:none; position:fixed; bottom:24px; right:24px; padding:10px 18px; border-radius:6px; font-size:12px; font-weight:600; z-index:999; }
.of-toast.show        { display:block; animation:fadeout 2.5s forwards; }
.of-toast-success     { background:var(--accent); color:#000; }
.of-toast-error       { background:var(--red); color:#fff; }
@keyframes fadeout { 0%{opacity:1} 70%{opacity:1} 100%{opacity:0} }

/* LOGIN */
.of-login-page { min-height:100vh; display:flex; align-items:center; justify-content:center; }
.of-login-box  { background:var(--surface); border:1px solid var(--border); border-radius:12px; padding:40px; width:360px; }
.of-login-logo     { font-size:24px; font-weight:700; letter-spacing:0.12em; margin-bottom:8px; }
.of-login-logo span { color:var(--accent); }
.of-login-sub      { font-size:11px; color:var(--muted); margin-bottom:32px; }
.of-input { width:100%; background:var(--surface2); border:1px solid var(--border); color:var(--text); padding:10px 12px; border-radius:6px; font-family:var(--font); font-size:12px; margin-bottom:12px; }
.of-input:focus { outline:none; border-color:var(--accent); }
.of-btn { width:100%; background:rgba(0,212,170,0.1); border:1px solid var(--accent); color:var(--accent); padding:10px; border-radius:6px; cursor:pointer; font-family:var(--font); font-size:12px; letter-spacing:0.08em; margin-top:8px; transition:all 0.15s; }
.of-btn:hover { background:rgba(0,212,170,0.2); }

/* NOC */
.noc-live     { display:flex; align-items:center; gap:8px; font-size:10px; color:var(--accent); letter-spacing:0.08em; margin-bottom:14px; }
.noc-live-dot { width:8px; height:8px; border-radius:50%; background:var(--accent); animation:pulse 1s infinite; }
.noc-metrics  { display:grid; grid-template-columns:repeat(6,1fr); gap:10px; margin-bottom:14px; }

/* SECURITY */
.sec-metrics { display:grid; grid-template-columns:repeat(5,1fr); gap:10px; margin-bottom:14px; }
.threat-row  { display:flex; align-items:center; gap:10px; padding:7px 0; border-bottom:1px solid var(--border); }
.threat-row:last-child { border-bottom:none; }
.threat-ip   { font-family:monospace; color:#f87171; font-size:12px; flex:1; cursor:pointer; }
.threat-ip:hover { text-decoration:underline; }
.threat-meta { font-size:10px; color:var(--muted); }

/* MANAGEMENT */
.mgmt-metrics { display:grid; grid-template-columns:repeat(4,1fr); gap:10px; margin-bottom:14px; }
.mgmt-kpi { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:16px; position:relative; overflow:hidden; }
.mgmt-kpi::before { content:''; position:absolute; top:0; left:0; bottom:0; width:3px; background:var(--accent); }
.mgmt-kpi.red::before   { background:var(--red); }
.mgmt-kpi.blue::before  { background:var(--blue); }
.mgmt-kpi.amber::before { background:var(--amber); }
.mgmt-kpi-label { font-size:9px; color:var(--muted); letter-spacing:0.1em; margin-bottom:8px; }
.mgmt-kpi-value { font-size:28px; font-weight:700; color:var(--text); line-height:1; }
.mgmt-kpi-sub   { font-size:10px; color:var(--muted); margin-top:6px; }
.summary-row    { display:flex; justify-content:space-between; align-items:center; padding:8px 0; border-bottom:1px solid var(--border); font-size:11px; }
.summary-row:last-child { border-bottom:none; }
.summary-label  { color:var(--muted); }
.summary-value  { font-weight:600; color:var(--text); }

/* RESPONSIVE */
@media (max-width:900px) {
  .noc-metrics { grid-template-columns:repeat(3,1fr); }
  .sec-metrics { grid-template-columns:repeat(3,1fr); }
  .mgmt-metrics { grid-template-columns:repeat(2,1fr); }
  .of-grid-2, .of-grid-3 { grid-template-columns:1fr; }
}

/* ─── v3.1 Patch: Modal-Show ────────────────────────── */
.of-modal-bg.show {
  display: flex !important;
  align-items: center;
  justify-content: center;
}


/* ─── v3.1.4.1 PATCH: LIGHT THEME ────────────────────────── */
[data-theme="light"] {
  --bg:        #f3f5f9;
  --surface:   #ffffff;
  --surface2:  #eef2f7;
  --border:    rgba(15, 23, 42, 0.10);
  --accent:    #00a884;
  --blue:      #2563eb;
  --red:       #dc2626;
  --amber:     #d97706;
  --text:      #0f172a;
  --muted:     #64748b;
}
[data-theme="light"] .of-nav-link.active   { background: rgba(0,168,132,0.10); }
[data-theme="light"] .of-time-btn:hover,
[data-theme="light"] .of-time-btn.active   { background: rgba(0,168,132,0.08); }
[data-theme="light"] .of-filter-tag        { background: rgba(0,168,132,0.10);
                                              border-color: rgba(0,168,132,0.30); }
[data-theme="light"] .of-table tr.clickable:hover td { background: rgba(0,168,132,0.05); }
[data-theme="light"] .of-bar-wrap          { background: rgba(15,23,42,0.06); }
[data-theme="light"] .of-ip                { color: #475569; }
[data-theme="light"] .of-modal-bg          { background: rgba(15,23,42,0.45); }
[data-theme="light"] .of-toast-success     { color: #ffffff; }
[data-theme="light"] body                  { background: var(--bg); }
[data-theme="light"] input,
[data-theme="light"] select,
[data-theme="light"] textarea              { color-scheme: light; }

/* ─── v3.1 Patch: Modal-Show + Dashboard-Grid ─── */
.of-modal-bg.show {
  display: flex !important;
  align-items: center;
  justify-content: center;
}

/* Dashboard 12-Spalten Grid (60px Zeilen) */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-rows: 60px;
  gap: 10px;
  padding: 16px;
}
.dash-widget {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.dash-widget-head {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 9px; color: var(--muted);
  letter-spacing: 0.1em;
  margin-bottom: 6px;
  cursor: move;
}
.dash-widget-body { flex: 1; overflow: auto; }
.dash-widget-x {
  background: transparent; border: none; color: var(--muted);
  cursor: pointer; font-size: 14px; line-height: 1;
}
.dash-widget-x:hover { color: var(--red); }
.dash-resize {
  position: absolute; bottom: 0; right: 0;
  width: 14px; height: 14px;
  cursor: nwse-resize;
  background: linear-gradient(135deg, transparent 50%, var(--muted) 50%);
  opacity: 0.3;
}
.dash-resize:hover { opacity: 0.8; }

/* Save-Indikator */
.dash-save-status.unsaved { color: var(--amber); }
.dash-save-status.saved   { color: var(--accent); }

/* Sidebar */
.dash-sidebar {
  width: 240px; min-width: 240px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 14px;
  overflow-y: auto;
}
.dash-sidebar-item {
  padding: 8px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2px;
}
.dash-sidebar-item:hover  { background: var(--surface2); }
.dash-sidebar-item.active { background: rgba(0,212,170,0.08); color: var(--accent); }
.dash-sidebar-count {
  font-size: 9px; color: var(--muted);
  background: var(--surface2);
  padding: 1px 5px; border-radius: 3px;
}

/* Metric-Widget Threshold-Farbverlauf */
.dash-metric-value {
  font-size: 32px; font-weight: 700;
  text-align: center; padding: 12px 0;
}
.dash-metric-value.green  { color: var(--accent); }
.dash-metric-value.amber  { color: var(--amber); }
.dash-metric-value.red    { color: var(--red); }

/* PATCH_LAYOUT_HEADER_WRAP_V1 — at narrow viewports time-controls goes to own row centered */
@media (max-width: 1700px) {
  header.of-header { row-gap: 6px; }
  header.of-header > .of-header-center {
    order: 3;
    flex-basis: 100%;
    justify-content: center;
  }
  header.of-header > .of-header-right {
    order: 2;
    margin-left: auto;
  }
}
@media (max-width: 720px) {
  header.of-header #of-time-controls {
    flex-wrap: wrap;
    justify-content: center;
    row-gap: 6px;
  }
}
/* END PATCH_LAYOUT_HEADER_WRAP_V1 */

/* ─── v3.1 Patch: Modal-Show + Dashboard-Grid ─── */
.of-modal-bg.show {
  display: flex !important;
  align-items: center;
  justify-content: center;
}

/* Dashboard 12-Spalten Grid (60px Zeilen) */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-rows: 60px;
  gap: 10px;
  padding: 16px;
}
.dash-widget {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.dash-widget-head {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 9px; color: var(--muted);
  letter-spacing: 0.1em;
  margin-bottom: 6px;
  cursor: move;
}
.dash-widget-body { flex: 1; overflow: auto; }
.dash-widget-x {
  background: transparent; border: none; color: var(--muted);
  cursor: pointer; font-size: 14px; line-height: 1;
}
.dash-widget-x:hover { color: var(--red); }
.dash-resize {
  position: absolute; bottom: 0; right: 0;
  width: 14px; height: 14px;
  cursor: nwse-resize;
  background: linear-gradient(135deg, transparent 50%, var(--muted) 50%);
  opacity: 0.3;
}
.dash-resize:hover { opacity: 0.8; }

/* Save-Indikator */
.dash-save-status.unsaved { color: var(--amber); }
.dash-save-status.saved   { color: var(--accent); }

/* Sidebar */
.dash-sidebar {
  width: 240px; min-width: 240px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 14px;
  overflow-y: auto;
}
.dash-sidebar-item {
  padding: 8px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2px;
}
.dash-sidebar-item:hover  { background: var(--surface2); }
.dash-sidebar-item.active { background: rgba(0,212,170,0.08); color: var(--accent); }
.dash-sidebar-count {
  font-size: 9px; color: var(--muted);
  background: var(--surface2);
  padding: 1px 5px; border-radius: 3px;
}

/* Metric-Widget Threshold-Farbverlauf */
.dash-metric-value {
  font-size: 32px; font-weight: 700;
  text-align: center; padding: 12px 0;
}
.dash-metric-value.green  { color: var(--accent); }
.dash-metric-value.amber  { color: var(--amber); }
.dash-metric-value.red    { color: var(--red); }
