@import url("/fonts.css");

:root {
  --navy: #1C3557;
  --navy-2: #2a4a72;
  --honey: #B8953A;
  --honey-dark: #8a5f2c;
  --bg: #F7F5F1;
  --stone: #EEEAE3;
  --card: #fff;
  --text: #1E2A3A;
  --muted: #5B6778;
  --line: #E3E0DA;
  --ok: #2E7D4F;
  --warn: #C2410C;
  --radius: 12px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.45 Inter, -apple-system, "Segoe UI", sans-serif; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
body:not(.is-matt) .matt-only { display: none !important; }

/* "Soulcraft Receipts": one name, in the Soulcraft site's serif. */
.brand { font-family: "Cormorant Garamond", Georgia, serif; font-weight: 700; font-size: 26px; margin: 0; color: #fff; white-space: nowrap; }
.brand span { color: #efd9b1; }

/* header: name on the left; Matt's menu, language and sign-out on the right */
.top { background: var(--navy); position: sticky; top: 0; z-index: 5; padding-top: env(safe-area-inset-top); }
.top-inner { max-width: 1000px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 16px; }
.top-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.tabs { display: flex; gap: 2px; margin-right: 6px; }
.tabs button { background: none; border: 0; color: rgba(255,255,255,.7); padding: 7px 11px; border-radius: 8px; font-weight: 600; font-size: 15px; cursor: pointer; }
.tabs button:hover { color: #fff; }
.tabs button[aria-selected="true"] { background: rgba(255,255,255,.12); color: #fff; }
.lang { background: none; border: 1px solid rgba(255,255,255,.3); color: #fff; border-radius: 6px; padding: 3px 8px; font-size: 13px; font-weight: 600; cursor: pointer; }
.signout { color: rgba(255,255,255,.7); font-size: 14px; white-space: nowrap; }
@media (max-width: 720px) {
  /* phone: name · language · sign out, then the menu as its own row */
  .top-inner { flex-wrap: wrap; gap: 8px 10px; }
  .top-right { display: contents; }
  .lang { margin-left: auto; }
  .tabs { order: 3; flex-basis: 100%; margin: 0; }
  .tabs button { flex: 1; padding: 8px 4px; }
}

main { max-width: 1000px; margin: 0 auto; padding: 20px 16px 60px; }
h1 { font-size: 22px; margin: 4px 0 16px; color: var(--navy); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
#add .card, #bulk .card { max-width: 560px; }

/* forms */
.form { display: grid; gap: 14px; }
.form label > span { display: block; font-size: 14px; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
input:not([type=file]):not([type=checkbox]), select, textarea {
  width: 100%; padding: 11px 12px; border: 1px solid #cfcac2; border-radius: 9px; background: #fff; font-size: 16px; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--honey); outline-offset: 0; border-color: var(--honey); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .row2 { grid-template-columns: 1fr; } }
button, .button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 14px; border-radius: 9px;
  border: 1px solid #cfcac2; background: #fff; font-weight: 600; cursor: pointer; text-decoration: none; color: var(--text); font-size: 15px; }
button:disabled { opacity: .5; cursor: default; }
button.primary { background: var(--honey); border-color: var(--honey); color: var(--navy); font-size: 17px; padding: 13px; }
button.primary:hover:not(:disabled) { background: #c9a548; }
.error { color: var(--warn); font-weight: 600; margin: 0; }

.file-drop { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  min-height: 150px; border: 2px dashed #cbbf9f; border-radius: var(--radius); background: #fbf9f4; padding: 16px; cursor: pointer; }
.file-drop.over { background: #f4ecd9; border-color: var(--honey); }
.file-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-prompt strong { display: block; font-size: 17px; color: var(--navy); }
.file-prompt small { color: var(--muted); }
.file-drop img { max-height: 220px; max-width: 100%; border-radius: 8px; margin-top: 10px; }
.file-name { margin-top: 8px; font-weight: 600; word-break: break-all; }
.progress { height: 6px; background: var(--stone); border-radius: 3px; overflow: hidden; }
.progress div { height: 100%; width: 0; background: var(--honey); transition: width .2s; }
.done { text-align: center; max-width: 560px; }
.big-check { font-size: 48px; color: var(--ok); margin: 0; }

.bulk-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 14px; }
.bulk-list li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 10px; background: var(--stone); border-radius: 8px; }
.bulk-list .st { font-weight: 600; white-space: nowrap; }
.bulk-list .st.ok { color: var(--ok); } .bulk-list .st.bad { color: var(--warn); }

/* list */
.list-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.list-head h1 { margin: 0; }
.list-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.list-tools input { width: 200px; } .list-tools select { width: auto; }
.bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.check-all { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); margin-right: auto; }
.bar button, .bar .button { padding: 5px 10px; font-size: 13px; border-radius: 7px; }
.bar button.danger:not(:disabled) { color: var(--warn); border-color: #e9b9a3; }
.empty { color: var(--muted); }

.receipts { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.receipt { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: grid; grid-template-columns: auto 1fr auto; gap: 3px 12px; }
.receipt .sel { grid-row: 1 / span 3; margin-top: 4px; }
.r-main { min-width: 0; }
.r-payee { font-weight: 700; color: var(--navy); font-size: 16px; }
.r-sub { color: var(--muted); font-size: 13px; }
.r-amount { text-align: right; font-weight: 700; color: var(--navy); white-space: nowrap; }
.r-amount small { display: block; color: var(--muted); font-weight: 500; font-size: 12px; }
.r-status { grid-column: 2 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--stone); color: var(--muted); }
.chip.ok { background: #e3f1e8; color: var(--ok); }
.chip.warn { background: #fbe9df; color: var(--warn); }
.chip.busy { background: #e6edf6; color: var(--navy-2); }
.chip.honey { background: #f4ecd9; color: var(--honey-dark); }
/* small actions: two quiet links and a ⋯ menu */
.r-actions { grid-column: 2 / -1; display: flex; align-items: center; gap: 12px; margin-top: 2px; font-size: 13px; }
.act { color: var(--navy-2); font-weight: 600; text-decoration: none; }
.act:hover { text-decoration: underline; }
.act.dl { color: var(--honey-dark); }
.more { position: relative; }
.more summary { list-style: none; cursor: pointer; color: var(--muted); font-weight: 700; padding: 0 6px; border-radius: 6px; line-height: 20px; }
.more summary::-webkit-details-marker { display: none; }
.more summary:hover, .more[open] summary { background: var(--stone); }
.more .menu { position: absolute; left: 0; top: 24px; z-index: 3; min-width: 170px; background: #fff; border: 1px solid var(--line);
  border-radius: 10px; box-shadow: 0 6px 20px rgba(28,53,87,.15); padding: 4px; display: grid; }
.more .menu a, .more .menu button { display: block; text-align: left; border: 0; background: none; padding: 7px 10px; border-radius: 6px;
  font-size: 13.5px; font-weight: 500; color: var(--text); text-decoration: none; cursor: pointer; }
.more .menu a:hover, .more .menu button:hover { background: var(--stone); }
.more .menu .danger { color: var(--warn); }
.r-error { grid-column: 2 / -1; font-size: 12.5px; color: var(--warn); }
.r-note { grid-column: 2 / -1; font-size: 12.5px; color: var(--muted); }

dialog { border: 0; border-radius: var(--radius); padding: 20px; width: min(480px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(28,53,87,.4); }
dialog h2 { margin: 0; color: var(--navy); font-size: 19px; }
dialog p { margin: 0; color: var(--muted); font-size: 14px; }
.dialog-buttons { display: flex; gap: 8px; justify-content: flex-end; }
.dialog-buttons .primary { font-size: 15px; padding: 10px 14px; }

/* sign-in */
body.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--navy); }
.login-card { width: 100%; max-width: 360px; text-align: center; color: #fff; }
.login-card h1 { font-size: 13px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: rgba(255,255,255,.6); margin: 4px 0 28px; }
.login-card .brand { font-size: 34px; margin-bottom: 28px; }
.login-card form { display: grid; gap: 12px; text-align: left; }
.login-card label { font-size: 13px; font-weight: 600; color: rgba(255,255,255,.75); }
/* (body.login … so it wins over the general white-input rule above) */
body.login .login-card input { background: #fff; border-color: #fff; color: var(--text); font-size: 17px; padding-right: 48px; }
.pw-wrap { position: relative; }
.pw-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); background: none; border: 0; padding: 6px 8px;
  font-size: 18px; line-height: 1; cursor: pointer; opacity: .6; }
.pw-eye:hover { opacity: 1; }
.login-card button[type=submit] { background: var(--honey); border-color: var(--honey); color: var(--navy); font-size: 16px; padding: 12px; }
.notice { background: rgba(184,149,58,.18); border: 1px solid rgba(184,149,58,.6); border-radius: 10px; padding: 10px 14px; margin-bottom: 16px; font-size: 14px; }
