/* Crew PWA — Variant B (Utilitarian field-tool) */

.crew-root {
  --crew-primary: #2DD4BF;
  --crew-primary-dark: #0D9488;
  --crew-bg: var(--ls-bg);
  --crew-surface: var(--ls-surface);
  --crew-text: var(--ls-ink);
  --crew-text-muted: var(--ls-ink-3);
  --crew-border: var(--ls-line-2);
  --crew-done: var(--ls-green);
  --crew-now: var(--ls-amber);
  --crew-next: var(--ls-ink-2);

  display: flex;
  flex-direction: column;
  height: 100vh;
  background: var(--crew-bg);
  color: var(--crew-text);
  font-family: var(--ls-body);
  padding-bottom: 60px; /* Room for tabbar */
  overflow-y: auto;
  -webkit-tap-highlight-color: transparent;
}

/* ─── HEADER ─── */
.crew-header {
  padding: 14px 16px 10px;
  background: rgba(20, 22, 28, 0.6);
  border-bottom: 1px solid var(--crew-border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.crew-header-name {
  font-family: var(--ls-display);
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.4px;
  margin-bottom: 2px;
}

.crew-header-project {
  font-size: 12px;
  color: var(--crew-text-muted);
  margin-bottom: 6px;
}

.crew-header-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--crew-primary);
  border-radius: 50%;
  margin-left: 6px;
}

/* ─── CLOCK SECTION ─── */
.crew-clock {
  padding: 14px 16px;
  background: rgba(20, 22, 28, 0.4);
  border-bottom: 1px solid var(--crew-border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.crew-clock-label {
  font-size: 10.5px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--crew-text-muted);
  font-weight: 600;
}

.crew-clock-time {
  font-family: var(--ls-display);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.3px;
}

.crew-clock-btn {
  padding: 12px 16px;
  background: var(--crew-primary-dark);
  color: white;
  border: none;
  border-radius: 10px;
  font-family: var(--ls-display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.5px;
  cursor: pointer;
  min-height: 48px;
  transition: background 0.2s;
}

.crew-clock-btn:active {
  background: var(--crew-primary);
}

.crew-clock-btn-out {
  background: #10B981;
}

.crew-clock-btn-out:active {
  background: #059669;
}

.crew-clock-btn-in {
  background: #EF4444;
}

.crew-clock-btn-in:active {
  background: #DC2626;
}

/* ─── TAB PANES ─── */
.crew-tab-pane {
  display: none;
  padding: 12px 16px 16px;
  animation: fadeIn 0.2s ease;
}

.crew-tab-pane.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ─── SECTION TITLE ─── */
.crew-section-title {
  margin: 14px 0 10px;
  font-family: var(--ls-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--crew-text-muted);
}

/* ─── TASK CARDS ─── */
.crew-task-card {
  display: flex;
  align-items: stretch;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(20, 22, 28, 0.5);
  border: 1px solid var(--crew-border);
  border-radius: 8px;
  margin-bottom: 8px;
  min-height: 56px;
}

.crew-task-bar {
  width: 4px;
  background: var(--crew-next);
  border-radius: 2px;
  flex-shrink: 0;
}

.crew-task-done .crew-task-bar {
  background: var(--crew-done);
}

.crew-task-now .crew-task-bar {
  background: var(--crew-now);
}

.crew-task-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.crew-task-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--crew-text);
  margin-bottom: 2px;
}

.crew-task-meta {
  font-size: 11px;
  color: var(--crew-text-muted);
}

.crew-task-time {
  font-family: var(--ls-mono);
  font-size: 11px;
  color: var(--crew-text-muted);
  flex-shrink: 0;
  align-self: center;
}

/* ─── BUTTON GRID ─── */
.crew-button-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 14px 0;
}

.crew-button {
  padding: 12px 14px;
  background: rgba(20, 22, 28, 0.6);
  border: 1px solid var(--crew-border);
  border-radius: 8px;
  color: var(--crew-text);
  font-family: var(--ls-body);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 60px;
  transition: all 0.2s;
}

.crew-button:active {
  background: rgba(20, 22, 28, 0.8);
  border-color: var(--crew-primary);
}

.crew-button-primary {
  background: var(--crew-primary);
  color: #0f1117;
  border-color: var(--crew-primary);
}

.crew-button-primary:active {
  background: var(--crew-primary-dark);
  border-color: var(--crew-primary-dark);
}

.crew-button-icon {
  font-size: 20px;
  line-height: 1;
}

/* ─── PAY CARD ─── */
.crew-pay-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 12px;
  background: rgba(20, 22, 28, 0.5);
  border: 1px solid var(--crew-border);
  border-radius: 8px;
}

.crew-pay-item {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.crew-pay-label {
  font-size: 10.5px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--crew-text-muted);
  font-weight: 600;
  margin-bottom: 4px;
}

.crew-pay-value {
  font-family: var(--ls-display);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.3px;
}

.crew-pay-unit {
  font-size: 10px;
  color: var(--crew-text-muted);
  font-family: var(--ls-mono);
  margin-left: 2px;
}

/* ─── TABBAR ─── */
.crew-tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: rgba(14, 16, 20, 0.9);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--crew-border);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  padding-top: 8px;
  z-index: 100;
}

.crew-tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  color: var(--crew-text-muted);
  transition: color 0.2s;
}

.crew-tab-item.active {
  color: var(--crew-primary);
}

.crew-tab-icon {
  font-size: 16px;
  line-height: 1;
}

.crew-tab-label {
  font-size: 9px;
  font-weight: 500;
}

/* ─── MODALS ─── */
.crew-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 200;
  align-items: flex-end;
}

.crew-modal.open {
  display: flex;
}

.crew-modal-content {
  background: var(--crew-surface);
  border: 1px solid var(--crew-border);
  border-bottom: none;
  border-radius: 16px 16px 0 0;
  padding: 16px;
  width: 100%;
  max-width: 100%;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

.crew-modal-header {
  font-family: var(--ls-display);
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
}

.crew-modal-textarea,
.crew-modal-input {
  width: 100%;
  padding: 10px 12px;
  background: rgba(14, 16, 20, 0.6);
  border: 1px solid var(--crew-border);
  border-radius: 8px;
  color: var(--crew-text);
  font-family: var(--ls-body);
  font-size: 13px;
  margin-bottom: 12px;
  min-height: 80px;
  resize: vertical;
}

.crew-modal-textarea::placeholder {
  color: var(--crew-text-muted);
}

.crew-modal-buttons {
  display: flex;
  gap: 8px;
}

.crew-modal-buttons .crew-button {
  flex: 1;
}

.crew-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  display: none;
  z-index: 199;
}

.crew-modal-overlay.open {
  display: block;
}

/* ─── LIGHT MODE ─── */
body[data-mode="light"] .crew-root,
body[data-site-theme="classic"] .crew-root {
  --crew-primary: #1E3A8A;
  --crew-primary-dark: #172554;
  --crew-bg: #F3F0E8;
  --crew-surface: #FDFBF5;
  --crew-text: #1A1812;
  --crew-text-muted: #6B6556;
  --crew-border: rgba(24, 18, 8, 0.12);
}

body[data-mode="light"] .crew-header,
body[data-site-theme="classic"] .crew-header {
  background: rgba(253, 251, 245, 0.85);
  backdrop-filter: blur(8px);
}

body[data-mode="light"] .crew-clock,
body[data-site-theme="classic"] .crew-clock {
  background: rgba(253, 251, 245, 0.6);
}

body[data-mode="light"] .crew-task-card,
body[data-site-theme="classic"] .crew-task-card {
  background: rgba(253, 251, 245, 0.7);
}

body[data-mode="light"] .crew-button,
body[data-site-theme="classic"] .crew-button {
  background: rgba(253, 251, 245, 0.8);
}

body[data-mode="light"] .crew-button-primary,
body[data-site-theme="classic"] .crew-button-primary {
  background: var(--crew-primary);
  color: #FDFBF5;
  border-color: var(--crew-primary);
}

body[data-mode="light"] .crew-button-primary:active,
body[data-site-theme="classic"] .crew-button-primary:active {
  background: var(--crew-primary-dark);
  border-color: var(--crew-primary-dark);
}

body[data-mode="light"] .crew-pay-card,
body[data-site-theme="classic"] .crew-pay-card {
  background: rgba(253, 251, 245, 0.7);
}

body[data-mode="light"] .crew-tabbar,
body[data-site-theme="classic"] .crew-tabbar {
  background: rgba(253, 251, 245, 0.92);
  backdrop-filter: blur(8px);
}

body[data-mode="light"] .crew-modal-content,
body[data-site-theme="classic"] .crew-modal-content {
  background: var(--crew-surface);
}

body[data-mode="light"] .crew-modal-textarea,
body[data-mode="light"] .crew-modal-input,
body[data-site-theme="classic"] .crew-modal-textarea,
body[data-site-theme="classic"] .crew-modal-input {
  background: rgba(243, 240, 232, 0.8);
}

/* ─── RESPONSIVE ─── */
@media (max-width: 600px) {
  .crew-button-grid {
    grid-template-columns: 1fr 1fr;
  }
}
