:root{
  --bg:#0b0f1a;
  --card:#0f172a;
  --fg:#e5e7eb;
  --muted:#9ca3af;
  --border:rgba(255,255,255,.12);
  --accent:#60a5fa;
  --danger:#f87171;
  --ok:#34d399;
}
*{box-sizing:border-box}
body{
  margin:0;
  background:radial-gradient(1200px 600px at 50% 20%, #111827 0%, var(--bg) 55%, #000 100%);
  color:var(--fg);
  font:16px/1.45 system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
}
a{color:var(--accent); text-decoration:none}
.container{max-width:1100px; margin:0 auto; padding:16px}
.header{
  display:flex; gap:12px; align-items:center; justify-content:space-between;
  padding:12px 16px; border-bottom:1px solid var(--border);
  background:rgba(15,23,42,.65); backdrop-filter: blur(8px);
  position:sticky; top:0; z-index:10;
}
.brand{font-weight:700}
.nav{display:flex; gap:10px; flex-wrap:wrap; align-items:center}
.card{
  background:rgba(15,23,42,.75);
  border:1px solid var(--border);
  border-radius:14px;
  padding:14px;
  box-shadow:0 10px 30px rgba(0,0,0,.25);
}
.grid{display:grid; gap:12px}
.grid-2{grid-template-columns:repeat(2,minmax(0,1fr))}
@media(max-width:760px){ .grid-2{grid-template-columns:1fr} }

table{width:100%; border-collapse:collapse; font-size:14px}
th,td{padding:10px 8px; border-bottom:1px solid var(--border); vertical-align:middle}
th{color:var(--muted); text-align:left; font-weight:600}
.badge{
  display:inline-block; padding:3px 8px; border-radius:999px; font-size:12px;
  border:1px solid var(--border); color:var(--muted);
}
.badge.ok{color:var(--ok)}
.badge.no{color:var(--danger)}
input,select,button,textarea{
  width:100%;
  padding:10px 12px;
  border-radius:10px;
  border:1px solid var(--border);
  background:#0b1224;
  color:var(--fg);
}
textarea{min-height:90px; resize:vertical}
button{cursor:pointer; background:#0b1224}
button.primary{background:rgba(96,165,250,.18); border-color:rgba(96,165,250,.35)}
.small{font-size:12px; color:var(--muted)}
.row{display:flex; gap:10px; align-items:center; flex-wrap:wrap}
.row > *{flex:1}
.checkbox{width:auto; transform:scale(1.1)}
hr{border:0; border-top:1px solid var(--border); margin:14px 0}

/* --- Login Theme (rot) --- */
body.login{
  background:radial-gradient(1200px 600px at 50% 20%, #7f1d1d 0%, #450a0a 55%, #000 100%);
}
.logo-wrap{display:flex;justify-content:center;margin:6px 0 14px}
.logo{max-width:180px;width:60%;height:auto;display:block;filter: drop-shadow(0 10px 20px rgba(0,0,0,.35))}
.alpha{display:flex;gap:6px;flex-wrap:wrap}
.alpha a{
  padding:6px 10px;
  border:1px solid rgba(255,255,255,.2);
  border-radius:999px;
  background:rgba(15,23,42,.55);
  font-size:13px;
}
.alpha a.active{
  border-color: rgba(96,165,250,.45);
  background: rgba(96,165,250,.18);
}

	  /* =========================================
   Ausgabe-Tracking: Desktop Tabelle / Mobile Karten
   ========================================= */

.only-desktop{ display:block; }
.only-mobile{ display:none; }

@media (max-width: 760px){
  .only-desktop{ display:none; }
  .only-mobile{ display:block; }
}

.mcard{ display:grid; gap:12px; }

.mitem{
  border:1px solid var(--border);
  border-radius:14px;
  padding:12px;
  background:rgba(15,23,42,.75);
  box-shadow:0 10px 30px rgba(0,0,0,.15);
}

.mitem .topline{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:12px;
}

.mitem .name{ font-weight:800; }
.mitem .meta{ font-size:12px; color:var(--muted); margin-top:2px; }

.mitem .status{
  font-size:12px;
  border:1px solid var(--border);
  border-radius:999px;
  padding:3px 8px;
  white-space:nowrap;
}

.mitem .status.ok{ color:var(--ok); }
.mitem .status.no{ color:var(--danger); }

.btn-wide{
  width:100%;
  padding:12px 14px;
  border-radius:12px;
}

	  
/* =========================================
   Ausgabe-Tracking: Mobile Card Fix + View Toggle Buttons
   ========================================= */

.view-toggle{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:10px;
}
.view-toggle a{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:8px 12px;
  border-radius:999px;
  border:1px solid var(--border);
  background:rgba(15,23,42,.55);
  font-size:13px;
  color:var(--fg);
}
.view-toggle a.active{
  border-color: rgba(96,165,250,.45);
  background: rgba(96,165,250,.18);
}

/* Mobile layout improvements */
@media (max-width: 760px){
  .mitem{ padding:16px; }
  .mitem .topline{ flex-direction:column; align-items:flex-start; }
  .mitem .status{ align-self:flex-start; }
  .mitem .meta{ margin-top:8px; font-size:13px; }
  .mitem .actions{
    display:grid;
    gap:10px;
  }
  .mitem .actions .toggle{
    width:100%;
    justify-content:space-between;
  }
  .btn-wide{ padding:14px 14px; font-weight:700; }
}

	  
	  /* Statistik Kacheln */
.stats-grid{
  display:grid;
  grid-template-columns: repeat(auto-fit,minmax(160px,1fr));
  gap:14px;
  margin-top:12px;
}
.stat-card{
  padding:18px;
  border-radius:18px;
  border:1px solid var(--border);
  background:rgba(15,23,42,.75);
  text-align:center;
}
.stat-card .label{
  font-size:13px;
  color:var(--muted);
  margin-bottom:6px;
}
.stat-card .value{
  font-size:26px;
  font-weight:800;
}
.stat-card.total{ border-color:rgba(255,255,255,.15); }
.stat-card.ok{ border-color:rgba(34,197,94,.4); }
.stat-card.no{ border-color:rgba(239,68,68,.4); }
.stat-card.filter{ border-color:rgba(96,165,250,.4); }

	  
	  /* Statistik Kacheln (Admin) */
.stats-grid{
  display:grid;
  grid-template-columns: repeat(auto-fit,minmax(160px,1fr));
  gap:14px;
  margin-top:12px;
}
.stat-card{
  padding:18px;
  border-radius:18px;
  border:1px solid var(--border);
  background:rgba(15,23,42,.75);
  text-align:center;
}
.stat-card .label{ font-size:13px; color:var(--muted); margin-bottom:6px; }
.stat-card .value{ font-size:26px; font-weight:800; }
.stat-card.total{ border-color:rgba(255,255,255,.15); }
.stat-card.ok{ border-color:rgba(34,197,94,.4); }
.stat-card.no{ border-color:rgba(239,68,68,.4); }
.stat-card.filter{ border-color:rgba(96,165,250,.4); }
	  
	  /* =========================================
   View Toggle Buttons (Auto/Mobile/Desktop)
   ========================================= */
.view-toggle{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:10px;
}
.view-toggle a{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:8px 12px;
  border-radius:999px;
  border:1px solid var(--border);
  background:rgba(15,23,42,.55);
  font-size:13px;
  color:var(--fg);
  text-decoration:none;
}
.view-toggle a.active{
  border-color: rgba(96,165,250,.45);
  background: rgba(96,165,250,.18);
}

/* =========================================
   Statistik Kacheln
   ========================================= */
.stats-grid{
  display:grid;
  grid-template-columns: repeat(auto-fit,minmax(160px,1fr));
  gap:14px;
  margin-top:12px;
}
.stat-card{
  padding:18px;
  border-radius:18px;
  border:1px solid var(--border);
  background:rgba(15,23,42,.75);
  text-align:center;
}
.stat-card .label{ font-size:13px; color:var(--muted); margin-bottom:6px; }
.stat-card .value{ font-size:26px; font-weight:800; }
.stat-card.total{ border-color:rgba(255,255,255,.15); }
.stat-card.ok{ border-color:rgba(34,197,94,.4); }
.stat-card.no{ border-color:rgba(239,68,68,.4); }
.stat-card.filter{ border-color:rgba(96,165,250,.4); }

/* =========================================
   Custom Modal (statt browser confirm)
   ========================================= */
.modal-backdrop{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.55);
  backdrop-filter: blur(6px);
  display:none;
  align-items:center;
  justify-content:center;
  padding:18px;
  z-index:9999;
}
.modal-backdrop.open{ display:flex; }

.modal{
  width:min(520px, 100%);
  border:1px solid var(--border);
  border-radius:18px;
  background:rgba(15,23,42,.92);
  box-shadow:0 20px 60px rgba(0,0,0,.35);
  overflow:hidden;
}
.modal-header{
  padding:14px 16px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  border-bottom:1px solid var(--border);
}
.modal-title{
  font-weight:800;
  font-size:16px;
}
.modal-close{
  border:1px solid var(--border);
  background:rgba(255,255,255,.06);
  color:var(--fg);
  border-radius:10px;
  padding:6px 10px;
  cursor:pointer;
}
.modal-body{
  padding:16px;
  color:var(--fg);
}
.modal-body .muted{
  color:var(--muted);
  font-size:13px;
  margin-top:6px;
}
.modal-footer{
  padding:14px 16px;
  display:flex;
  gap:10px;
  justify-content:flex-end;
  border-top:1px solid var(--border);
}
.modal-footer .btn{
  padding:10px 14px;
  border-radius:12px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.06);
  color:var(--fg);
  cursor:pointer;
}
.modal-footer .btn.primary{
  border-color: rgba(96,165,250,.45);
  background: rgba(96,165,250,.18);
}
.modal-footer .btn.danger{
  border-color: rgba(239,68,68,.45);
  background: rgba(239,68,68,.16);
}
.modal-footer .btn.success{
  border-color: rgba(34,197,94,.45);
  background: rgba(34,197,94,.18);
}

	  
	  /* =========================================================
   MODERN STATE BUTTONS (Mobile + Desktop)
   - filled gradient feel
   - subtle glow
   - icons via ::before (no extra assets)
   ========================================================= */

:root{
  --btn-radius: 14px;
  --btn-shadow: 0 10px 24px rgba(0,0,0,.22);
}

/* Base */
.btn-state{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  padding:12px 14px;
  border-radius: var(--btn-radius);
  border:1px solid var(--border);
  background: rgba(255,255,255,.06);
  color: var(--fg);
  font-weight:800;
  letter-spacing:.2px;
  cursor:pointer;
  transition: transform .08s ease, filter .12s ease, box-shadow .12s ease, border-color .12s ease;
  box-shadow: 0 6px 16px rgba(0,0,0,.18);
}

.btn-state:active{ transform: translateY(1px) scale(.99); }

/* Icons */
.btn-state::before{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:24px;
  height:24px;
  border-radius:999px;
  font-size:14px;
  font-weight:900;
  background: rgba(255,255,255,.12);
  border:1px solid rgba(255,255,255,.12);
}

/* OPEN = green */
.btn-state-open{
  border-color: rgba(34,197,94,.50);
  background: linear-gradient(180deg, rgba(34,197,94,.22), rgba(34,197,94,.10));
  box-shadow: var(--btn-shadow);
}
.btn-state-open::before{ content:"✓"; background: rgba(34,197,94,.20); border-color: rgba(34,197,94,.40); }
.btn-state-open:hover{
  filter: brightness(1.06);
  box-shadow: 0 14px 34px rgba(34,197,94,.14), 0 10px 26px rgba(0,0,0,.20);
}

/* DONE = red */
.btn-state-done{
  border-color: rgba(239,68,68,.55);
  background: linear-gradient(180deg, rgba(239,68,68,.20), rgba(239,68,68,.10));
  box-shadow: var(--btn-shadow);
}
.btn-state-done::before{ content:"↺"; background: rgba(239,68,68,.18); border-color: rgba(239,68,68,.38); }
.btn-state-done:hover{
  filter: brightness(1.06);
  box-shadow: 0 14px 34px rgba(239,68,68,.14), 0 10px 26px rgba(0,0,0,.20);
}

/* Full width for mobile action button */
@media (max-width: 760px){
  .mitem .line3 .btn-state{
    width:100%;
    padding:14px 14px;
  }
}

	/* =========================================
   FIX: Such-/Filterleiste bleibt beim Scrollen sichtbar
   (unter dem sticky Header)
   ========================================= */

.sticky-tools{
  position: sticky;
  top: 64px;            /* unter Header (sticky) */
  z-index: 9;
}

.sticky-tools .tools-card{
  background: rgba(15,23,42,.88);          /* etwas dichter, damit Text darunter nicht durchscheint */
  backdrop-filter: blur(10px);
}

@media (max-width: 760px){
  .sticky-tools{ top: 58px; }
}


/* =========================
   Professional Login Layout
   ========================= */

body.login{
  min-height:100vh;
}

/* full-screen shell */
.login-shell{
  min-height:100vh;
  display:grid;
  grid-template-columns: 1.1fr .9fr;
  gap:0;
}

/* left brand panel */
.login-left{
  position:relative;
  padding:56px 56px;
  display:flex;
  flex-direction:column;
  justify-content:center;
  overflow:hidden;
}

/* subtle pattern */
.login-left::before{
  content:"";
  position:absolute;
  inset:-2px;
  background:
    radial-gradient(900px 520px at 30% 20%, rgba(255,255,255,.18) 0%, rgba(255,255,255,0) 60%),
    radial-gradient(700px 420px at 70% 70%, rgba(255,255,255,.10) 0%, rgba(255,255,255,0) 60%),
    linear-gradient(135deg, rgba(0,0,0,.18), rgba(0,0,0,.45));
  pointer-events:none;
  mix-blend-mode: overlay;
}

/* content above pattern */
.login-left > *{
  position:relative;
  z-index:1;
}

.login-brand{
  display:flex;
  flex-direction:column;
  gap:10px;
  align-items:flex-start;
  margin-bottom:22px;
}

.login-logo{
  width:220px;
  max-width:70%;
  height:auto;
  display:block;
  filter: drop-shadow(0 14px 26px rgba(0,0,0,.45));
}

.login-subtitle{
  font-weight:900;
  letter-spacing:2px;
  text-transform:uppercase;
  font-size:14px;
  color:rgba(255,255,255,.85);
}

.login-title{
  margin:0 0 10px;
  font-size:44px;
  line-height:1.05;
  letter-spacing:-.5px;
}

.login-lead{
  margin:0 0 22px;
  color:rgba(255,255,255,.82);
  max-width:48ch;
}

.login-bullets{
  display:grid;
  gap:10px;
  margin:0 0 18px;
  max-width:55ch;
}

.lb-item{
  display:flex;
  gap:10px;
  align-items:flex-start;
  color:rgba(255,255,255,.85);
}

.lb-dot{
  width:10px;
  height:10px;
  margin-top:6px;
  border-radius:999px;
  background: rgba(255,255,255,.75);
  box-shadow: 0 0 0 6px rgba(255,255,255,.08);
  flex: 0 0 auto;
}

.login-meta{
  margin-top:8px;
}

/* right login panel */
.login-right{
  padding:56px 28px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-left: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.18);
  backdrop-filter: blur(8px);
}

.login-card{
  width:min(420px, 100%);
  background:rgba(15,23,42,.78);
  border:1px solid rgba(255,255,255,.14);
  border-radius:18px;
  padding:18px;
  box-shadow: 0 18px 60px rgba(0,0,0,.35);
}

.login-card-head{
  margin-bottom:12px;
}

.login-card h2{
  margin:0;
  font-size:22px;
}

.login-error{
  margin:10px 0 12px;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid rgba(239,68,68,.45);
  background: rgba(239,68,68,.10);
  color: var(--fg);
}

.login-foot{
  margin-top:12px;
  opacity:.9;
}

/* responsive */
@media (max-width: 920px){
  .login-shell{ grid-template-columns: 1fr; }
  .login-right{ border-left:0; border-top:1px solid rgba(255,255,255,.10); }
  .login-left{ padding:42px 20px 22px; }
  .login-right{ padding:22px 20px 42px; }
  .login-title{ font-size:36px; }
}

@media (max-width: 420px){
  .login-title{ font-size:30px; }
  .login-logo{ width:200px; }
}
