/* =================================================================
   Stiglitz-Leitgeb Bau — Zeiterfassung
   Design-System (identisch mit Upload-Tool)
   ================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ===== Design Tokens ===== */
:root {
  --blue-700: #0D4770;
  --blue-600: #1565A0;
  --blue-500: #1976D2;
  --blue-400: #42A5F5;
  --blue-100: #E3F2FD;
  --blue-50:  #F0F8FF;

  --green-600: #2E7D32;
  --green-500: #388E3C;
  --green-100: #E8F5E9;

  --red-600:   #C62828;
  --red-500:   #D32F2F;
  --red-100:   #FFEBEE;

  --orange-600: #E65100;
  --orange-100: #FFF3E0;

  --gray-900: #111827;
  --gray-700: #374151;
  --gray-600: #4B5563;
  --gray-500: #6B7280;
  --gray-400: #9CA3AF;
  --gray-300: #D1D5DB;
  --gray-200: #E5E7EB;
  --gray-100: #F3F4F6;
  --gray-50:  #F9FAFB;
  --white:    #FFFFFF;

  --radius:    12px;
  --radius-sm: 8px;
  --radius-lg: 16px;

  --shadow-xs: 0 1px 2px rgba(0,0,0,.05);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.04);
  --shadow-lg: 0 10px 15px rgba(0,0,0,.08), 0 4px 6px rgba(0,0,0,.04);
  --shadow-xl: 0 20px 25px rgba(0,0,0,.10), 0 8px 10px rgba(0,0,0,.04);

  --t:      .2s;
  --t-fast: .12s;
  --ease:   cubic-bezier(.4,0,.2,1);
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ===== Base ===== */
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--gray-900);
  background: linear-gradient(135deg, var(--blue-50) 0%, #f0f4f8 40%, #e8f0f8 100%);
  min-height: 100vh;
}

/* ===== Keyframes ===== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes gradientMove {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 4px 14px rgba(21,101,160,.25); }
  50%       { box-shadow: 0 4px 24px rgba(21,101,160,.45); }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 7px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-400); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-500); }

/* =================================================================
   HEADER
   ================================================================= */
.header {
  background: var(--white);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-md);
  animation: slideDown .5s var(--ease);
}

.header::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg,
    var(--blue-700), var(--blue-500), var(--blue-400), var(--blue-500), var(--blue-700));
  background-size: 200% 100%;
  animation: gradientMove 4s ease infinite;
}

.header-inner {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1rem 2rem;
}

.header-logo {
  height: 54px;
  width: auto;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.05));
  transition: transform var(--t) var(--ease);
}
.header-logo:hover { transform: scale(1.04); }

.header-text h1 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--blue-700);
  letter-spacing: -.02em;
  line-height: 1.2;
}
.header-text p {
  font-size: .8rem;
  color: var(--gray-500);
  margin-top: .15rem;
}

.header-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: .5rem;
}

.btn-nav {
  display: flex;
  align-items: center;
  gap: .35rem;
  background: transparent;
  color: var(--gray-600);
  border: 1px solid var(--gray-300);
  padding: .4rem .85rem;
  border-radius: var(--radius-sm);
  font-size: .78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--t-fast) var(--ease);
  text-decoration: none;
  white-space: nowrap;
}
.btn-nav:hover { background: var(--gray-100); border-color: var(--gray-400); color: var(--gray-900); }
.btn-nav.active { background: var(--blue-700); color: #fff; border-color: var(--blue-700); }
.btn-nav .icon { width: 15px; height: 15px; }

/* =================================================================
   CONTAINER
   ================================================================= */
.container {
  max-width: 860px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

/* =================================================================
   CARDS
   ================================================================= */
.card {
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.65);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm), 0 0 0 1px rgba(0,0,0,.03);
  padding: 2rem;
  margin-bottom: 1.25rem;
  position: relative;
  transition: box-shadow var(--t) var(--ease), transform var(--t) var(--ease);
  animation: fadeInUp .55s var(--ease) both;
}
.card:nth-child(1) { animation-delay: .04s; }
.card:nth-child(2) { animation-delay: .08s; }
.card:nth-child(3) { animation-delay: .12s; }
.card:nth-child(4) { animation-delay: .16s; }
.card:hover {
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(0,0,0,.04);
  transform: translateY(-2px);
}

.card-title {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--blue-700);
  margin-bottom: 1.25rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--gray-100);
}
.card-title .icon { width: 18px; height: 18px; color: var(--blue-500); flex-shrink: 0; }

.step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  background: var(--blue-700);
  color: var(--white);
  border-radius: 50%;
  font-size: .75rem;
  font-weight: 700;
  flex-shrink: 0;
  letter-spacing: 0;
}

/* =================================================================
   CLOCK DISPLAY
   ================================================================= */
.clock-display {
  text-align: center;
  padding: 1.5rem 1rem;
}

.clock-time {
  font-size: 3.5rem;
  font-weight: 700;
  color: var(--blue-700);
  letter-spacing: -.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.clock-time .colon {
  animation: blink 1s step-end infinite;
  display: inline-block;
}

.clock-date {
  font-size: .9rem;
  color: var(--gray-500);
  margin-top: .4rem;
  font-weight: 400;
}

/* =================================================================
   STATUS BADGE (Eingestempelt / Ausgestempelt)
   ================================================================= */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .4rem .9rem;
  border-radius: 50px;
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .01em;
}
.status-badge.in {
  background: var(--green-100);
  color: var(--green-600);
}
.status-badge.out {
  background: var(--gray-100);
  color: var(--gray-600);
}
.status-badge .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: currentColor;
}
.status-badge.in .dot {
  animation: pulseGlow .8s ease infinite;
  box-shadow: 0 0 0 3px rgba(46,125,50,.2);
}

/* =================================================================
   FORM ELEMENTS
   ================================================================= */
.form-group { margin-bottom: 1.1rem; }
.form-group:last-child { margin-bottom: 0; }

label {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: .4rem;
  letter-spacing: .01em;
}
label.required::after { content: ' *'; color: var(--red-500); }

input[type="text"],
input[type="search"],
input[type="date"],
input[type="datetime-local"],
input[type="password"],
select,
textarea {
  width: 100%;
  padding: .65rem 1rem;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: .9rem;
  color: var(--gray-900);
  background: var(--white);
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
  outline: none;
  -webkit-appearance: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(25,118,210,.12);
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .85rem center;
  padding-right: 2.5rem;
  cursor: pointer;
}

textarea { resize: vertical; min-height: 70px; line-height: 1.5; }

/* =================================================================
   BUTTONS
   ================================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .7rem 1.4rem;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--t-fast) var(--ease);
  white-space: nowrap;
  text-decoration: none;
  letter-spacing: .01em;
  position: relative;
  overflow: hidden;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary {
  background: var(--blue-700);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(13,71,112,.3);
}
.btn-primary:not(:disabled):hover {
  background: var(--blue-600);
  box-shadow: 0 4px 12px rgba(13,71,112,.4);
  transform: translateY(-1px);
}
.btn-primary:not(:disabled):active { transform: translateY(0); }

.btn-success {
  background: var(--green-600);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(46,125,50,.3);
}
.btn-success:not(:disabled):hover {
  background: var(--green-500);
  box-shadow: 0 4px 12px rgba(46,125,50,.4);
  transform: translateY(-1px);
}

.btn-danger {
  background: var(--red-500);
  color: var(--white);
}
.btn-danger:not(:disabled):hover { background: var(--red-600); transform: translateY(-1px); }

.btn-outline {
  background: transparent;
  color: var(--blue-700);
  border: 1.5px solid var(--blue-700);
}
.btn-outline:not(:disabled):hover {
  background: var(--blue-50);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--gray-600);
  border: 1px solid var(--gray-300);
}
.btn-ghost:not(:disabled):hover { background: var(--gray-100); color: var(--gray-900); }

.btn-full { width: 100%; }

.btn .icon { width: 18px; height: 18px; flex-shrink: 0; }
.btn-lg { padding: .9rem 1.8rem; font-size: 1rem; }

/* Clock-in / Clock-out Buttons */
.btn-clockin {
  background: linear-gradient(135deg, var(--green-600), var(--green-500));
  color: var(--white);
  font-size: 1.1rem;
  padding: 1rem 2rem;
  box-shadow: 0 4px 14px rgba(46,125,50,.35);
  animation: pulseGlow 2s ease infinite;
}
.btn-clockin:not(:disabled):hover {
  background: linear-gradient(135deg, var(--green-500), var(--green-600));
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(46,125,50,.45);
}

.btn-clockout {
  background: linear-gradient(135deg, var(--red-500), var(--red-600));
  color: var(--white);
  font-size: 1.1rem;
  padding: 1rem 2rem;
  box-shadow: 0 4px 14px rgba(211,47,47,.3);
}
.btn-clockout:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(211,47,47,.4);
}

/* =================================================================
   ALERTS
   ================================================================= */
.alert {
  display: none;
  align-items: flex-start;
  gap: .75rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 500;
  margin-bottom: 1.25rem;
  animation: fadeInUp .3s var(--ease);
}
.alert.show { display: flex; }
.alert .icon { width: 18px; height: 18px; flex-shrink: 0; margin-top: .05rem; }
.alert-success { background: var(--green-100); color: var(--green-600); border: 1px solid rgba(46,125,50,.2); }
.alert-error   { background: var(--red-100);   color: var(--red-600);   border: 1px solid rgba(211,47,47,.2); }
.alert-info    { background: var(--blue-100);  color: var(--blue-600);  border: 1px solid rgba(25,118,210,.2); }
.alert-warning { background: var(--orange-100);color: var(--orange-600);border: 1px solid rgba(230,81,0,.2); }

/* =================================================================
   ACTIVE ENTRY INFO BOX
   ================================================================= */
.active-entry-box {
  background: linear-gradient(135deg, var(--green-100), #f0faf0);
  border: 2px solid rgba(46,125,50,.25);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
}

.active-entry-box .employee-name {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--gray-900);
}

.active-entry-box .project-name {
  font-size: .95rem;
  color: var(--gray-600);
  margin-top: .25rem;
}

.active-entry-box .since-time {
  font-size: .85rem;
  color: var(--green-600);
  margin-top: .5rem;
  font-weight: 500;
}

.elapsed-time {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--green-600);
  font-variant-numeric: tabular-nums;
  margin: .75rem 0;
}

/* =================================================================
   ENTRIES LIST
   ================================================================= */
.entries-list { list-style: none; }

.entry-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: .85rem 0;
  border-bottom: 1px solid var(--gray-100);
  animation: fadeInUp .3s var(--ease);
}
.entry-item:last-child { border-bottom: none; }

.entry-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--blue-400);
  flex-shrink: 0;
  margin-top: .35rem;
}
.entry-dot.open {
  background: var(--green-500);
  box-shadow: 0 0 0 3px rgba(56,142,60,.2);
  animation: pulseGlow 1.5s ease infinite;
}

.entry-info { flex: 1; min-width: 0; }
.entry-name { font-weight: 600; font-size: .9rem; color: var(--gray-900); }
.entry-meta { font-size: .8rem; color: var(--gray-500); margin-top: .15rem; }
.entry-note { font-size: .8rem; color: var(--blue-600); font-style: italic; margin-top: .1rem; }

.entry-time {
  text-align: right;
  flex-shrink: 0;
}
.entry-time .time { font-size: .85rem; font-weight: 600; color: var(--gray-700); font-variant-numeric: tabular-nums; }
.entry-time .duration { font-size: .78rem; color: var(--gray-500); margin-top: .1rem; }

/* =================================================================
   SEARCH / FILTER
   ================================================================= */
.search-wrapper {
  position: relative;
}
.search-icon {
  position: absolute;
  left: .85rem;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--gray-400);
  pointer-events: none;
}
.search-wrapper input {
  padding-left: 2.5rem;
}

/* Dropdown Liste */
.dropdown-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: var(--white);
  border: 1.5px solid var(--blue-400);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  max-height: 220px;
  overflow-y: auto;
  animation: fadeInUp .15s var(--ease);
}

.dropdown-item {
  padding: .65rem 1rem;
  cursor: pointer;
  font-size: .88rem;
  transition: background var(--t-fast);
  display: flex;
  align-items: center;
  gap: .5rem;
}
.dropdown-item:hover { background: var(--blue-50); }
.dropdown-item .sub { font-size: .75rem; color: var(--gray-500); }

.selected-chip {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: var(--blue-100);
  color: var(--blue-700);
  padding: .35rem .75rem;
  border-radius: 50px;
  font-size: .82rem;
  font-weight: 600;
  margin-top: .4rem;
  cursor: pointer;
}
.selected-chip .remove { font-size: 1rem; line-height: 1; opacity: .6; }
.selected-chip:hover .remove { opacity: 1; }

/* =================================================================
   PIN LOGIN
   ================================================================= */
.pin-modal {
  max-width: 380px;
  text-align: center;
  padding: 2.5rem 2rem 2rem;
}

.pin-header { margin-bottom: 1.75rem; }
.pin-header .pin-logo {
  height: 56px;
  width: auto;
  margin-bottom: .75rem;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.05));
}
.pin-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--blue-700);
  margin-bottom: .25rem;
}
.pin-header p {
  font-size: .9rem;
  color: var(--gray-500);
}

.pin-digits {
  display: flex;
  justify-content: center;
  gap: .75rem;
  margin-bottom: 1.5rem;
}
.pin-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2.5px solid var(--gray-300);
  background: transparent;
  transition: all var(--t-fast) var(--ease);
}
.pin-dot.filled {
  background: var(--blue-700);
  border-color: var(--blue-700);
  transform: scale(1.15);
  box-shadow: 0 0 0 4px rgba(13,71,112,.12);
}
.pin-dot.error {
  border-color: var(--red-500);
  background: var(--red-500);
  animation: pinShake .4s var(--ease);
}

@keyframes pinShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

.pin-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .6rem;
  max-width: 280px;
  margin: 0 auto;
}
.pin-key {
  height: 56px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  background: var(--white);
  font-family: inherit;
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--gray-900);
  cursor: pointer;
  transition: all var(--t-fast) var(--ease);
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.pin-key:hover { background: var(--blue-50); border-color: var(--blue-400); }
.pin-key:active {
  background: var(--blue-100);
  transform: scale(.95);
}
.pin-key-empty {
  border: none;
  background: transparent;
  cursor: default;
}
.pin-key-empty:hover { background: transparent; }
.pin-key-delete {
  color: var(--gray-500);
}
.pin-key-delete:hover { color: var(--red-500); border-color: var(--red-500); background: var(--red-100); }

/* =================================================================
   PROJECT LIST (Frontend)
   ================================================================= */
.project-list {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.project-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .7rem 1rem;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-sm);
  background: var(--white);
  cursor: pointer;
  transition: all var(--t-fast) var(--ease);
  font-size: .9rem;
  color: var(--gray-700);
}
.project-item:hover {
  border-color: var(--blue-400);
  background: var(--blue-50);
  color: var(--gray-900);
}
.project-item.selected {
  border-color: var(--blue-600);
  background: var(--blue-100);
  color: var(--blue-700);
  font-weight: 600;
  box-shadow: 0 0 0 3px rgba(25,118,210,.12);
}
.project-item .project-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--gray-400);
}
.project-item.selected .project-icon { color: var(--blue-600); }
.project-item .project-nummer {
  margin-left: auto;
  font-size: .75rem;
  font-weight: 600;
  color: var(--gray-400);
  background: var(--gray-100);
  padding: .15rem .5rem;
  border-radius: 50px;
}
.project-item.selected .project-nummer {
  background: rgba(25,118,210,.15);
  color: var(--blue-700);
}

.project-list-empty {
  text-align: center;
  padding: 1.5rem;
  color: var(--gray-400);
  font-size: .85rem;
}

/* =================================================================
   GRID / LAYOUT HELPERS
   ================================================================= */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 600px) {
  .grid-2 { grid-template-columns: 1fr; }
}

.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-center  { display: flex; align-items: center; justify-content: center; }
.flex-gap     { display: flex; align-items: center; gap: .6rem; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }

/* =================================================================
   TABLE (Admin)
   ================================================================= */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gray-200);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: .85rem;
}

thead th {
  background: var(--gray-50);
  padding: .7rem 1rem;
  text-align: left;
  font-weight: 600;
  color: var(--gray-700);
  font-size: .8rem;
  letter-spacing: .03em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--gray-200);
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid var(--gray-100);
  transition: background var(--t-fast);
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--blue-50); }

tbody td {
  padding: .75rem 1rem;
  color: var(--gray-700);
  vertical-align: middle;
}
tbody td .bold { font-weight: 600; color: var(--gray-900); }
tbody td .sub  { font-size: .75rem; color: var(--gray-500); margin-top: .1rem; }

.tag {
  display: inline-flex;
  align-items: center;
  padding: .2rem .55rem;
  border-radius: 50px;
  font-size: .72rem;
  font-weight: 600;
}
.tag-green  { background: var(--green-100); color: var(--green-600); }
.tag-gray   { background: var(--gray-100);  color: var(--gray-600); }
.tag-blue   { background: var(--blue-100);  color: var(--blue-700); }
.tag-orange { background: var(--orange-100);color: var(--orange-600); }

/* =================================================================
   MODAL
   ================================================================= */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 500;
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-backdrop.show { display: flex; }

.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  padding: 2rem;
  width: 100%;
  max-width: 500px;
  animation: fadeInUp .25s var(--ease);
  position: relative;
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: .6rem;
}
.modal-title .icon { width: 22px; height: 22px; color: var(--blue-500); }

.modal-actions {
  display: flex;
  gap: .75rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
}

/* =================================================================
   SPINNER
   ================================================================= */
.spinner {
  display: inline-block;
  width: 20px; height: 20px;
  border: 2.5px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.spinner-blue {
  border-color: rgba(13,71,112,.2);
  border-top-color: var(--blue-700);
}

/* =================================================================
   EMPTY STATE
   ================================================================= */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--gray-500);
}
.empty-state svg {
  width: 48px; height: 48px;
  color: var(--gray-300);
  margin-bottom: 1rem;
}
.empty-state p { font-size: .9rem; }

/* =================================================================
   SUMMARY STATS (Admin)
   ================================================================= */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
  transition: box-shadow var(--t) var(--ease);
}
.stat-card:hover { box-shadow: var(--shadow-md); }

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--blue-700);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.stat-label {
  font-size: .78rem;
  color: var(--gray-500);
  margin-top: .35rem;
  font-weight: 500;
}

/* =================================================================
   TABS
   ================================================================= */
.tabs {
  display: flex;
  gap: .25rem;
  border-bottom: 2px solid var(--gray-200);
  margin-bottom: 1.5rem;
}
.tab-btn {
  padding: .65rem 1.1rem;
  font-size: .88rem;
  font-weight: 500;
  color: var(--gray-500);
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--t-fast);
  display: flex;
  align-items: center;
  gap: .4rem;
}
.tab-btn:hover { color: var(--blue-700); }
.tab-btn.active { color: var(--blue-700); font-weight: 600; border-bottom-color: var(--blue-700); }
.tab-btn .icon { width: 15px; height: 15px; }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeInUp .2s var(--ease); }

/* =================================================================
   FOOTER
   ================================================================= */
.footer {
  text-align: center;
  padding: 2.5rem 1.5rem;
  color: var(--gray-400);
  font-size: .78rem;
  line-height: 1.8;
}
.footer a { color: var(--gray-400); text-decoration: none; }
.footer a:hover { color: var(--blue-600); text-decoration: underline; }
.footer-divider { margin: 0 .5rem; }

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

/* ── Tablet & small desktop ── */
@media (max-width: 768px) {
  .header-inner { padding: .85rem 1rem; gap: .75rem; }
  .header-logo  { height: 44px; }
  .header-text h1 { font-size: 1.1rem; }
  .header-text p { font-size: .72rem; }

  .container { margin: 1rem auto; padding: 0 .75rem; }
  .card { padding: 1.25rem; }

  /* Filter-Buttons umbrechen */
  .flex-gap { flex-wrap: wrap; }

  /* Tabellen: kompaktere Zellen */
  thead th { padding: .55rem .6rem; font-size: .72rem; }
  tbody td { padding: .55rem .6rem; font-size: .82rem; }

  .modal { padding: 1.25rem; }
  .modal-actions { flex-wrap: wrap; }
  .modal-actions .btn { flex: 1; min-width: 0; }

  .stats-grid { grid-template-columns: 1fr 1fr; }
}

/* ── Mobile ── */
@media (max-width: 640px) {
  body { font-size: 14px; }

  .header-inner {
    padding: .6rem .75rem;
    gap: .5rem;
    flex-wrap: wrap;
  }
  .header-logo { height: 36px; }
  .header-text h1 { font-size: 1rem; }
  .header-text p { display: none; }

  /* Nav-Buttons: nur Icons auf Mobile */
  .header-nav { gap: .35rem; }
  .btn-nav {
    padding: .35rem .55rem;
    font-size: 0;
    gap: 0;
  }
  .btn-nav .icon { width: 18px; height: 18px; }

  .container { margin: .5rem auto; padding: 0 .5rem; }

  .card {
    padding: 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: .75rem;
  }
  .card-title { font-size: .9rem; margin-bottom: .75rem; padding-bottom: .5rem; }

  /* Tabs kompakter */
  .tabs { gap: 0; }
  .tab-btn {
    padding: .55rem .6rem;
    font-size: .78rem;
    gap: .3rem;
    flex: 1;
    justify-content: center;
  }
  .tab-btn .icon { width: 14px; height: 14px; }

  /* Filter & Export */
  .flex-gap {
    flex-wrap: wrap;
    gap: .4rem;
  }
  .flex-gap .btn {
    flex: 1;
    min-width: calc(50% - .4rem);
    font-size: .78rem;
    padding: .55rem .6rem;
  }
  .flex-gap .btn-ghost {
    min-width: auto;
    flex: 0 1 auto;
  }

  .clock-time { font-size: 2.5rem; }
  .elapsed-time { font-size: 1.75rem; }

  /* Stats: 2 Spalten, kompakter */
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: .5rem;
    margin-bottom: 1rem;
  }
  .stat-card { padding: .75rem .5rem; }
  .stat-value { font-size: 1.4rem; }
  .stat-label { font-size: .7rem; }

  /* ── Tabellen auf Mobile als Karten ── */
  .table-wrapper { border: none; overflow: visible; }

  table, thead, tbody, th, tr, td {
    display: block;
  }
  thead { display: none; }

  tbody tr {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    margin-bottom: .5rem;
    padding: .75rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .25rem .5rem;
    align-items: center;
  }
  tbody tr:hover { background: var(--white); transform: none; }

  tbody td {
    padding: .15rem 0;
    font-size: .82rem;
    border: none;
  }
  tbody td::before {
    content: attr(data-label);
    display: block;
    font-size: .68rem;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: .03em;
    margin-bottom: .1rem;
  }

  /* Aktions-Spalte volle Breite */
  tbody td:last-child {
    grid-column: 1 / -1;
    display: flex;
    gap: .35rem;
    justify-content: flex-end;
    padding-top: .4rem;
    margin-top: .25rem;
    border-top: 1px solid var(--gray-100);
  }
  tbody td:last-child::before { display: none; }

  /* Modal fullscreen auf Mobile */
  .modal-backdrop { padding: .5rem; align-items: flex-end; }
  .modal {
    max-width: 100%;
    border-radius: var(--radius) var(--radius) 0 0;
    padding: 1.25rem 1rem;
    max-height: 90vh;
    overflow-y: auto;
  }
  .modal-title { font-size: 1rem; }
  .modal-actions { gap: .5rem; }
  .modal-actions .btn {
    flex: 1;
    min-width: 0;
    padding: .65rem .5rem;
    font-size: .85rem;
  }

  /* Grid-2 immer einspaltig */
  .grid-2 { grid-template-columns: 1fr; gap: .5rem; }

  .footer { padding: 1.5rem .75rem; }

  /* Tags kompakter */
  .tag { font-size: .68rem; padding: .15rem .45rem; }
}

/* ── Sehr kleine Screens ── */
@media (max-width: 380px) {
  .header-inner { padding: .5rem; gap: .35rem; }
  .header-logo { height: 30px; }
  .header-text h1 { font-size: .9rem; }

  .tab-btn { padding: .45rem .35rem; font-size: .72rem; }

  .card { padding: .75rem; }

  .stat-value { font-size: 1.2rem; }

  .flex-gap .btn { min-width: 100%; }

  .pin-keypad { max-width: 240px; gap: .4rem; }
  .pin-key { height: 48px; font-size: 1.15rem; }
}
