/* =========================================================
   LGFW App – styles.css (bereinigt)
   Ziel: altes Look&Feel als Standard, ohne doppelte Overrides
   ========================================================= */

:root{
  /* Theme (OLD Look) */
  --bg:#0b1020;
  --panel:#121a33;
  --panel2:#0f1730;
  --text:#e9ecf5;
  --muted:#a9b2d3;
  --line:rgba(255,255,255,.10);
  --accent:#7aa2ff;
  --range-track: rgba(255,255,255,.08);
  --range-track-fill: rgba(255,255,255,.16);
  --range-thumb: var(--accent);
  --bg-grad1: radial-gradient(1200px 600px at 20% -10%, rgba(122,162,255,.25), transparent 60%);
  --bg-grad2: radial-gradient(1000px 600px at 90% 10%, rgba(69,212,131,.18), transparent 65%);
  --bg-grad3: radial-gradient(1000px 700px at 60% 110%, rgba(255,200,87,.10), transparent 60%);
  --card-bg: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.01));
  --input-bg: rgba(0,0,0,.18);
  --badge-bg: rgba(255,255,255,.04);
  --pill-bg: rgba(255,255,255,.03);

  --ok:#45d483;
  --warn:#ffc857;
  --bad:#ff5c7a;

  --shadow: 0 12px 40px rgba(0,0,0,.35);
  --radius:18px;

  /* Layer Colors (dein Farbschema) */
  --layer-innovation:#6A1B9A; /* Violett */
  --layer-flex:#F57C00;       /* Orange */
  --layer-process:#2E7D32;    /* Mittelgrün */
  --layer-core:#003366;       /* Dunkelblau */
}

:root.theme-light{
  --bg:#f7f8fc;
  --panel:#ffffff;
  --panel2:#f0f3ff;
  --text:#172038;
  --muted:#6a728d;
  --line:rgba(0,0,0,.10);
  --accent:#3d63ff;
  --range-track: rgba(0,0,0,.08);
  --range-track-fill: rgba(0,0,0,.12);
  --range-thumb: var(--accent);
  --bg-grad1: radial-gradient(1200px 600px at 20% -10%, rgba(61,99,255,.16), transparent 55%);
  --bg-grad2: radial-gradient(1000px 600px at 90% 10%, rgba(69,212,131,.13), transparent 55%);
  --bg-grad3: radial-gradient(1000px 700px at 60% 110%, rgba(255,200,87,.16), transparent 55%);
  --card-bg: linear-gradient(180deg, rgba(255,255,255,.95), rgba(255,255,255,.92));
  --input-bg: rgba(255,255,255,.90);
  --badge-bg: rgba(0,0,0,.04);
  --pill-bg: rgba(0,0,0,.04);
  --shadow: 0 10px 28px rgba(0,0,0,.14);
}

/* Reset / Base */
*{ box-sizing:border-box; }
html,body{
  margin:0; padding:0;
  font-family:ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Arial;
  color:var(--text);
  background: var(--bg-grad1), var(--bg-grad2), var(--bg-grad3), var(--bg);
}
a{ color:inherit; text-decoration:none; }
small{ color:var(--muted); }
code{
  font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;
  font-size:12px;
}
hr{ border:none; border-top:1px solid var(--line); margin:12px 0; }

/* Layout */
.container{ max-width:1100px; margin:0 auto; padding:18px; }

.grid{ display:grid; gap:14px; }
.grid.two{ grid-template-columns: 1.05fr .95fr; }
@media (max-width: 980px){ .grid.two{ grid-template-columns:1fr; } }

.row{ display:grid; gap:10px; }
.row.two{ grid-template-columns:1fr 1fr; }
@media (max-width: 700px){ .row.two{ grid-template-columns:1fr; } }

/* Top Nav */
.nav{
  display:flex; gap:10px; align-items:center; justify-content:space-between;
  padding:12px 14px;
  border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  background: var(--card-bg);
  position:sticky; top:12px; z-index:10;
}
.nav .left{ display:flex; gap:10px; align-items:center; }
.nav .right{ display:flex; gap:8px; align-items:center; }
.brand{ font-weight:700; letter-spacing:.4px; }

.menu{ display:flex; gap:8px; flex-wrap:wrap; }
.menu a{
  padding:8px 10px;
  border:1px solid rgba(122,162,255,.22);
  border-radius:12px;
  background: rgba(122,162,255,.10);
}
.menu a.active{
  border-color: rgba(122,162,255,.45);
  box-shadow:0 0 0 2px rgba(122,162,255,.14) inset;
}

/* Cards */
.card{
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:14px;
  box-shadow:var(--shadow);
  background: var(--card-bg);
  transition: .16s ease;
}
.card h2{ margin:0 0 8px 0; font-size:16px; }
.card h3{ margin:0 0 8px 0; font-size:14px; color:var(--muted); font-weight:600; }

/* Hover-Glow */
.card:hover{
  border-color: rgba(122,162,255,.45);
  box-shadow: 0 0 0 2px rgba(122,162,255,.12) inset, var(--shadow);
  transform: translateY(-1px);
}

/* Forms */
label{ display:block; font-size:12px; color:var(--muted); margin:0 0 6px 2px; }
input[type="text"], textarea, select{
  width:100%;
  padding:10px 10px;
  border-radius:12px;
  background: var(--input-bg);
  color:var(--text);
  border:1px solid var(--line);
  outline:none;
}
input[type="text"]:focus, textarea:focus{
  border-color: rgba(122,162,255,.55);
  box-shadow: 0 0 0 3px rgba(122,162,255,.10);
}
textarea{ min-height:80px; resize:vertical; }
input[type="range"]{
  width:100%;
  -webkit-appearance:none;
  appearance:none;
  height:10px;
  background: var(--range-track);
  border-radius:999px;
  border:1px solid rgba(0,0,0,.12);
  box-shadow: inset 0 1px 1px rgba(0,0,0,.15);
}
input[type="range"]::-webkit-slider-thumb{
  -webkit-appearance:none;
  appearance:none;
  width:20px; height:20px;
  border-radius:50%;
  background: var(--range-thumb);
  border:2px solid rgba(0,0,0,.15);
  box-shadow: 0 4px 10px rgba(0,0,0,.25);
  cursor:pointer;
}
input[type="range"]::-moz-range-thumb{
  width:20px; height:20px;
  border-radius:50%;
  background: var(--range-thumb);
  border:2px solid rgba(0,0,0,.15);
  box-shadow: 0 4px 10px rgba(0,0,0,.25);
  cursor:pointer;
}
input[type="range"]::-moz-range-track{
  height:10px;
  background: var(--range-track);
  border-radius:999px;
  border:1px solid rgba(0,0,0,.12);
}
input[type="range"]:focus{
  outline:none;
  box-shadow: 0 0 0 3px rgba(122,162,255,.10);
  border-color: rgba(122,162,255,.45);
}

/* Matrix Rows (Hover Mode) */
.matrix{ display:grid; gap:10px; }
.matrix-row{
  padding:12px;
  border:1px solid var(--line);
  border-radius:16px;
  background: rgba(255,255,255,.02);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
  transition: .16s ease;
}
:root.theme-light .matrix-row{
  background: rgba(0,0,0,.02);
  box-shadow: inset 0 1px 0 rgba(0,0,0,.05);
}
.matrix-row:hover{
  border-color: rgba(122,162,255,.55);
  box-shadow: 0 0 0 3px rgba(122,162,255,.12) inset, var(--shadow);
  background: rgba(122,162,255,.05);
}
.matrix-row .kv{ margin-bottom:8px; }
.matrix-row .pill{
  background: var(--panel2);
  border-color: rgba(122,162,255,.35);
}
:root.theme-light .matrix-row .pill{
  background: rgba(61,99,255,.12);
  color:#172038;
}
.kv{ display:flex; justify-content:space-between; gap:10px; align-items:center; }

/* Buttons */
.btns{ display:flex; gap:8px; flex-wrap:wrap; }
button{
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--line);
  background: rgba(122,162,255,.14);
  color:var(--text);
  cursor:pointer;
  font-weight:700;
}
button.primary{
  border-color: rgba(122,162,255,.35);
  box-shadow:0 0 0 2px rgba(122,162,255,.12) inset;
}
button.danger{
  background: rgba(255,92,122,.14);
  border-color: rgba(255,92,122,.30);
}

/* Badges / Pills */
.badge{
  display:inline-flex; align-items:center; gap:6px;
  padding:7px 12px;
  border-radius:999px;
  border:1px solid var(--line);
  background: var(--badge-bg);
  font-size:12px;
}
.badge.low{
  border-color: rgba(69,212,131,.35);
  background: rgba(69,212,131,.12);
  color:#c9ffe0;
}
.badge.med{
  border-color: rgba(255,200,87,.35);
  background: rgba(255,200,87,.12);
  color:#fff2c9;
}
.badge.high{
  border-color: rgba(255,92,122,.35);
  background: rgba(255,92,122,.12);
  color:#ffd0d9;
}
:root.theme-light .badge.low{ color:#155f3b; }
:root.theme-light .badge.med{ color:#8a5b00; }
:root.theme-light .badge.high{ color:#b12b44; }

.pill{
  display:inline-block;
  padding:4px 8px;
  border-radius:999px;
  border:1px solid var(--line);
  font-size:12px;
  background: var(--pill-bg);
}
.pill.low{ border-color: rgba(69,212,131,.45); }
.pill.med{ border-color: rgba(255,200,87,.45); }
.pill.high{ border-color: rgba(255,92,122,.45); }

.muted{ color:var(--muted); }

/* Tables */
table{ width:100%; border-collapse:collapse; font-size:13px; }
th,td{ border-bottom:1px solid var(--line); padding:8px 8px; text-align:left; vertical-align:top; }
th{ color:var(--muted); font-weight:600; }

/* Layer Pill */
.layer-pill{
  display:inline-flex; align-items:center; gap:8px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--line);
  background: var(--badge-bg);
  font-size:12px;
  font-weight:650;
}
.layer-pill::before{
  content:"";
  width:9px; height:9px;
  border-radius:999px;
}

.layer-innovation{
  border-color: rgba(106,27,154,.75);
  box-shadow: 0 0 0 2px rgba(106,27,154,.12) inset;
}
.layer-innovation::before{ background: var(--layer-innovation); }

.layer-flex{
  border-color: rgba(245,124,0,.75);
  box-shadow: 0 0 0 2px rgba(245,124,0,.12) inset;
}
.layer-flex::before{ background: var(--layer-flex); }

.layer-process{
  border-color: rgba(46,125,50,.75);
  box-shadow: 0 0 0 2px rgba(46,125,50,.12) inset;
}
.layer-process::before{ background: var(--layer-process); }

.layer-core{
  border-color: rgba(0,51,102,.75);
  box-shadow: 0 0 0 2px rgba(0,51,102,.12) inset;
}
.layer-core::before{ background: var(--layer-core); }

.footer-note{ font-size:12px; color:var(--muted); }

/* Modal */
.modal-backdrop{position:fixed;inset:0;display:none;align-items:center;justify-content:center;padding:24px;background:rgba(0,0,0,.55);z-index:9999;}
.modal-backdrop.open{display:flex;}
body.modal-open{overflow:hidden;}
.modal{width:min(980px,96vw);max-height:86vh;overflow:auto;border-radius:var(--radius);border:1px solid var(--line);background:var(--panel);box-shadow:var(--shadow);}
.modal-header{position:sticky;top:0;display:flex;justify-content:space-between;align-items:center;gap:12px;padding:14px 16px;border-bottom:1px solid var(--line);background:var(--panel2);backdrop-filter:blur(10px);}
.modal-title{font-weight:800;letter-spacing:.2px;}
.modal-close{cursor:pointer;border:1px solid var(--line);background:rgba(122,162,255,.10);color:var(--text);border-radius:12px;padding:8px 10px;}
.modal-body{padding:16px;}
.modal-strong{font-weight:800;font-size:18px;}
.modal-section{margin-top:14px;}
.modal-h{font-weight:800;margin-bottom:8px;}
.modal-box{border:1px solid var(--line);background:rgba(0,0,0,.18);border-radius:14px;padding:12px;line-height:1.45;color:var(--muted);}
.modal-grid{display:grid;grid-template-columns:1.2fr .8fr;gap:14px;}
@media (max-width:860px){.modal-grid{grid-template-columns:1fr;}}
.modal-grid2{display:grid;grid-template-columns:1fr 1fr;gap:10px 14px;}
@media (max-width:860px){.modal-grid2{grid-template-columns:1fr;}}
.modal-list{margin:0;padding-left:18px;color:var(--muted);line-height:1.5;}
.modal-pre{border:1px solid var(--line);background:rgba(0,0,0,.22);border-radius:14px;padding:12px;white-space:pre-wrap;color:var(--text);font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:12px;}
.modal-table{width:100%;border-collapse:collapse;font-size:13px;}
.modal-table th,.modal-table td{border-top:1px solid var(--line);padding:10px 8px;vertical-align:top;}
.modal-table th{color:var(--muted);font-weight:700;}
.btn.small{padding:8px 10px;border-radius:12px;border:1px solid var(--line);background:rgba(122,162,255,.10);color:var(--text);cursor:pointer;}

/* Modal – Lesbarkeit erhöhen (weniger Transparenz) */
/* Modal – Lesbarkeit erhöhen (Light/Dark via Variablen) */
.modal-backdrop{
  background: rgba(0,0,0,.70);
  backdrop-filter: blur(6px);
}
.modal{
  background: var(--panel);
}
.modal-header{
  background: var(--panel2);
}
.modal-box{
  background: var(--panel2);
  color: var(--text);
}
.modal-pre{
  background: var(--panel2);
}

/* =========================
   Responsive (Mobile) – CSS-only
   Desktop bleibt unverändert
   ========================= */
@media (max-width: 900px){

  /* Layout: 2 Spalten -> 1 Spalte */
  .grid.two{ grid-template-columns: 1fr !important; }
  .row.two{ grid-template-columns: 1fr !important; }

  /* Cards etwas kompakter */
  .card{ padding: 14px !important; }

  /* Navigation: wrap statt Overflow */
  .nav{
    flex-wrap: wrap;
    gap: 10px;
  }
  .nav .left{
    flex-wrap: wrap;
    gap: 10px;
  }
  .menu{
    flex-wrap: wrap;
    gap: 8px;
  }
  .nav .right{
    width: 100%;
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
  }

  /* Inputs/Buttons: volle Breite wenn nötig */
  input, textarea, button{
    max-width: 100%;
  }

  /* Tabellen: horizontal scroll */
  table{
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  /* Modal: mobile friendly */
  .modal{
    width: min(96vw, 980px) !important;
    max-height: 88vh !important;
  }
  .modal-body{
    max-height: calc(88vh - 64px) !important;
    overflow: auto;
  }
}

/* Grafik Page */
.grafik-legend{
  display:flex;
  align-items:center;
  gap:8px;
  margin:12px 0;
  color:var(--muted);
  font-size:13px;
}
.grafik-controls{
  display:flex;
  flex-direction:column;
  gap:6px;
  margin-top:12px;
  max-width:420px;
}
.grafik-controls select{
  width:100%;
}
.grafik-marker-demo{
  width:10px;
  height:10px;
  border-radius:50%;
  background:var(--accent);
  box-shadow:0 0 0 3px rgba(122,162,255,.18);
}
.grafik-board{
  display:grid;
  gap:10px;
  margin-top:6px;
}
.grafik-head,
.grafik-row{
  display:grid;
  gap:10px;
  grid-template-columns: 170px repeat(3, 1fr);
  align-items:stretch;
}
.grafik-path-head{
  text-align:center;
  font-weight:600;
  color:var(--muted);
  padding:6px 0;
}
.grafik-layer{
  padding:12px;
  border-radius:14px;
  border:1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}
.grafik-layer-core{ background: rgba(0,51,102,.25); }
.grafik-layer-process{ background: rgba(46,125,50,.25); }
.grafik-layer-flex{ background: rgba(245,124,0,.25); }
.grafik-layer-innovation{ background: rgba(106,27,154,.25); }
.grafik-cell{
  position:relative;
  padding:12px;
  border-radius:14px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.03);
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;
  min-height:68px;
  color:var(--text);
}
:root.theme-light .grafik-cell{
  background: rgba(0,0,0,.03);
}
.grafik-cell.selected{
  border-color: rgba(122,162,255,.6);
  box-shadow: 0 0 0 2px rgba(122,162,255,.18) inset, var(--shadow);
}
.grafik-cell.selected::after{
  content:"";
  position:absolute;
  top:8px;
  right:8px;
  width:12px;
  height:12px;
  border-radius:50%;
  background:var(--accent);
  box-shadow:0 0 0 3px rgba(122,162,255,.18);
}
.grafik-status{
  margin-top:12px;
  color:var(--muted);
  font-size:13px;
}
@media (max-width: 900px){
  .grafik-head,
  .grafik-row{
    grid-template-columns: 1fr;
  }
  .grafik-path-head{
    text-align:left;
  }
  .grafik-row .grafik-cell{
    justify-content:flex-start;
  }
}
