/* ═══════════════════════════════════════════════════════════════
   IKM Hendrik Veder — Time Registration
   © Cas Rietveld 2026
   Brand: Blue (#003366) and White
   ═══════════════════════════════════════════════════════════════ */

@font-face {
  font-family: 'Bahnschrift';
  src: local('Bahnschrift'), local('Aptos'), local('Segoe UI');
}

:root {
  --primary: #003366;
  --primary-dark: #002244;
  --primary-light: #0056b3;
  --accent: #e8f0fe;
  --bg: #f5f8fc;
  --white: #ffffff;
  --text: #1a1a2e;
  --text-light: #4a5568;
  --border: #d0dae8;
  --success: #16a34a;
  --warning: #f59e0b;
  --danger: #dc2626;
  --shadow: 0 2px 8px rgba(0, 51, 102, 0.08);
  --shadow-lg: 0 4px 20px rgba(0, 51, 102, 0.12);
  --radius: 8px;
  --radius-lg: 12px;
  --transition: 0.2s ease;
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Bahnschrift', 'Aptos', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

/* ─── Layout ─────────────────────────────────────────────── */

.app-header {
  background: var(--primary);
  color: var(--white);
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-lg);
  position: sticky;
  top: 0;
  z-index: 100;
}

.app-header .logo {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.app-header .logo span {
  font-weight: 300;
  opacity: 0.85;
}

.app-header nav {
  display: flex;
  align-items: center;
  gap: 16px;
}

.app-header .user-info {
  font-size: 14px;
  font-weight: 500;
  opacity: 0.9;
}

.app-header .header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-header .header-btn {
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.3px;
  padding: 7px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  line-height: 1.2;
  white-space: nowrap;
}

.app-header .header-btn-ghost {
  background: transparent;
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.app-header .header-btn-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.55);
}

.app-header .header-btn-solid {
  background: rgba(255, 255, 255, 0.15);
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.app-header .header-btn-solid:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.45);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

.container-narrow {
  max-width: 480px;
  margin: 0 auto;
  padding: 24px;
}

/* ─── Cards ──────────────────────────────────────────────── */

.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--accent);
}

.card-header h2 {
  color: var(--primary);
  font-size: 18px;
  font-weight: 600;
}

.card-header h3 {
  color: var(--primary);
  font-size: 16px;
  font-weight: 600;
}

/* ─── Buttons ────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: 2px solid transparent;
  text-decoration: none;
}

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

.btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: var(--shadow);
}

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

.btn-secondary:hover {
  background: var(--accent);
}

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

.btn-success:hover {
  background: #15803d;
}

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

.btn-danger:hover {
  background: #b91c1c;
}

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

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

.btn-lg {
  padding: 14px 28px;
  font-size: 16px;
}

.btn-block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-start {
  background: var(--success);
  color: var(--white);
  font-size: 20px;
  padding: 20px 40px;
  border-radius: 50px;
  width: 100%;
  max-width: 300px;
}

.btn-stop {
  background: var(--danger);
  color: var(--white);
  font-size: 20px;
  padding: 20px 40px;
  border-radius: 50px;
  width: 100%;
  max-width: 300px;
}

/* ─── Forms ──────────────────────────────────────────────── */

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 15px;
  color: var(--text);
  background: var(--white);
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 51, 102, 0.1);
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23003366' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

textarea.form-control {
  resize: vertical;
  min-height: 80px;
}

/* ─── Tables ─────────────────────────────────────────────── */

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th {
  background: var(--primary);
  color: var(--white);
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

tr:nth-child(even) {
  background: var(--accent);
}

tr:hover {
  background: #dce8f5;
}

/* ─── Badges ─────────────────────────────────────────────── */

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-draft { background: #e2e8f0; color: #475569; }
.badge-in_progress, .badge-active { background: #dbeafe; color: #1d4ed8; }
.badge-continuing_tomorrow { background: #fef3c7; color: #92400e; }
.badge-awaiting_signatures { background: #fce7f3; color: #9d174d; }
.badge-partially_signed { background: #fed7aa; color: #c2410c; }
.badge-signed { background: #d1fae5; color: #065f46; }
.badge-emailed { background: #c7d2fe; color: #3730a3; }
.badge-locked { background: #e2e8f0; color: #1e293b; }
.badge-completed { background: #d1fae5; color: #065f46; }

/* ─── Timer ──────────────────────────────────────────────── */

.timer-display {
  font-size: 48px;
  font-weight: 700;
  color: var(--primary);
  text-align: center;
  font-variant-numeric: tabular-nums;
  padding: 20px;
  margin: 20px 0;
}

.timer-label {
  text-align: center;
  color: var(--text-light);
  font-size: 14px;
  margin-bottom: 8px;
}

/* ─── Location Picker ────────────────────────────────────── */

.location-picker {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin: 16px 0;
}

.location-btn {
  flex: 1;
  max-width: 150px;
  padding: 16px;
  border: 3px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--white);
  cursor: pointer;
  text-align: center;
  transition: var(--transition);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.location-btn:hover {
  border-color: var(--primary-light);
  background: var(--accent);
}

.location-btn.selected {
  border-color: var(--primary);
  background: var(--accent);
  color: var(--primary);
}

.location-btn .icon {
  font-size: 24px;
  display: block;
  margin-bottom: 6px;
}

/* ─── Signature Canvas ───────────────────────────────────── */

.signature-pad {
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  cursor: crosshair;
  touch-action: none;
  max-width: 100%;
}

/* ─── Modals ─────────────────────────────────────────────── */

.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 20, 40, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 24px;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}

.modal h2 {
  color: var(--primary);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--accent);
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}

/* ─── Login Page ─────────────────────────────────────────── */

.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  padding: 20px;
}

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

.login-card .logo-area {
  text-align: center;
  margin-bottom: 32px;
}

.login-card .logo-area h1 {
  color: var(--primary);
  font-size: 24px;
  margin-bottom: 4px;
}

.login-card .logo-area p {
  color: var(--text-light);
  font-size: 14px;
}

.login-card .copyright {
  text-align: center;
  margin-top: 24px;
  font-size: 11px;
  color: var(--text-light);
}

/* ─── Dashboard Grid ─────────────────────────────────────── */

.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 16px;
}

.stat-card .stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: var(--primary);
}

.stat-card .stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}

.stat-card .stat-label {
  font-size: 13px;
  color: var(--text-light);
}

/* ─── Tabs ───────────────────────────────────────────────── */

.tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
  overflow-x: auto;
}

.tab {
  padding: 10px 20px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-light);
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.tab:hover {
  color: var(--primary);
}

.tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* ─── Alerts ─────────────────────────────────────────────── */

.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 500;
}

.alert-error {
  background: #fef2f2;
  color: var(--danger);
  border: 1px solid #fecaca;
}

.alert-success {
  background: #f0fdf4;
  color: var(--success);
  border: 1px solid #bbf7d0;
}

.alert-info {
  background: var(--accent);
  color: var(--primary);
  border: 1px solid #b0c4de;
}

.alert-warning {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}

/* ─── Notifications & activity panels ───────────────────── */

.notifications-panel .card-header h3 {
  display: flex;
  align-items: center;
  gap: 10px;
}

.notification-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.notification-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  background: var(--accent);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.notification-item.unread {
  background: var(--white);
  border-color: #b0c4de;
}

.notification-item strong {
  display: block;
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.notification-item small {
  color: var(--text-light);
  font-size: 13px;
  line-height: 1.45;
}

.activity-block {
  padding: 14px 16px;
  margin-bottom: 10px;
  background: var(--accent);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.activity-block:last-child {
  margin-bottom: 0;
}

.activity-block strong {
  color: var(--primary);
  font-size: 14px;
}

.activity-block ul {
  margin: 8px 0 0 20px;
  font-size: 13px;
  color: var(--text-light);
}

.activity-block li {
  margin-bottom: 4px;
}

/* ─── Summary Table ──────────────────────────────────────── */

.summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 16px 0;
}

.summary-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--accent);
  border-radius: var(--radius);
}

.summary-item .label {
  font-size: 13px;
  color: var(--text-light);
}

.summary-item .value {
  font-weight: 700;
  color: var(--primary);
  font-size: 14px;
}

/* ─── Filters ────────────────────────────────────────────── */

.filters {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  align-items: end;
}

.filters .form-group {
  margin-bottom: 0;
  min-width: 160px;
}

/* ─── Responsive ─────────────────────────────────────────── */

@media (max-width: 768px) {
  .app-header {
    padding: 0 16px;
  }

  .container {
    padding: 16px;
  }

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

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

  .timer-display {
    font-size: 36px;
  }

  .btn-start, .btn-stop {
    font-size: 16px;
    padding: 16px 32px;
  }

  .filters {
    flex-direction: column;
  }

  .modal {
    margin: 10px;
    padding: 16px;
  }

  .card {
    padding: 16px;
  }

  th, td {
    padding: 8px 10px;
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  .app-header .logo {
    font-size: 14px;
  }

  .app-header .user-info {
    display: none;
  }

  .app-header .header-btn {
    font-size: 12px;
    padding: 6px 10px;
  }

  .app-header .header-actions {
    gap: 6px;
  }

  .tab {
    padding: 8px 12px;
    font-size: 12px;
  }
}

/* ─── Utility ────────────────────────────────────────────── */

.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.hidden { display: none !important; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }

/* ─── Loading Spinner ────────────────────────────────────── */

.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(0,51,102,0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

.loading-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(255,255,255,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}
