/* name=assets/css/testula.css
   Unified stylesheet for the app (dark theme).
   Includes compact table action buttons (.table-btn).
*/

/* Theme variables */
:root{
  --bg: #0a1030;
  --bg-2: #0f1726;
  --fg: #e8ecf1;
  --muted: #9aa4bf;
  --brand: #3a66ff;
  --card: #151b2e;
  --border: #2a3355;
  --radius: 12px;
  --shadow-1: 0 8px 30px rgba(3,6,20,0.55);
  --touch-min: 44px;
  --max-width: 1200px;
  /* default header height variable (used for page padding when header is fixed) */
  --header-height-compact: 48px; /* fallback */
  --header-height: var(--header-height-compact);
}

/* Reset / base */
* { box-sizing: border-box; }
html,body { height:100%; }
body {
  margin:0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color:var(--fg);
  background: radial-gradient(1200px 600px at 40% 40%, #0d1650 0%, var(--bg) 60%) fixed;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  line-height:1.35;
  font-size:16px;
}

/* Page layout */
.page { min-height:100vh; display:grid; grid-template-rows:auto 1fr auto; }

/* When the header is fixed to the top, we must add top padding to the page
   so the content doesn't get hidden under the header. Uses --header-height. */
.page.fixed-header-padding {
  padding-top: var(--header-height);
}

/* NOTE:
   The header is made fixed further below in the file (compact header section).
   We add the .fixed-header-padding helper here so you can toggle it if needed.
*/

/* Header basic */
.site-header {
  display:grid; grid-template-columns: 48px 1fr auto;
  align-items:center; gap:12px;
  padding:20px clamp(16px,4vw,48px);
  background: transparent;
  border-bottom: 1px solid rgba(255,255,255,0.02);
}
.menu-btn {
  width:40px; height:40px; border-radius:10px; display:grid; place-items:center;
  border: 1px solid var(--border); background:var(--card); color:var(--fg);
  cursor:pointer;
}
.menu-btn span { display:block; width:18px; height:2px; background:var(--fg); box-shadow: 0 6px 0 var(--fg), 0 -6px 0 var(--fg); }
.logo { margin-left:8px; font-size:clamp(28px,5.2vw,56px); font-weight:800; letter-spacing:0.02em; }

/* Language select */
.lang select {
  appearance:none; background:var(--card); color:var(--fg);
  border:1px solid var(--border); padding:10px 12px; border-radius:12px;
}

/* Main hero / center area */
.hero { display:grid; place-items:center; padding:20px; min-height:60vh; }
.container { width:100%; max-width:var(--max-width); margin: 0 auto; padding: 0 16px; }

/* Card */
.card, .login-card, .user-card, .eb-container {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-1);
  color: var(--fg);
}

/* Login card specifics */
.login-card { width: min(96vw, 420px); }
.login-card label { display:block; margin:12px 0 6px; color:var(--muted); font-size:0.95rem; }
.login-card input, .login-card select, .login-card button {
  width:100%; padding:10px; border-radius:10px; border:1px solid var(--border);
  background:#0e1426; color:var(--fg);
}
.login-card button { margin-top:14px; border:0; background:var(--brand); color:white; font-weight:700; cursor:pointer; }

/* Register small link fallback */
.register-row { margin-top:10px; display:flex; justify-content:center; }

/* Message */
.msg { margin-top:10px; color:#ff8a8a; min-height:1.2em; }

/* General buttons (primary) */
.btn {
  display:inline-block;
  padding:10px 12px;
  border-radius:10px;
  background: linear-gradient(180deg,var(--brand), #2146d9);
  color:#fff; text-decoration:none; border:0; cursor:pointer;
  box-shadow: 0 8px 20px rgba(58,102,255,0.12);
  text-align:center;
  min-height:var(--touch-min);
}

/* Form standard look (unified "email look") */
input[type="text"], input[type="email"], input[type="date"], input[type="password"], select, textarea {
  padding:10px 12px; border-radius:10px; border:1px solid rgba(255,255,255,0.04);
  background: linear-gradient(180deg, rgba(7,12,22,0.6), rgba(7,12,22,0.9));
  color: var(--fg); width:100%;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.02);
}
input::placeholder { color: rgba(255,255,255,0.35); }
input:focus, select:focus, textarea:focus { outline:none; border-color:rgba(58,102,255,0.85); box-shadow:0 8px 24px rgba(58,102,255,0.06); }

/* Cards container */
.eb-container { max-width:95%; }

/* User card / tables */
.user-card { margin: 2rem auto; max-width: var(--max-width); }
.user-card h2 { margin-top:0; margin-bottom:1rem; }
.user-table { width:100%; border-collapse:collapse; }
.user-table th, .user-table td { border:1px solid rgba(255,255,255,0.03); padding:0.6em 0.9em; text-align:left; color:var(--fg); }
.user-table th { background:#1e2a4a; color:#c7d2ff; font-weight:700; }
.user-table td { color:#e5e7eb; white-space:nowrap; }

/* small helper column */
.user-table th.action-col, .user-table td.action-col { width:1%; white-space:nowrap; }

/* Status dot */
.status-dot { display:inline-block; width:20px; height:20px; border-radius:50%; text-align:center; line-height:20px; font-size:12px; }
.status-dot.green { background:#39d353; color:#062b10; }
.status-dot.red { background:#ff4d4d; color:#2a0606; }

/* Footer (fixed bottom like eb_start) */
.site-footer {
  display:flex; gap:16px; justify-content:space-between; align-items:center;
  border-top:1px solid var(--border); background:var(--bg-2); padding:10px clamp(16px,4vw,48px);
  font-size:14px; color:var(--muted);
  position:fixed; left:0; right:0; bottom:0; height:36px; box-sizing:border-box;
}

/* Compact table action buttons (use class .table-btn on action links) */
.table-btn {
  display:inline-block;
  padding:4px 8px;
  min-width:64px;
  font-size:0.88rem;
  line-height:1;
  border-radius:7px;
  background: linear-gradient(180deg,#2e66ff,#2146d9);
  color:#fff;
  text-decoration:none;
  border:0;
  box-shadow: 0 6px 14px rgba(58,102,255,0.10);
  text-align:center;
  vertical-align:middle;
}

/* Slightly smaller on very small screens */
@media (max-width:520px) {
  .table-btn { padding:4px 7px; min-width:56px; font-size:0.86rem; }
}

/* Make sure form primary buttons inside cards stay full width and larger */
.login-card .btn,
.card .btn,
.user-card .card-primary {
  width:100%;
  padding:12px 14px;
  min-height:44px;
  font-weight:700;
}

/* Utility: responsive wrappers & small screens */
@media (max-width: 900px) {
  .login-card { width: calc(100% - 32px); }
  .logo { font-size: 26px; }
  .site-header { padding: 14px 16px; }
  .user-card { margin: 1.5rem 12px; }
  .user-table th, .user-table td { font-size: 14px; }
}
@media (max-width: 520px) {
  .site-header { grid-template-columns: 40px 1fr auto; padding:10px; }
  .logo { font-size: 22px; }
  .user-table, .user-table thead, .user-table tbody, .user-table th, .user-table td, .user-table tr { display:block; }
  .user-table thead { display:none; }
  .user-table tr { margin-bottom:12px; padding:12px; border-radius:10px; background: rgba(255,255,255,0.01); border:1px solid rgba(255,255,255,0.02); }
  .user-table td { display:flex; justify-content:space-between; padding:8px 6px; }
  .user-table td::before { content: attr(data-label) ": "; color:var(--muted); width:40%; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
}

/* Accessibility */
button:focus, a:focus, input:focus, select:focus { outline: 3px solid rgba(58,102,255,0.18); outline-offset:2px; }

/* Minimal helper classes used across pages */
.text-muted { color:var(--muted); font-size:0.95rem; }
.center { text-align:center; }
.small { font-size:0.9rem; color:var(--muted); margin-top:8px; }

/* Improve select dropdown contrast and focus visibility (dark theme)
   Note: styling of native <option> is limited in some browsers, but these rules
   improve contrast in most modern browsers (Chrome, Firefox, Edge, Safari).
*/
select {
  color: var(--fg);
  background: linear-gradient(180deg, rgba(7,12,22,0.6), rgba(7,12,22,0.9));
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  padding: 10px 40px 10px 12px;
  border-radius: 12px;
  font-size: 1rem;
  border: 1px solid rgba(255,255,255,0.04);
  background-image:
    linear-gradient(180deg, rgba(7,12,22,0.6), rgba(7,12,22,0.9)),
    url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='8' viewBox='0 0 24 24'%3E%3Cpath fill='%23c7d2ff' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
select:focus {
  border-color: rgba(58,102,255,0.95);
  box-shadow: 0 12px 36px rgba(58,102,255,0.12);
  outline: none;
}
select option {
  background: var(--card);
  color: var(--fg);
  padding: 6px 10px;
}
select option:hover,
select option:checked {
  background: linear-gradient(180deg,var(--brand), #2146d9);
  color: #fff;
}
select::-ms-expand { filter: invert(1); }

/* --- Einheitliche Button-Standards (Ans Ende der Datei) --- */

/* Basis für alle Buttons und Button-Inputs */
button, input[type="button"], input[type="submit"], .table-btn, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  font-size: 0.95rem;
  line-height: 1;
  border-radius: 10px;
  border: 0;
  cursor: pointer;
  text-decoration: none;
  color: #fff;
  background: linear-gradient(180deg, var(--brand), #2146d9);
  box-shadow: 0 8px 20px rgba(58,102,255,0.12);
  transition: transform .08s ease, box-shadow .12s ease, opacity .08s ease;
  min-height: var(--touch-min);
  box-sizing: border-box;
}

/* Varianten: sekundär / ghost / danger / outline */
.btn-secondary, .btn-ghost, .btn-danger, .btn-outline {
  background: transparent;
  color: var(--fg);
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow: none;
}

/* Primary bleibt kräftig */
.btn-primary, .btn {
  background: linear-gradient(180deg, var(--brand), #2146d9);
  color: #fff;
}

/* Danger */
.btn-danger {
  background: linear-gradient(180deg, #ff5b6b, #d43b4f);
  color: #fff;
}

/* Warning (gelb) */
.btn-warning {
  background: linear-gradient(180deg, #ffd24d, #ffb62b);
  color: #1a1200;
  box-shadow: 0 8px 20px rgba(255,182,43,0.12);
  border: 1px solid rgba(255,200,80,0.12);
}

/* Outline (invertierbar) */
.btn-outline {
  background: transparent;
  color: var(--brand);
  border: 1px solid rgba(58,102,255,0.12);
  box-shadow: none;
}

/* Kleine Buttons (z. B. Tabellen-Aktionen) */
.table-btn {
  padding: 6px 10px;
  min-width: 56px;
  font-size: 0.88rem;
  border-radius: 8px;
  box-shadow: 0 6px 14px rgba(58,102,255,0.10);
}

/* Icon-only oder sehr kleine Version */
.btn-sm {
  padding: 6px 8px;
  font-size: 0.85rem;
  min-height: 36px;
}

/* „Hinzufügen“ / „Entfernen“ Buttons */
.btn-add {
  background: linear-gradient(180deg, #2fb04f, #1f8a3a);
  color: #062b10;
  box-shadow: 0 6px 18px rgba(47,176,79,0.10);
  padding: 6px 10px;
  font-size: 0.86rem;
  border-radius: 8px;
}
.btn-remove {
  background: linear-gradient(180deg, #ff6b6b, #d94b4b);
  color: #fff;
  padding: 6px 10px;
  font-size: 0.86rem;
  border-radius: 8px;
}

/* Menü-Button (kleiner, ikonzentriert) */
.menu-btn {
  padding: 8px;
  width:40px;
  height:40px;
  border-radius:10px;
  display:grid;
  place-items:center;
  border: 1px solid rgba(255,255,255,0.04);
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(0,0,0,0.04));
  box-shadow: 0 6px 18px rgba(0,0,0,0.35);
}

/* Full-width / block button (z.B. "Rotte Starten" im user-card) */
.btn-block {
  display: block !important;
  width: 100% !important;
  box-sizing: border-box;
  margin-top: 18px; /* Abstand: entspricht ungefähr "2 Zeilen" */
}

/* Hover / Active / Focus für alle Buttons */
button:hover, .btn:hover, .table-btn:hover, input[type="button"]:hover, input[type="submit"]:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 30px rgba(58,102,255,0.14);
  opacity: 0.98;
}
button:active, .btn:active {
  transform: translateY(0);
  box-shadow: 0 6px 14px rgba(0,0,0,0.45);
}
button:focus, .btn:focus, .table-btn:focus {
  outline: none;
  box-shadow: 0 0 0 4px rgba(58,102,255,0.12), 0 12px 30px rgba(58,102,255,0.10);
  border-radius: 10px;
}

/* Form-spezifische Regeln beibehalten, aber auf neue Basis abstimmen */
.login-card .btn, .card .btn, .user-card .card-primary {
  width: 100%;
  padding: 12px 14px;
  min-height: 44px;
  font-weight: 700;
  border-radius: 10px;
}

/* Mobile: kleinere Anpassungen */
@media (max-width:520px) {
  .btn { padding: 10px 12px; font-size: 0.95rem; }
  .table-btn { padding: 6px 8px; min-width: 48px; font-size: 0.84rem; }
  .menu-btn { width:40px; height:40px; }
  .btn-block { margin-top: 14px; }
}

/* End of unified stylesheet (base) */

/* === Menü-Erweiterungen (ans Ende der Datei) ===
   Macht das Side-Menu sichtbar über der fixierten Kopfzeile, fügt Backdrop hinzu
   und sorgt dafür, dass der Menü-Button immer klickbar bleibt.
*/

.side-menu {
  /* animation: slide from left */
  position: fixed;
  top: 0;
  left: 0; /* base position; we hide with transform */
  transform: translateX(-100%);
  width: 240px;
  max-width: 88vw;
  height: 100%;
  background: var(--card, #0f172a);
  padding: 2em 1em;
  transition: transform 0.28s cubic-bezier(.2,.9,.2,1), opacity 0.18s ease;
  z-index: 10060; /* deutlich über der Kopfzeile (header sollte niedriger sein als 10060) */
  box-shadow: 0 18px 48px rgba(3,6,20,0.6);
  pointer-events: none;
  opacity: 0;
  overflow:auto;
  -webkit-overflow-scrolling: touch;
}

/* open state */
.side-menu.open {
  transform: translateX(0);
  pointer-events: auto;
  opacity: 1;
}

/* ensure menu list style */
.side-menu ul { list-style: none; padding: 0; margin: 0; }
.side-menu li { margin: 0.8em 0; }
.side-menu a {
  display: block;
  color: #c7d2ff;
  text-decoration: none;
  padding: 0.6em 1em;
  border-radius: 0.5em;
  transition: background 0.18s;
}
.side-menu a:hover { background: #1e2a4a; }

/* Backdrop behind menu (but above other content) */
.menu-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 10050; /* behind the menu itself but over content */
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}
.menu-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

/* Keep menu button clickable on top of everything */
/* menu-btn gets an intentionally high z-index to remain clickable when header is fixed */
.menu-btn {
  position: relative;
  z-index: 10070 !important; /* highest so user can open/close reliably */
}

/* Accessibility: show focus visible in menu */
.side-menu :focus { outline: 3px solid rgba(58,102,255,0.16); outline-offset:2px; }

/* Variant if you later want the menu to start under the header:
   .side-menu.menu-under-header { top: var(--header-height, 72px); height: calc(100% - var(--header-height,72px)); z-index:10050; }
   Optionally set --header-height via JS if header size changes dynamically.
*/

/* ===================================================================
   Header: kompaktere Variante (ca. 50% niedriger)
   Füge diesen Block ans ENDE von assets/css/testula.css ein.
   =================================================================== */

/* Basis: kompakter Header */
:root {
  --header-height-compact: 48px; /* fallback für JS / main-padding */
  /* keep existing header height var in sync */
  --header-height: var(--header-height-compact);
}

/* Make the header fixed at the top so it doesn't disappear on scroll.
   It keeps the same visual layout but is removed from normal flow:
   - header: position:fixed; top:0; left:0; right:0
   - header's z-index is intentionally lower than the side-menu/backdrop/menu-btn
*/
.site-header {
  /* weniger padding oben/unten, kleinerer gap */
  padding: 8px clamp(8px, 2.2vw, 20px);
  grid-template-columns: 36px 1fr auto;
  gap: 10px;
  align-items: center;
  height: auto;
  min-height: var(--header-height-compact);

  /* make it fixed so it stays visible while scrolling */
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  /* keep header below the side-menu and backdrop which use z-index 10050+ */
  z-index: 9990;
  background: linear-gradient(180deg, rgba(10,14,30,0.8), rgba(10,14,30,0.6)); /* subtle bg so content below doesn't peek through */
  backdrop-filter: blur(4px);
  border-bottom: 1px solid rgba(255,255,255,0.03);
}

/* Menü-Button kleiner */
.menu-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  padding: 4px;
  display: grid;
  place-items: center;
}

/* Hamburger-Streifen anpassen */
.menu-btn span {
  display: block;
  width: 14px;
  height: 2px;
  background: var(--fg);
  box-shadow: 0 5px 0 var(--fg), 0 -5px 0 var(--fg);
}

/* Logo deutlich kleiner, behält responsive Skalierung */
.logo {
  margin-left: 8px;
  font-size: clamp(14px, 3.2vw, 28px); /* ca. 50% der bisherigen Maximalgröße */
  line-height: 1;
}

/* rechter Bereich (Benutzer) in header kompakter */
.site-header > div[style] {
  margin-left: auto;
  font-size: 0.92rem;
  line-height: 1;
}

/* Main padding fallback: berücksichtigt kompakte Header-Höhe
   (bestehende JS, das main padding-top setzt, überschreibt dieses Inline-Wert) */
/* Apply the padding to the page container so content isn't hidden beneath the fixed header.
   To enable, add the class .fixed-header-padding to the .page element in your templates,
   or add this rule globally if you always want the header fixed. */
.page { padding-top: var(--header-height); }

/* Responsive: auf sehr kleinen Bildschirmen noch kompakter */
@media (max-width: 520px) {
  :root { --header-height-compact: 44px; --header-height: var(--header-height-compact); }
  .site-header { padding: 6px 10px; grid-template-columns: 36px 1fr auto; }
  .menu-btn { width: 28px; height: 28px; }
  .menu-btn span { width: 12px; }
  .logo { font-size: clamp(14px, 4.6vw, 20px); }
}

/* Accessibility / focus: kleinere outline so that header stays compact */
.site-header :focus { outline-offset: 2px; }

/* --- append: ensure header remains fixed on all viewport sizes --- */
.site-header {
  position: fixed !important;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10090 !important; /* über dem normalen Inhalt, aber unter dem Side-Menu */
  background: linear-gradient(180deg, rgba(10,14,30,0.88), rgba(10,14,30,0.7));
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

/* Erzwinge das Page-Padding, damit Inhalt nicht unter die fixe Kopfzeile rutscht */
.page {
  padding-top: calc(var(--header-height) + 6px) !important;
}