/* ============================================================
   People First Co — Workforce Dashboard
   Design system matched to PFC website mockup
   ============================================================ */

:root {
  --color-primary: #2d3436;
  --color-accent: #E5A835;
  --color-accent-light: #f0be4a;
  --color-bg: #1a2021;
  --color-surface: rgba(255,255,255,0.04);
  --color-surface-hover: rgba(255,255,255,0.07);
  --color-border: rgba(255,255,255,0.06);
  --color-border-strong: rgba(255,255,255,0.1);
  --color-text: rgba(255,255,255,0.85);
  --color-text-muted: rgba(255,255,255,0.4);
  --color-text-dim: rgba(255,255,255,0.25);
  --status-active-bg: rgba(22,163,74,0.15);
  --status-active-color: #4ade80;
  --status-late-bg: rgba(234,179,8,0.15);
  --status-late-color: #facc15;
  --status-absent-bg: rgba(239,68,68,0.12);
  --status-absent-color: #f87171;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-pill: 999px;
  --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

body {
  font-family: var(--font-body);
  background: linear-gradient(160deg, #2d3436 0%, #1a2021 60%, #1e2526 100%);
  background-attachment: fixed;
  color: var(--color-text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   LOGIN
   ============================================================ */

.login-view {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.login-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: 48px 40px;
  width: 100%;
  max-width: 380px;
  text-align: center;
}

.login-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.login-logo-icon {
  width: 56px;
  height: 56px;
  background: var(--color-accent);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.login-logo-text {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.3px;
}

.login-subtitle {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-bottom: 32px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
}

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

.login-form input {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 15px;
  font-family: var(--font-body);
  color: var(--color-text);
  outline: none;
  transition: border-color 200ms ease;
}

.login-form input:focus {
  border-color: var(--color-accent);
}

.login-form input::placeholder {
  color: var(--color-text-dim);
}

.login-form button {
  background: var(--color-accent);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: 14px;
  font-size: 15px;
  font-weight: 700;
  font-family: var(--font-body);
  cursor: pointer;
  transition: background 200ms ease;
}

.login-form button:hover {
  background: var(--color-accent-light);
}

.login-error {
  font-size: 13px;
  color: #f87171;
  display: none;
}

.login-error.show {
  display: block;
}

/* ============================================================
   DASHBOARD HEADER
   ============================================================ */

.dashboard-view {
  min-height: 100vh;
}

.dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.dash-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dash-logo {
  width: 36px;
  height: 36px;
  background: var(--color-accent);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
}

.dash-brand {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.3px;
}

.dash-header-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.dash-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.dash-header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.dash-date {
  font-size: 13px;
  color: var(--color-text-muted);
  font-weight: 500;
}

.dash-logout {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 200ms ease;
}

.dash-logout:hover {
  border-color: var(--color-border-strong);
  color: var(--color-text);
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */

.dash-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 24px 60px;
}

/* Shift Banner */
.shift-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 18px 24px;
  margin-bottom: 20px;
}

.shift-banner-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.shift-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.shift-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text);
}

.shift-banner-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.shift-time {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-accent);
}

.shift-summary {
  font-size: 13px;
  color: var(--color-text-muted);
  font-weight: 500;
}

/* Weekly Schedule */
.week-schedule {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-bottom: 20px;
}

.week-day {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 14px 10px;
  text-align: center;
  transition: border-color 200ms ease;
}

.week-day.today {
  border-color: var(--color-accent);
  background: rgba(229, 168, 53, 0.06);
}

.week-day-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.week-day-date {
  font-size: 18px;
  font-weight: 800;
  color: var(--color-text);
  line-height: 1;
  margin-bottom: 8px;
}

.week-day.today .week-day-date {
  color: var(--color-accent);
}

.week-day-shift {
  font-size: 10px;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: 2px;
}

.week-day-hours {
  font-size: 10px;
  color: var(--color-text-dim);
}

.week-day-workers {
  font-size: 11px;
  font-weight: 700;
  color: var(--color-accent);
  margin-top: 6px;
}

.week-day-off .week-day-shift,
.week-day-off .week-day-hours {
  display: none;
}

.week-day-off .week-day-workers {
  color: var(--color-text-dim);
  font-weight: 500;
}

/* Stats Row */
.stats-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 18px 14px;
  text-align: center;
  transition: border-color 200ms ease;
}

.stat-card:hover {
  border-color: var(--color-border-strong);
}

.stat-num {
  font-size: 28px;
  font-weight: 800;
  color: var(--color-accent);
  letter-spacing: -1px;
  line-height: 1;
}

.stat-label {
  font-size: 10px;
  font-weight: 500;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 6px;
}

/* Workers Section */
.workers-section {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.workers-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--color-border);
}

.workers-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text);
}

.workers-filters {
  display: flex;
  gap: 4px;
}

.filter-btn {
  background: none;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 200ms ease;
}

.filter-btn:hover {
  color: var(--color-text);
}

.filter-btn.active {
  background: var(--color-surface-hover);
  border-color: var(--color-border);
  color: var(--color-text);
}

/* Worker List */
.workers-list {
  padding: 8px;
}

.worker-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  transition: background 200ms ease;
}

.worker-card:hover {
  background: var(--color-surface-hover);
}

.worker-avatar {
  width: 38px;
  height: 38px;
  background: var(--color-accent);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.worker-info {
  flex: 1;
  min-width: 0;
}

.worker-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.3;
}

.worker-role {
  font-size: 12px;
  color: var(--color-text-muted);
  font-weight: 500;
}

.worker-checkin {
  font-size: 12px;
  color: var(--color-text-muted);
  font-weight: 500;
  text-align: right;
  flex-shrink: 0;
}

.worker-checkin-time {
  color: var(--color-text);
  font-weight: 600;
}

.worker-status {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  flex-shrink: 0;
}

.status-active {
  background: var(--status-active-bg);
  color: var(--status-active-color);
}

.status-late {
  background: var(--status-late-bg);
  color: var(--status-late-color);
}

.status-absent {
  background: var(--status-absent-bg);
  color: var(--status-absent-color);
}

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

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

  .dash-header-center {
    display: none;
  }

  .dash-brand {
    display: none;
  }

  .dash-main {
    padding: 20px 16px 40px;
  }

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

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

  .shift-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .shift-banner-right {
    align-items: flex-start;
  }

  .workers-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
  }

  .worker-card {
    padding: 12px;
  }

  .worker-checkin {
    display: none;
  }
}

@media (max-width: 480px) {
  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }
}
