/* ---------------------------------------------------------------
   Barverwaltung (white-label) — schlichtes, Apple-inspiriertes Design
--------------------------------------------------------------- */
:root {
  --bg: #F5F5F7;
  --surface: #FFFFFF;
  --text: #1D1D1F;
  --text-secondary: #6E6E73;
  --border: #E3E3E6;
  --accent: #007AFF;
  --accent-dark: #0056CC;
  --green: #34C759;
  --red: #FF3B30;
  --yellow: #FFCC00;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- Layout --- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 24px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.sidebar .brand {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  padding: 0 12px 20px 12px;
  color: var(--text);
}
.sidebar .brand span { color: var(--accent); }

.filiale-switch {
  padding: 0 12px 16px 12px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.filiale-switch label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.filiale-switch select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.filiale-fest {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
}

.user-box {
  margin-top: auto;
  padding: 14px 12px 4px 12px;
  border-top: 1px solid var(--border);
}
.user-name { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.logout-link { font-size: 13px; color: var(--red); font-weight: 600; }

/* --- Login-Seite --- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 20px;
}
.login-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px 28px;
  width: 100%;
  max-width: 360px;
}
.login-brand {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-align: center;
  color: var(--text);
}
.login-brand span { color: var(--accent); }
.login-card label { display: block; font-size: 13px; font-weight: 600; margin: 12px 0 5px; }
.login-card input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
}
.login-fehler {
  background: #FFF0EF;
  color: var(--red);
  border: 1px solid #F5C6C2;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 13.5px;
  margin-bottom: 8px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14.5px;
  font-weight: 500;
  margin-bottom: 2px;
  transition: background 0.15s ease;
}
.nav-link:hover { background: var(--bg); text-decoration: none; }
.nav-link.active { background: var(--accent); color: white; }
.nav-link .emoji { font-size: 16px; width: 20px; text-align: center; }

.main {
  flex: 1;
  padding: 32px 40px;
  max-width: 1400px;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 12px;
}

h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 4px 0; }
h2 { font-size: 19px; font-weight: 600; margin: 0 0 14px 0; }
.subtitle { color: var(--text-secondary); font-size: 14px; margin: 0; }

/* --- Cards / KPI --- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.kpi-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow);
}
.kpi-card .label { font-size: 12.5px; color: var(--text-secondary); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 8px; }
.kpi-card .value { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; }
.kpi-card .value.warn { color: var(--red); }

.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 24px;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent);
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}
.btn:hover { background: var(--accent-dark); text-decoration: none; color: white; }
.btn.secondary { background: var(--bg); color: var(--text); border: 1px solid var(--border); }
.btn.secondary:hover { background: #EBEBED; }
.btn.danger { background: var(--surface); color: var(--red); border: 1px solid var(--border); padding: 6px 12px; font-size: 13px; }
.btn.danger:hover { background: #FFF0EF; }
.btn.small { padding: 6px 12px; font-size: 13px; }

/* --- Forms --- */
label { display: block; font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-bottom: 5px; }
input, select, textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14.5px;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0,122,255,0.15);
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  align-items: end;
  margin-bottom: 16px;
}
.form-row-actions { display: flex; gap: 10px; margin-top: 4px; }

/* --- Tables --- */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-secondary);
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #FAFAFB; }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.badge.ok { background: #E4F8E9; color: #1B7F35; }
.badge.warn { background: #FDEAEA; color: #C41E1E; }

.empty-state { text-align: center; padding: 60px 20px; color: var(--text-secondary); }
.empty-state .emoji { font-size: 40px; margin-bottom: 12px; }

/* --- Dienstplan-Grid --- */
.dp-table { font-size: 13px; }
.dp-table input.dp-cell { width: 100%; padding: 6px 8px; font-size: 13px; text-align: center; }
.dp-table th { text-align: center; }
.week-nav { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.week-nav .kw-label { font-weight: 700; font-size: 16px; min-width: 220px; text-align: center; }

/* --- Misc --- */
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.text-secondary { color: var(--text-secondary); }
.mt-0 { margin-top: 0; }
.section-divider { border: none; border-top: 1px solid var(--border); margin: 28px 0; }
