/* ═══════════════════════════════════════════════════════════
   MultiMarkt Rooster – Premium SaaS Dashboard
   ═══════════════════════════════════════════════════════════ */

:root {
  --primary: #c0392b;
  --primary-hover: #a93226;
  --primary-secondary: #e74c3c;
  --primary-light: #fdf2f2;
  --primary-rgb: 192, 57, 43;
  --dark: #0f172a;
  --dark-hover: #1e293b;
  --success: #10b981;
  --success-light: #ecfdf5;
  --gray: #64748b;
  --gray-light: #94a3b8;
  --bg: #f8fafc;
  --surface: #ffffff;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --text: #0f172a;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 4px 16px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 4px 24px rgba(15, 23, 42, 0.08);
  --radius: 12px;
  --radius-lg: 16px;
  --nav-height: 64px;
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Top Navigation ── */
.topnav {
  position: sticky;
  top: 0;
  z-index: 1050;
  background: var(--dark);
  height: var(--nav-height);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.topnav-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.topnav-brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
  flex-shrink: 0;
}

.topnav-brand-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--primary-secondary));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.95rem;
}

.topnav-brand-text {
  color: #fff;
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.03em;
}

.topnav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex: 1;
}

.topnav-links a {
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.5rem 0.875rem;
  border-radius: 8px;
  transition: all var(--transition);
  white-space: nowrap;
}

.topnav-links a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.topnav-links a.active {
  color: #fff;
  background: rgba(var(--primary-rgb), 0.15);
  border-left: 3px solid var(--primary);
  padding-left: calc(0.875rem - 3px);
  border-radius: 0 8px 8px 0;
}

.topnav-links a i {
  margin-right: 0.4rem;
  font-size: 0.8rem;
}

.topnav-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
  flex-shrink: 0;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.375rem 0.75rem 0.375rem 0.375rem;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: background var(--transition);
}

.user-menu:hover {
  background: rgba(255, 255, 255, 0.1);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 600;
  font-size: 0.8rem;
}

.user-name {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.8125rem;
  font-weight: 500;
}

.btn-logout {
  color: rgba(255, 255, 255, 0.5);
  background: none;
  border: none;
  padding: 0.375rem;
  border-radius: 8px;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  display: flex;
  align-items: center;
}

.btn-logout:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.25rem;
  padding: 0.375rem;
  cursor: pointer;
}

.mobile-nav {
  display: none;
  background: var(--dark-hover);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: 0.75rem 1rem;
}

.mobile-nav.open { display: block; }

.mobile-nav a {
  display: block;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  padding: 0.625rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 2px;
}

.mobile-nav a.active {
  color: #fff;
  background: rgba(var(--primary-rgb), 0.15);
  border-left: 3px solid var(--primary);
  padding-left: calc(1rem - 3px);
  border-radius: 0 8px 8px 0;
}

/* ── Main Content ── */
.page-wrapper {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
}

.page-enter {
  animation: pageEnter 0.35s ease forwards;
}

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

/* ── Welcome Header ── */
.welcome-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 0.375rem;
  color: var(--text);
}

.welcome-header p {
  color: var(--gray);
  font-size: 0.9375rem;
  margin: 0;
}

/* ── Stat Cards ── */
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.375rem 1.5rem;
  height: 100%;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: transparent;
  transition: background 0.25s ease;
}

.stat-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.stat-card:hover::after { background: var(--primary); }

.stat-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.stat-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.stat-card-icon.primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-secondary));
  color: #fff;
}
.stat-card-icon.success { background: var(--success-light); color: var(--success); }
.stat-card-icon.amber   { background: #fffbeb; color: #f59e0b; }
.stat-card-icon.violet  { background: #f5f3ff; color: #8b5cf6; }

.stat-card-value {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 0.25rem;
}

.stat-card-label {
  color: var(--gray);
  font-size: 0.8125rem;
  font-weight: 500;
}

/* ── Cards ── */
.card-saas {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow 0.25s ease;
}

.card-saas:hover {
  box-shadow: var(--shadow);
}

.card-saas-header {
  padding: 1.125rem 1.5rem;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.card-saas-header h2 {
  font-size: 0.9375rem;
  font-weight: 600;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-saas-header h2 .icon-accent {
  color: var(--primary);
  font-size: 0.85rem;
}

.card-saas-body { padding: 0; }

.card-saas-body.padded { padding: 1.5rem; }

/* ── Pulsing dot ── */
.pulse-dot {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  display: inline-block;
  position: relative;
  flex-shrink: 0;
}

.pulse-dot::before {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: var(--success);
  opacity: 0.4;
  animation: pulse 2s ease infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.4; }
  50%       { transform: scale(1.8); opacity: 0; }
}

/* ── Tables ── */
.table-saas {
  width: 100%;
  margin: 0;
  font-size: 0.875rem;
  border-collapse: collapse;
}

.table-saas thead th {
  background: #fafbfc;
  color: var(--gray);
  font-weight: 600;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.table-saas tbody td {
  padding: 0.9375rem 1.5rem;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}

.table-saas tbody tr:last-child td { border-bottom: none; }

.table-saas tbody tr {
  transition: background 0.15s ease;
}

.table-saas tbody tr:hover {
  background: #fafbfc;
}

.employee-cell {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.employee-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.8125rem;
  flex-shrink: 0;
}

/* ── Status Badges ── */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3em 0.75em;
  border-radius: 99px;
  white-space: nowrap;
}

.badge-aanwezig {
  background: var(--success-light);
  color: #059669;
}

.badge-afwezig {
  background: #f1f5f9;
  color: var(--gray);
}

.badge-loc-ok {
  background: var(--success-light);
  color: #059669;
}

.badge-loc-fail {
  background: #fef2f2;
  color: #dc2626;
}

.badge-accent {
  background: var(--primary-light);
  color: var(--primary);
}

/* ── Activity Feed ── */
.activity-feed {
  list-style: none;
  margin: 0;
  padding: 0.5rem 0;
}

.activity-item {
  display: flex;
  gap: 0.875rem;
  padding: 0.875rem 1.5rem;
  border-bottom: 1px solid var(--border-light);
  transition: background 0.15s ease;
}

.activity-item:last-child { border-bottom: none; }
.activity-item:hover { background: #fafbfc; }

.activity-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.activity-icon.success { background: var(--success-light); color: var(--success); }
.activity-icon.indigo  { background: var(--primary-light); color: var(--primary); }
.activity-icon.gray    { background: #f1f5f9; color: var(--gray); }

.activity-body { flex: 1; min-width: 0; }

.activity-title {
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 0.125rem;
}

.activity-meta {
  font-size: 0.75rem;
  color: var(--gray);
}

/* ── Buttons ── */
.btn-primary-saas {
  background: var(--primary);
  border: none;
  color: #fff;
  font-weight: 500;
  font-size: 0.875rem;
  padding: 0.5625rem 1.125rem;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

.btn-primary-saas:hover {
  background: var(--primary-hover);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.35);
}

.btn-secondary-saas {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-weight: 500;
  font-size: 0.875rem;
  padding: 0.5625rem 1.125rem;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

.btn-secondary-saas:hover {
  background: #fafbfc;
  border-color: #cbd5e1;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
  color: var(--text);
}

.btn-icon-saas {
  width: 34px;
  height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--gray);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.8rem;
}

.btn-icon-saas:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
}

.btn-icon-saas.danger:hover {
  background: #fef2f2;
  border-color: #fecaca;
  color: #dc2626;
}

/* ── Empty States ── */
.empty-state {
  padding: 3.5rem 2rem;
  text-align: center;
}

.empty-illustration {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.25rem;
  background: linear-gradient(135deg, var(--primary-light), #fde8e8);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--primary);
}

.empty-state h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.375rem;
}

.empty-state p {
  color: var(--gray);
  font-size: 0.875rem;
  margin: 0;
}

/* ── Progress bars ── */
.hours-row {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-light);
  transition: background 0.15s ease;
}

.hours-row:last-child { border-bottom: none; }
.hours-row:hover { background: #fafbfc; }

.hours-row-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.625rem;
}

.hours-row-name {
  font-weight: 600;
  font-size: 0.875rem;
}

.hours-row-value {
  font-weight: 700;
  color: var(--primary);
  font-size: 0.875rem;
}

.progress-saas {
  height: 8px;
  background: #e2e8f0;
  border-radius: 99px;
  overflow: hidden;
}

.progress-saas-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-secondary));
  border-radius: 99px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Forms ── */
.form-saas {
  padding: 1.25rem 1.5rem;
  background: #fafbfc;
  border-bottom: 1px solid var(--border-light);
}

.form-saas .form-control {
  border-radius: 10px;
  border-color: var(--border);
  font-size: 0.875rem;
  padding: 0.5625rem 0.875rem;
}

.form-saas .form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.12);
}

.form-saas .form-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--gray);
  margin-bottom: 0.375rem;
}

code.employee-code {
  background: var(--primary-light);
  color: var(--primary);
  padding: 0.25em 0.6em;
  border-radius: 6px;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.06em;
}

/* ── Chart container ── */
.chart-container {
  position: relative;
  height: 260px;
  padding: 1rem 1.5rem 1.5rem;
}

/* ── Alerts ── */
.alert-saas {
  border-radius: var(--radius);
  font-size: 0.875rem;
  border: none;
}

/* ── Login Page ── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
}

.login-page::before {
  content: "";
  position: absolute;
  top: -40%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(var(--primary-rgb), 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.login-page::after {
  content: "";
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.06) 0%, transparent 70%);
  pointer-events: none;
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 1;
}

.login-logo-wrap {
  text-align: center;
  margin-bottom: 2rem;
}

.login-logo {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--primary), var(--primary-secondary));
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.375rem;
  margin-bottom: 1rem;
  box-shadow: 0 8px 24px rgba(var(--primary-rgb), 0.3);
}

.login-brand {
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: -0.03em;
  margin-bottom: 0.25rem;
}

.login-subtitle {
  color: var(--gray);
  font-size: 0.875rem;
}

.login-card .form-control {
  border-radius: 10px;
  border-color: var(--border);
  padding: 0.6875rem 0.875rem;
  font-size: 0.9rem;
}

.login-card .form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.12);
}

.login-card .form-label {
  font-weight: 500;
  font-size: 0.875rem;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.5rem 0;
  color: var(--gray-light);
  font-size: 0.75rem;
}

.login-divider::before,
.login-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Responsive ── */
@media (max-width: 991.98px) {
  .topnav-links { display: none; }
  .nav-toggle { display: block; }
  .user-name { display: none; }
  .page-wrapper { padding: 1.25rem 1rem 2rem; }
  .welcome-header h1 { font-size: 1.375rem; }
}

@media (max-width: 575.98px) {
  .stat-card-value { font-size: 1.625rem; }
  .table-saas thead th,
  .table-saas tbody td { padding: 0.75rem 1rem; }
}
