/**
 * Documents lab styles — aligned with tasks-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; }

#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;
  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; width: 100%; }

.btn-nav {
  flex: 1;
  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;
}

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

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

.security-notice {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #fff5f0;
  border: 1px solid #e8c4b4;
  font-family: Arial, sans-serif;
  font-size: 0.88rem;
  line-height: 1.45;
  color: #6b3a2a;
}

.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;
}

.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;
  min-height: 44px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.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; }

.field-hint {
  display: block;
  font-family: Arial, sans-serif;
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: normal;
  margin-top: -8px;
  margin-bottom: 10px;
}

.filter-bar { margin-bottom: 16px; }
.filter-label { margin: 0; }

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

.stat-card {
  background: var(--card);
  border: 1px solid #eadecc;
  border-radius: 14px;
  padding: 14px 16px;
  text-align: center;
}

.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;
}

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

.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;
}

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

.doc-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;
}

.doc-card-expiring { border-color: #e8d4a0; background: #fffdf8; }
.doc-card-expired { border-color: #e8b4b4; background: #fffafa; }

.doc-card-header { display: flex; gap: 12px; align-items: flex-start; }
.doc-cat-icon { font-size: 1.5rem; line-height: 1; }
.doc-title { font-size: 1.05rem; color: var(--primary); line-height: 1.3; }
.doc-sub { font-family: Arial, sans-serif; font-size: 0.8rem; color: var(--muted); margin-top: 2px; }
.doc-notes { font-family: Arial, sans-serif; font-size: 0.85rem; color: var(--muted); line-height: 1.4; }

.doc-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;
}

.badge-cat { background: #eee; color: var(--primary); }
.badge-exp { background: #fff3d6; color: #8a6d1a; }
.badge-exp.expired { background: #f4dddd; color: var(--danger); }
.badge-pending-sync {
  color: #8b4513;
  font-weight: 700;
  background: #fff3d6;
}
.doc-card-pending-sync {
  border-color: #e8c878;
  background: #fffdf6;
}

.doc-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }

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

.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%;
}

.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); }
  .doc-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
}
