/* Smith Family Chores — shared styles */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --accent: #0d9488;
  --accent-dark: #0f766e;
  --accent-light: #ccfbf1;
  --bg: #f8fafc;
  --surface: #ffffff;
  --border: #e2e8f0;
  --text: #0f172a;
  --text-muted: #64748b;
  --danger: #ef4444;
  --warning: #f59e0b;
  --success: #22c55e;
  --info: #3b82f6;
  --radius: 8px;
  --shadow: 0 1px 4px rgba(0,0,0,.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,.1);
  --sidebar-w: 220px;
}
html { font-size: 16px; }
body { font-family: system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif; background: var(--bg); color: var(--text); line-height: 1.5; }
a { color: var(--accent); text-decoration: none; }
button, .btn { cursor: pointer; border: none; border-radius: var(--radius); font-size: .875rem; font-weight: 500; padding: .45rem .9rem; transition: background .15s, opacity .15s; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-secondary { background: var(--border); color: var(--text); }
.btn-secondary:hover { background: #cbd5e1; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { opacity: .85; }
.btn-sm { font-size: .78rem; padding: .3rem .65rem; }
input, select, textarea {
  font: inherit; border: 1px solid var(--border); border-radius: var(--radius);
  padding: .45rem .75rem; width: 100%; background: var(--surface); color: var(--text);
  transition: border-color .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
label { font-size: .85rem; font-weight: 500; color: var(--text-muted); display: block; margin-bottom: .25rem; }
.form-group { margin-bottom: 1rem; }

/* Layout */
.app-layout { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); background: var(--surface); border-right: 1px solid var(--border);
  padding: 1rem 0; position: fixed; top: 0; left: 0; bottom: 0; overflow-y: auto; z-index: 100;
}
.sidebar .logo { padding: .75rem 1.25rem 1rem; font-weight: 700; font-size: 1rem; color: var(--text); display: flex; align-items: center; gap: .5rem; }
.sidebar nav a {
  display: flex; align-items: center; gap: .6rem; padding: .55rem 1.25rem;
  color: var(--text-muted); font-size: .9rem; transition: color .15s, background .15s;
}
.sidebar nav a:hover, .sidebar nav a.active { color: var(--accent); background: var(--accent-light); }
.main-content { margin-left: var(--sidebar-w); flex: 1; padding: 1.5rem; max-width: calc(100vw - var(--sidebar-w)); }
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.25rem; }
.page-header h2 { font-size: 1.2rem; font-weight: 700; }

/* Top bar */
.topbar { background: var(--surface); border-bottom: 1px solid var(--border); padding: .65rem 1.25rem; display: flex; align-items: center; gap: 1rem; margin-left: var(--sidebar-w); position: sticky; top: 0; z-index: 50; }
.topbar .spacer { flex: 1; }
.view-as-banner { background: #fef3c7; border: 1px solid #f59e0b; border-radius: var(--radius); padding: .3rem .75rem; font-size: .82rem; color: #92400e; }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow); }
.card + .card { margin-top: .75rem; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .75rem; }

/* Status badges */
.badge { display: inline-block; font-size: .72rem; font-weight: 600; padding: .15rem .5rem; border-radius: 999px; }
.badge-active { background: #fef9c3; color: #854d0e; }
.badge-completed, .badge-verified { background: #dcfce7; color: #166534; }
.badge-pending_verification { background: #dbeafe; color: #1e40af; }
.badge-missed { background: #fee2e2; color: #991b1b; }
.badge-exempted, .badge-skipped { background: #f1f5f9; color: #475569; }
.badge-pending { background: #f0fdf4; color: #166534; }

/* Chore occurrence row */
.occ-row { display: flex; align-items: center; gap: .75rem; padding: .6rem 0; border-bottom: 1px solid var(--border); }
.occ-row:last-child { border-bottom: none; }
.occ-title { flex: 1; font-weight: 500; }
.occ-meta { font-size: .8rem; color: var(--text-muted); }
.occ-actions { display: flex; gap: .4rem; flex-shrink: 0; }

/* Section heading */
.section-title { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin: 1.25rem 0 .5rem; }

/* Alert/notice boxes */
.notice { padding: .75rem 1rem; border-radius: var(--radius); font-size: .875rem; margin-bottom: 1rem; }
.notice-warn { background: #fffbeb; border: 1px solid #fcd34d; color: #92400e; }
.notice-info { background: #eff6ff; border: 1px solid #93c5fd; color: #1e40af; }
.notice-success { background: #f0fdf4; border: 1px solid #86efac; color: #166534; }

/* Stats row */
.stats-row { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.stat-tile { flex: 1; min-width: 100px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .75rem 1rem; text-align: center; }
.stat-tile .num { font-size: 1.8rem; font-weight: 700; line-height: 1; }
.stat-tile .lbl { font-size: .72rem; color: var(--text-muted); margin-top: .2rem; }

/* Modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 200; display: flex; align-items: center; justify-content: center; }
.modal { background: var(--surface); border-radius: 12px; padding: 1.5rem; max-width: 520px; width: 90vw; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-md); }
.modal h3 { margin-bottom: 1rem; font-size: 1.05rem; }
.modal-footer { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1.25rem; }

/* Table */
table { width: 100%; border-collapse: collapse; font-size: .875rem; }
th { text-align: left; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); border-bottom: 2px solid var(--border); padding: .5rem .75rem; }
td { padding: .5rem .75rem; border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #f8fafc; }

/* Hamburger (mobile) */
.hamburger { display: none; background: none; border: none; padding: .5rem; cursor: pointer; }
.hamburger span { display: block; width: 22px; height: 2px; background: var(--text); margin: 4px 0; transition: .2s; }

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: transform .25s; }
  .sidebar.open { transform: translateX(0); }
  .main-content, .topbar { margin-left: 0; }
  .hamburger { display: block; }
  .card-grid { grid-template-columns: 1fr; }
  .stats-row { gap: .5rem; }
  .stat-tile { min-width: 80px; }
}
