/* Admin panel, couple dashboard and public pages — e-invitation.lk brand colours (from the logo) */
:root {
  --bg: #faf6f0;
  --surface: #ffffff;
  --text: #2a1614;
  --muted: #7d6b63;
  --border: #ece2d6;
  --primary: #7a0c16;      /* logo crimson, a touch lighter for buttons */
  --primary-dark: #5c0710; /* logo crimson */
  --primary-soft: #f7e8e6;
  --gold: #a96b3f;         /* logo copper */
  --gold-soft: #f5e9dc;
  --cream: #fbf5ec;
  --green: #1d7f4a;
  --green-soft: #e3f4ea;
  --amber: #a8650f;
  --amber-soft: #fdf1dc;
  --red: #b42318;
  --red-soft: #fde8e6;
  --grey-soft: #eeebe7;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(40, 20, 10, .04), 0 4px 16px rgba(40, 20, 10, .05);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 Inter, "Noto Sans Sinhala", system-ui, -apple-system, "Segoe UI", sans-serif;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 26px; line-height: 1.2; margin: 4px 0; letter-spacing: -.01em; }
h2 { font-size: 17px; margin: 0 0 14px; }
.h-sub { font-size: 13px; font-weight: 500; color: var(--gold); margin-left: 6px; }
h3 { font-size: 14px; margin: 22px 0 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
small, .small { font-size: 12.5px; }
.muted { color: var(--muted); }
.text-red { color: var(--red); }
.text-green { color: var(--green); }
code { background: var(--grey-soft); padding: 1px 6px; border-radius: 6px; font-size: 13px; }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 18px;
  padding: 10px 24px;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 8px; color: var(--text); white-space: nowrap; flex: none; }
.brand:hover { text-decoration: none; }
.brand-mark-img { height: 34px; width: auto; display: block; }
.brand-word { height: 25px; width: auto; display: block; margin-top: 2px; }
.brand-sub { font-size: 10.5px; font-weight: 600; color: var(--gold); text-transform: uppercase; letter-spacing: .1em; padding: 2px 7px; border: 1px solid var(--gold-soft); border-radius: 999px; background: var(--cream); }
.nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav a {
  display: flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: 10px;
  color: var(--muted); font-weight: 500; white-space: nowrap;
}
.nav a:hover { background: var(--grey-soft); color: var(--text); text-decoration: none; }
.nav a.active { background: var(--primary-soft); color: var(--primary); }
.nav svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.userbox { display: flex; align-items: center; gap: 10px; }
.userbox form { margin: 0; }
.user-name { color: var(--muted); font-size: 13px; white-space: nowrap; }

.content { max-width: 1240px; margin: 0 auto; padding: 26px 24px 80px; }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.page-head p { margin: 0; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.back { font-size: 13px; color: var(--muted); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; font-weight: 600; font-size: 14px;
  cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { background: var(--grey-soft); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--grey-soft); color: var(--text); }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger:hover { background: #8f1c13; }
.btn-whatsapp { background: #1fa855; border-color: #1fa855; color: #fff; }
.btn-whatsapp:hover { background: #178a45; }
.btn-sm { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.btn.copied { background: var(--green-soft); border-color: var(--green); color: var(--green); }

/* Cards & grids */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow); min-width: 0;
}
.card + .card { margin-top: 16px; }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.stack > .card + .card { margin-top: 0; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.grid-wide-left { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
.card-danger { border-color: #f1d3cf; }
.empty { color: var(--muted); padding: 16px 0; margin: 0; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.stats-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 2px; min-width: 0;
}
a.stat-link { color: inherit; }
a.stat-link:hover { text-decoration: none; border-color: var(--primary); }
.stat-label { color: var(--muted); font-size: 13px; font-weight: 500; }
.stat-value { font-size: 30px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
.stat-money { font-size: 22px; padding: 4px 0; }
.stat-foot { color: var(--muted); font-size: 12.5px; }
.stat-green .stat-value { color: var(--green); }
.stat-red .stat-value { color: var(--red); }
.stat-amber .stat-value { color: var(--amber); }

.mini-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 10px; margin-bottom: 14px; }
.mini-stats div { background: var(--bg); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; min-width: 0; }
.mini-stats strong { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-stats span { color: var(--muted); font-size: 12.5px; }

/* Tables */
.table-wrap { overflow-x: auto; margin: 0 -4px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 11px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table-compact td { padding: 8px 10px; }
.table .actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: nowrap; }
.table .actions form { margin: 0; }
.row-muted td { opacity: .6; }
.cell-text { max-width: 340px; overflow-wrap: anywhere; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; flex-direction: column; padding: 9px 0; border-bottom: 1px solid var(--border); }
.list li:last-child { border-bottom: 0; }
.list .muted { font-size: 12.5px; }

.list-actions li { flex-direction: row; justify-content: space-between; align-items: center; gap: 10px; }
.list-actions .btn { flex: none; }
.schedule { margin: 0 0 14px; padding-left: 18px; font-size: 14px; }
.schedule li { margin-bottom: 6px; }

.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; vertical-align: middle; }
.dot-green { background: var(--green); }
.dot-red { background: var(--red); }

/* Badges & alerts */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; vertical-align: middle; }
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-amber { background: var(--amber-soft); color: var(--amber); }
.badge-red { background: var(--red-soft); color: var(--red); }
.badge-grey { background: var(--grey-soft); color: var(--muted); }

.alert { padding: 12px 16px; border-radius: 12px; margin-bottom: 16px; border: 1px solid transparent; }
.alert ul { margin: 6px 0 0; padding-left: 18px; }
.alert-success { background: var(--green-soft); color: #145c35; border-color: #c4e8d2; }
.alert-error { background: var(--red-soft); color: #8f1c13; border-color: #f6cdc8; }
.alert-warn { background: var(--amber-soft); color: #7a4708; border-color: #f4dcb1; }

/* Forms */
.form { display: flex; flex-direction: column; gap: 14px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 13.5px; }
.form label small { font-weight: 400; color: var(--muted); }
input, select, textarea {
  font: inherit; font-size: 15px; color: var(--text); background: #fff;
  border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; width: 100%; min-width: 0;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--primary); }
input[type="range"] { accent-color: var(--primary); padding: 0; border: 0; box-shadow: none; }
input[type="file"] { padding: 8px; background: var(--bg); }
textarea { resize: vertical; }
.form label.check { flex-direction: row; align-items: center; gap: 10px; font-weight: 500; }
.row-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.row-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
.form-sections .card + .card { margin-top: 0; }
.form-sections { gap: 16px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; }
.sticky-actions {
  position: sticky; bottom: 0; padding: 14px 0; z-index: 5;
  background: linear-gradient(to top, var(--bg) 70%, transparent);
}
.input-prefix { display: flex; align-items: stretch; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: #fff; }
.input-prefix span { padding: 10px 0 10px 12px; color: var(--muted); font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 55%; }
.input-prefix input { border: 0; border-radius: 0; padding-left: 2px; }
.input-prefix:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.inline-form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 6px; }
.copy-row { display: flex; gap: 8px; }
.copy-row input { background: var(--bg); font-size: 14px; }
.toolbar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar input[type="search"] { flex: 1; min-width: 200px; }
.toolbar select { width: auto; }

/* Design choices */
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.choice { cursor: pointer; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice-card {
  display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center;
  padding: 14px 10px; border: 2px solid var(--border); border-radius: 12px; font-weight: 500; font-size: 13px;
  transition: border-color .15s, background .15s;
}
.choice-grid-wide { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); margin-bottom: 4px; }
.mode-grid { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); margin-bottom: 12px; }
.type-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.type-card { gap: 4px; padding: 14px 8px 12px; }
.type-card .ev-icon { width: 30px; height: 30px; fill: none; stroke: var(--primary); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 4px; }
.type-card strong { font-size: 14px; }
.type-card small { color: var(--muted); font-size: 12px; font-weight: 400; }
.choice[hidden] { display: none; }
.mode-card { align-items: flex-start; text-align: left; gap: 4px; padding: 14px 16px; height: 100%; }
.mode-card strong { font-size: 15px; }
.mode-card small { color: var(--muted); font-size: 12.5px; line-height: 1.45; font-weight: 400; }
.mode-si { color: var(--gold); font-weight: 600; font-size: 13px; margin-left: 4px; }
.choice input:disabled + .choice-card { opacity: .45; cursor: not-allowed; }
.family-max { max-width: 420px; }
.choice-thumb { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: #1a0b0e; }
.choice-thumb img { width: 100%; height: 100%; object-fit: cover; }
.choice-demo { font-size: 12px; font-weight: 600; margin-top: -4px; }
.choice input:checked + .choice-card { border-color: var(--primary); background: var(--primary-soft); }
.choice input:focus-visible + .choice-card { box-shadow: 0 0 0 3px var(--primary-soft); }
.swatch { width: 100%; height: 34px; border-radius: 8px; }
.swatch-maroon { background: linear-gradient(90deg, #5c0f22 0 55%, #c9a24a 55% 75%, #fbf5ea 75%); }
.swatch-ivory { background: linear-gradient(90deg, #f4ead8 0 55%, #b8862b 55% 75%, #6b4f2a 75%); }
.swatch-emerald { background: linear-gradient(90deg, #0d3b2f 0 55%, #c9a24a 55% 75%, #f7f2e6 75%); }
.swatch-navy { background: linear-gradient(90deg, #14213d 0 55%, #d4af37 55% 75%, #f8f5ee 75%); }
.swatch-blush { background: linear-gradient(90deg, #f3d9dc 0 55%, #b76e79 55% 75%, #fffaf8 75%); }
.swatch-saffron { background: linear-gradient(90deg, #8a1c0e 0 55%, #f6c85a 55% 75%, #fff8e7 75%); }
.swatch-purple { background: linear-gradient(90deg, #4b1d6b 0 55%, #ead08f 55% 75%, #fbf7ef 75%); }
.swatch-teal { background: linear-gradient(90deg, #0f4c5c 0 55%, #e8cf8c 55% 75%, #f8f5ec 75%); }
.swatch-sunshine { background: linear-gradient(90deg, #c8442c 0 55%, #ffd36b 55% 75%, #fffbf2 75%); }
.swatch-sky { background: linear-gradient(90deg, #4a78a8 0 55%, #e6edf5 55% 75%, #fbfdff 75%); }
.swatch-mint { background: linear-gradient(90deg, #2f7a68 0 55%, #f1cdb8 55% 75%, #fdfcf8 75%); }
.swatch-onyx { background: linear-gradient(90deg, #1d1d23 0 55%, #c5a24a 55% 75%, #faf8f3 75%); }
.intro-lotus { background: #0b3a45; }
.intro-lotus::before { content: ""; position: absolute; left: 50%; bottom: 6px; width: 14px; height: 26px; margin-left: -7px; border-radius: 50% 50% 50% 50% / 70% 70% 30% 30%; background: linear-gradient(#e86a8e, #fff); box-shadow: -11px 4px 0 -2px #f4a6b8, 11px 4px 0 -2px #f4a6b8; }
.intro-kolam { background: #6e160b; }
.intro-kolam::before { content: ""; position: absolute; left: 50%; top: 50%; width: 26px; height: 26px; margin: -13px; border: 2px solid #fff8ea; border-radius: 4px; transform: rotate(45deg); box-shadow: 0 0 0 4px #6e160b, 0 0 0 6px #fff8ea; }
.intro-scroll { background: #2a1a10; }
.intro-scroll::before { content: ""; position: absolute; left: 12px; right: 12px; top: 8px; bottom: 8px; background: #f6ecd6; }
.intro-scroll::after { content: ""; position: absolute; left: 8px; right: 8px; top: 5px; height: 6px; border-radius: 3px; background: #c9a24a; box-shadow: 0 25px 0 #c9a24a; }
.choice-icon { width: 54px; height: 40px; border-radius: 8px; position: relative; background: #5c0f22; overflow: hidden; }
.intro-door::before, .intro-door::after { content: ""; position: absolute; top: 4px; bottom: 0; width: 22px; background: #8a2a2a; border: 2px solid #c9a24a; }
.intro-door::before { left: 4px; border-radius: 10px 0 0 0; }
.intro-door::after { right: 4px; border-radius: 0 10px 0 0; }
.intro-envelope { background: #f4ead8; }
.intro-envelope::before { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom right, transparent 49%, #d9c7a5 50%) left / 50% 100% no-repeat, linear-gradient(to bottom left, transparent 49%, #d9c7a5 50%) right / 50% 100% no-repeat; }
.intro-envelope::after { content: ""; position: absolute; left: 21px; top: 15px; width: 12px; height: 12px; border-radius: 50%; background: var(--primary); }
.intro-curtain { background: #f8e7b5; }
.intro-curtain::before, .intro-curtain::after { content: ""; position: absolute; top: 0; bottom: 0; width: 22px; background: repeating-linear-gradient(90deg, #7a1026 0 4px, #9b1b35 4px 8px); }
.intro-curtain::before { left: 0; border-bottom-right-radius: 14px; }
.intro-curtain::after { right: 0; border-bottom-left-radius: 14px; }

.file-current { display: flex; align-items: center; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
.file-current img { width: 96px; height: 72px; object-fit: cover; border-radius: 8px; }
.file-current audio { max-width: 100%; height: 36px; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; margin-top: 12px; }
.thumb { display: flex; flex-direction: column; gap: 4px; font-weight: 400 !important; font-size: 12.5px !important; }
.thumb img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 8px; }
.thumb span { display: flex; gap: 6px; align-items: center; }

.details { display: grid; grid-template-columns: 120px 1fr; gap: 10px 14px; margin: 0; font-size: 14px; }
.details dt { color: var(--muted); }
.details dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
details summary { cursor: pointer; color: var(--red); font-weight: 600; margin-top: 14px; }
details .form { margin-top: 12px; }

/* Tabs (couple dashboard) */
.tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.tabs a { padding: 7px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--muted); font-weight: 600; font-size: 13.5px; }
.tabs a:hover { text-decoration: none; color: var(--text); }
.tabs a.active { background: var(--text); border-color: var(--text); color: #fff; }
.tabs a .count { opacity: .7; margin-left: 4px; }

.wish { padding: 14px 0; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.wish:last-child { border-bottom: 0; }
.wish p { margin: 0 0 4px; white-space: pre-line; overflow-wrap: anywhere; }
.wish form { margin: 0; flex: none; }
.wish-hidden p { opacity: .5; }
.wall-toggle { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 14px; margin-bottom: 8px; background: var(--bg); border-radius: 12px; }

/* 4K templates */
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.tpl-card { display: flex; flex-direction: column; gap: 6px; color: var(--text); padding: 10px; border: 1px solid var(--border); border-radius: 12px; transition: border-color .15s, box-shadow .15s; }
.tpl-card:hover { text-decoration: none; border-color: var(--primary); box-shadow: var(--shadow); }
.tpl-thumb { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: #1a0b0e; }
.tpl-thumb img { width: 100%; height: 100%; object-fit: cover; }
.tpl-kind { position: absolute; left: 8px; top: 8px; padding: 2px 8px; border-radius: 999px; background: rgba(0, 0, 0, .6); color: #fff; font-size: 11.5px; font-weight: 600; }
.src-thumb { width: 100%; max-width: 280px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; margin-top: 8px; }
.src-video { width: 100%; max-width: 320px; border-radius: 8px; background: #000; }
.src-video.vid-tall { max-width: 180px; }
.vid-block { display: flex; flex-direction: column; gap: 10px; padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); }
.frame-pick { display: flex; gap: 10px; align-items: center; }
.frame-pick[hidden] { display: none; }
.frame-pick input { flex: 1; }
.poster-preview { width: 120px; height: auto !important; max-height: 120px; object-fit: contain !important; background: #000; }
.dw-editor { position: relative; user-select: none; touch-action: none; border-radius: 10px; overflow: hidden; background: #000; line-height: 0; }
.dw-editor img { width: 100%; height: auto; display: block; pointer-events: none; }
.dw-box { position: absolute; cursor: move; outline: 2px dashed #fff; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .45); }
.dw-box:focus { outline-color: #ffd76a; }
.dw-shape { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.dw-shape path { fill: rgba(255, 215, 106, .12); stroke: #ffd76a; stroke-width: 2; vector-effect: non-scaling-stroke; }
.dw-mid { position: absolute; left: 50%; top: 0; bottom: 0; border-left: 1px dashed rgba(255, 255, 255, .7); }
.dw-h { position: absolute; width: 14px; height: 14px; margin: -7px 0 0 -7px; background: #fff; border: 2px solid var(--primary); border-radius: 3px; }
.dw-nw { left: 0; top: 0; cursor: nwse-resize; } .dw-n { left: 50%; top: 0; cursor: ns-resize; } .dw-ne { left: 100%; top: 0; cursor: nesw-resize; }
.dw-e { left: 100%; top: 50%; cursor: ew-resize; } .dw-se { left: 100%; top: 100%; cursor: nwse-resize; } .dw-s { left: 50%; top: 100%; cursor: ns-resize; }
.dw-sw { left: 0; top: 100%; cursor: nesw-resize; } .dw-w { left: 0; top: 50%; cursor: ew-resize; }
.dw-controls { margin-top: 14px; align-items: end; }
.layer-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 8px; }
.layer-strip figure { margin: 0; text-align: center; font-size: 12px; color: var(--muted); }
.layer-strip img { width: 100%; height: 110px; object-fit: contain; border-radius: 6px; background: repeating-conic-gradient(#ddd 0 25%, #fff 0 50%) 0 0 / 14px 14px; }
.guide-steps { padding-left: 20px; margin: 0 0 10px; font-size: 14px; }
.guide-steps li { margin-bottom: 8px; }
.prompt-set { border-top: 1px solid var(--border); padding: 10px 0; }
.prompt-set summary { color: var(--text); margin-top: 0; }
.prompt { margin: 10px 0; padding: 10px 12px; background: var(--bg); border-radius: 10px; }
.prompt-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; }
.prompt p { margin: 6px 0 0; font-size: 13px; color: var(--muted); line-height: 1.5; }

/* Public pages (order) */
.content-narrow { max-width: 980px; }
.public-page .nav { visibility: hidden; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.btn-lg { padding: 13px 26px; font-size: 16px; border-radius: 12px; }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.plan-choice .choice-card { align-items: flex-start; text-align: left; gap: 4px; padding: 16px; height: 100%; }
.plan-name { font-size: 17px; }
.plan-price { font-size: 22px; font-weight: 700; color: var(--primary); }
.plan-desc { color: var(--muted); font-size: 13px; }
.plan-feats { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 6px; font-size: 12.5px; color: var(--green); font-weight: 600; }
.pay-redirect, .order-status { max-width: 620px; margin: 30px auto; text-align: center; }
.order-status .copy-row, .order-status .btn-row { justify-content: center; }
.order-status h1 { margin: 10px 0 8px; }
.status-icon { width: 64px; height: 64px; margin: 6px auto; border-radius: 50%; display: grid; place-items: center; font-size: 28px; font-weight: 700; }
.status-icon.ok { background: var(--green-soft); color: var(--green); }
.status-icon.wait { background: var(--amber-soft); color: var(--amber); }
.status-icon.fail { background: var(--red-soft); color: var(--red); }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid currentColor; border-right-color: transparent; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.bank-box, .bank-details pre { text-align: left; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; font: 14px/1.6 ui-monospace, Consolas, monospace; white-space: pre-wrap; margin: 12px 0; }
.bank-details summary { color: inherit; margin-top: 0; list-style: none; }
.bank-details summary::-webkit-details-marker { display: none; }
.pay-banner { display: flex; justify-content: space-between; align-items: center; gap: 12px 20px; flex-wrap: wrap; padding: 16px 18px; margin-bottom: 16px; border-radius: 14px; background: var(--amber-soft); border: 1px solid #f4dcb1; color: #6b3f07; }
.pay-banner .btn-row { margin: 0; align-items: flex-start; }
.pay-banner form { margin: 0; }

/* Login page */
.auth-page {
  min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background: radial-gradient(circle at 15% 10%, #f6e3df, transparent 45%), radial-gradient(circle at 90% 90%, #f3e6d6, transparent 50%), var(--bg);
}
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--border); border-top: 4px solid var(--primary-dark); border-radius: 20px; padding: 26px 28px 30px; box-shadow: 0 20px 60px rgba(60, 20, 20, .08); }
.auth-brand { display: block; margin: 0 auto 14px; width: 180px; }
.auth-brand img { width: 100%; height: auto; display: block; }
.auth-card h1 { font-size: 22px; }
.auth-card h1, .public-page h1 { font-family: "Cormorant Garamond", Georgia, serif; font-weight: 700; font-size: 30px; color: var(--primary-dark); letter-spacing: 0; }
.auth-card .muted { margin: 4px 0 20px; }
.auth-card .script { font-family: "Great Vibes", cursive; font-size: 34px; color: var(--primary); font-weight: 400; margin: 0; }

/* Finance */
.period-bar { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px 16px; flex-wrap: wrap; margin-bottom: 16px; }
.period-bar .tabs { margin: 0; }
.period-custom { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; }
.period-custom label { font-size: 12px; color: var(--muted); font-weight: 600; display: flex; flex-direction: column; gap: 3px; }
.period-custom input { padding: 6px 8px; font-size: 13.5px; }
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.table th.num { text-align: right; }
.nowrap { white-space: nowrap; }
.pos { color: var(--green); }
.neg { color: var(--red); }
.fbar { display: block; position: relative; height: 18px; margin: 2px 0; border-radius: 5px; background: var(--grey-soft); overflow: hidden; }
.fbar::before { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--w, 0%); border-radius: 5px; }
.fbar-in::before { background: #8fd1a9; }
.fbar-out::before { background: #f0a8a0; }
.fbar em { position: relative; font-style: normal; font-size: 11.5px; font-weight: 600; padding-left: 6px; line-height: 18px; color: #3b2a2a; }
.month-table td.bars { width: 60%; min-width: 150px; }
.legend { display: flex; align-items: center; gap: 6px; margin: 10px 0 0; }
.key { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.key-in { background: #8fd1a9; }
.key-out { background: #f0a8a0; margin-left: 10px; }
.breakdown { list-style: none; margin: 0; padding: 0; }
.breakdown li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.breakdown li:last-child { border-bottom: 0; }
.breakdown .fbar { grid-column: 1 / -1; height: 6px; margin: 4px 0 0; }
.ledger .badge { margin-right: 4px; }
.type-switch { display: flex; gap: 8px; margin-bottom: 4px; }
.type-switch .choice-card { flex-direction: row; padding: 10px 18px; font-size: 14px; font-weight: 600; }
.receipt-current { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.receipt-current img { max-height: 90px; border-radius: 8px; border: 1px solid var(--border); }
.danger-zone { margin-top: 16px; }

@media (min-width: 641px) and (max-width: 1100px) {
  .nav a:not(.active) span { display: none; }
}
@media (max-width: 960px) {
  .user-name { display: none; }
  .nav a { padding: 8px 9px; }
  .stats, .stats-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2, .grid-wide-left { grid-template-columns: minmax(0, 1fr); }
  .row-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; padding: 10px 16px; gap: 8px; }
  .brand-mark-img { height: 28px; }
  .brand-word { height: 20px; }
  .brand-sub { display: none; }
  .nav { order: 3; width: 100%; flex: none; }
  .nav a span { font-size: 13px; }
  .userbox { margin-left: auto; }
  .user-name { display: none; }
  .content { padding: 18px 16px 80px; }
  h1 { font-size: 22px; }
  .row-2, .row-3 { grid-template-columns: minmax(0, 1fr); }
  .stat-value { font-size: 24px; }
  .stat-value.stat-money { font-size: clamp(15px, 4.6vw, 20px); white-space: nowrap; }
  .period-custom { width: 100%; }
  .month-table td.bars { min-width: 0; width: auto; }
  .month-table th, .month-table td { padding-left: 5px; padding-right: 5px; }
  .month-table td.num { font-size: 12.5px; }
  /* Transactions become small cards on phones */
  .ledger, .ledger tbody { display: block; }
  .ledger thead { display: none; }
  .ledger tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "date amount" "details details" "method actions"; gap: 4px 10px; padding: 12px 0; border-bottom: 1px solid var(--border); }
  .ledger tr:last-child { border-bottom: 0; }
  .ledger td { padding: 0; border: 0; }
  .ledger td:nth-child(1) { grid-area: date; color: var(--muted); font-size: 13px; }
  .ledger td:nth-child(2) { grid-area: details; }
  .ledger td:nth-child(3) { grid-area: method; color: var(--muted); font-size: 12.5px; align-self: center; }
  .ledger td:nth-child(4) { grid-area: amount; font-weight: 700; }
  .ledger td:nth-child(5) { grid-area: actions; }
  .ledger .badge { white-space: normal; }
  .card { padding: 16px; }
  .details { grid-template-columns: 1fr; gap: 2px; }
  .details dd { margin-bottom: 8px; }
  .page-head .head-actions { width: 100%; }
}
