/* ── Client Portal Styles ────────────────────────────────────────────────── */

/* Login page */
.client-login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg, #F4F6F8);
  padding: 24px;
}

.login-card {
  background: #fff;
  border-radius: 20px;
  border: 1px solid #E0E6EA;
  padding: 40px 36px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 8px 32px rgba(0,0,0,.06);
}

.login-card__header {
  text-align: center;
  margin-bottom: 28px;
}

.login-back {
  display: inline-block;
  font-size: .85rem;
  color: var(--text-sec, #6B7280);
  text-decoration: none;
  margin-bottom: 20px;
}
.login-back:hover { color: var(--primary, #166C9F); }

.login-brand { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.login-brand .brand-mark { font-size: 1.6rem; font-weight: 700; color: var(--primary, #166C9F); }
.login-brand .brand-sub  { font-size: .85rem; color: var(--text-sec, #6B7280); }

.login-form { display: flex; flex-direction: column; gap: 16px; }

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: .85rem; font-weight: 600; color: var(--text, #111827); }

.form-group select,
.form-group input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #D0D6DA;
  border-radius: 10px;
  font-size: .95rem;
  font-family: inherit;
  background: #fff;
  color: var(--text, #111827);
  outline: none;
  transition: border-color .15s;
}
.form-group select:focus,
.form-group input:focus { border-color: var(--primary, #166C9F); box-shadow: 0 0 0 3px rgba(22,108,159,.12); }

.btn--full { width: 100%; justify-content: center; }

.login-error {
  background: #FEE2E2;
  color: #B91C1C;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: .875rem;
}

/* Dashboard page */
.client-dashboard-body {
  min-height: 100vh;
  background: #F5F5F7;
}

.client-topbar {
  background: #fff;
  border-bottom: 1px solid #E0E6EA;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  height: 60px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.client-topbar__brand { display: flex; align-items: center; gap: 10px; }
.client-topbar__brand .brand-mark { font-size: 1.2rem; font-weight: 700; color: var(--primary, #166C9F); }
.client-topbar__brand .brand-sub  { font-size: .85rem; color: var(--text-sec, #6B7280); }

.client-topbar__actions { display: flex; align-items: center; gap: 12px; }

.client-main { padding: 32px 0 60px; }
.client-main h1 { font-size: 1.5rem; font-weight: 700; margin-bottom: 20px; }

/* Job table */
.table-wrap {
  background: #fff;
  border-radius: 14px;
  border: 1px solid #E0E6EA;
  overflow: hidden;
}

.jobs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}
.jobs-table th {
  background: #F8FAFB;
  color: var(--secondary, #60859D);
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid #E0E6EA;
}
.jobs-table td {
  padding: 13px 16px;
  border-bottom: 1px solid #F3F4F6;
  color: var(--text, #111827);
  vertical-align: middle;
}
.jobs-table tr:last-child td { border-bottom: none; }
.jobs-table tr:hover td { background: #FAFBFC; }

/* Status badges */
.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: .78rem;
  font-weight: 700;
}
.status--open      { background: #EFF6FF; color: #2563EB; }
.status--progress  { background: #FFF7ED; color: #C2410C; }
.status--done      { background: #DCFCE7; color: #16A34A; }
.status--synced    { background: rgba(22,108,159,.1); color: var(--primary, #166C9F); }

.no-pdf { color: var(--text-sec, #6B7280); font-size: .85rem; font-style: italic; }

.loading-cell { padding: 32px; text-align: center; color: var(--text-sec, #6B7280); }

.empty-msg {
  text-align: center;
  color: var(--text-sec, #6B7280);
  padding: 48px 0;
  font-style: italic;
}

/* Filter pills */
.filter-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.pill {
  background: #fff;
  border: 1px solid #D0D6DA;
  border-radius: 100px;
  padding: 5px 14px;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-sec, #6B7280);
  transition: background .15s, color .15s;
}
.pill--active,
.pill:hover {
  background: var(--primary, #166C9F);
  color: #fff;
  border-color: var(--primary, #166C9F);
}

@media (max-width: 640px) {
  .client-topbar { padding: 0 16px; }
  .client-main   { padding: 20px 0 40px; }
  .jobs-table th:nth-child(2),
  .jobs-table td:nth-child(2),
  .jobs-table th:nth-child(4),
  .jobs-table td:nth-child(4) { display: none; }
}

/* ── Topbar user label ───────────────────────────────────────────────────── */
.topbar-user {
  font-size: 0.82rem;
  color: var(--text-muted, #6B7280);
  font-weight: 500;
}

/* ── Stats grid ──────────────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 40px;
}

.stat-card {
  background: #fff;
  border-radius: var(--radius-lg, 16px);
  padding: 24px 28px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.04);
  border: 1px solid rgba(0,0,0,0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.08), 0 8px 24px rgba(0,0,0,0.04);
}

.stat-card__header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.stat-card__number {
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--text-dark, #111827);
  line-height: 1;
  margin-bottom: 6px;
}

.stat-card--active .stat-card__number { color: #EA580C; }
.stat-card--done   .stat-card__number { color: #16A34A; }

.stat-card__label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted, #6B7280);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── Live pulserende dot ──────────────────────────────────────────────────── */
@keyframes pulse-ring {
  0%   { transform: scale(0.85); opacity: 0.8; }
  70%  { transform: scale(1.8);  opacity: 0;   }
  100% { transform: scale(0.85); opacity: 0;   }
}

.live-dot {
  position: relative;
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #EA580C;
  flex-shrink: 0;
}

.live-dot--active::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: #EA580C;
  opacity: 0.4;
  animation: pulse-ring 1.8s ease-out infinite;
}

/* ── Locatie secties ─────────────────────────────────────────────────────── */
.location-section {
  margin-bottom: 44px;
}

.location-section__title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-dark, #111827);
  margin-bottom: 16px;
}

.location-section__title svg {
  color: var(--primary, #166C9F);
  flex-shrink: 0;
}

.location-job-count {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted, #6B7280);
  background: rgba(0,0,0,0.06);
  border-radius: 100px;
  padding: 2px 8px;
  margin-left: 4px;
}

/* ── Job cards grid ──────────────────────────────────────────────────────── */
.job-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.job-card {
  background: #fff;
  border-radius: var(--radius-lg, 16px);
  padding: 20px 22px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 2px 8px rgba(0,0,0,0.03);
  border: 1px solid rgba(0,0,0,0.04);
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: default;
}

.job-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.04);
}

.job-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.job-card__status {
  display: flex;
  align-items: center;
  gap: 8px;
}

.job-card__code {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary, #166C9F);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.job-card__type {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-dark, #111827);
}

.job-card__date {
  font-size: 0.8rem;
  color: var(--text-muted, #6B7280);
  flex: 1;
}

.job-card__footer {
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid #F3F4F6;
}

/* ── Section titles (Document Hub) ──────────────────────────────────────── */
.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-dark, #111827);
  margin-bottom: 4px;
}

.section-sub {
  font-size: 0.85rem;
  color: var(--text-muted, #6B7280);
  margin-bottom: 20px;
}

/* ── Document Hub ────────────────────────────────────────────────────────── */
.doc-hub-section {
  margin-top: 52px;
  margin-bottom: 60px;
}

.doc-hub {
  background: #fff;
  border-radius: var(--radius-lg, 16px);
  border: 1px solid rgba(0,0,0,0.05);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 2px 8px rgba(0,0,0,0.03);
  overflow: hidden;
}

.doc-group {
  padding: 18px 24px;
  border-bottom: 1px solid #F3F4F6;
}

.doc-group:last-child { border-bottom: none; }

.doc-group__title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted, #6B7280);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 10px;
}

.doc-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #FAFAFA;
}

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

.doc-item__info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.doc-item__code {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-dark, #111827);
}

.doc-item__date {
  font-size: 0.78rem;
  color: var(--text-muted, #6B7280);
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }
  .stats-grid .stat-card:last-child {
    grid-column: span 2;
  }
  .job-cards-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .stats-grid .stat-card:last-child {
    grid-column: auto;
  }
  .client-topbar { padding: 0 16px; }
}

/* ── Download toast ──────────────────────────────────────────────────────── */
.dl-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: .9rem;
  font-weight: 500;
  box-shadow: 0 4px 16px rgba(0,0,0,.15);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .25s ease, transform .25s ease;
  z-index: 9999;
  pointer-events: none;
}
.dl-toast--visible  { opacity: 1; transform: translateY(0); }
.dl-toast--info     { background: #1e40af; color: #fff; }
.dl-toast--success  { background: #16a34a; color: #fff; }
.dl-toast--error    { background: #dc2626; color: #fff; }
