/* Cards: white gift boxes with a gold ribbon edge */
.card { position: relative; background: var(--white); border-radius: var(--radius-box); border-top: 4px solid var(--gold); box-shadow: var(--shadow); padding: 1.25rem 1.4rem 1.4rem; margin-bottom: 1.25rem; }
.card-head { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 0.9rem; }
.card-head h2 { flex: 1 1 auto; }
.card-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.page-title { display: flex; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin: 0.25rem 0 1.25rem; padding: 0.9rem 1.4rem; background: var(--white); border-radius: var(--radius-box); box-shadow: var(--shadow); }
.page-title h1 { font-size: var(--step-3); }
.page-title p { margin: 0; color: var(--navy-soft); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; align-items: start; margin-bottom: 1.25rem; }
.grid-2 > .card { margin-bottom: 0; }
@media (max-width: 820px) { .grid-2 { grid-template-columns: minmax(0, 1fr); } }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 0.4rem; border: 1.5px solid var(--navy); background: var(--white); color: var(--navy); border-radius: 999px; padding: 0.45rem 1rem; font-weight: 700; font-size: var(--step--1); cursor: pointer; text-decoration: none; line-height: 1.2; }
.btn:hover { background: var(--blush); }
.btn:disabled { opacity: 0.55; cursor: progress; }
.btn-primary { background: var(--olive); border-color: var(--olive); color: var(--white); }
.btn-primary:hover { background: var(--olive-dark); color: var(--white); }
.btn-danger { background: var(--peony-deep); border-color: var(--peony-deep); color: var(--white); }
.btn-danger:hover { background: #A9416A; }
.btn-quiet { border-color: transparent; background: transparent; color: var(--olive); padding-inline: 0.5rem; }
.btn-quiet:hover { background: var(--blush); }
.icon-btn { border: 0; background: transparent; width: 2rem; height: 2rem; border-radius: 50%; font-size: 1.25rem; line-height: 1; cursor: pointer; color: var(--navy-soft); flex: 0 0 auto; }
.icon-btn:hover { background: var(--blush); color: var(--navy); }
.row-end { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 1rem; }

/* Status chips */
.chip { display: inline-block; padding: 0.15rem 0.65rem; border-radius: 999px; font-size: 0.8rem; font-weight: 700; white-space: nowrap; }
.chip-needs-ideas { background: var(--blush); color: var(--navy); }
.chip-shopping { background: var(--white); color: var(--navy); box-shadow: inset 0 0 0 1.5px var(--gold); }
.chip-bought { background: var(--olive); color: var(--white); }
.chip-wrapped { background: var(--mint); color: var(--navy); }

/* Stage pills */
.stage-wrap { display: inline-flex; align-items: center; border-radius: 999px; }
.stage { border: 0; border-radius: 999px 0 0 999px; padding: 0.3rem 0.7rem; font-weight: 700; font-size: 0.8rem; cursor: pointer; min-width: 5.5rem; }
.stage-menu { appearance: none; -webkit-appearance: none; border: 0; border-left: 1px solid rgba(36, 51, 90, 0.18); border-radius: 0 999px 999px 0; width: 1.6rem; padding: 0.3rem 0; font-size: 0.8rem; cursor: pointer; color: transparent;
  background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2324335A'/%3E%3C/svg%3E") center / 9px no-repeat; }
.stage-menu option { color: var(--navy); }
.stage-idea { background: var(--white); color: var(--navy); box-shadow: inset 0 0 0 1.5px var(--navy-soft); }
.stage-ordered { background: var(--blush); color: var(--navy); }
.stage-have { background: #DCE8F0; color: var(--navy); }
.stage-wrapped { background: var(--mint); color: var(--navy); }
.stage-given { background: var(--gold-soft); color: var(--navy); cursor: default; }
.stage-wrap:has(.stage-idea) .stage-menu { box-shadow: inset 0 0 0 1.5px var(--navy-soft); }

/* Inline-editable fields look like text until touched */
.inline { border: 1px solid transparent; background: transparent; border-radius: 6px; padding: 0.25rem 0.4rem; min-width: 0; width: 100%; }
.inline:hover { border-color: rgba(36, 51, 90, 0.2); background: rgba(255, 255, 255, 0.7); }
.inline:focus { border-color: var(--gold); background: var(--white); outline: none; box-shadow: 0 0 0 3px rgba(194, 164, 106, 0.35); }
.inline::placeholder { color: #8A93AC; }
textarea.inline { resize: vertical; min-height: 2.4rem; }
.money-input { text-align: right; width: 5.75rem; max-width: 5.75rem; }
.date-input { max-width: 10rem; color: var(--navy-soft); }
.add-input { border: 1px dashed rgba(36, 51, 90, 0.3); margin-top: 0.5rem; }
select.field, input.field, textarea.field { border: 1px solid rgba(36, 51, 90, 0.25); border-radius: 8px; padding: 0.4rem 0.6rem; background: var(--white); }
label.field-label { display: block; font-weight: 700; font-size: var(--step--1); margin: 0.6rem 0 0.25rem; }
.field-error { color: var(--peony-deep); font-weight: 700; margin: 0.4rem 0 0; }

/* Dialogs */
dialog.modal { border: 0; border-radius: var(--radius-box); border-top: 4px solid var(--gold); padding: 0; width: min(94vw, 560px); max-height: 88vh; box-shadow: 0 30px 60px -20px rgba(36, 51, 90, 0.55); color: var(--navy); }
dialog.modal-wide { width: min(96vw, 1000px); }
dialog.modal::backdrop { background: rgba(36, 51, 90, 0.45); }
.modal-head { display: flex; align-items: center; gap: 0.5rem; padding: 1rem 1.25rem 0.5rem; position: sticky; top: 0; background: var(--white); z-index: 1; }
.modal-head h2 { flex: 1; }
.modal-body { padding: 0.5rem 1.25rem 1.25rem; }

/* Ornament progress row */
.ornaments { display: flex; flex-wrap: wrap; gap: 0.2rem; margin: 0.6rem 0; }
.ornament img { width: 26px; height: 26px; object-fit: contain; display: block; }
.ornament:not(.is-covered) img { filter: grayscale(0.85) brightness(1.08); opacity: 0.45; }

/* Checklists */
.todo-list { list-style: none; margin: 0; padding: 0; }
.todo { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 0.4rem; padding: 0.15rem 0; border-bottom: 1px solid rgba(36, 51, 90, 0.07); }
.todo input[type='checkbox'] { width: 1.15rem; height: 1.15rem; accent-color: var(--olive); }
.todo.is-done .inline:not(.date-input) { text-decoration: line-through; color: var(--navy-soft); }
@media (max-width: 640px) { .todo { grid-template-columns: auto 1fr auto; } .todo .date-input { grid-column: 2; } }

/* Empty states */
.empty { display: flex; align-items: center; gap: 1rem; padding: 0.5rem 0; }
.empty-nut { height: 90px; width: auto; }
.empty p { margin: 0; font-family: var(--serif); font-size: var(--step-1); }

/* Bars */
.bar { height: 14px; border-radius: 999px; background: #E8EEF2; overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 999px; background: var(--olive); transition: width 0.6s ease; }
.bar.near > span { background: var(--gold); }
.bar.over > span { background: var(--peony-deep); }

/* Tables */
.table { width: 100%; border-collapse: collapse; font-size: var(--step--1); }
.table th { text-align: left; font-weight: 700; padding: 0.5rem; border-bottom: 2px solid var(--gold-soft); white-space: nowrap; }
.table td { padding: 0.45rem 0.5rem; border-bottom: 1px solid rgba(36, 51, 90, 0.08); vertical-align: middle; }
.table .right { text-align: right; }
.table-scroll { overflow-x: auto; }
th button.sort { border: 0; background: none; font-weight: 700; cursor: pointer; padding: 0; }
th button.sort[aria-sort]::after { content: ' ▾'; }
th button.sort[aria-sort='ascending']::after { content: ' ▴'; }

.filter-chips { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.filter-chips button { border: 1.5px solid var(--olive); background: var(--white); color: var(--olive); border-radius: 999px; padding: 0.25rem 0.8rem; font-weight: 700; font-size: 0.8rem; cursor: pointer; }
.filter-chips button[aria-pressed='true'] { background: var(--olive); color: var(--white); }
