:root{
  --brand:#0077cc;
  --text:#111;
  --muted:#666;
  --border:#e6e6e6;
  --bg:#ffffff;

  --danger:#d32f2f;
  --dangerHover:#b71c1c;
  --primary:#1976d2;
  --primaryHover:#155fa0;

  --shadow: 0 2px 10px rgba(0,0,0,0.12);
}

*{ box-sizing:border-box; }

body{
  font-family: Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  max-width: 900px;
  margin: 32px auto;
  padding: 0 16px;
  line-height: 1.6;
  text-align: center;
}

/* Listen in Inhaltskarten linksbündig darstellen */
.card ul{
  text-align: left;
  margin: 12px auto;
  max-width: 720px;
  padding-left: 0.4em;
}

.card ul li{
  margin: 6px 0;
}

/* Links */
a{
  color: var(--brand);
  text-decoration: none;
}
a:hover{ text-decoration: underline; }

/* Header / Footer */
header, footer{
  margin: 18px 0;
  padding: 14px 0;
}
header{ border-bottom: 1px solid var(--border); }
footer{
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 14px;
}

/* Nav */
.nav{
  display:flex;
  gap:14px;
  justify-content:center;
  flex-wrap:wrap;
  margin-top:10px;
}

.nav a{
  padding: 6px 10px;
  border:1px solid var(--border);
  border-radius: 10px;
  background:#fafafa;
  color: var(--text);
  text-decoration:none;
}

.nav a:hover{
  text-decoration:none;
  background:#f0f6ff;
}

.nav a.active{
  border-color: var(--brand);
}

/* Logout im Nav */
.nav a.logout-link{
  background-color: #c62828;
  border-color: #c62828;
  color: #fff;
}
.nav a.logout-link:hover{
  background-color: #a00000;
  border-color: #a00000;
}

/* Logo */
.logo{
  height: 110px;
  width: auto;
  margin: 14px auto 6px;
}

/* Cards / Notices */
.notice{ color:var(--muted); }
.error{ color:#b00020; margin-top:10px; }

.card{
  border:1px solid var(--border);
  border-radius:12px;
  padding:16px;
  margin:16px 0;
  background:#fff;
}

/* Public Forms (Default look) */
form{ margin-top: 18px; }

input, textarea, select{
  padding:10px;
  margin:8px 0;
  border:1px solid var(--border);
  border-radius:10px;
  font: inherit;
}

input, textarea{
  width: 260px;
  max-width: 90%;
}

/* Checkboxen & Radios dürfen NICHT die globale Input-Breite erben */
input[type="checkbox"],
input[type="radio"]{
  width: auto !important;
  max-width: none !important;
  margin: 0;              /* optional */
}

textarea{
  width: 100%;
  max-width: 100%;
}

select{
  max-width: 100%;
}

button{
  background: var(--brand);
  color: white;
  padding: 10px 18px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
}

button:hover{
  filter: brightness(0.95);
}

/* Focus (Accessibility) */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible{
  outline: 3px solid rgba(0,119,204,0.25);
  outline-offset: 2px;
}

/* ----------------------------
   Admin Dashboard Layout
---------------------------- */
.admin-wrap{
  max-width: 1200px;
  margin: 24px auto;
  padding: 0 16px;
  text-align: left;
}

.admin-header{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:16px;
  margin-bottom: 14px;
}

.admin-header h1{
  margin: 0;
  font-size: 28px;
}

.admin-sub{
  color: var(--muted);
  margin-top: 6px;
}

/* KPI */
.kpi-row{
  display:grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap:14px;
  margin: 16px 0 18px;
}

.kpi{
  border:1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  background: #fff;
  box-shadow: var(--shadow);
}

.kpi .label{ color: var(--muted); font-size: 13px; }
.kpi .value{ font-size: 26px; font-weight: 700; margin-top: 6px; }

/* Tiles */
.tile-grid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap:14px;
}

.tile{
  display:block;
  border:1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  background:#fff;
  box-shadow: var(--shadow);
  text-decoration:none;
  color: var(--text);
  transition: transform 120ms ease, background 120ms ease;
}

.tile:hover{
  transform: translateY(-1px);
  text-decoration:none;
}

.tile .title{
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 6px;
}

.tile .desc{
  color: var(--muted);
  margin: 0;
}

.tile .meta{
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.badge{
  display:inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  border:1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
  margin-left: 8px;
}

/* ToDo/Info Box */
.todo{
  margin: 14px 0 18px;
  border:1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  background: #fafafa;
}

/* Tile Lists (links inside tile) */
.tile .list{
  display:block;
  margin: 6px 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fafafa;
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration:none;
  transition: background 120ms ease;
}

.tile .list:hover{
  background: #f0f6ff;
  text-decoration:none;
}

/* ----------------------------
   Admin Buttons (.btn)
   (Works for <a> and <button>)
---------------------------- */
.btn,
a.btn,
button.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap: 6px;

  padding: 6px 12px;
  min-height: 34px;
  line-height: 1;

  border-radius: 8px;
  border: 1px solid transparent;

  font-size: 14px;
  font-weight: 600;

  text-decoration:none;
  cursor:pointer;
  white-space:nowrap;

  transition: background 120ms ease, border-color 120ms ease, filter 120ms ease;
}

/* Wichtig: verhindert, dass das globale button{} die Admin-Buttons „übermalt“ */
button.btn{
  background: transparent;
  color: inherit;
  margin: 0;
  padding: 6px 12px; /* überschreibt globales button padding */
}

/* Farben */
.btn-primary{
  background: var(--primary);
  color:#fff;
}
.btn-primary:hover{ background: var(--primaryHover); }

.btn-secondary{
  background:#f5f5f5;
  color:#333;
  border-color:#ccc;
}
.btn-secondary:hover{ background:#eaeaea; }

.btn-danger{
  background: var(--danger);
  color:#fff;
}
.btn-danger:hover{ background: var(--dangerHover); }

/* Responsive */
@media (max-width: 980px){
  .kpi-row{ grid-template-columns: repeat(2, 1fr); }
  .tile-grid{ grid-template-columns: 1fr; }
}

/* ================================
   Statistik – Säulendiagramme
   ================================ */

.bar-chart{
  display: flex;
  gap: 12px;
  align-items: flex-end;
  padding: 10px 0;
  overflow-x: auto;
}

.bar-item{
  width: 46px;
  flex: 0 0 auto;
  text-align: center;
}

.bar{
  width: 46px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fafafa;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column-reverse;
}

.bar-paid{
  background: #2e7d32;   /* grün = bezahlt */
}

.bar-open{
  background: #bdbdbd;   /* grau = offen */
}

.bar-label{
  margin-top: 6px;
  font-weight: 700;
  font-size: 12px;
}

.bar-value{
  font-size: 12px;
  color: var(--muted);
}

/* Damit Balken auch bei kleinen Werten sichtbar bleiben */
.bar{
  min-height: 10px;          /* verhindert 0px Bars */
}

/* Segmente sollen sich im Flex-Container korrekt verhalten */
.bar-paid,
.bar-open{
  width: 100%;
  min-height: 2px;           /* verhindert “unsichtbar” bei sehr kleinen % */
}

/* Auswahl-Spalte in Bestelltabellen */
/* Auswahl-Spalte */
.col-select{
  width: 56px;
  padding: 8px;                 /* 👈 Abstand zum Rand */
  text-align: center;
  background: #f5f5f5;
  vertical-align: middle;
}

/* Kopfzeile optional etwas dunkler */
th.col-select{
  background: #f0f0f0;
  border-bottom: 1px solid var(--border);
}

/* Checkboxen darin sauber zentrieren */
.col-select input[type="checkbox"]{
  width: auto;
  margin: 0;
  transform: scale(1.1);        /* optional, etwas besser klickbar */
}

.actions-row{
  display:flex;
  gap:10px;
  align-items:center;
  white-space:nowrap;
}

.actions-inline{
  display:inline-flex;
  margin:0;
}

@media (max-width: 980px){
  .actions-row{
    flex-wrap:wrap;
    white-space:normal;
  }
}

/* Universeller Aktions-Button (Header-Stil) */
.action-link{
  display:inline-flex;
  align-items:center;
  justify-content:center;

  padding: 6px 12px;
  min-height: 34px;

  border:1px solid var(--border);
  border-radius:10px;

  background:#fafafa;
  color:var(--text);
  text-decoration:none;

  font-size:10px;
  font-weight:600;

  cursor:pointer;
  white-space:nowrap;

  transition: background 120ms ease, border-color 120ms ease;
}

.action-link:hover{
  background:#f0f6ff;
  text-decoration:none;
}

/* Varianten */
.action-link.primary{
  background: var(--primary);
  border-color: var(--primary);
  color:#fff;
}
.action-link.primary:hover{
  background: var(--primaryHover);
}

.action-link.danger{
  background:#fdecea;
  border-color:#f3c7c7;
  color:#b00020;
}
.action-link.danger:hover{
  background:#f8d7da;
}

/* Header-Button-Look überall nutzbar */
.navbtn{
  display:inline-flex;
  align-items:center;
  justify-content:center;

  padding: 10px 18px;          /* wie deine button{} */
  border:1px solid var(--border);
  border-radius: 12px;

  background:#fafafa;
  color: var(--text);
  text-decoration:none;

  font-weight: 600;
  font-size: 15px; 
  line-height: 1;
  cursor:pointer;
  white-space:nowrap;
}

.navbtn:hover{
  background:#f0f6ff;
  text-decoration:none;
}

/* aktive/primäre Variante (wie Admin-Outline im Header) */
.navbtn-outline{
  border-color: var(--brand);
}

/* Logout/Danger Variante (wie Logout im Header) */
.navbtn-danger{
  background:#c62828;
  border-color:#c62828;
  color:#fff;
}
.navbtn-danger:hover{
  background:#a00000;
  border-color:#a00000;
}

/* optional: feste Breite, wenn du die 3 Buttons gleich breit willst */
.navbtn-w{
  width: 120px;
}

.actions-nav{
  display:flex;
  gap:8px;          /* 👈 enger als Header */
  align-items:center;
}

.actions-col{
  display:flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}
.actions-inline{ margin:0; }