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

/* ── PAGE BACKGROUND ── */
#page-bg { position: fixed; inset: 0; z-index: -1; opacity: 0; transition: opacity 0.5s ease; pointer-events: none; }
#page-bg.visible { opacity: 1; }
body.trip-view { background: #09151f; }
body.trip-view main { background: transparent; }
body.trip-view footer { background: transparent; border-top-color: rgba(255,255,255,0.08); color: rgba(255,255,255,0.3); }

:root {
  --blue: #1a5276;
  --blue-light: #2e86c1;
  --blue-dark: #0e2f45;
  --accent: #e67e22;
  --accent-light: #f0a050;
  --bg: #eef2f7;
  --card: #ffffff;
  --text: #1a1f2e;
  --muted: #64748b;
  --border: #dde3ec;
  --radius: 14px;
  --shadow: 0 2px 16px rgba(0,0,0,0.07);
}

body { font-family: "Elms Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; display: flex; flex-direction: column; }

/* ── HEADER ── */
header { background: var(--blue-dark); color: #fff; border-bottom: 1px solid rgba(255,255,255,.06); }
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: 0 24px; height: 62px; max-width: 980px; margin: 0 auto; width: 100%; }
.header-brand { display: flex; flex-direction: column; gap: 1px; }
h1 { font-size: 1.05rem; font-weight: 800; letter-spacing: -.2px; color: #fff; line-height: 1.2; }
.subtitle { font-size: .68rem; color: rgba(255,255,255,.38); font-weight: 500; letter-spacing: .01em; }
nav { display: flex; align-items: center; gap: 2px; }
.tab-btn { background: none; border: none; color: rgba(255,255,255,.42); font-size: .8rem; font-weight: 600; padding: 7px 15px; cursor: pointer; border-radius: 20px; transition: color .15s, background .15s; }
.tab-btn:hover { color: rgba(255,255,255,.82); background: rgba(255,255,255,.07); }
.tab-btn.active { color: #fff; background: rgba(255,255,255,.13); }

/* ── MAIN / VIEWS ── */
main { flex: 1; max-width: 980px; width: 100%; margin: 24px auto; padding: 0 16px; }
.view { display: none; }
.view.active { display: block; }
.hidden { display: none !important; }

/* ── TRIPS GRID ── */
.trips-grid { display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 16px; }
.trips-section-label { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; padding: 6px 0 2px; }
.trips-section-label::before, .trips-section-label::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.trip-card {
  position: relative; border-radius: var(--radius); overflow: hidden;
  cursor: pointer; min-height: 210px; background: var(--blue-dark);
  display: flex; flex-direction: column; justify-content: flex-end;
  box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s;
}
.trip-card:hover { transform: translateY(-3px); box-shadow: 0 8px 28px rgba(0,0,0,0.15); }

.trip-card-bg { position: absolute; inset: 0; background-size: cover; background-position: center; }
.trip-card-overlay { position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(0,0,0,.1) 0%, rgba(0,0,0,.78) 100%); }

.trip-card-content { position: relative; padding: 18px 20px; color: #fff; }
.trip-card-dest { font-size: 1.25rem; font-weight: 800; letter-spacing: -.3px; line-height: 1.2; }
.trip-card-dates { font-size: .82rem; color: rgba(255,255,255,.75); margin-top: 3px; }
.trip-card-badge { display: inline-block; background: var(--accent); color: #fff; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; padding: 3px 10px; border-radius: 12px; margin-top: 8px; }
.trip-card-past-badge { background: rgba(255,255,255,.2); }
.trip-card-avatars { display: flex; gap: 4px; margin-top: 10px; flex-wrap: wrap; }

.add-trip-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; background: none; border: 2px dashed var(--border); border-radius: var(--radius);
  color: var(--muted); font-size: .9rem; font-weight: 600; cursor: pointer;
  min-height: 120px; width: 100%; transition: border-color .15s, color .15s; padding: 20px;
}
.add-trip-card:hover { border-color: var(--blue-light); color: var(--blue-light); }
.add-trip-plus { font-size: 2rem; line-height: 1; }

/* ── TRIP DETAIL ── */
.trip-back-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.back-btn { background: none; border: none; color: var(--blue-light); font-size: .9rem; font-weight: 700; cursor: pointer; padding: 6px 0; display: flex; align-items: center; gap: 6px; }
.back-btn:hover { color: var(--blue); }

.trip-hero { position: relative; border-radius: var(--radius); overflow: hidden; min-height: 260px; display: flex; align-items: flex-end; margin-bottom: 14px; box-shadow: var(--shadow); background: var(--blue-dark); }
.trip-hero-bg { position: absolute; inset: 0; background-size: cover; background-position: center; transition: background-image .3s; }
.trip-hero-overlay { position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(0,0,0,.15) 0%, rgba(0,0,0,.8) 100%); }
.trip-hero-content { position: relative; padding: 28px 28px 24px; color: #fff; width: 100%; }
.trip-hero-dest { font-size: 2rem; font-weight: 900; letter-spacing: -.5px; text-transform: uppercase; line-height: 1.1; }
.trip-hero-dates { font-size: 1rem; color: rgba(255,255,255,.75); margin-top: 5px; }
.trip-hero-countdown { display: inline-flex; margin-top: 12px; background: var(--accent); color: #fff; font-size: .8rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; padding: 5px 14px; border-radius: 16px; }

.edit-wrap { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 24px; margin-bottom: 14px; box-shadow: var(--shadow); }
.edit-form .form-grid { margin-bottom: 16px; }

.trip-members-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 12px; box-shadow: var(--shadow); }
.trip-members-label { font-size: .75rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; }
.trip-members-avatars { display: flex; flex-wrap: wrap; gap: 8px; }

.quickinfo-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin-bottom: 14px; }
.quickinfo-chip { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 16px 12px 14px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; box-shadow: var(--shadow); }
.chip-icon { font-size: 1.6rem; line-height: 1; }
.chip-label { font-size: .63rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .07em; display: block; }
.chip-val { font-weight: 700; color: var(--blue-dark); display: block; line-height: 1.45; word-break: break-word; font-size: .88rem; }
.chip-val a { color: var(--blue-light); text-decoration: none; font-weight: 600; }
.chip-val a:hover { text-decoration: underline; }

/* ── TRIP SECTIONS ── */
.trip-section { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 14px; box-shadow: var(--shadow); overflow: hidden; }
.trip-section-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.trip-section-header h2 { font-size: 1rem; font-weight: 800; color: var(--blue-dark); }
.trip-section-body { padding: 12px 16px; display: flex; flex-direction: column; gap: 8px; }

/* Itinerary */
.itin-day-label { font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); padding: 6px 0 4px; }
.itin-event { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; background: var(--bg); border-radius: 9px; border: 1px solid var(--border); }
.itin-time { font-size: .78rem; font-weight: 700; color: var(--accent); min-width: 52px; white-space: nowrap; padding-top: 1px; }
.itin-body { flex: 1; min-width: 0; }
.itin-title { font-weight: 700; font-size: .9rem; color: var(--blue-dark); }
.itin-desc { font-size: .78rem; color: var(--muted); margin-top: 2px; line-height: 1.4; }
.itin-meta { font-size: .72rem; color: var(--muted); margin-top: 2px; }
.itin-actions { display: flex; gap: 4px; }

/* Place cards */
.place-card { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; background: var(--bg); border-radius: 9px; border: 1px solid var(--border); }
.place-body { flex: 1; min-width: 0; }
.place-name { font-weight: 700; font-size: .9rem; color: var(--blue-dark); }
.place-desc { font-size: .78rem; color: var(--muted); margin-top: 2px; line-height: 1.4; }
.place-meta { font-size: .72rem; color: var(--muted); margin-top: 4px; display: flex; gap: 8px; flex-wrap: wrap; }
.place-meta a { color: var(--blue-light); }
.place-actions { display: flex; gap: 4px; }

.section-empty { color: var(--muted); font-size: .85rem; font-style: italic; padding: 6px 0; }

/* ── MEMBERS ── */
.members-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.members-header h2 { font-size: 1.2rem; font-weight: 800; color: var(--blue-dark); }
.members-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }

.member-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; display: flex; align-items: center; gap: 14px; box-shadow: var(--shadow); }
.member-card-info { flex: 1; min-width: 0; }
.member-card-name { font-weight: 700; font-size: .95rem; color: var(--blue-dark); }
.member-card-actions { display: flex; gap: 4px; }

/* ── AVATARS ── */
.avatar {
  width: 36px; height: 36px; border-radius: 50%; object-fit: cover;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 800; color: #fff; flex-shrink: 0;
  border: 2px solid rgba(255,255,255,.4); overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 28px; height: 28px; font-size: .65rem; }
.avatar-lg { width: 52px; height: 52px; font-size: 1rem; }

/* ── MEMBER PICKER ── */
.member-picker { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.member-pick-chip {
  display: flex; align-items: center; gap: 6px; padding: 5px 12px 5px 6px;
  border-radius: 20px; border: 2px solid var(--border); cursor: pointer;
  font-size: .82rem; font-weight: 600; color: var(--muted);
  background: var(--bg); transition: border-color .15s, color .15s, background .15s;
  user-select: none;
}
.member-pick-chip.selected { border-color: var(--blue); background: #e8f0fa; color: var(--blue-dark); }

/* ── CALC INSIDE TRIP ── */
.calc-toggle-bar { display: flex; align-items: center; justify-content: space-between; padding: 11px 20px; border-top: 1px solid var(--border); cursor: pointer; font-size: .85rem; font-weight: 700; color: var(--muted); user-select: none; transition: background .1s; }
.calc-toggle-bar:hover { background: var(--bg); }
.calc-panel { border-top: 1px solid var(--border); }
.calc-inner { padding: 16px 20px; display: flex; flex-direction: column; gap: 16px; }
.calc-row { display: flex; flex-direction: column; gap: 8px; }
.calc-label { font-size: .73rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.route-row { display: flex; gap: 8px; }
.route-row input { flex: 1; border: 1px solid var(--border); border-radius: 8px; padding: 9px 12px; font-size: .93rem; outline: none; transition: border-color .15s; }
.route-row input:focus { border-color: var(--blue-light); }
.route-row button { background: var(--blue-dark); color: #fff; border: none; border-radius: 8px; padding: 9px 16px; font-weight: 700; font-size: .88rem; cursor: pointer; white-space: nowrap; transition: background .15s; }
.route-row button:hover { background: var(--blue); }
.route-row button:disabled { opacity: .5; cursor: default; }
.route-result { border-radius: 9px; padding: 11px 15px; font-size: .88rem; font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.route-result.drive { background: #e8f5e9; border: 1px solid #a5d6a7; color: #2e7d32; }
.route-result.fly   { background: #e3f2fd; border: 1px solid #90caf9; color: #1565c0; }
.route-result.error { background: #fdecea; border: 1px solid #f5c6c2; color: #c62828; }
.route-badge { font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; padding: 3px 9px; border-radius: 16px; margin-left: auto; }
.route-result.drive .route-badge { background: #2e7d32; color: #fff; }
.route-result.fly .route-badge   { background: #1565c0; color: #fff; }
.route-details { opacity: .75; font-weight: 500; font-size: .8rem; }
.inline-inputs { display: flex; flex-wrap: wrap; gap: 10px; }
.num-field { display: flex; flex-direction: column; gap: 3px; }
.num-field label { font-size: .72rem; font-weight: 600; color: var(--muted); }
.num-field input { width: 100px; border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; font-size: .93rem; outline: none; transition: border-color .15s; }
.num-field input:focus { border-color: var(--blue-light); }
.or-badge { display: inline-flex; align-items: center; height: 34px; font-size: .72rem; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.calc-hint { font-size: .75rem; color: var(--muted); font-style: italic; }
.add-expense-btn { background: none; border: 1px dashed var(--border); border-radius: 7px; color: var(--blue-light); font-size: .82rem; font-weight: 600; padding: 6px 12px; cursor: pointer; transition: border-color .15s; align-self: flex-start; }
.add-expense-btn:hover { border-color: var(--blue-light); }
.shared-exp-row { display: flex; align-items: center; gap: 7px; margin-bottom: 6px; }
.shared-exp-row input[type="text"] { flex: 1; border: 1px solid var(--border); border-radius: 7px; padding: 7px 10px; font-size: .88rem; outline: none; }
.shared-exp-row input[type="number"] { width: 95px; border: 1px solid var(--border); border-radius: 7px; padding: 7px 10px; font-size: .88rem; outline: none; }
.shared-exp-row .rm-btn { background: none; border: none; color: #bbb; font-size: .9rem; cursor: pointer; padding: 3px 5px; border-radius: 4px; }
.shared-exp-row .rm-btn:hover { color: #e53935; }
.calc-result { background: var(--bg); border-radius: 10px; padding: 16px; }
.calc-breakdown { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.breakdown-row { display: flex; justify-content: space-between; font-size: .88rem; padding: 4px 0; border-bottom: 1px dashed var(--border); }
.breakdown-row:last-child { border-bottom: none; }
.breakdown-row span:first-child { color: var(--muted); }
.breakdown-row span:last-child { font-weight: 700; }
.calc-total-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; padding: 11px 14px; background: var(--card); border-radius: 9px; border: 1px solid var(--border); }
.calc-total-label { font-size: .88rem; font-weight: 700; color: var(--blue-dark); }
.calc-total-val { font-size: 1.45rem; font-weight: 800; color: var(--blue-dark); }
.budget-bar-wrap { margin-bottom: 10px; }
.budget-bar-track { height: 14px; background: var(--border); border-radius: 7px; position: relative; margin-bottom: 4px; }
.budget-bar-fill { height: 100%; border-radius: 7px; transition: width .4s, background .3s; max-width: 100%; }
.budget-bar-goal { position: absolute; right: 0; top: -3px; bottom: -3px; width: 3px; background: #aaa; border-radius: 2px; }
.budget-bar-labels { display: flex; justify-content: space-between; font-size: .72rem; color: var(--muted); font-weight: 600; }
.budget-verdict { text-align: center; font-size: .95rem; font-weight: 700; padding: 8px; border-radius: 8px; }
.budget-verdict.under { background: #e8f5e9; color: #2e7d32; }
.budget-verdict.over  { background: #fdecea; color: #c62828; }

/* ── EXPENSE TRACKER ── */
.expense-entry { display: flex; align-items: center; gap: 9px; background: var(--bg); border: 1px solid var(--border); border-radius: 9px; padding: 9px 13px; }
.exp-date { font-size: .72rem; color: var(--muted); white-space: nowrap; width: 50px; flex-shrink: 0; }
.exp-body { flex: 1; min-width: 0; }
.exp-desc { font-weight: 700; font-size: .88rem; }
.exp-meta { font-size: .72rem; color: var(--muted); margin-top: 1px; display: flex; align-items: center; gap: 5px; }
.exp-amount { font-size: .97rem; font-weight: 800; color: var(--blue-dark); flex-shrink: 0; }
.receipt-thumb { width: 34px; height: 34px; object-fit: cover; border-radius: 5px; cursor: pointer; flex-shrink: 0; border: 1px solid var(--border); }
.receipt-icon { font-size: 1.1rem; color: #ccc; cursor: pointer; flex-shrink: 0; transition: color .15s; }
.receipt-icon:hover { color: var(--blue-light); }
/* Expense cards (new expandable design) */
.expense-card { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; transition: box-shadow .15s; }
.expense-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,.08); }
.expense-card-header { display: flex; align-items: center; gap: 8px; padding: 10px 13px; }
.expense-card-header.expandable { cursor: pointer; }
.expense-card-header.expandable:hover { background: rgba(0,0,0,.025); }
.exp-right { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex-shrink: 0; }
.exp-type-badge { font-size: .62rem; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; padding: 2px 7px; border-radius: 8px; }
.exp-type-badge.paid { background: #e8f5e9; color: #2e7d32; }
.exp-type-badge.reserved { background: #fff3e0; color: #e65100; }
.exp-expand-arrow { font-size: .7rem; color: var(--muted); transition: transform .2s; flex-shrink: 0; margin-left: 2px; }
.expense-card.open .exp-expand-arrow { transform: rotate(180deg); }
.expense-card-body { border-top: 1px solid var(--border); background: #fff; padding: 12px 14px; display: flex; flex-direction: column; gap: 0; }
.expense-card-body.hidden { display: none; }
.exp-split-header { font-size: .7rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; padding-bottom: 8px; }
.exp-split-row { display: flex; align-items: center; gap: 9px; padding: 7px 0; border-bottom: 1px dashed var(--border); }
.exp-split-row:last-of-type { border-bottom: none; }
.exp-split-name { flex: 1; font-size: .88rem; font-weight: 600; min-width: 0; }
.exp-split-share { font-size: .78rem; color: var(--muted); white-space: nowrap; }
.exp-payer-tag { font-size: .75rem; font-weight: 700; color: #2e7d32; white-space: nowrap; }
.exp-reserved-tag { font-size: .75rem; font-weight: 700; color: #e65100; white-space: nowrap; }
.exp-received-wrap { display: flex; align-items: center; gap: 5px; flex-shrink: 0; }
.exp-received-input { width: 72px; border: 1px solid var(--border); border-radius: 6px; padding: 4px 7px; font-size: .82rem; outline: none; transition: border-color .15s; text-align: right; }
.exp-received-input:focus { border-color: var(--blue-light); }
.exp-received-of { font-size: .72rem; color: var(--muted); white-space: nowrap; }
.exp-full-btn { background: none; border: 1px solid #a5d6a7; color: #2e7d32; font-size: .72rem; font-weight: 700; padding: 3px 8px; border-radius: 6px; cursor: pointer; white-space: nowrap; transition: background .15s; }
.exp-full-btn:hover { background: #e8f5e9; }
.exp-undo-btn { background: none; border: 1px solid var(--border); color: var(--muted); font-size: .7rem; font-weight: 600; padding: 2px 7px; border-radius: 6px; cursor: pointer; }
.exp-undo-btn:hover { border-color: #fca5a5; color: #dc2626; }
.exp-fully-paid { color: #2e7d32; font-size: .8rem; font-weight: 800; display: flex; align-items: center; gap: 3px; white-space: nowrap; }
.exp-outstanding { margin-top: 10px; padding: 8px 10px; background: #fff8e1; border-radius: 7px; font-size: .82rem; color: #856404; font-weight: 600; }
.exp-outstanding.all-clear { background: #e8f5e9; color: #2e7d32; }
.exp-delete-btn { background: none; border: 1px solid #fca5a5; color: #dc2626; font-size: .72rem; font-weight: 700; border-radius: 6px; padding: 4px 7px; cursor: pointer; flex-shrink: 0; transition: background .15s; line-height: 1; }
.exp-delete-btn:hover { background: #fee2e2; }

/* Expense form type toggle */
.exp-type-toggle { display: flex; gap: 8px; margin-bottom: 16px; }
.exp-type-btn { flex: 1; padding: 9px 6px; border: 2px solid var(--border); border-radius: 9px; background: none; cursor: pointer; font-size: .88rem; font-weight: 700; color: var(--muted); transition: all .15s; }
.exp-type-btn.active { border-color: var(--blue); background: #e8f0fa; color: var(--blue-dark); }
.picker-section { margin-bottom: 14px; }
.picker-label { font-size: .78rem; font-weight: 700; color: var(--blue-dark); display: block; margin-bottom: 6px; }

/* Expense summary — fixed bottom cutoff */
.expense-summary { border-top: 2px solid var(--border); padding: 12px 16px 16px; display: flex; flex-direction: column; gap: 5px; }
.exp-sum-row { display: flex; justify-content: space-between; font-size: .92rem; font-weight: 600; }
.exp-sum-pp { font-size: 1.25rem; font-weight: 800; color: var(--blue-dark); }
.exp-by-label { font-size: .72rem; color: var(--muted); font-weight: 500; }

/* ── FORMS ── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid label { display: flex; flex-direction: column; gap: 4px; font-size: .78rem; font-weight: 700; color: var(--blue-dark); }
.form-grid label.span2 { grid-column: span 2; }
.form-grid input, .form-grid textarea, .form-grid select { border: 1px solid var(--border); border-radius: 8px; padding: 8px 11px; font-size: .9rem; font-family: inherit; outline: none; transition: border-color .15s; resize: vertical; }
.form-grid input:focus, .form-grid textarea:focus, .form-grid select:focus { border-color: var(--blue-light); }
.form-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.img-upload-area { border: 2px dashed var(--border); border-radius: 9px; padding: 14px; text-align: center; cursor: pointer; color: var(--muted); font-size: .85rem; transition: border-color .15s; min-height: 70px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.img-upload-area:hover { border-color: var(--blue-light); color: var(--blue-light); }
.img-upload-area img { max-height: 120px; max-width: 100%; border-radius: 6px; object-fit: cover; }

/* ── BUTTONS ── */
.btn-primary { background: var(--blue-dark); color: #fff; border: none; border-radius: 8px; padding: 10px 18px; font-size: .9rem; font-weight: 700; cursor: pointer; transition: background .15s; }
.btn-primary:hover { background: var(--blue); }
.btn-primary.btn-sm { padding: 6px 13px; font-size: .8rem; }
.btn-ghost { background: none; border: 1px solid var(--border); border-radius: 8px; padding: 8px 16px; font-size: .85rem; font-weight: 600; color: var(--muted); cursor: pointer; transition: border-color .15s, color .15s; }
.btn-ghost:hover { border-color: var(--blue-light); color: var(--blue-light); }
.btn-ghost.btn-sm { padding: 5px 12px; font-size: .78rem; }
.btn-danger { background: none; border: 1px solid #fca5a5; border-radius: 8px; padding: 8px 16px; font-size: .85rem; font-weight: 600; color: #dc2626; cursor: pointer; transition: background .15s; margin-left: auto; }
.btn-danger:hover { background: #fee2e2; }
.btn-icon { background: none; border: none; color: var(--muted); font-size: .82rem; cursor: pointer; padding: 4px 6px; border-radius: 6px; transition: color .15s, background .15s; }
.btn-icon:hover { background: var(--border); color: var(--text); }
.btn-icon.danger:hover { background: #fee2e2; color: #dc2626; }

/* ── MODAL ── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; z-index: 200; padding: 16px; }
.modal-box { background: var(--card); border-radius: var(--radius); width: 100%; max-width: 500px; max-height: 92vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px 14px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--card); z-index: 1; }
.modal-header h3 { font-size: 1rem; font-weight: 800; color: var(--blue-dark); }
.modal-close-btn { background: none; border: none; font-size: 1.1rem; color: var(--muted); cursor: pointer; padding: 4px 8px; border-radius: 6px; }
.modal-close-btn:hover { color: var(--text); }
.modal-body { padding: 18px 22px; }
.modal-body .form-grid { margin-bottom: 18px; }
.modal-footer { display: flex; gap: 10px; }
.receipt-upload-area { border: 2px dashed var(--border); border-radius: 8px; padding: 14px; text-align: center; cursor: pointer; color: var(--muted); font-size: .85rem; transition: border-color .15s; min-height: 70px; display: flex; align-items: center; justify-content: center; }
.receipt-upload-area:hover { border-color: var(--blue-light); }
.receipt-upload-area img { max-height: 140px; max-width: 100%; border-radius: 6px; }
.receipt-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.85); display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 300; gap: 12px; cursor: pointer; }
.receipt-overlay img { max-width: 90vw; max-height: 80vh; border-radius: 10px; }
.receipt-overlay p { color: rgba(255,255,255,.5); font-size: .8rem; }

/* ── TOAST ── */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(60px); background: var(--blue-dark); color: #fff; padding: 10px 20px; border-radius: 20px; font-weight: 600; box-shadow: 0 4px 20px rgba(0,0,0,.2); transition: transform .3s ease; z-index: 400; white-space: nowrap; font-size: .9rem; }
.toast.show { transform: translateX(-50%) translateY(0); }

/* ── FOOTER ── */
footer { text-align: center; padding: 16px; color: var(--muted); font-size: .8rem; border-top: 1px solid var(--border); margin-top: auto; }

/* ── MAP VIEW ── */
.map-view-header { text-align: center; padding: 24px 0 16px; }
.map-view-header h2 { font-size: 1.4rem; font-weight: 800; color: var(--blue-dark); }
.map-view-subtitle { font-size: .85rem; color: var(--muted); margin-top: 4px; }
.map-progress { font-size: 1.6rem; font-weight: 900; color: var(--accent); margin-top: 10px; }
.map-progress span { font-size: .9rem; color: var(--muted); font-weight: 600; }
.map-svg-wrap { max-width: 820px; margin: 0 auto; padding: 0 16px 8px; }
.us-map-svg { width: 100%; height: auto; display: block; }
.us-map-svg .states path, #map-svg-wrap .states path {
  fill: var(--border);
  stroke: var(--card);
  stroke-width: 1.2;
  transition: fill .25s, filter .2s;
  cursor: default;
}
.us-map-svg .states path.visited, #map-svg-wrap .states path.visited {
  fill: var(--accent);
  filter: drop-shadow(0 2px 6px rgba(230,126,34,.4));
  cursor: pointer;
}
.us-map-svg .states path.visited:hover, #map-svg-wrap .states path.visited:hover {
  fill: #e8853a;
  filter: drop-shadow(0 3px 10px rgba(230,126,34,.6));
}
.map-legend { text-align: center; padding: 8px 16px 28px; font-size: .82rem; color: var(--muted); }
.map-trip-list { max-width: 640px; margin: 0 auto; padding: 0 12px 24px; display: flex; flex-direction: column; gap: 8px; }
.map-trip-row { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; display: flex; align-items: center; gap: 10px; font-size: .85rem; }
.map-trip-state-badge { background: var(--accent); color: #fff; font-size: .68rem; font-weight: 800; padding: 3px 8px; border-radius: 8px; flex-shrink: 0; }
.map-tooltip { position: fixed; background: rgba(0,0,0,.82); color: #fff; font-size: .75rem; font-weight: 600; padding: 5px 10px; border-radius: 8px; pointer-events: none; white-space: nowrap; opacity: 0; transition: opacity .12s; z-index: 9999; }
.map-tooltip.visible { opacity: 1; }

/* ── RESPONSIVE ── */
@media (max-width: 600px) {
  .header-inner { padding: 0 14px; height: 54px; }
  h1 { font-size: .95rem; }
  .subtitle { display: none; }
  .tab-btn { padding: 6px 11px; font-size: .76rem; }
  main { margin: 12px auto; padding: 0 10px; }
  .trips-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid label.span2 { grid-column: span 1; }
  .members-list { grid-template-columns: 1fr; }
  .trip-hero-dest { font-size: 1.55rem; }
}
