/* ==========================================================================
   Wedding Planner — design system
   Warm neutral / cream palette with gold + rose accents
   ========================================================================== */

:root {
  --cream: #fbf7f1;
  --cream-deep: #f4ecdf;
  --surface: #fffdfa;
  --surface-alt: #f8f1e7;
  --border: #e8dcc8;
  --border-soft: #efe6d6;
  --ink: #3a3128;
  --ink-soft: #6f6355;
  --ink-faint: #a3968264;
  --gold: #b6893f;
  --gold-deep: #92692a;
  --gold-light: #e9d3a3;
  --rose: #b76e79;
  --rose-light: #f1dde0;
  --rose-deep: #96525c;
  --sage: #7c8f6e;
  --sage-light: #e5ecdd;
  --danger: #b3453f;
  --danger-light: #f6e0dd;
  --warning: #c08a2e;
  --warning-light: #f6ecd8;
  --info: #5c7c99;
  --info-light: #e2ebf1;
  --success: #6f9463;
  --success-light: #e6efe0;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 3px rgba(90, 70, 40, 0.06);
  --shadow: 0 4px 18px rgba(90, 70, 40, 0.08);
  --sidebar-w: 250px;

  --font-display: "Cormorant Garamond", "Georgia", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 0.4em;
  letter-spacing: 0.01em;
}

h1 { font-size: 2.1rem; }
h2 { font-size: 1.55rem; }
h3 { font-size: 1.2rem; }

a { color: var(--gold-deep); text-decoration: none; }
a:hover { text-decoration: underline; }

p { margin: 0 0 0.8em; color: var(--ink-soft); }

/* ---------- layout ---------- */

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  padding: 28px 20px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  padding: 0 6px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-light), var(--rose-light));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--gold-deep);
  font-size: 1.1rem;
  flex-shrink: 0;
}

.brand-text { line-height: 1.2; }
.brand-text strong { display: block; font-family: var(--font-display); font-size: 1.1rem; }
.brand-text span { font-size: 0.75rem; color: var(--ink-soft); }

.nav-section-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  margin: 22px 8px 8px;
}

.nav-list { list-style: none; margin: 0; padding: 0; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  font-weight: 500;
  font-size: 0.92rem;
  margin-bottom: 2px;
}

.nav-link:hover { background: var(--cream-deep); text-decoration: none; color: var(--ink); }

.nav-link.active {
  background: linear-gradient(120deg, var(--gold-light), var(--rose-light));
  color: var(--gold-deep);
  font-weight: 600;
}

.nav-icon { width: 18px; text-align: center; flex-shrink: 0; }

.sidebar-footer {
  margin-top: auto;
  padding-top: 16px;
  font-size: 0.75rem;
  color: var(--ink-faint);
  border-top: 1px solid var(--border-soft);
}

.main {
  flex: 1;
  min-width: 0;
  padding: 30px 40px 60px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 26px;
  flex-wrap: wrap;
}

.topbar h1 { margin: 0; }
.topbar .subtitle { color: var(--ink-soft); font-size: 0.9rem; margin-top: 2px; }

.mobile-nav-toggle {
  display: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 1.1rem;
  cursor: pointer;
}

.search-form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-form input {
  min-width: 220px;
}

/* ---------- cards ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}

.card + .card { margin-top: 18px; }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 12px;
  flex-wrap: wrap;
}

.card-header h2, .card-header h3 { margin: 0; }

.grid {
  display: grid;
  gap: 18px;
}

.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

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

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.stat-card .stat-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  margin-bottom: 6px;
}

.stat-card .stat-value {
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 600;
  color: var(--ink);
}

.stat-card .stat-sub {
  font-size: 0.8rem;
  color: var(--ink-faint);
  margin-top: 4px;
}

.stat-card.accent-gold::before,
.stat-card.accent-rose::before,
.stat-card.accent-sage::before,
.stat-card.accent-info::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
}
.stat-card.accent-gold::before { background: var(--gold); }
.stat-card.accent-rose::before { background: var(--rose); }
.stat-card.accent-sage::before { background: var(--sage); }
.stat-card.accent-info::before { background: var(--info); }

/* ---------- progress ---------- */

.progress-track {
  width: 100%;
  height: 10px;
  background: var(--cream-deep);
  border-radius: 20px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--rose));
  border-radius: 20px;
  transition: width 0.4s ease;
}

.progress-fill.over { background: linear-gradient(90deg, var(--danger), var(--warning)); }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
  line-height: 1.2;
}

.btn:hover { text-decoration: none; transform: translateY(-1px); }

.btn-primary {
  background: linear-gradient(120deg, var(--gold), var(--gold-deep));
  color: #fff8ec;
  box-shadow: 0 2px 8px rgba(182, 137, 63, 0.35);
}

.btn-secondary {
  background: var(--surface);
  border-color: var(--border);
  color: var(--ink);
}

.btn-outline {
  background: transparent;
  border-color: var(--gold);
  color: var(--gold-deep);
}

.btn-danger {
  background: var(--danger-light);
  color: var(--danger);
  border-color: transparent;
}

.btn-sm { padding: 5px 12px; font-size: 0.78rem; }
.btn-block { width: 100%; }

.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ---------- forms ---------- */

label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 5px;
}

input[type="text"], input[type="email"], input[type="tel"], input[type="number"],
input[type="date"], input[type="password"], input[type="url"], input[type="search"],
select, textarea {
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--ink);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(182, 137, 63, 0.15);
}

textarea { resize: vertical; min-height: 80px; }

.field { margin-bottom: 16px; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.field-hint { font-size: 0.76rem; color: var(--ink-faint); margin-top: 4px; }

.checkbox-row { display: flex; align-items: center; gap: 8px; }
.checkbox-row input { width: auto; }
.checkbox-row label { margin: 0; }

fieldset { border: 1px dashed var(--border); border-radius: var(--radius); padding: 16px; margin: 0 0 16px; }
legend { font-family: var(--font-display); font-size: 1rem; padding: 0 8px; color: var(--gold-deep); }

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

/* ---------- tables ---------- */

.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border-soft); }

table { width: 100%; border-collapse: collapse; background: var(--surface); }

th, td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-soft);
  font-size: 0.87rem;
  white-space: nowrap;
}

th {
  background: var(--surface-alt);
  font-weight: 600;
  color: var(--ink-soft);
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
}

tbody tr:hover { background: var(--cream-deep); }
tbody tr:last-child td { border-bottom: none; }

td.wrap, th.wrap { white-space: normal; }

/* ---------- badges ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-gold { background: var(--gold-light); color: var(--gold-deep); }
.badge-rose { background: var(--rose-light); color: var(--rose-deep); }
.badge-sage { background: var(--sage-light); color: #4c5c40; }
.badge-info { background: var(--info-light); color: var(--info); }
.badge-success { background: var(--success-light); color: var(--success); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-neutral { background: var(--cream-deep); color: var(--ink-soft); }

/* ---------- alerts / flash ---------- */

.flash-stack { margin-bottom: 20px; display: flex; flex-direction: column; gap: 8px; }

.flash {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  border: 1px solid transparent;
}

.flash-success { background: var(--success-light); color: #3e5c34; border-color: #cfe0c5; }
.flash-error { background: var(--danger-light); color: var(--danger); border-color: #edc6c1; }

.alert-list { display: flex; flex-direction: column; gap: 8px; }
.alert-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  border: 1px solid transparent;
}
.alert-danger { background: var(--danger-light); color: var(--danger); border-color: #edc6c1; }
.alert-warning { background: var(--warning-light); color: var(--warning); border-color: #ecdcb4; }
.alert-info { background: var(--info-light); color: var(--info); border-color: #cddce7; }

/* ---------- misc ---------- */

.muted { color: var(--ink-faint); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }

.empty-state {
  text-align: center;
  padding: 50px 20px;
  color: var(--ink-faint);
}
.empty-state .empty-icon { font-size: 2.4rem; margin-bottom: 10px; }

.filter-bar {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 20px;
}
.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  align-items: end;
}
.filter-actions { display: flex; gap: 8px; align-items: end; }

.chip-group { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  border-radius: 999px;
  background: var(--cream-deep);
  border: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--ink-soft);
}
.chip form { display: inline; }
.chip button {
  background: none; border: none; cursor: pointer; color: var(--ink-faint); font-size: 0.85rem; padding: 0;
}

.divider { height: 1px; background: var(--border-soft); margin: 20px 0; border: none; }

.tag-pill { background: var(--surface-alt); border: 1px solid var(--border); padding: 3px 10px; border-radius: 999px; font-size: 0.74rem; color: var(--ink-soft); }

.section-tabs { display: flex; gap: 6px; margin-bottom: 20px; flex-wrap: wrap; }
.section-tabs a {
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  color: var(--ink-soft);
  font-size: 0.85rem;
  font-weight: 500;
}
.section-tabs a.active { background: linear-gradient(120deg, var(--gold-light), var(--rose-light)); color: var(--gold-deep); border-color: transparent; font-weight: 600; }

.container-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.container-card .container-type { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--gold-deep); }

.donut-legend { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.donut-legend-item { display: flex; align-items: center; gap: 8px; font-size: 0.83rem; }
.legend-swatch { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }

.bar-chart { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 110px 1fr auto; align-items: center; gap: 10px; font-size: 0.82rem; }
.bar-track { height: 10px; background: var(--cream-deep); border-radius: 20px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 20px; }

.modal-backdrop {
  display: none;
  position: fixed; inset: 0; background: rgba(58, 49, 40, 0.35);
  align-items: center; justify-content: center; z-index: 50; padding: 20px;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 26px;
  max-width: 480px;
  width: 100%;
  box-shadow: var(--shadow);
  max-height: 90vh;
  overflow-y: auto;
}

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .app-shell { flex-direction: column; }
  .sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: var(--shadow);
  }
  .sidebar.open { transform: translateX(0); }
  .mobile-nav-toggle { display: inline-flex; }
  .main { padding: 20px 16px 50px; }
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .search-form input { min-width: 0; flex: 1; }
  th, td { font-size: 0.82rem; padding: 10px; }
}

.sidebar-scrim {
  display: none;
  position: fixed; inset: 0; background: rgba(0,0,0,0.25); z-index: 90;
}
.sidebar-scrim.open { display: block; }
