/**
 * Tasks lab styles — aligned with trips-lab / Family Hub palette.
 */

:root {
  --primary: #2d2a26;
  --accent: #d4af37;
  --bg: #f5f2eb;
  --card: #fff;
  --text: #333;
  --soft-orange: #f4b251;
  --danger: #a33;
  --muted: #777;
}

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

body {
  font-family: Georgia, serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

a {
  color: var(--primary);
}

input,
textarea,
select {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  margin: 0 0 14px;
  font-family: inherit;
  background: #fff;
  font-size: 1rem;
}

label {
  display: block;
  font-family: Arial, sans-serif;
  font-size: 0.85rem;
  font-weight: bold;
  color: var(--primary);
}

button {
  font-family: Arial, sans-serif;
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.muted {
  color: var(--muted);
}

#lock-screen {
  position: fixed;
  inset: 0;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  color: #fff;
  padding: 20px;
}

.lock-box {
  background: rgba(255, 255, 255, 0.1);
  padding: 34px;
  border-radius: 14px;
  text-align: center;
  max-width: 420px;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.lock-box h1 {
  margin-bottom: 8px;
}

.lock-box p {
  color: #ddd;
  margin-bottom: 16px;
  font-size: 0.95rem;
}

.lock-box button {
  padding: 12px 20px;
  border: 0;
  border-radius: 30px;
  background: var(--soft-orange);
  color: var(--primary);
  font-weight: bold;
  width: 100%;
}

.site-header {
  background: var(--card);
  padding: 16px 18px 20px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  font-family: Arial, sans-serif;
  font-size: 0.9rem;
}

.lab-badge {
  background: #fff3d6;
  color: #8a6d1a;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.site-header h1 {
  font-size: 1.75rem;
  color: var(--primary);
  margin-bottom: 4px;
}

.tagline {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 14px;
}

.top-nav {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  width: 100%;
}

.btn-nav {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 10px 8px;
  border: 0;
  border-radius: 999px;
  background: #eee;
  color: var(--primary);
  font-weight: bold;
  font-size: 0.82rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.btn-nav:hover,
.btn-nav:focus-visible {
  background: #e3ddd3;
  outline: 2px solid var(--soft-orange);
  outline-offset: 2px;
}

#app-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px;
}

.status {
  max-width: 100%;
  margin-bottom: 18px;
  padding: 12px;
  border-radius: 10px;
  background: #fff8df;
  border: 1px solid #ead28c;
  font-family: Arial, sans-serif;
  font-size: 0.9rem;
  line-height: 1.45;
}

.panel {
  background: var(--card);
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
  border: 1px dashed #ddd;
}

.panel-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: transparent;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--primary);
  font-weight: bold;
  cursor: pointer;
}

.panel-chevron {
  display: inline-block;
  transition: transform 0.15s ease;
  font-size: 0.85rem;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 0 16px;
  flex-wrap: wrap;
}

.section-head h2 {
  font-size: 1.35rem;
  color: var(--primary);
}

.user-line {
  font-family: Arial, sans-serif;
  font-size: 0.85rem;
  color: var(--muted);
}

.btn {
  padding: 11px 18px;
  border: 0;
  border-radius: 999px;
  font-weight: bold;
  font-size: 0.9rem;
  cursor: pointer;
  min-height: 44px;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-gold {
  background: var(--soft-orange);
  color: var(--primary);
}

.btn-ghost {
  background: #eee;
  color: var(--primary);
}

.btn-danger {
  background: #f4dddd;
  color: var(--danger);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.78rem;
  min-height: 36px;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--card);
  border: 1px solid #eadecc;
  border-radius: 14px;
  padding: 14px 16px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.stat-num {
  display: block;
  font-size: 1.6rem;
  font-weight: bold;
  color: var(--primary);
  font-family: Arial, sans-serif;
}

.stat-label {
  font-family: Arial, sans-serif;
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat-warn .stat-num {
  color: #b8860b;
}

.stat-alert .stat-num {
  color: var(--danger);
}

.stat-done .stat-num {
  color: #1e5631;
}

.dashboard-section {
  margin-bottom: 24px;
}

.section-title {
  font-size: 1.1rem;
  color: var(--primary);
  margin-bottom: 12px;
  font-family: Arial, sans-serif;
}

.section-count {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: normal;
}

.section-empty {
  font-family: Arial, sans-serif;
  font-size: 0.9rem;
  color: var(--muted);
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 10px;
  border: 1px dashed #ddd;
}

.task-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.task-card-pending-sync {
  border-left: 4px solid var(--accent);
  background: #fffdf6;
}

.badge-pending-sync {
  color: #8b4513;
  font-weight: 700;
  background: #fff3d6;
}

.task-check-pending {
  opacity: 0.35;
  pointer-events: none;
}

.task-card {
  background: var(--card);
  border: 1px solid #eadecc;
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.task-card-overdue {
  border-color: #e8b4b4;
  background: #fffafa;
}

.task-card-top {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.task-check {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border: 2px solid #ccc;
  border-radius: 8px;
  background: #fff;
  font-size: 1rem;
  font-weight: bold;
  color: #1e5631;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.task-check.checked {
  background: #e2f0e8;
  border-color: #1e5631;
}

.task-title {
  font-size: 1.05rem;
  color: var(--primary);
  line-height: 1.3;
}

.task-title-done {
  text-decoration: line-through;
  color: var(--muted);
}

.task-desc {
  font-family: Arial, sans-serif;
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.4;
}

.task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.badge {
  font-family: Arial, sans-serif;
  font-size: 0.72rem;
  font-weight: bold;
  padding: 4px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.badge-cat {
  background: #eee;
  color: var(--primary);
}

.priority-low {
  background: #e8e8e8;
  color: #555;
}

.priority-normal {
  background: #dceefb;
  color: #1a5276;
}

.priority-high {
  background: #fde8d8;
  color: #a04000;
}

.status-open {
  background: #fff3d6;
  color: #8a6d1a;
}

.status-done {
  background: #e2f0e8;
  color: #1e5631;
}

.task-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-family: Arial, sans-serif;
  font-size: 0.8rem;
}

.task-due.overdue {
  color: var(--danger);
  font-weight: bold;
}

.task-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
  padding-top: 4px;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
  font-family: Arial, sans-serif;
}

.empty-hint {
  font-size: 0.9rem;
}

.footer-note {
  text-align: center;
  font-family: Arial, sans-serif;
  font-size: 0.78rem;
  color: var(--muted);
  margin: 24px 0 8px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9000;
  padding: 20px;
}

.modal-panel {
  background: var(--card);
  border-radius: 16px;
  padding: 24px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.modal-panel h3 {
  margin-bottom: 10px;
  color: var(--primary);
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  justify-content: flex-end;
}

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

  .task-grid {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .section-head {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 400px) {
  #app-shell {
    padding: 12px;
  }

  .stats-grid {
    gap: 8px;
  }

  .stat-card {
    padding: 10px 12px;
  }

  .stat-num {
    font-size: 1.3rem;
  }
}
