/* === ZEITWERK PRO — KLASSISCHES BANKING DESIGN === */

:root {
  --primary-dark: #1E3A5F;
  --primary-mid: #2C5282;
  --primary-light: #B8C5D6;
  --accent: #C9A961;
  --accent-bg: #F8FAFB;

  --success: #2D6A4F;
  --success-bg: #D3E5DC;
  --danger: #9D2933;
  --danger-bg: #F5DBDD;
  --warning: #B45309;
  --warning-bg: #FEF5E7;
  --warning-border: #F4D8A4;
  --info: var(--primary-mid);
  --info-bg: #DBEAFE;

  --text-primary: #1E3A5F;
  --text-secondary: #5A6B7D;
  --text-muted: #8895A5;

  --border: #D1D9E0;
  --border-light: #E8ECEF;

  --bg-page: #F0F2F5;
  --bg-muted: #F5F7FA;
  --bg-white: #FFFFFF;

  --radius: 3px;
  --radius-lg: 4px;

  --shadow-sm: 0 1px 2px rgba(30, 58, 95, 0.08);
  --shadow-md: 0 2px 6px rgba(30, 58, 95, 0.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

/* === TYPOGRAPHY === */
.tabular { font-variant-numeric: tabular-nums; }
.font-bold { font-weight: 700; }
.text-muted { color: var(--text-secondary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-center { text-align: center; }
.text-right { text-align: right; }

/* === HEADER === */
.app-header {
  background: var(--primary-dark);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 4px solid var(--primary-mid);
  max-width: 1280px;
  margin: 0 auto;
}

.app-header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-logo {
  width: 40px;
  height: 40px;
  background: white;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-dark);
  font-weight: 700;
  font-size: 20px;
  flex-shrink: 0;
  overflow: hidden;
}

.app-header-title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: white;
  letter-spacing: 0.05em;
}

.app-header-subtitle {
  margin: 0;
  font-size: 11px;
  color: var(--primary-light);
  letter-spacing: 0.03em;
}

.app-header-user { text-align: right; }
.app-header-user-name { margin: 0; font-size: 13px; font-weight: 600; color: white; }
.app-header-user-meta { margin: 0; font-size: 10px; color: var(--primary-light); font-weight: 600; letter-spacing: 0.05em; }
.app-header-user-meta.super { color: #FCA5A5; }

/* === NAVIGATION === */
.app-nav {
  background: var(--primary-mid);
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 0;
  border-bottom: 1px solid var(--border);
  max-width: 1280px;
  margin: 0 auto;
}

.app-nav a {
  color: white;
  text-decoration: none;
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
}

.app-nav a:hover {
  background: rgba(255, 255, 255, 0.1);
  text-decoration: none;
}

.app-nav a.active {
  border-bottom-color: var(--accent);
  background: rgba(0, 0, 0, 0.15);
}

.nav-toggle { display: none; }

/* === MAIN === */
.app-main {
  padding: 20px 24px;
  max-width: 1280px;
  margin: 0 auto;
}

/* === FOOTER === */
.app-footer {
  background: var(--primary-dark);
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  max-width: 1280px;
  margin: 0 auto;
  color: var(--primary-light);
  margin-top: 32px;
}

.app-footer a {
  color: var(--primary-light);
  margin-left: 16px;
  text-decoration: none;
}

.app-footer a:hover { color: white; }

/* === CARDS === */
.card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 16px;
  overflow: hidden;
}

.card-header {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-header-title {
  margin: 0;
  font-size: 11px;
  color: var(--primary-dark);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.card-header-link {
  font-size: 11px;
  color: var(--primary-mid);
  font-weight: 600;
  text-decoration: none;
}

.card-body { padding: 20px; }

/* === STAT CARDS === */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.stat-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  border-left: 4px solid var(--primary-dark);
}

.stat-card.success { border-left-color: var(--success); }
.stat-card.warning { border-left-color: var(--warning); }
.stat-card.warning-fill {
  background: var(--warning-bg);
  border-color: var(--warning-border);
  border-left-color: var(--warning);
}
.stat-card.danger { border-left-color: var(--danger); }

.stat-label {
  margin: 0 0 4px;
  font-size: 10px;
  color: var(--text-secondary);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.stat-value {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  color: var(--primary-dark);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.stat-value.success { color: var(--success); }
.stat-value.warning { color: var(--warning); }
.stat-value.danger { color: var(--danger); }

.stat-meta {
  margin: 4px 0 0;
  font-size: 11px;
  color: var(--text-secondary);
}

/* === BUTTONS === */
.btn {
  background: white;
  color: var(--primary-dark);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
  display: inline-block;
  text-decoration: none;
  text-align: center;
}

.btn:hover {
  background: var(--bg-muted);
  border-color: var(--primary-mid);
  text-decoration: none;
}

.btn-primary {
  background: var(--primary-dark);
  color: white;
  border-color: var(--primary-dark);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
}

.btn-primary:hover {
  background: var(--primary-mid);
  border-color: var(--primary-mid);
  color: white;
}

.btn-success {
  background: var(--success);
  color: white;
  border-color: var(--success);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
}

.btn-success:hover { background: #1B5036; color: white; }

.btn-danger {
  background: var(--danger);
  color: white;
  border-color: var(--danger);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
}

.btn-danger:hover { background: #7A1F26; color: white; }

.btn-block { display: block; width: 100%; }

.btn-sm { padding: 6px 10px; font-size: 11px; }

.btn-large {
  padding: 14px 28px;
  font-size: 14px;
  letter-spacing: 0.05em;
}

/* === FORM === */
.form-group { margin-bottom: 14px; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-label {
  display: block;
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.form-input, .form-select, textarea.form-input {
  width: 100%;
  padding: 8px 12px;
  font-size: 13px;
  font-family: inherit;
  color: var(--primary-dark);
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.15s;
}

.form-input:focus, .form-select:focus, textarea.form-input:focus {
  outline: none;
  border-color: var(--primary-mid);
  box-shadow: 0 0 0 2px rgba(44, 82, 130, 0.15);
}

textarea.form-input { resize: vertical; min-height: 60px; }

/* === TABLE === */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.table thead th {
  background: var(--bg-muted);
  padding: 10px 16px;
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}

.table tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
}

.table tbody tr:hover { background: var(--bg-muted); }
.table tbody tr.table-row-warning { background: #FEF5E7; }
.table tbody tr.table-row-warning:hover { background: #FBE7C7; }

/* === BADGE === */
.badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.badge-info { background: var(--info-bg); color: var(--primary-dark); }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-muted { background: var(--bg-muted); color: var(--text-secondary); }

/* === STATUS DOT === */
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
}

.status-dot.active { background: var(--success); }
.status-dot.warning { background: var(--warning); }
.status-dot.urlaub { background: var(--info); }
.status-dot.krank { background: var(--danger); }

.status-text {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.status-text.active { color: var(--success); }
.status-text.warning { color: var(--warning); }
.status-text.urlaub { color: var(--info); }
.status-text.krank { color: var(--danger); }

/* === ALERT === */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius);
  margin: 12px 0;
}

.alert-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: white;
}

.alert-icon.info { background: var(--info); }
.alert-icon.warning { background: var(--warning); }
.alert-icon.danger { background: var(--danger); }
.alert-icon.success { background: var(--success); }

.alert-title { margin: 0; font-size: 13px; font-weight: 700; color: var(--primary-dark); }
.alert-text { margin: 4px 0 0; font-size: 12px; color: var(--text-secondary); }

.alert-info { background: var(--info-bg); border: 1px solid #93C5FD; }
.alert-warning { background: var(--warning-bg); border: 1px solid var(--warning-border); }
.alert-danger { background: var(--danger-bg); border: 1px solid #FCA5A5; }
.alert-success { background: var(--success-bg); border: 1px solid #86C19F; }

/* === TIMER === */
.timer-card {
  text-align: center;
  padding: 32px 20px;
  background: var(--accent-bg);
}

.timer-label {
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 600;
  letter-spacing: 0.05em;
}

.timer-display {
  margin: 0 0 8px;
  font-size: 48px;
  font-weight: 700;
  color: var(--primary-dark);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1;
}

.timer-meta {
  margin: 0 0 16px;
  font-size: 11px;
  color: var(--text-secondary);
}

/* === WEEK ROW === */
.week-row {
  display: grid;
  grid-template-columns: 100px 1fr 100px;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 12px;
  align-items: center;
}

.week-row:last-child { border-bottom: none; }
.week-row.active { background: var(--bg-muted); margin: 0 -20px; padding: 8px 20px; }

.week-day { font-weight: 600; color: var(--primary-dark); }
.week-time { color: var(--text-secondary); }
.week-total { font-weight: 700; text-align: right; color: var(--primary-dark); }

/* === QUICK ACTIONS === */
.quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 8px;
}

.quick-action {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  text-decoration: none;
  color: var(--primary-dark);
  transition: all 0.15s;
  display: block;
}

.quick-action:hover {
  border-color: var(--primary-mid);
  background: var(--bg-muted);
  text-decoration: none;
}

.quick-action-title { margin: 0 0 4px; font-size: 13px; font-weight: 700; color: var(--primary-dark); }
.quick-action-meta { margin: 0; font-size: 11px; color: var(--text-secondary); }


/* === V3 ADDITIONS === */

/* LOGO UPLOAD */
.logo-upload-area {
  border: 2px dashed var(--border);
  border-radius: 4px;
  padding: 32px 24px;
  text-align: center;
  background: var(--bg-muted);
  cursor: pointer;
  transition: all 0.15s;
}

.logo-upload-area:hover {
  border-color: var(--primary-mid);
  background: white;
}

.logo-upload-area.has-logo {
  padding: 16px;
  background: white;
  border-style: solid;
}

.logo-preview {
  max-width: 200px;
  max-height: 100px;
  object-fit: contain;
  margin: 0 auto 12px;
  display: block;
}

.logo-upload-text {
  margin: 0;
  font-size: 12px;
  color: var(--text-secondary);
}

.logo-upload-hint {
  margin: 4px 0 0;
  font-size: 11px;
  color: var(--text-muted);
}

/* COLOR PICKER */
.color-picker {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.color-swatch {
  width: 36px;
  height: 36px;
  border-radius: 4px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.15s;
}

.color-swatch:hover { transform: scale(1.1); }
.color-swatch.active { border-color: var(--primary-dark); transform: scale(1.1); }

/* SCHEDULE GRID */
.schedule-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.schedule-table th {
  background: var(--primary-dark);
  color: white;
  padding: 8px 6px;
  text-align: center;
  font-weight: 600;
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-right: 1px solid var(--primary-mid);
}

.schedule-table th:first-child { text-align: left; padding-left: 12px; }
.schedule-table th:last-child { border-right: none; }

.schedule-table td {
  padding: 6px;
  text-align: center;
  border-right: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
  background: var(--accent-bg);
}

.schedule-table td:first-child {
  text-align: left;
  padding: 10px 12px;
  font-weight: 600;
  color: var(--primary-dark);
  background: white;
  border-right: 1px solid var(--border-light);
}

.schedule-cell-frei {
  background: var(--bg-muted) !important;
  color: var(--text-muted);
}

.schedule-cell-urlaub {
  background: #DBEAFE !important;
  color: #1E40AF;
  text-align: center;
  padding: 8px 4px !important;
}

.schedule-cell-krank {
  background: #FEE2E2 !important;
  color: #991B1B;
  text-align: center;
  padding: 8px 4px !important;
}

.schedule-cell-dienstreise {
  background: #FED7AA !important;
  color: #9A3412;
  text-align: center;
  padding: 8px 4px !important;
}

/* Büyük harf U/K/D + küçük label altta */
.schedule-cell-urlaub .status-letter,
.schedule-cell-krank .status-letter,
.schedule-cell-dienstreise .status-letter {
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}
.schedule-cell-urlaub .status-label,
.schedule-cell-krank .status-label,
.schedule-cell-dienstreise .status-label {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.8;
}

/* Mobile - kompakt */
@media (max-width: 768px) {
  .schedule-cell-urlaub .status-letter,
  .schedule-cell-krank .status-letter,
  .schedule-cell-dienstreise .status-letter {
    font-size: 16px;
  }
  .schedule-cell-urlaub .status-label,
  .schedule-cell-krank .status-label,
  .schedule-cell-dienstreise .status-label {
    font-size: 8px;
  }
}

.schedule-time {
  font-weight: 600;
  color: var(--primary-dark);
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
}

.schedule-legend {
  background: var(--bg-muted);
  padding: 12px 20px;
  border-top: 1px solid var(--border-light);
  display: flex;
  gap: 24px;
  font-size: 11px;
  flex-wrap: wrap;
}

.schedule-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.schedule-legend-color {
  width: 12px;
  height: 12px;
  border: 1px solid var(--border);
  flex-shrink: 0;
  box-sizing: border-box;
}

/* GEOFENCE MAP */
.map-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 16px;
}

.location-list-item {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: background 0.15s;
}

.location-list-item:hover { background: var(--bg-muted); }

.location-list-item.active {
  background: var(--bg-muted);
  border-left: 3px solid var(--primary-dark);
  padding-left: 17px;
}

.location-list-item:last-child { border-bottom: none; }

.location-name {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary-dark);
}

.location-address {
  margin: 2px 0 0;
  font-size: 11px;
  color: var(--text-secondary);
}

.location-meta {
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.map-canvas {
  width: 100%;
  height: 460px;
  background: linear-gradient(135deg, #E8EFE5 0%, #DDE5DA 100%);
  border-radius: 3px;
  position: relative;
  overflow: hidden;
}

.map-grid-pattern {
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 38px, rgba(180,190,170,0.4) 38px, rgba(180,190,170,0.4) 40px),
    repeating-linear-gradient(90deg, transparent, transparent 38px, rgba(180,190,170,0.4) 38px, rgba(180,190,170,0.4) 40px);
}

.map-street {
  position: absolute;
  background: #C8B58C;
  border-top: 1px solid #A89668;
  border-bottom: 1px solid #A89668;
}

.map-street-label {
  position: absolute;
  font-size: 9px;
  color: #6B5933;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.map-building {
  position: absolute;
  background: #B8B0A0;
  border: 1px solid #888076;
  border-radius: 2px;
}

.map-geofence {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: rgba(30, 58, 95, 0.15);
  border: 2px solid var(--primary-dark);
}

.map-pin {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary-dark);
  border: 3px solid white;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 13px;
}

.map-pin-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, calc(-50% + 32px));
  background: white;
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 4px 8px;
  font-size: 10px;
  color: var(--primary-dark);
  font-weight: 600;
  white-space: nowrap;
}

.map-controls {
  position: absolute;
  top: 12px;
  right: 12px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.map-control-btn {
  width: 22px;
  height: 22px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 2px;
  font-size: 14px;
  cursor: pointer;
  color: var(--primary-dark);
  font-weight: 700;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* RANGE SLIDER */
.range-slider {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 4px;
  background: var(--border-light);
  border-radius: 2px;
  outline: none;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  background: var(--primary-dark);
  border-radius: 50%;
  cursor: pointer;
}

.range-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: var(--primary-dark);
  border-radius: 50%;
  cursor: pointer;
  border: none;
}

/* AVATAR */
.avatar-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  color: var(--primary-dark);
  flex-shrink: 0;
}

.avatar-circle.lg { width: 48px; height: 48px; font-size: 16px; }

/* MODAL */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(30, 58, 95, 0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 24px;
}

.modal-overlay.show { display: flex; }

.modal {
  background: white;
  border-radius: 4px;
  width: 540px;
  max-width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.modal-header {
  background: var(--primary-dark);
  padding: 16px 24px;
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.modal-close {
  background: transparent;
  border: none;
  color: white;
  font-size: 22px;
  cursor: pointer;
  padding: 0;
  width: 28px;
  height: 28px;
  line-height: 1;
}

.modal-body { padding: 24px; }

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-light);
  background: var(--bg-muted);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* WELCOME CARD */
.welcome-card {
  background: linear-gradient(135deg, #1E3A5F 0%, #2C5282 100%);
  color: white;
  padding: 24px;
  border-radius: 3px;
  margin-bottom: 16px;
}

.welcome-title {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 700;
}

.welcome-subtitle {
  margin: 0;
  font-size: 13px;
  opacity: 0.85;
}

/* ROLE BADGES */
.role-badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.role-badge.inhaber { background: #FEE2E2; color: #991B1B; }
.role-badge.manager { background: #DBEAFE; color: var(--primary-dark); }
.role-badge.hr { background: #E0E7FF; color: #3730A3; }
.role-badge.teamleiter { background: var(--success-bg); color: var(--success); }
.role-badge.mitarbeiter { background: var(--bg-muted); color: var(--text-secondary); }

/* TOGGLE */
.toggle {
  width: 36px;
  height: 20px;
  background: var(--border);
  border-radius: 10px;
  position: relative;
  cursor: pointer;
  transition: background 0.15s;
  flex-shrink: 0;
  border: none;
  padding: 0;
}

.toggle.on { background: var(--success); }

.toggle::after {
  content: '';
  position: absolute;
  left: 2px;
  top: 2px;
  width: 16px;
  height: 16px;
  background: white;
  border-radius: 50%;
  transition: transform 0.15s;
}

.toggle.on::after { transform: translateX(16px); }

/* PAUSE BUTTON */
.btn-pause {
  background: var(--warning);
  color: white;
  border-color: var(--warning);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  margin-left: 8px;
}

.btn-pause:hover { background: #8C5811; }

.btn-pause-active {
  background: var(--warning-bg);
  color: var(--warning);
  border-color: var(--warning);
}

/* REPORT TABLES */
.report-month-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 20px;
  margin-bottom: 12px;
}

.report-month-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.report-month-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--primary-dark);
}

.report-stat {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 12px;
}

.report-stat:last-child { border-bottom: none; }

.report-stat-label { color: var(--text-secondary); }
.report-stat-value { font-weight: 700; color: var(--primary-dark); font-variant-numeric: tabular-nums; }

/* EMPLOYEE LIST PAGE */
.employees-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 16px;
}

.employee-detail-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 3px;
}

.employee-list {
  background: white;
  border: 1px solid var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.employee-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: background 0.15s;
}

.employee-item:hover { background: var(--bg-muted); }

.employee-item.active {
  background: #F0F4F8;
  border-left: 3px solid var(--primary-dark);
  padding-left: 13px;
}

.employee-item:last-child { border-bottom: none; }

.employee-name {
  margin: 0;
  font-weight: 600;
  color: var(--primary-dark);
  font-size: 13px;
}

.employee-meta {
  margin: 2px 0 0;
  font-size: 11px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.action-buttons {
  display: flex;
  gap: 4px;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
}
.action-buttons .btn {
  white-space: nowrap;
}

@media (max-width: 768px) {
  .map-grid, .employees-grid { grid-template-columns: 1fr; }
}

/* === MOBILE RESPONSIVE === */

/* Touch-friendly defaults */
@media (max-width: 768px) {
  body { font-size: 14px; }

  /* Header — kompakter, sıralama: ☰ → Logo → 💬 → User */
  .app-header {
    padding: 10px 14px;
    flex-wrap: nowrap;
    gap: 8px;
    align-items: center;
  }
  .app-header-brand {
    gap: 10px;
    flex: 1;
    min-width: 0;
    order: 1;            /* Logo solda (hamburger'dan sonra) */
  }
  .app-logo { width: 36px; height: 36px; font-size: 18px; flex-shrink: 0; }
  .app-header-title { font-size: 13px; }
  .app-header-subtitle { font-size: 10px; }

  .header-msg-icon {
    order: 2;            /* Logo'dan sonra Sprechblase */
    margin: 0 4px !important;
    flex-shrink: 0;
  }

  .app-header-user {
    order: 3;            /* En sağ — kullanıcı */
    text-align: right;
    flex-shrink: 0;
  }
  .app-header-user-name { font-size: 12px; }
  .app-header-user-meta { font-size: 9px; }

  /* Hamburger Menu - SOLDA (Tivigo style) */
  .nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    width: 40px;
    height: 40px;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 6px;
    cursor: pointer;
    padding: 9px;
    margin-left: 0;
    margin-right: 12px;
    order: -1;
    flex-shrink: 0;
  }
  .nav-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background: white;
    border-radius: 1px;
  }

  /* === MOBILE NAV - TIVIGO STYLE LEFT DRAWER === */
  .app-nav {
    display: flex !important;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 86%;
    max-width: 340px;
    background: white;
    z-index: 9999;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 24px rgba(0,0,0,0.15);
    padding: 0;
    border-bottom: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .app-nav.open { transform: translateX(0); }

  /* Body scroll lock - drawer açıkken arka plan kaymasın */
  /* Body scroll - drawer açıkken arka plan da kaydırılabilir (Tivigo gibi) */
  body.drawer-open { /* overflow serbest */ }

  /* Drawer Header - Logo + Brand */
  .app-nav::before {
    content: "Z\A ZEITWERK PRO\A APP";
    white-space: pre;
    display: flex;
    align-items: center;
    padding: 18px 20px 14px;
    border-bottom: 1px solid var(--border);
    background: white;
    color: var(--primary-dark);
    font-weight: 700;
    font-size: 16px;
    /* Bu basit fallback değil - aşağıda gerçek logo kullanılır */
    display: none;
  }

  /* Drawer Backdrop */
  .app-nav-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    z-index: 9998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
  }
  .app-nav-backdrop.show {
    opacity: 1;
    pointer-events: auto;
  }

  /* Drawer Brand Header */
  .drawer-header {
    display: flex !important;
    align-items: center;
    gap: 12px;
    padding: 18px 16px 16px 20px;
    border-bottom: 1px solid var(--border);
    background: white;
    flex-shrink: 0;
    position: relative;
  }
  .drawer-brand {
    flex: 1;
    min-width: 0;
  }

  /* Drawer Close Button (X) */
  .drawer-close {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--bg-muted);
    color: var(--primary-dark);
    border-radius: 50%;
    font-size: 24px;
    font-weight: 400;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s;
    padding: 0;
  }
  .drawer-close:hover {
    background: var(--border);
  }
  .drawer-logo {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: var(--primary-dark);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 22px;
    flex-shrink: 0;
  }
  .drawer-brand-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-dark);
    line-height: 1.2;
  }
  .drawer-brand-sub {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-top: 2px;
  }

  /* Drawer Sections */
  .app-nav a {
    padding: 12px 20px;
    border-bottom: none;
    font-size: 15px;
    font-weight: 500;
    color: var(--primary-dark);
    margin: 2px 12px;
    border-radius: 8px;
    transition: all 0.15s;
  }
  .app-nav a:hover {
    background: var(--bg-muted);
  }
  .app-nav a.active {
    background: var(--primary-bg);
    color: var(--primary-dark);
    font-weight: 600;
    border-bottom-color: transparent;
  }
  .app-nav a[style*="margin-left"] {
    margin-left: 12px !important;
    margin-top: auto !important;
    margin-bottom: 16px !important;
    color: var(--danger) !important;
    border-top: 1px solid var(--border);
    border-radius: 0;
    padding-top: 16px;
    margin-bottom: 8px !important;
  }

  /* Drawer Footer - Eingeloggt als */
  .drawer-footer {
    padding: 12px 20px 18px;
    border-top: 1px solid var(--border);
    font-size: 12px;
    color: var(--text-secondary);
    flex-shrink: 0;
    background: var(--bg-muted);
  }
  .drawer-footer strong {
    color: var(--primary-dark);
    font-weight: 600;
  }

  /* Main */
  .app-main { padding: 14px 12px; }

  /* Cards */
  .card { margin-bottom: 12px; }
  .card-header { padding: 12px 14px; flex-wrap: wrap; gap: 8px; }
  .card-header-title { font-size: 12px; }
  .card-body { padding: 14px; }

  /* Stat Grid - Telefon: 2x2 */
  .stat-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .stat-card { padding: 12px; }
  .stat-label { font-size: 10px; }
  .stat-value { font-size: 22px; }
  .stat-meta { font-size: 10px; }

  /* Buttons - büyük dokunma alanı */
  .btn {
    padding: 12px 16px;
    font-size: 13px;
    min-height: 44px; /* Apple HIG / Google Material touch target */
  }
  .btn-sm { padding: 8px 12px; font-size: 11px; min-height: 36px; }
  .btn-large { font-size: 16px; padding: 16px 24px; }

  /* Timer */
  .timer-card { padding: 24px 16px; }
  .timer-display { font-size: 36px; }
  .timer-label { font-size: 12px; }
  .btn-large { width: 100%; }

  /* Forms */
  .form-input, .form-select, textarea.form-input {
    font-size: 16px; /* iOS Zoom prevention */
    padding: 12px 14px;
    min-height: 44px;
  }
  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .form-label { font-size: 12px; }

  /* Tables - kart görünümü */
  .table { display: block; }
  .table thead { display: none; }
  .table tbody { display: block; }
  .table tr {
    display: block;
    background: white;
    border: 1px solid var(--border);
    border-radius: 4px;
    margin-bottom: 8px;
    padding: 12px;
  }
  .table tr.table-row-warning { border-left: 4px solid var(--warning); }
  .table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 12px;
    text-align: right !important;
  }
  .table td:last-child { border-bottom: none; padding-top: 10px; }
  .table td:first-child { padding-top: 0; }
  .table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 11px;
    text-align: left;
    margin-right: 12px;
    flex-shrink: 0;
  }
  .table td .action-buttons { width: 100%; justify-content: flex-end; }

  /* Action buttons full width on mobile */
  .action-buttons { flex-wrap: wrap; gap: 6px; }
  .action-buttons .btn { flex: 1; min-width: 100px; }

  /* Welcome Card */
  .welcome-card { padding: 18px 16px; }
  .welcome-title { font-size: 16px; }
  .welcome-subtitle { font-size: 12px; }

  /* Notification Banner */
  .notif-banner {
    flex-direction: column;
    align-items: flex-start;
    padding: 12px;
  }
  .notif-banner .btn { margin-top: 8px; width: 100%; }

  /* Modal - Vollbild auf Mobile */
  .modal-overlay { padding: 0; }
  .modal {
    width: 100%;
    height: 100%;
    max-height: 100vh;
    border-radius: 0;
    display: flex;
    flex-direction: column;
  }
  .modal-body { flex: 1; overflow-y: auto; padding: 18px; }
  .modal-footer { padding: 14px 18px; }

  /* Permissions Grid */
  .employees-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  /* Map */
  .map-grid { grid-template-columns: 1fr; gap: 12px; }
  .map-canvas { height: 320px; }

  /* Schedule Table - bleibt scroll-fähig */
  .schedule-table {
    display: table;
    overflow-x: auto;
    white-space: nowrap;
    font-size: 10px;
  }
  .card .schedule-table thead { display: table-header-group; }
  .card .schedule-table tr { display: table-row; padding: 0; margin: 0; border: none; background: transparent; }
  .card .schedule-table td {
    display: table-cell;
    padding: 6px;
    border-bottom: 1px solid var(--border-light);
    text-align: center !important;
  }
  .card .schedule-table td::before { content: none; }

  /* Login Footer */
  .app-footer {
    flex-direction: column;
    gap: 8px;
    padding: 14px;
    text-align: center;
    font-size: 10px;
  }

  /* Quick Actions */
  .quick-actions {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  /* Permission Toggles */
  .permission-row { padding: 12px 0; }
  .permission-name { font-size: 13px; }
  .permission-desc { font-size: 11px; }

  /* Event Cards (attendance) */
  .event-card { padding: 14px; flex-direction: column; gap: 10px; }
  .event-icon { width: 36px; height: 36px; font-size: 16px; }
  .event-title { font-size: 13px; }
  .event-detail-row { flex-wrap: wrap; }
  .event-actions { width: 100%; }
  .event-actions .btn { flex: 1; }

  /* Tabs - scroll horizontal */
  .tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    border-bottom: 1px solid var(--border);
  }
  .tab {
    flex-shrink: 0;
    padding: 12px 14px;
    font-size: 12px;
  }

  /* Color picker */
  .color-picker { gap: 12px; }
  .color-swatch { width: 44px; height: 44px; }

  /* Logo upload */
  .logo-upload-area { padding: 24px 16px; }

  /* Login - special handling already in index.html */
}

/* Tablet (769-1024) — orta boy */
@media (min-width: 769px) and (max-width: 1024px) {
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
  .map-grid { grid-template-columns: 280px 1fr; }
  .employees-grid { grid-template-columns: 280px 1fr; }
}

/* === MOBILE TABLE FIX === */
@media (max-width: 768px) {
  /* Önceki td::before kuralını override et — boş data-label sorun yapmasın */
  .table td::before {
    content: "";
    margin-right: 0;
  }
  /* Tablolarda her hücre kendi başına satır */
  .table td {
    flex-direction: column;
    align-items: flex-start;
    text-align: left !important;
    gap: 4px;
  }
  /* avatar ve text inline kalsın */
  .table td > div { width: 100%; text-align: left; }
  .table td .action-buttons { justify-content: flex-start; margin-top: 6px; }
}

/* === Status Dot Pulse Animation (Aktiv) === */
@keyframes pulse-green {
  0% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.7); }
  70% { box-shadow: 0 0 0 6px rgba(22, 163, 74, 0); }
  100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); }
}

/* Status Pill (klein) */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px 2px 6px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.status-pill.status-active { background: #D1FAE5; color: #065F46; }
.status-pill.status-pause { background: #FEF3C7; color: #92400E; }
.status-pill.status-inactive { background: #E2E8F0; color: #475569; }
.status-pill.status-urlaub { background: #DBEAFE; color: #1E40AF; }
.status-pill.status-krank { background: #FEE2E2; color: #991B1B; }

/* Bildirim çanı kırmızı pulse */
@keyframes pulse-red {
  0% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.7); }
  70% { box-shadow: 0 0 0 8px rgba(220, 38, 38, 0); }
  100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
}

/* === Header Message Icon === */
.header-msg-icon {
  position: relative;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.2);
  color: white;
  padding: 8px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 16px;
  margin-right: 12px;
  transition: background 0.15s;
  font-family: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.header-msg-icon:hover {
  background: rgba(255,255,255,0.1);
  text-decoration: none;
  color: white;
}
.header-msg-icon .msg-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--danger);
  color: white;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  padding: 0 4px;
  border: 2px solid var(--primary-dark);
  animation: pulse-red 2s infinite;
}


/* === SCHICHTPLAN — MOBILE KOMPAKT === */
@media (max-width: 768px) {
  /* Mitarbeiter sütunu: Desktop name gizle, mobile name göster */
  .schedule-employee-name-desktop { display: none !important; }
  .schedule-employee-name-mobile { display: block !important; }
  .schedule-employee-pers { display: none !important; }

  /* Mitarbeiter hücresi daralt */
  .schedule-employee-cell {
    min-width: 110px !important;
    max-width: 130px !important;
    padding-left: 10px !important;
    padding-right: 6px !important;
  }

  /* Schichtplan tablo — kompakt görünüm */
  .schedule-table {
    font-size: 11px;
  }
  .schedule-table thead th {
    padding: 8px 4px !important;
    font-size: 10px !important;
  }
  .schedule-table tbody td {
    padding: 8px 4px !important;
    font-size: 11px !important;
  }

  /* Saat hücreleri */
  .schedule-time {
    font-size: 12px;
    line-height: 1.3;
    text-align: center;
  }
  .schedule-cell-frei,
  .schedule-cell-urlaub,
  .schedule-cell-krank {
    font-size: 10px !important;
    padding: 8px 2px !important;
  }

}

/* === DRAWER BRAND LINK (Tıklanabilir Logo) === */
.drawer-brand-link {
  cursor: pointer;
  border-radius: 8px;
  padding: 4px 6px;
  margin: -4px -6px;
  transition: background 0.15s;
}
.drawer-brand-link:hover {
  background: var(--bg-muted);
}
.drawer-brand-link:active {
  background: var(--border);
}

/* === SCHICHTPLAN FEIERTAG HÜCRESİ (Sade - normal hücre gibi) === */
.schedule-cell-feiertag {
  background: repeating-linear-gradient(45deg, #FEE2E2, #FEE2E2 4px, #FECACA 4px, #FECACA 8px) !important;
  border-left: 3px solid #DC2626 !important;
  text-align: center !important;
  padding: 8px 4px !important;
  vertical-align: middle !important;
}

/* Saatler - normal hücre gibi (08:00 / 16:30) */
.schedule-cell-feiertag .feiertag-times {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: #991B1B;
  line-height: 1.3;
}
.schedule-cell-feiertag .feiertag-time-start,
.schedule-cell-feiertag .feiertag-time-end {
  font-size: 13px;
}

/* Has-plan: daha vurgulu kırmızı border */
.schedule-cell-feiertag.has-plan {
  border-left-width: 4px !important;
}

/* Mobile */
@media (max-width: 768px) {
  .schedule-cell-feiertag {
    padding: 8px 2px !important;
  }
  .schedule-cell-feiertag .feiertag-time-start,
  .schedule-cell-feiertag .feiertag-time-end {
    font-size: 11px;
  }
}

/* === MOBILE — Rotation Badge ismin altında === */
@media (max-width: 768px) {
  .rotation-badge-mobile {
    line-height: 1.4;
  }
  .rotation-badge-mobile span {
    margin-left: 0 !important;
    font-size: 8px !important;
  }
}

/* === DESKTOP: Drawer header/footer gizle === */
/* Mobile drawer için tasarlandı, desktop'ta menü çubuğunda görünmesin */
@media (min-width: 769px) {
  .drawer-header,
  .drawer-footer,
  .app-nav-backdrop {
    display: none !important;
  }
}
