/* ==========================================================================
   Moderne Arbeitszeit-App - Clean, Responsive & Mobile-First CSS
   ========================================================================== */

:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --success: #10b981;
  --success-hover: #059669;
  --success-light: #ecfdf5;
  --warning: #f59e0b;
  --warning-hover: #d97706;
  --warning-light: #fffbeb;
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --danger-light: #fef2f2;
  --dark: #0f172a;
  --slate-700: #334155;
  --slate-500: #64748b;
  --slate-300: #cbd5e1;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --slate-50: #f8fafc;
  --white: #ffffff;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.08), 0 2px 4px -2px rgb(0 0 0 / 0.05);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.05);
  --font-main: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

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

body {
  font-family: var(--font-main);
  background-color: #f1f5f9;
  color: var(--dark);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* Container */
.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.25rem 1rem 5rem 1rem;
}

@media (min-width: 768px) {
  .container {
    padding: 2rem 1.5rem 3rem 1.5rem;
  }
}

/* Header & Navigation */
.navbar {
  background: var(--white);
  border-bottom: 1px solid var(--slate-200);
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: var(--shadow-sm);
}

.nav-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--dark);
  letter-spacing: -0.02em;
}

.nav-menu {
  display: none;
  align-items: center;
  gap: 0.35rem;
  list-style: none;
}

@media (min-width: 768px) {
  .nav-menu {
    display: flex;
  }
}

.nav-link {
  text-decoration: none;
  color: var(--slate-700);
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
  display: inline-block;
}

.nav-link:hover {
  background-color: var(--slate-100);
  color: var(--primary);
}

.nav-link.active {
  background-color: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

@media (max-width: 767px) {
  .desktop-only {
    display: none !important;
  }
}

.user-badge {
  font-size: 0.85rem;
  background: var(--slate-100);
  color: var(--slate-700);
  padding: 0.35rem 0.7rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
}

/* Burger Toggle Button (Ohne Icons) */
.burger-btn {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  width: 38px;
  height: 38px;
  background: var(--slate-100);
  border: 1px solid var(--slate-300);
  border-radius: var(--radius-sm);
  padding: 8px 7px;
  cursor: pointer;
  z-index: 250;
  transition: background-color 0.15s ease;
}

.burger-btn:hover {
  background-color: var(--slate-200);
}

.burger-bar {
  display: block;
  width: 100%;
  height: 2.5px;
  background-color: var(--slate-700);
  border-radius: 2px;
  transition: all 0.25s ease;
}

@media (min-width: 768px) {
  .burger-btn {
    display: none !important;
  }
}

/* Mobile Drawer (Burgermenü) */
.mobile-drawer {
  position: fixed;
  top: 0;
  right: -320px;
  width: 300px;
  max-width: 86vw;
  height: 100%;
  background: var(--white);
  box-shadow: -4px 0 25px rgba(0, 0, 0, 0.2);
  z-index: 300;
  transition: right 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.mobile-drawer.active {
  right: 0;
}

.mobile-drawer-header {
  padding: 1.25rem 1.25rem 1rem 1.25rem;
  border-bottom: 1px solid var(--slate-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mobile-drawer-close {
  background: none;
  border: none;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--slate-500);
  cursor: pointer;
  padding: 0.25rem 0.5rem;
}

.mobile-drawer-list {
  list-style: none;
  padding: 0.75rem 0;
  margin: 0;
  overflow-y: auto;
  flex: 1;
}

.mobile-drawer-link {
  display: block;
  padding: 0.85rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--slate-700);
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: all 0.15s ease;
}

.mobile-drawer-link:hover,
.mobile-drawer-link.active {
  background-color: var(--primary-light);
  color: var(--primary);
  border-left-color: var(--primary);
}

.mobile-drawer-footer {
  padding: 1.25rem;
  border-top: 1px solid var(--slate-200);
  background: var(--slate-50);
}

.mobile-drawer-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.55);
  z-index: 290;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.mobile-drawer-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

/* Mobile Bottom Navigation Bar */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--white);
  border-top: 1px solid var(--slate-200);
  display: flex;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0.5rem 0.5rem;
  z-index: 50;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
  scrollbar-width: none;
}

.bottom-nav::-webkit-scrollbar {
  display: none;
}

@media (min-width: 768px) {
  .bottom-nav {
    display: none;
  }
}

.bottom-nav-item {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--slate-500);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.bottom-nav-item.active {
  color: var(--primary);
  background: var(--primary-light);
  font-weight: 700;
}

/* Cards & Layout */
.card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  border: 1px solid var(--slate-200);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--slate-100);
}

.card-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--dark);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Grid */
.grid {
  display: grid;
  gap: 1.25rem;
}

.grid-cols-2 {
  grid-template-columns: repeat(1, 1fr);
}

.grid-cols-3 {
  grid-template-columns: repeat(1, 1fr);
}

.grid-cols-4 {
  grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 640px) {
  .grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
}

/* Metric / Stat Card */
.stat-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  border: 1px solid var(--slate-200);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--slate-500);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--dark);
  line-height: 1.2;
}

.stat-sub {
  font-size: 0.8rem;
  color: var(--slate-500);
  margin-top: 0.25rem;
}

.stat-positive {
  color: var(--success);
}

.stat-negative {
  color: var(--danger);
}

/* ==========================================================================
   Live Stempeluhr (Clock-In) Widget
   ========================================================================== */
.clock-card {
  text-align: center;
  padding: 2.25rem 1.5rem;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid var(--slate-200);
  box-shadow: var(--shadow-md);
}

.live-time-display {
  font-size: 3.25rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  color: var(--dark);
  line-height: 1;
  margin-bottom: 0.4rem;
}

.live-date-display {
  font-size: 1.1rem;
  color: var(--slate-500);
  font-weight: 500;
  margin-bottom: 1.5rem;
}

/* Status Badge (Ohne Icons) */
.status-pill {
  display: inline-block;
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 1.75rem;
  text-align: center;
}

.status-pill.out {
  background: var(--slate-100);
  color: var(--slate-700);
  border: 1px solid var(--slate-300);
}

.status-pill.active {
  background: var(--success-light);
  color: var(--success-hover);
  border: 1px solid #a7f3d0;
}

.status-pill.paused {
  background: var(--warning-light);
  color: var(--warning-hover);
  border: 1px solid #fde68a;
}

/* Live Timer Counters */
.timer-container {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.timer-box {
  background: var(--white);
  border: 1px solid var(--slate-200);
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  min-width: 150px;
  box-shadow: var(--shadow-sm);
}

.timer-box-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--slate-500);
}

.timer-box-val {
  font-size: 1.6rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--dark);
}

/* Action Buttons */
.action-buttons {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 1rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  line-height: 1.2;
}

.btn-lg {
  font-size: 1.2rem;
  padding: 1rem 2.25rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.btn-sm {
  font-size: 0.85rem;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
}

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

.btn-success {
  background: var(--success);
  color: var(--white);
}
.btn-success:hover {
  background: var(--success-hover);
}

.btn-warning {
  background: var(--warning);
  color: var(--white);
}
.btn-warning:hover {
  background: var(--warning-hover);
}

.btn-danger {
  background: var(--danger);
  color: var(--white);
}
.btn-danger:hover {
  background: var(--danger-hover);
}

.btn-secondary {
  background: var(--white);
  color: var(--slate-700);
  border: 1px solid var(--slate-300);
}
.btn-secondary:hover {
  background: var(--slate-100);
}

.btn-link {
  background: transparent;
  color: var(--primary);
  padding: 0;
}

/* Geolocation Info Box (Ohne Icons) */
.geo-info-box {
  margin-top: 1.5rem;
  padding: 0.6rem 1rem;
  background: var(--white);
  border-radius: var(--radius-sm);
  border: 1px solid var(--slate-300);
  display: inline-block;
  font-size: 0.85rem;
  color: var(--slate-600);
  max-width: 90%;
  font-weight: 500;
}

/* ==========================================================================
   Tables & Lists
   ========================================================================== */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.95rem;
}

.table th {
  background-color: var(--slate-50);
  color: var(--slate-500);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--slate-200);
  white-space: nowrap;
}

.table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--slate-200);
  vertical-align: middle;
}

.table tbody tr:hover {
  background-color: #f8fafc;
}

.table tr.weekend {
  background-color: #fafbfc;
  color: var(--slate-500);
}

.table tr.holiday {
  background-color: #f0f7ff;
}

.table tr.vacation {
  background-color: #f0fdf4;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-work { background: #dbeafe; color: #1e40af; }
.badge-vacation { background: #dcfce7; color: #166534; }
.badge-sick { background: #fee2e2; color: #991b1b; }
.badge-holiday { background: #e0e7ff; color: #3730a3; }
.badge-neutral { background: #f1f5f9; color: #475569; }

/* Location link */
.location-link {
  color: var(--primary);
  text-decoration: none;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
.location-link:hover {
  text-decoration: underline;
}

/* Forms */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 0.4rem;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--slate-300);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: inherit;
  background-color: var(--white);
  color: var(--dark);
  transition: border-color 0.15s ease;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.form-help {
  font-size: 0.8rem;
  color: var(--slate-500);
  margin-top: 0.3rem;
}

/* Filter bar */
.filter-bar {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transform: translateY(20px);
  transition: transform 0.2s ease;
}

.modal-backdrop.active .modal {
  transform: translateY(0);
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--slate-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--slate-500);
  line-height: 1;
}

.modal-body {
  padding: 1.5rem;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--slate-200);
  background: var(--slate-50);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: var(--dark);
  color: var(--white);
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  animation: slideIn 0.3s ease;
  max-width: 360px;
}

.toast.success { background: #065f46; border-left: 4px solid var(--success); }
.toast.error { background: #991b1b; border-left: 4px solid var(--danger); }
.toast.info { background: #1e3a8a; border-left: 4px solid var(--primary); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Auth / Login Page */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}

.auth-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
}

.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-logo {
  width: 56px;
  height: 56px;
  background: var(--primary);
  color: var(--white);
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin-bottom: 1rem;
}
