/* Tend Health — worker dashboard */

.worker-body { background: #f7f3f5; margin: 0; }

/* Login */
.worker-login { min-height: 100vh; display: none; align-items: center; justify-content: center; padding: 24px; }
.worker-login-card { background: white; padding: 36px; border-radius: 18px; box-shadow: 0 6px 28px rgba(0,0,0,0.08); width: 100%; max-width: 400px; }
.worker-login-logo { display: flex; justify-content: center; margin-bottom: 12px; }
.worker-login-card h1 { font-size: 24px; margin: 0 0 4px; text-align: center; }
.worker-login-card .hint { text-align: center; margin-bottom: 22px; }
.worker-login-card label { font-weight: 600; display: block; margin: 12px 0 6px; font-size: 14px; }
.worker-login-card input { width: 100%; padding: 12px 14px; border: 1px solid var(--color-border); border-radius: 10px; font: inherit; box-sizing: border-box; }

/* Header */
.worker-header {
  background: white;
  border-bottom: 1px solid var(--color-border);
  padding: 14px 24px;
  display: flex; justify-content: space-between; align-items: center;
  position: sticky; top: 0; z-index: 10;
}
.worker-brand { display: flex; align-items: center; gap: 4px; font-weight: 800; font-size: 18px; color: var(--color-text); text-decoration: none; }
.worker-header-right { display: flex; gap: 14px; align-items: center; }
.worker-name { font-weight: 600; font-size: 14px; color: var(--color-text); }

.worker-main { max-width: 880px; margin: 0 auto; padding: 22px 16px; }

.worker-notice {
  display: flex; gap: 12px; align-items: flex-start;
  background: #fff3cd; border-left: 4px solid #f0b400;
  padding: 14px 18px; border-radius: 10px;
  margin-bottom: 18px;
}
.worker-notice ion-icon { font-size: 24px; color: #856404; flex-shrink: 0; margin-top: 2px; }
.worker-notice strong { color: #533f03; font-size: 15px; }
.worker-notice p { margin: 4px 0 0; color: #6a5304; font-size: 14px; }

/* Tabs */
.worker-tabs { display: flex; gap: 6px; background: white; padding: 6px; border-radius: 12px; margin-bottom: 18px; border: 1px solid var(--color-border); }
.worker-tab {
  flex: 1;
  background: transparent;
  border: 0;
  padding: 10px 16px;
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  border-radius: 8px;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
}
.worker-tab:hover { background: var(--color-bg-soft); }
.worker-tab.active { background: var(--color-primary); color: white; }
.worker-tab-count { opacity: 0.7; margin-left: 4px; }

.worker-tab-content { display: none; }
.worker-tab-content.active { display: block; }

/* Job cards */
.worker-jobs { display: flex; flex-direction: column; gap: 12px; }
.worker-empty { background: white; padding: 32px; border-radius: 14px; text-align: center; color: var(--color-text-muted); border: 1px dashed var(--color-border); }

.worker-job-card {
  background: white;
  padding: 18px 20px;
  border-radius: 14px;
  border: 1px solid var(--color-border);
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}
.worker-job-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.worker-job-service { font-weight: 700; font-size: 17px; color: var(--color-text); }
.worker-job-when { font-size: 13px; color: var(--color-text-muted); margin-top: 2px; }
.worker-job-rate { background: var(--color-primary); color: white; padding: 6px 12px; border-radius: 999px; font-weight: 700; font-size: 13px; white-space: nowrap; }

.worker-job-details { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; font-size: 14px; color: var(--color-text); }
.worker-job-details > div { display: flex; align-items: center; gap: 8px; }
.worker-job-details ion-icon { color: var(--color-primary); font-size: 16px; flex-shrink: 0; }

.worker-job-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.worker-job-actions .btn { flex: 1; min-width: 140px; padding: 12px 16px; font-size: 14px; }
.worker-job-payout { background: #d4edda; color: #155724; padding: 10px 16px; border-radius: 10px; font-size: 14px; width: 100%; text-align: center; }

/* Modal */
.worker-modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 100; padding: 20px;
}
.worker-modal-card {
  background: white;
  border-radius: 18px;
  padding: 26px 28px;
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}
.worker-modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.worker-modal-head h2 { margin: 0; font-size: 20px; }
.worker-modal-close { background: transparent; border: 0; font-size: 28px; cursor: pointer; color: var(--color-text-muted); line-height: 1; padding: 0 6px; }
.worker-modal-context { margin-bottom: 18px; padding: 12px 14px; background: var(--color-bg-soft); border-radius: 10px; font-size: 14px; }
.worker-modal-summary .hint { margin-top: 4px; }

.worker-modal-card label { display: block; font-weight: 600; font-size: 14px; margin: 12px 0 6px; }
.worker-modal-card input, .worker-modal-card textarea {
  width: 100%; padding: 11px 14px;
  border: 1px solid var(--color-border); border-radius: 10px;
  font: inherit; box-sizing: border-box;
}

.worker-price-box {
  background: var(--color-bg-cream);
  border-radius: 12px;
  padding: 14px 16px;
  margin: 18px 0 14px;
  font-size: 14px;
}
.worker-price-box .price-row { display: flex; justify-content: space-between; padding: 4px 0; }
.worker-price-box .price-row.price-total { font-weight: 700; font-size: 15px; }
.worker-price-box .price-divider { height: 1px; background: rgba(0,0,0,0.1); margin: 6px 0; }

@media (max-width: 640px) {
  .worker-header { padding: 12px 16px; }
  .worker-main { padding: 16px 12px; }
  .worker-job-head { flex-direction: column; align-items: flex-start; }
  .worker-job-rate { align-self: flex-start; }
  .worker-name { display: none; }
}

/* Chat */
.worker-chat-card { max-width: 520px; padding: 22px 24px; }
.worker-chat-thread {
  background: var(--color-bg-soft);
  border-radius: 12px;
  padding: 14px;
  max-height: 320px;
  min-height: 200px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}
.worker-chat-empty { color: var(--color-text-muted); text-align: center; padding: 30px 10px; font-size: 14px; }
.worker-chat-msg { max-width: 80%; padding: 8px 12px; border-radius: 12px; word-wrap: break-word; }
.worker-chat-msg-meta { font-size: 11px; color: var(--color-text-muted); margin-bottom: 2px; }
.worker-chat-msg-body { font-size: 14px; line-height: 1.4; white-space: pre-wrap; }
.worker-chat-msg-worker { background: var(--color-primary); color: white; align-self: flex-end; }
.worker-chat-msg-worker .worker-chat-msg-meta { color: rgba(255,255,255,0.8); }
.worker-chat-msg-family { background: white; border: 1px solid var(--color-border); align-self: flex-start; }
.worker-chat-msg-admin { background: #fff3cd; border: 1px solid #f0b400; align-self: center; }

.worker-chat-actions { display: flex; justify-content: flex-end; margin-bottom: 8px; }
.worker-chat-form { display: flex; gap: 8px; align-items: flex-end; }
.worker-chat-form textarea { flex: 1; padding: 10px 12px; border: 1px solid var(--color-border); border-radius: 10px; font: inherit; resize: vertical; min-height: 42px; box-sizing: border-box; }
.worker-chat-form button { padding: 10px 18px; }
