/* ========================================
   GRIMY GRILLS / Employee Portal
   Mobile-first, app-like design
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,400;12..96,600;12..96,700;12..96,800&family=Outfit:wght@300;400;500;600&display=swap');

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --copper: #C4501B;
  --copper-dark: #A3400F;
  --copper-light: #FDEEE6;
  --charcoal: #2B2926;
  --charcoal-light: #6B6560;
  --cream: #FAF7F2;
  --cream-dark: #EFE9DF;
  --border: #E0D8CC;
  --white: #FFFFFF;
  --sage: #3B7A57;
  --sage-light: #E8F3ED;
  --red: #DC2626;
  --red-light: #FEE2E2;
  --radius: 14px;
  --shadow: 0 4px 20px rgba(43,41,38,0.1);
}

html, body {
  height: 100%;
  overflow: hidden;
  font-family: 'Outfit', sans-serif;
  background: var(--charcoal);
  color: var(--charcoal);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: 'Bricolage Grotesque', sans-serif;
  line-height: 1.2;
}

.hidden { display: none !important; }

/* Employee marketing header: no admin tools in nav */
.header--employee .hamburger {
  display: none;
}

.header--employee .nav-links--employee {
  gap: 12px;
}

.header--employee .nav-links--employee .crm-nav-link {
  font-weight: 600;
}

/* ========================================
   PIN SCREEN
   ======================================== */

.pin-screen {
  position: fixed;
  top: var(--header-bar-height);
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(160deg, #1a1714 0%, #2b2926 60%, #3a3330 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 32px env(safe-area-inset-bottom, 24px);
  z-index: 100;
  gap: 8px;
}

.pin-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
}

.pin-logo .logo-icon {
  height: 96px;
  max-width: none;
}

.pin-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
  text-align: center;
}

.pin-subtitle {
  font-size: 0.875rem;
  color: rgba(255,255,255,0.45);
  margin-bottom: 20px;
  text-align: center;
}

.pin-dots {
  display: flex;
  gap: 18px;
  margin: 8px 0 16px;
}

.pin-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.3);
  background: transparent;
  transition: all 0.15s ease;
}

.pin-dot.filled {
  background: var(--copper);
  border-color: var(--copper);
  transform: scale(1.1);
}

.pin-dot.shake {
  animation: dotShake 0.4s ease;
  background: var(--red);
  border-color: var(--red);
}

@keyframes dotShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

.pin-error {
  color: #FCA5A5;
  font-size: 0.83rem;
  text-align: center;
  min-height: 20px;
  margin-bottom: 4px;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Numpad */
.numpad {
  display: grid;
  grid-template-columns: repeat(3, 72px);
  grid-template-rows: repeat(4, 68px);
  gap: 10px;
  margin-top: 8px;
}

.numpad-key {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  color: white;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 1.4rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.1s ease, transform 0.1s ease;
  user-select: none;
  touch-action: manipulation;
}

.numpad-key:active {
  background: rgba(196, 80, 27, 0.4);
  transform: scale(0.94);
}

.numpad-empty {
  /* placeholder for empty grid cell */
}

.numpad-del {
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.6);
}

.numpad-del:active {
  background: rgba(220, 38, 38, 0.3);
}

.pin-config-warning {
  margin-top: 24px;
  padding: 14px 20px;
  background: rgba(196, 80, 27, 0.2);
  border: 1px solid rgba(196, 80, 27, 0.4);
  border-radius: 10px;
  color: #FDEEE6;
  font-size: 0.8rem;
  text-align: center;
  line-height: 1.6;
}

.pin-config-warning code {
  background: rgba(196, 80, 27, 0.3);
  padding: 1px 5px;
  border-radius: 4px;
}

/* ========================================
   PORTAL LAYOUT
   ======================================== */

.portal {
  position: fixed;
  top: var(--header-bar-height);
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--cream);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 1;
}

/* Header */
.emp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--charcoal);
  color: white;
  flex-shrink: 0;
  padding-top: max(16px, env(safe-area-inset-top, 16px));
}

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

.emp-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--copper);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 800;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.emp-name {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  color: white;
}

.emp-date {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.5);
  margin-top: 2px;
}

.sign-out-btn {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.7);
  padding: 10px 16px;
  min-height: 44px;
  border-radius: 8px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
  touch-action: manipulation;
}

.sign-out-btn:active {
  background: rgba(255,255,255,0.18);
}

/* Main area: big tab tiles + panels */
.emp-portal-main {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.emp-tab-tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
  flex-shrink: 0;
  background: var(--cream);
  border-bottom: 1px solid var(--border);
}

.emp-tab-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-height: 112px;
  padding: 18px 16px;
  text-align: left;
  border: 2px solid var(--border);
  border-radius: 16px;
  background: var(--white);
  color: var(--charcoal);
  cursor: pointer;
  font-family: inherit;
  box-shadow: var(--shadow);
  touch-action: manipulation;
  transition:
    border-color 0.2s ease,
    transform 0.12s ease,
    box-shadow 0.2s ease;
}

.emp-tab-tile:active {
  transform: scale(0.98);
}

.emp-tab-tile--active {
  border-color: var(--copper);
  box-shadow: 0 0 0 1px rgba(196, 80, 27, 0.25), var(--shadow);
}

.emp-tab-tile-icon {
  color: var(--copper);
  display: flex;
  align-items: center;
  justify-content: center;
}

.emp-tab-tile-label {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 800;
  font-size: 1.05rem;
  line-height: 1.2;
}

.emp-tab-tile-hint {
  font-size: 0.78rem;
  color: var(--charcoal-light);
  font-weight: 500;
  line-height: 1.35;
}

.emp-panels {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--cream);
}

.emp-tab-panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.emp-tab-panel.hidden {
  display: none !important;
}

.emp-tab-panel--jobs .portal-content {
  flex: 1;
  min-height: 0;
}

/* Clock bar */
.clock-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--charcoal);
  border-top: none;
  border-radius: 0;
  flex-shrink: 0;
}

#empPanelTime .clock-bar {
  margin: 16px 16px 0;
  border-radius: 14px;
  overflow: hidden;
}

.clock-info {
  color: white;
}

.clock-label {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.clock-time {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: white;
  margin-top: 2px;
  min-height: 24px;
}

.clock-btn {
  padding: 10px 22px;
  border-radius: 100px;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.875rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.clock-btn.clock-in {
  background: var(--sage);
  color: white;
}

.clock-btn.clock-in:active { background: #2d6044; }

.clock-btn.clock-out {
  background: var(--red);
  color: white;
}

.clock-btn.clock-out:active { background: #b91c1c; }

/* Pay period summary (time tab) */
.emp-pay-summary {
  margin: 16px 16px 0;
  padding: 16px;
  background: white;
  border-radius: 14px;
  border: 1px solid var(--cream-dark);
}

.emp-pay-summary-title {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 4px;
  color: var(--charcoal);
}

.emp-pay-summary-period {
  font-size: 0.82rem;
  color: var(--charcoal-light);
  margin: 0 0 14px;
}

.emp-pay-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.emp-pay-stat {
  padding: 10px 12px;
  background: var(--cream);
  border-radius: 10px;
}

.emp-pay-stat--total {
  grid-column: 1 / -1;
  background: var(--sage-light);
}

.emp-pay-stat-label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--charcoal-light);
  font-weight: 600;
}

.emp-pay-stat-value {
  display: block;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--charcoal);
  margin-top: 2px;
}

.emp-pay-stat--total .emp-pay-stat-value {
  color: var(--sage);
}

.emp-pay-summary-hint {
  font-size: 0.78rem;
  color: var(--charcoal-light);
  margin: 12px 0 0;
  line-height: 1.4;
}

/* Shift history */
.emp-shift-history {
  margin: 16px;
  padding-bottom: 24px;
}

.emp-shift-history-title {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 4px;
}

.emp-shift-history-sub {
  font-size: 0.82rem;
  color: var(--charcoal-light);
  margin: 0 0 12px;
}

.emp-shift-history-loading {
  display: flex;
  justify-content: center;
  padding: 16px;
}

.emp-shift-row {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 2px 12px;
  padding: 12px 14px;
  background: white;
  border: 1px solid var(--cream-dark);
  border-radius: 10px;
  margin-bottom: 8px;
  font-size: 0.88rem;
}

.emp-shift-row-day {
  font-weight: 600;
  color: var(--charcoal);
}

.emp-shift-row-dur {
  grid-row: 1 / 3;
  grid-column: 2;
  align-self: center;
  font-weight: 700;
  color: var(--sage);
  font-family: 'Bricolage Grotesque', sans-serif;
}

.emp-shift-row-times {
  color: var(--charcoal-light);
  font-size: 0.82rem;
}

.emp-shift-history-empty,
.emp-shift-history-error {
  font-size: 0.88rem;
  color: var(--charcoal-light);
  text-align: center;
  padding: 16px;
}

/* Portal content area */
.portal-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 20px 16px;
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  -webkit-overflow-scrolling: touch;
}

/* Loading state */
.jobs-loading {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 32px 0;
  color: var(--charcoal-light);
  font-size: 0.9rem;
  justify-content: center;
}

.emp-spinner {
  width: 20px;
  height: 20px;
  border: 2.5px solid var(--border);
  border-top-color: var(--copper);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

/* Jobs list */
.jobs-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.jobs-list--week {
  gap: 0;
}

/* 7-day schedule (swipe on narrow screens, grid on wide) */
.emp-schedule-week {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin: 0 -4px;
  padding-left: 4px;
  padding-right: 4px;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
}

.emp-schedule-day {
  flex: 0 0 min(86vw, 320px);
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scroll-snap-align: start;
  border-radius: 12px;
  padding: 8px 8px 10px;
  background: var(--cream-dark);
  border: 1px solid var(--border);
}

.emp-schedule-day--today {
  border-color: var(--copper);
  box-shadow: 0 0 0 1px rgba(196, 80, 27, 0.2);
  background: var(--copper-light);
}

.emp-schedule-day-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
  padding: 2px 2px 0;
}

.emp-schedule-day-head-text {
  display: flex;
  flex-direction: column;
  gap: 0;
  line-height: 1.15;
}

.emp-schedule-dow {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--charcoal-light);
}

.emp-schedule-dom {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--charcoal);
}

.emp-schedule-day--today .emp-schedule-dow {
  color: var(--copper-dark);
}

.emp-schedule-today-pill {
  flex-shrink: 0;
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 7px;
  border-radius: 100px;
  background: var(--copper);
  color: white;
}

.emp-schedule-day-jobs {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 32px;
}

.emp-schedule-day-jobs .job-card {
  box-shadow: 0 2px 10px rgba(43, 41, 38, 0.06);
}

.emp-schedule-day-jobs .job-card-body {
  padding: 12px;
  gap: 8px;
}

.emp-schedule-day-jobs .job-card-head .job-number {
  width: 28px;
  height: 28px;
  min-width: 28px;
  font-size: 0.82rem;
}

.emp-schedule-day-jobs .job-card-client {
  font-size: 0.92rem;
}

.emp-schedule-day-jobs .job-card-address {
  font-size: 0.8rem;
}

.emp-schedule-day-jobs .job-card-services {
  margin-top: 4px;
}

.emp-schedule-day-empty {
  font-size: 0.85rem;
  color: var(--charcoal-light);
  text-align: center;
  padding: 12px 4px;
  margin: 0;
}

@media (min-width: 960px) {
  .emp-schedule-week {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    overflow-x: visible;
    margin: 0;
    padding-left: 0;
    padding-right: 0;
    scroll-snap-type: none;
  }

  .emp-schedule-day {
    flex: unset;
    min-width: 0;
    scroll-snap-align: unset;
  }
}

/* Job card */
.job-card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow);
}

.job-card:active {
  transform: scale(0.985);
}

.job-card.status-in-progress {
  border-color: #F59E0B;
}

.job-card.status-complete {
  border-color: var(--sage);
  opacity: 0.75;
}

.job-card-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 12px;
}

.job-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.job-card-head .status-pill {
  margin-left: auto;
  flex-shrink: 1;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.job-card-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.job-number {
  width: 32px;
  height: 32px;
  min-width: 32px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--copper-light);
  color: var(--copper);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 800;
  font-size: 0.9rem;
}

.job-card.status-in-progress .job-number {
  background: #FEF3C7;
  color: #D97706;
}

.job-card.status-complete .job-number {
  background: var(--sage-light);
  color: var(--sage);
}

.job-card-client {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--charcoal);
  line-height: 1.25;
  overflow-wrap: break-word;
  word-break: normal;
}

.job-card-address {
  font-size: 0.8rem;
  color: var(--charcoal-light);
  line-height: 1.4;
  overflow-wrap: anywhere;
  word-break: normal;
}

.job-card-services {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}

.job-service-chip {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 100px;
  background: var(--copper-light);
  color: var(--copper-dark);
}

.job-card.status-in-progress .job-service-chip {
  background: #FEF3C7;
  color: #92400E;
}

.job-card.status-complete .job-service-chip {
  background: var(--sage-light);
  color: var(--sage);
}

.job-card-arrow {
  color: var(--charcoal-light);
  flex-shrink: 0;
}

.status-pill {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 7px;
  border-radius: 100px;
  white-space: nowrap;
  flex-shrink: 0;
}

.status-pill.pending { background: var(--cream-dark); color: var(--charcoal-light); }
.status-pill.confirmed { background: #DBEAFE; color: #1E40AF; }
.status-pill.in-progress { background: #FEF3C7; color: #92400E; }
.status-pill.complete { background: var(--sage-light); color: var(--sage); }

/* Empty state */
.jobs-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 48px 24px;
  gap: 10px;
}

.jobs-empty-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  border: 2px dashed var(--border);
  background: var(--cream-dark);
  opacity: 0.9;
}
.jobs-empty.jobs-empty--error .jobs-empty-icon {
  border-style: solid;
  border-color: var(--red-light);
  background: var(--red-light);
}
.jobs-empty h3 { font-size: 1.2rem; font-weight: 700; color: var(--charcoal); }
.jobs-empty p { font-size: 0.875rem; color: var(--charcoal-light); line-height: 1.6; max-width: 280px; }
.jobs-empty.jobs-empty--error h3 { color: var(--red); }

/* ========================================
   JOB DRAWER (bottom sheet)
   ======================================== */

.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(43, 41, 38, 0.5);
  z-index: 200;
  animation: fadeIn 0.2s ease;
}

.drawer-overlay.hidden { display: none !important; }

.drawer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--cream);
  border-radius: 20px 20px 0 0;
  z-index: 201;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s cubic-bezier(0.34, 1.2, 0.64, 1);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.drawer.hidden { display: none !important; }

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.drawer-handle {
  width: 36px;
  height: 4px;
  background: var(--border);
  border-radius: 4px;
  margin: 10px auto 0;
  flex-shrink: 0;
}

.drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 14px 20px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  gap: 12px;
}

.drawer-client-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--charcoal);
}

.drawer-address {
  font-size: 0.82rem;
  color: var(--charcoal-light);
  margin-top: 3px;
  line-height: 1.45;
  white-space: normal;
  word-break: break-word;
  max-width: min(100%, 52ch);
}

.drawer-close {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 50%;
  background: var(--cream-dark);
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--charcoal-light);
  margin-top: 2px;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.drawer-section {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.drawer-section:last-child { border-bottom: none; }

.drawer-service-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.drawer-tag {
  background: var(--copper-light);
  color: var(--copper-dark);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 100px;
}

.drawer-contact {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.drawer-contact-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--charcoal-light);
}

.drawer-contact-item a {
  color: var(--copper);
  font-weight: 500;
  text-decoration: none;
}

.drawer-contact-item svg { color: var(--copper); flex-shrink: 0; }

/* Status row */
.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.status-badge {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 5px 12px;
  border-radius: 100px;
}

.status-badge.pending { background: var(--cream-dark); color: var(--charcoal-light); }
.status-badge.confirmed { background: #DBEAFE; color: #1E40AF; }
.status-badge.in-progress { background: #FEF3C7; color: #92400E; }
.status-badge.complete { background: var(--sage-light); color: var(--sage); }

.status-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
  justify-content: flex-end;
}

.emp-status-action-col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  max-width: min(100%, 220px);
}

.emp-status-clock-hint {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.35;
  color: var(--charcoal-light);
  text-align: right;
}

.emp-btn-arrive:disabled {
  background: var(--border);
  color: var(--charcoal-light);
  cursor: not-allowed;
  opacity: 0.85;
}

.emp-btn-arrive:disabled:active {
  transform: none;
}

.emp-btn-status-revert {
  font-size: 0.82rem;
  padding: 8px 12px;
  white-space: nowrap;
}

.emp-modal-panel--compact {
  max-height: none;
}

.emp-status-schema-hint {
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--charcoal-light);
  max-width: min(100%, 260px);
  text-align: right;
  margin: 0 0 8px;
}

.emp-status-help-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  max-width: min(100%, 280px);
}

.emp-status-sql-details {
  font-size: 0.72rem;
  color: var(--charcoal-light);
  text-align: right;
  width: 100%;
}

.emp-status-sql-details summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--copper-dark);
  list-style-position: outside;
  margin-bottom: 6px;
}

.emp-status-sql-pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.62rem;
  line-height: 1.35;
  text-align: left;
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--cream-dark);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  margin: 0 0 8px;
  color: var(--charcoal);
}

.emp-copy-sql-btn {
  font-family: 'Outfit', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--charcoal);
  cursor: pointer;
}

.emp-copy-sql-btn:active {
  background: var(--cream-dark);
}

/* Photo section */
.photo-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.photo-section-header h4 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--charcoal);
}

.photo-upload-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--copper);
  color: white;
  font-family: 'Outfit', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.photo-upload-btn:active { background: var(--copper-dark); }

.photo-upload-btn--disabled {
  opacity: 0.38;
  cursor: not-allowed;
  pointer-events: none;
}

input[type="file"] { display: none; }

.photo-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.photo-grid-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 16px;
  font-size: 0.8rem;
  color: var(--charcoal-light);
  opacity: 0.5;
}

.photo-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--white);
  display: flex;
  flex-direction: column;
}

.photo-card-thumb {
  aspect-ratio: 1;
  background: var(--cream-dark);
  cursor: pointer;
}

.photo-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-card-meta {
  padding: 8px 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.photo-card-time {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--charcoal-light);
  letter-spacing: 0.02em;
}

.photo-card-caption {
  width: 100%;
  min-height: 52px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.8rem;
  color: var(--charcoal);
  background: var(--cream);
  resize: vertical;
  line-height: 1.35;
}

.photo-card-caption:focus {
  outline: none;
  border-color: var(--copper);
  box-shadow: 0 0 0 2px rgba(196, 80, 27, 0.08);
}

.photo-card-caption:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  resize: none;
}

/* Legacy single-thumb (unused after photo-card; kept for safety) */
.photo-thumb-sm {
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--cream-dark);
  cursor: pointer;
}

.photo-thumb-sm img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Photo upload modal */
.emp-modal {
  position: fixed;
  inset: 0;
  z-index: 450;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  padding-bottom: max(16px, env(safe-area-inset-bottom));
}

.emp-modal.hidden {
  display: none !important;
}

.emp-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(43, 41, 38, 0.45);
}

.emp-modal-panel {
  position: relative;
  width: 100%;
  max-width: 420px;
  max-height: min(88vh, 640px);
  background: var(--cream);
  border-radius: 16px 16px 12px 12px;
  box-shadow: var(--shadow);
  padding: 18px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
}

.emp-modal-panel h3 {
  font-size: 1.1rem;
  margin: 0;
}

.emp-modal-sub {
  font-size: 0.78rem;
  color: var(--charcoal-light);
  line-height: 1.4;
  margin: 0;
}

.emp-modal-rows {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-right: 2px;
  flex: 1;
  min-height: 0;
}

.emp-photo-upload-row {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 10px;
  align-items: start;
}

.emp-photo-upload-row-preview {
  width: 72px;
  height: 72px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--cream-dark);
}

.emp-photo-upload-row-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.emp-photo-upload-row-fields {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.emp-photo-upload-row-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--charcoal-light);
}

.emp-photo-upload-row textarea {
  width: 100%;
  min-height: 56px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.8rem;
  resize: vertical;
}

.emp-photo-upload-row textarea:focus {
  outline: none;
  border-color: var(--copper);
}

.emp-modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding-top: 4px;
}

.emp-modal-actions .emp-btn {
  width: 100%;
  padding: 12px;
}

.job-notes-status {
  font-size: 0.75rem;
  color: var(--charcoal-light);
  min-height: 1.2em;
  margin: -4px 0 0;
}

.job-notes-status--error {
  color: var(--red);
  font-weight: 600;
}

/* Notes */
.emp-textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.9rem;
  color: var(--charcoal);
  background: var(--white);
  resize: none;
  min-height: 80px;
  transition: border-color 0.2s ease;
  margin-bottom: 10px;
  display: block;
  width: 100%;
}

.emp-textarea:focus {
  outline: none;
  border-color: var(--copper);
  box-shadow: 0 0 0 3px rgba(196, 80, 27, 0.08);
}

/* Buttons */
.emp-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.emp-btn:active { transform: scale(0.97); }

.emp-btn-complete {
  background: var(--sage);
  color: white;
  font-size: 1rem;
  padding: 16px;
}

.emp-btn-complete:active { background: #2d6044; }

.emp-btn-complete:disabled {
  background: var(--border);
  color: var(--charcoal-light);
  cursor: not-allowed;
}

.emp-btn-outline {
  background: transparent;
  color: var(--charcoal);
  border: 1.5px solid var(--border);
  padding: 10px;
  font-size: 0.875rem;
}

.emp-btn-outline:active { background: var(--cream-dark); }

.emp-btn-arrive {
  background: #F59E0B;
  color: white;
  padding: 8px 16px;
  font-size: 0.8rem;
  width: auto;
  border-radius: 8px;
}

.emp-btn-arrive:active { background: #D97706; }

/* ========================================
   LIGHTBOX
   ======================================== */

.emp-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
}

.emp-lightbox.hidden { display: none !important; }

.emp-lightbox img {
  max-width: 95vw;
  max-height: 90vh;
  border-radius: 8px;
  object-fit: contain;
}

.emp-lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255,255,255,0.15);
  border: none;
  color: white;
  font-size: 1.5rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* ========================================
   TOAST
   ======================================== */

.emp-toast {
  position: fixed;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  background: var(--charcoal);
  color: white;
  padding: 11px 22px;
  border-radius: 100px;
  font-size: 0.875rem;
  font-weight: 500;
  z-index: 400;
  max-width: min(92vw, 420px);
  white-space: normal;
  text-align: center;
  line-height: 1.35;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
  transition: opacity 0.3s ease;
}

.emp-toast.hidden {
  opacity: 0;
  pointer-events: none;
  display: flex !important;
}

.emp-toast.success { background: var(--sage); }
.emp-toast.error { background: var(--red); }

@media (max-width: 380px) {
  .emp-tab-tiles {
    grid-template-columns: 1fr;
  }

  .emp-tab-tile {
    min-height: 96px;
  }
}

/* Employee marketing header: compact on phones */
@media (max-width: 520px) {
  .header--employee .container {
    flex-wrap: wrap;
    row-gap: 8px;
    min-height: auto;
    padding-top: 8px;
    padding-bottom: 10px;
  }

  .header--employee .nav-right {
    width: 100%;
    justify-content: flex-end;
  }

  .header--employee .nav-phone {
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  .emp-header {
    padding-left: 14px;
    padding-right: 14px;
  }

  .emp-tab-tiles {
    padding: 12px;
    gap: 10px;
  }

  .portal-content {
    padding: 14px 12px;
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  }

  .numpad {
    grid-template-columns: repeat(3, min(22vw, 76px));
    grid-template-rows: repeat(4, min(16vw, 64px));
    gap: 8px;
  }

  .clock-btn {
    min-height: 44px;
    padding: 10px 18px;
  }

  .job-card-body {
    padding: 12px 10px;
    gap: 8px;
  }

  .job-card-head .status-pill {
    font-size: 0.6rem;
    padding: 2px 6px;
  }
}
