/* ==========================================================
   DA Interior & Exterior — white · gold · soft blue glass UI
   ========================================================== */
:root {
  --gold: #b8732f;
  --gold-d: #8f541e;
  --gold-l: #e9b877;
  --gold-grad: linear-gradient(135deg, #9a5a22 0%, #c9853f 35%, #f1c98c 55%, #c07a35 75%, #9a5a22 100%);
  --blue: #2f6bd8;
  --blue-soft: #e9f0fd;
  --ink: #1f1d1b;
  --ink-2: #57524c;
  --muted: #8d867e;
  --line: rgba(184, 115, 47, .16);
  --bg: #fbf8f3;
  --glass: rgba(255, 255, 255, .62);
  --glass-strong: rgba(255, 255, 255, .82);
  --glass-border: rgba(255, 255, 255, .85);
  --shadow: 0 10px 30px -12px rgba(120, 80, 30, .22), 0 2px 6px -2px rgba(120, 80, 30, .08);
  --shadow-lg: 0 24px 60px -20px rgba(90, 60, 20, .35);
  --green: #1f9d63;
  --red: #d64545;
  --amber: #d68a1a;
  --r: 18px;
  --r-sm: 12px;
  --nav-h: 68px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--sans); color: var(--ink); background: var(--bg);
  font-size: 15px; line-height: 1.45; min-height: 100vh; overflow-x: clip;
  animation: pageIn .45s var(--ease);
}
body.leaving { opacity: 0; transform: translateY(6px); transition: .2s ease; }
a { color: var(--blue); text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; }
small { color: var(--muted); }
.ic { width: 20px; height: 20px; flex: none; }
.hide { display: none !important; }
.muted { color: var(--muted); }
.text-r { text-align: right; }
.green { color: var(--green); } .red { color: var(--red); } .gold { color: var(--gold); } .blue { color: var(--blue); }
.mt { margin-top: 16px; } .mb { margin-bottom: 16px; } .mt-s { margin-top: 8px; }

/* ---------- Background art ---------- */
.bg-art { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none;
  background: radial-gradient(1200px 600px at 100% -10%, #fff 0%, transparent 60%), linear-gradient(180deg, #fdfbf7, #f7f1e8); }
.bg-art i { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55; animation: float 18s ease-in-out infinite alternate; }
.bg-art i:nth-child(1) { width: 380px; height: 380px; background: #f3d3a3; top: -120px; left: -100px; }
.bg-art i:nth-child(2) { width: 320px; height: 320px; background: #cfdcf7; top: 35%; right: -140px; animation-delay: -6s; }
.bg-art i:nth-child(3) { width: 300px; height: 300px; background: #f6e2c4; bottom: -120px; left: 20%; animation-delay: -12s; }

/* ---------- Glass ---------- */
.glass, .card, .item, .stat, .empty, .topbar, .bottomnav, .sheet-panel, .sidebar {
  background: var(--glass);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
}

/* ---------- Layout ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px; border-radius: 0 0 22px 22px; border-top: 0;
}
.top-logo img { width: 40px; height: 40px; object-fit: contain; }
.top-title { flex: 1; min-width: 0; }
.top-title h1 { font-family: var(--serif); font-size: 24px; line-height: 1.1; letter-spacing: .2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-title small { display: block; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-actions { display: flex; gap: 6px; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: var(--ink);
  background: var(--glass-strong); border: 1px solid var(--line); cursor: pointer; transition: .2s var(--ease); }
.icon-btn:active { transform: scale(.92); }
.icon-btn.gold { color: #fff; background: var(--gold-grad); border: 0; }

.main { padding: 16px 16px calc(var(--nav-h) + 40px + env(safe-area-inset-bottom)); max-width: 1180px; margin: 0 auto; }

.sidebar { display: none; }

@media (min-width: 1024px) {
  .sidebar { display: flex; flex-direction: column; position: fixed; inset: 14px auto 14px 14px; width: 250px; border-radius: 24px; padding: 18px 12px; z-index: 40; overflow-y: auto; }
  .brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; color: var(--ink); border-bottom: 1px solid var(--line); margin-bottom: 10px; }
  .brand img { width: 46px; height: 46px; object-fit: contain; }
  .brand b { font-family: var(--serif); font-size: 24px; display: block; line-height: 1; background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
  .brand small { font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; }
  .sidebar nav a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; color: var(--ink-2); font-weight: 500; transition: .2s var(--ease); margin-bottom: 2px; }
  .sidebar nav a:hover { background: rgba(255, 255, 255, .7); color: var(--ink); transform: translateX(3px); }
  .sidebar nav a.on { background: var(--gold-grad); color: #fff; box-shadow: 0 8px 20px -8px rgba(184, 115, 47, .7); }
  .topbar, .main { margin-left: 278px; }
  .topbar { margin-top: 14px; margin-right: 14px; border-radius: 20px; border-top: 1px solid var(--glass-border); padding-top: 12px; }
  .top-logo { display: none; }
  .bottomnav { display: none !important; }
  .main { padding-bottom: 40px; }
}

/* ---------- Bottom nav ---------- */
.bottomnav {
  position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 50;
  height: var(--nav-h); border-radius: 24px; display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
  background: rgba(255, 255, 255, .78);
}
.bottomnav a, .bottomnav button { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--muted); background: none; border: 0; font-family: inherit; cursor: pointer; padding: 6px 0; transition: .25s var(--ease); }
.bottomnav a .ic, .bottomnav > button:not(.fab) .ic { width: 22px; height: 22px; }
.bottomnav a.on { color: var(--gold); }
.bottomnav a.on .ic { transform: translateY(-2px); }
.bottomnav .fab { justify-self: center; width: 60px; height: 60px; border-radius: 20px; color: #fff; background: var(--gold-grad); background-size: 200% 200%;
  box-shadow: 0 12px 26px -8px rgba(184, 115, 47, .8), inset 0 1px 0 rgba(255, 255, 255, .5); transform: translateY(-18px); animation: shimmer 6s ease infinite; }
.bottomnav .fab .ic { width: 28px; height: 28px; stroke-width: 2.2; transition: transform .35s var(--ease); }
.bottomnav .fab:active { transform: translateY(-18px) scale(.92); }
body.sheet-open .bottomnav .fab .ic { transform: rotate(45deg); }

/* ---------- Sheets (bottom sheet on mobile, modal on desktop) ---------- */
.sheet { position: fixed; inset: 0; z-index: 80; display: flex; align-items: flex-end; justify-content: center; background: rgba(40, 28, 12, .28);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); opacity: 0; pointer-events: none; transition: opacity .3s ease; }
.sheet.open { opacity: 1; pointer-events: auto; }
.sheet-panel { width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto; border-radius: 28px 28px 0 0; padding: 10px 18px calc(22px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, .9); transform: translateY(100%); transition: transform .45s var(--ease); }
.sheet.open .sheet-panel { transform: none; }
.sheet-handle { width: 44px; height: 5px; border-radius: 9px; background: rgba(0, 0, 0, .14); margin: 0 auto 14px; }
.sheet h3 { font-family: var(--serif); font-size: 24px; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
@media (min-width: 700px) {
  .sheet { align-items: center; }
  .sheet-panel { border-radius: 26px; transform: translateY(30px) scale(.96); opacity: 0; transition: .35s var(--ease); }
  .sheet.open .sheet-panel { transform: none; opacity: 1; }
  .sheet-handle { display: none; }
}

.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.tile { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; color: var(--ink); font-size: 12px; padding: 12px 4px; border-radius: 16px;
  transition: .2s var(--ease); opacity: 0; }
.sheet.open .tile { animation: rise .45s var(--ease) forwards; animation-delay: calc(var(--i) * 35ms); }
.tile span { width: 50px; height: 50px; border-radius: 16px; display: grid; place-items: center; background: linear-gradient(145deg, #fff, #f6ece0); border: 1px solid var(--line); color: var(--gold); box-shadow: var(--shadow); }
.tile:nth-child(3n+2) span { color: var(--blue); background: linear-gradient(145deg, #fff, var(--blue-soft)); }
.tile b { font-weight: 600; line-height: 1.2; }
.tile:active { transform: scale(.94); }

/* ---------- Cards ---------- */
.card { border-radius: var(--r); padding: 16px; margin-bottom: 14px; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-h h3, .sec-h h2 { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.card-h h3 .ic { color: var(--gold); }
.sec-h { display: flex; align-items: center; justify-content: space-between; margin: 22px 2px 10px; }
.sec-h a { font-size: 13px; font-weight: 600; }

.hero { border-radius: 24px; padding: 20px; margin-bottom: 14px; color: #fff; position: relative; overflow: hidden;
  background: linear-gradient(135deg, #2a2118 0%, #4a3420 55%, #8f541e 100%); box-shadow: var(--shadow-lg); }
.hero::after { content: ""; position: absolute; inset: -40% -20% auto auto; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, rgba(241, 201, 140, .55), transparent 65%); }
.hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .12) 50%, transparent 70%); background-size: 250% 100%; animation: sheen 5s ease-in-out infinite; }
.hero small { color: rgba(255, 255, 255, .7); text-transform: uppercase; letter-spacing: 1.4px; font-size: 11px; }
.hero .big { font-family: var(--serif); font-size: 38px; font-weight: 700; line-height: 1.1; margin: 4px 0 12px; background: linear-gradient(90deg, #fff, #f6d8a8); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .accs { display: flex; gap: 8px; overflow-x: auto; position: relative; z-index: 1; scrollbar-width: none; }
.hero .accs a { flex: none; color: #fff; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .18); border-radius: 12px; padding: 8px 12px; font-size: 12px; }
.hero .accs a b { display: block; font-size: 14px; }

.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 14px; }
@media (min-width: 800px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { border-radius: var(--r); padding: 14px; position: relative; overflow: hidden; display: block; color: var(--ink); transition: .25s var(--ease); }
.stat:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.stat .si { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; margin-bottom: 10px; color: var(--gold); background: #fbf1e4; }
.stat.blue .si { color: var(--blue); background: var(--blue-soft); }
.stat.red .si { color: var(--red); background: #fdeaea; }
.stat.green .si { color: var(--green); background: #e5f6ee; }
.stat small { display: block; font-size: 12px; font-weight: 500; }
.stat b { font-size: 18px; font-weight: 700; letter-spacing: -.2px; }

/* ---------- Lists ---------- */
.list { display: grid; gap: 10px; }
@media (min-width: 800px) { .list.cols { grid-template-columns: repeat(2, 1fr); } }
.item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; color: var(--ink); transition: transform .2s var(--ease), box-shadow .2s; position: relative; }
a.item:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
a.item:active { transform: scale(.985); }
.av { width: 44px; height: 44px; border-radius: 14px; flex: none; display: grid; place-items: center; font-weight: 700; font-size: 14px; color: var(--gold-d);
  background: linear-gradient(145deg, #fff6ea, #f1dcc0); border: 1px solid var(--line); }
.av.blue { color: var(--blue); background: linear-gradient(145deg, #f4f8ff, #dbe6fb); }
.av.green { color: var(--green); background: linear-gradient(145deg, #f0fbf6, #d4f0e2); }
.av.red { color: var(--red); background: linear-gradient(145deg, #fff4f4, #f8d9d9); }
.av img { width: 100%; height: 100%; object-fit: cover; border-radius: 13px; }
.item .meta { flex: 1; min-width: 0; }
.item .meta b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .meta small { display: block; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .end { text-align: right; flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.item .end b { font-weight: 700; font-size: 14px; }
.item .acts { display: flex; gap: 6px; }

/* ---------- Badges / chips ---------- */
.badge { --c: var(--muted); display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 99px; font-size: 11px; font-weight: 600;
  color: var(--c); background: color-mix(in srgb, var(--c) 12%, white); border: 1px solid color-mix(in srgb, var(--c) 25%, transparent); white-space: nowrap; }
.badge.blue { --c: var(--blue); } .badge.green { --c: var(--green); } .badge.red { --c: var(--red); }
.badge.amber { --c: var(--amber); } .badge.gold { --c: var(--gold); } .badge.muted { --c: #8d867e; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 10px; margin: 0 -16px 4px; padding-left: 16px; padding-right: 16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 8px 14px; border-radius: 99px; font-size: 13px; font-weight: 600; color: var(--ink-2); background: var(--glass-strong); border: 1px solid var(--line); transition: .2s var(--ease); white-space: nowrap; cursor: pointer; }
.chip.on { color: #fff; background: var(--gold-grad); border-color: transparent; box-shadow: 0 6px 16px -6px rgba(184, 115, 47, .7); }
.chip .n { opacity: .7; margin-left: 4px; }

/* ---------- Tabs (segmented) ---------- */
.tabs { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: rgba(255, 255, 255, .55); border: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; margin-bottom: 14px; position: sticky; top: 72px; z-index: 20; -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: 1 0 auto; border: 0; background: none; padding: 9px 14px; border-radius: 10px; font: 600 13px var(--sans); color: var(--ink-2); cursor: pointer; transition: .25s var(--ease); white-space: nowrap; }
.tabs button.on { background: #fff; color: var(--gold-d); box-shadow: 0 4px 12px -4px rgba(120, 80, 30, .3); }
.tab-pane { display: none; }
.tab-pane.on { display: block; animation: rise .4s var(--ease); }

/* ---------- Buttons ---------- */
.btn { position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 18px; border-radius: 14px;
  font: 600 14px var(--sans); border: 1px solid transparent; cursor: pointer; transition: transform .15s var(--ease), box-shadow .2s, filter .2s; text-decoration: none; white-space: nowrap; color: var(--ink); background: var(--glass-strong); }
.btn:active { transform: scale(.97); }
.btn-gold { color: #fff; background: var(--gold-grad); background-size: 200% 200%; box-shadow: 0 10px 22px -10px rgba(184, 115, 47, .9), inset 0 1px 0 rgba(255, 255, 255, .4); animation: shimmer 8s ease infinite; }
.btn-gold:hover { filter: brightness(1.05); }
.btn-blue { color: #fff; background: linear-gradient(135deg, #2f6bd8, #5a8ef0); box-shadow: 0 10px 22px -10px rgba(47, 107, 216, .8); }
.btn-ghost { background: rgba(255, 255, 255, .7); border-color: var(--line); color: var(--ink); }
.btn-wa { color: #fff; background: linear-gradient(135deg, #1ea952, #25d366); box-shadow: 0 10px 22px -10px rgba(37, 211, 102, .8); }
.btn-danger { color: var(--red); background: #fff5f5; border-color: #f4d4d4; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 13px; border-radius: 11px; }
.btn-sm .ic { width: 17px; height: 17px; }
.btn-block { width: 100%; margin-top: 10px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-row > * { flex: 1 1 auto; }
.ripple { position: absolute; border-radius: 50%; transform: scale(0); background: rgba(255, 255, 255, .55); animation: ripple .6s ease-out; pointer-events: none; }
.actions-bar { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 12px; scrollbar-width: none; }
.actions-bar::-webkit-scrollbar { display: none; }
.actions-bar .btn { flex: none; }

/* ---------- Forms ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin: 0 0 6px 2px; }
.field label .req { color: var(--red); }
input, select, textarea { width: 100%; font: 500 16px var(--sans); color: var(--ink); background: rgba(255, 255, 255, .85); border: 1.5px solid rgba(184, 115, 47, .18);
  border-radius: 13px; padding: 12px 14px; min-height: 48px; outline: none; transition: border-color .2s, box-shadow .2s; -webkit-appearance: none; appearance: none; }
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%23b8732f' stroke-width='2'%3E%3Cpath d='m1 1 5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(184, 115, 47, .14); background: #fff; }
input[type=checkbox], input[type=radio] { width: auto; min-height: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 10px; }
@media (max-width: 380px) { .grid3 { grid-template-columns: 1fr 1fr; } }
.hint { font-size: 12px; color: var(--muted); margin-top: 5px; }

.form-actions { position: sticky; bottom: calc(var(--nav-h) + 18px + env(safe-area-inset-bottom)); z-index: 25; display: flex; gap: 10px; padding: 10px; margin-top: 16px; border-radius: 18px;
  background: rgba(255, 255, 255, .8); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border: 1px solid var(--glass-border); box-shadow: var(--shadow-lg); }
.form-actions .btn { flex: 1; }
@media (min-width: 1024px) { .form-actions { bottom: 14px; } }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; border-radius: 14px; background: rgba(255, 255, 255, .6); border: 1px solid var(--line); }
.seg input { display: none; }
.seg label { margin: 0; text-align: center; padding: 10px 6px; border-radius: 10px; font-size: 13px; font-weight: 600; color: var(--ink-2); cursor: pointer; transition: .25s var(--ease); }
.seg input:checked + label { background: var(--gold-grad); color: #fff; box-shadow: 0 6px 14px -6px rgba(184, 115, 47, .8); }

.search { position: relative; margin-bottom: 12px; }
.search .ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input { padding-left: 44px; border-radius: 16px; background: var(--glass-strong); }

/* line items editor */
.line { position: relative; padding: 12px; border-radius: 16px; background: rgba(255, 255, 255, .7); border: 1px solid var(--line); margin-bottom: 10px; animation: rise .35s var(--ease); }
.line .ln-top { display: flex; gap: 8px; align-items: flex-start; }
.line .ln-top textarea { min-height: 48px; flex: 1; }
.line .ln-n { width: 26px; height: 26px; border-radius: 8px; background: var(--gold-grad); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; flex: none; margin-top: 11px; }
.line .ln-grid { display: grid; grid-template-columns: 1fr .8fr 1.2fr 1.2fr; gap: 8px; margin-top: 8px; }
.line .ln-grid label { font-size: 11px; font-weight: 600; color: var(--muted); display: block; margin: 0 0 4px 2px; }
.line .ln-grid input { padding: 10px; min-height: 44px; font-size: 15px; }
.line .ln-amt { font-weight: 700; min-height: 44px; display: flex; align-items: center; justify-content: flex-end; padding-right: 4px; color: var(--gold-d); }
.line .del { flex: none; width: 36px; height: 36px; margin-top: 6px; border-radius: 10px; border: 0; background: #fff1f1; color: var(--red); display: grid; place-items: center; cursor: pointer; }
@media (max-width: 420px) { .line .ln-grid { grid-template-columns: 1fr 1fr; } }

.totals { border-radius: 16px; padding: 12px 14px; background: linear-gradient(135deg, rgba(255, 255, 255, .9), rgba(251, 241, 228, .9)); border: 1px solid var(--line); }
.totals .r { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; gap: 10px; }
.totals .r input { max-width: 150px; text-align: right; min-height: 40px; padding: 8px 10px; }
.totals .r.grand { border-top: 1px dashed rgba(184, 115, 47, .35); margin-top: 6px; padding-top: 10px; font-size: 18px; font-weight: 700; color: var(--gold-d); }

/* key-value */
.kv { display: grid; gap: 0; }
.kv > div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid rgba(184, 115, 47, .1); font-size: 14px; }
.kv > div:last-child { border-bottom: 0; }
.kv span { color: var(--muted); }
.kv b { text-align: right; font-weight: 600; }
.kv .big b { font-size: 17px; }

/* progress bar */
.progress { height: 8px; border-radius: 9px; background: rgba(184, 115, 47, .12); overflow: hidden; }
.progress i { display: block; height: 100%; border-radius: 9px; background: var(--gold-grad); width: 0; transition: width 1.2s var(--ease); }
.progress.blue i { background: linear-gradient(90deg, #2f6bd8, #79a5f5); }

/* stage stepper */
.stepper { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
.stepper::-webkit-scrollbar { display: none; }
.stepper .st { flex: 1 0 auto; min-width: 74px; text-align: center; font-size: 11px; font-weight: 600; color: var(--muted); }
.stepper .st i { display: block; height: 6px; border-radius: 6px; background: rgba(184, 115, 47, .14); margin-bottom: 6px; }
.stepper .st.done i { background: var(--gold-grad); }
.stepper .st.cur { color: var(--gold-d); }
.stepper .st.cur i { background: var(--gold-grad); box-shadow: 0 0 0 3px rgba(184, 115, 47, .2); animation: pulse 2s infinite; }

/* timeline */
.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(var(--gold-l), rgba(184, 115, 47, .1)); }
.tl { position: relative; padding: 0 0 16px; }
.tl::before { content: ""; position: absolute; left: -20px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 3px solid var(--c, var(--gold)); }
.tl b { display: block; font-size: 14px; }
.tl small { display: block; }
.tl p { margin: 4px 0 0; font-size: 13px; color: var(--ink-2); }

/* gallery */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
@media (min-width: 700px) { .gallery { grid-template-columns: repeat(5, 1fr); } }
.gallery .g { position: relative; aspect-ratio: 1; border-radius: 14px; overflow: hidden; background: #f3ebe0; cursor: zoom-in; animation: pop .4s var(--ease) both; }
.gallery .g img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s var(--ease); }
.gallery .g:hover img { transform: scale(1.06); }
.gallery .g .badge { position: absolute; left: 6px; bottom: 6px; background: rgba(255, 255, 255, .9); }
.gallery .g .gdel { position: absolute; right: 6px; top: 6px; width: 28px; height: 28px; border-radius: 9px; border: 0; background: rgba(255, 255, 255, .9); color: var(--red); display: grid; place-items: center; cursor: pointer; }
.gallery .g .gdel .ic { width: 16px; height: 16px; }
.upload-box { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 20px; border-radius: 16px; border: 2px dashed rgba(184, 115, 47, .35); background: rgba(255, 255, 255, .5); color: var(--gold-d); font-weight: 600; cursor: pointer; text-align: center; transition: .2s; }
.upload-box:hover { background: rgba(255, 255, 255, .8); }
.upload-box .ic { width: 30px; height: 30px; }
.upload-box input { display: none; }
.up-progress { margin-top: 10px; display: none; }
.up-progress.on { display: block; }

.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(15, 10, 5, .92); display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: .3s; }
.lightbox.open { opacity: 1; pointer-events: auto; }
.lightbox img { max-width: 94vw; max-height: 86vh; border-radius: 10px; transform: scale(.94); transition: .35s var(--ease); }
.lightbox.open img { transform: none; }
.lightbox .lb-x { position: absolute; top: calc(14px + env(safe-area-inset-top)); right: 14px; color: #fff; background: rgba(255, 255, 255, .15); border: 0; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; }
.lightbox .lb-cap { position: absolute; bottom: 24px; left: 0; right: 0; text-align: center; color: #fff; font-size: 14px; }

/* empty */
.empty { border-radius: var(--r); padding: 30px 20px; text-align: center; color: var(--muted); }
.empty .ic { width: 42px; height: 42px; color: var(--gold-l); margin: 0 auto 8px; }
.empty p { margin: 0 0 12px; }

/* toasts */
.toasts { position: fixed; top: calc(12px + env(safe-area-inset-top)); left: 12px; right: 12px; z-index: 200; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { pointer-events: auto; max-width: 440px; width: 100%; display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 16px; font-weight: 600; font-size: 14px;
  background: rgba(255, 255, 255, .92); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); box-shadow: var(--shadow-lg); border: 1px solid var(--glass-border); animation: toastIn .5s var(--ease); }
.toast .ic { color: var(--green); }
.toast.error .ic { color: var(--red); }
.toast.out { animation: toastOut .35s ease forwards; }

/* login */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.login-card { width: 100%; max-width: 400px; border-radius: 28px; padding: 28px 24px; text-align: center; animation: pop .6s var(--ease); }
.login-card img { width: 170px; margin: 0 auto 10px; animation: rise .8s var(--ease); }
.login-card h2 { font-family: var(--serif); font-size: 26px; margin-bottom: 4px; }
.login-card form { text-align: left; margin-top: 20px; }

/* tables (desktop detail) */
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); padding: 8px 6px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 10px 6px; border-bottom: 1px solid rgba(184, 115, 47, .08); vertical-align: top; }
.tbl .r { text-align: right; white-space: nowrap; }
.scroll-x { overflow-x: auto; }

.two-col { display: grid; gap: 14px; }
.two-col > *, .stats > *, .list > *, .grid2 > *, .grid3 > * { min-width: 0; }
@media (min-width: 1024px) { .two-col { grid-template-columns: 1.4fr 1fr; align-items: start; } }

.alloc-row { display: grid; grid-template-columns: 1fr 90px 36px; gap: 8px; align-items: center; margin-bottom: 8px; animation: rise .3s var(--ease); }
.alloc-row input, .alloc-row select { min-height: 44px; padding: 10px; }
.alloc-row .amt { grid-column: 1 / -1; font-size: 12px; color: var(--gold-d); font-weight: 600; margin: -4px 0 4px 4px; }
.alloc-row .del { width: 36px; height: 36px; border-radius: 10px; border: 0; background: #fff1f1; color: var(--red); display: grid; place-items: center; cursor: pointer; }

.check { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--gold); }

/* stagger entry */
.fx { opacity: 0; animation: rise .55s var(--ease) forwards; animation-delay: calc(var(--i, 0) * 45ms); }

/* ---------- Animations ---------- */
@keyframes pageIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }
@keyframes float { from { transform: translate(0, 0) scale(1); } to { transform: translate(40px, 30px) scale(1.15); } }
@keyframes shimmer { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
@keyframes sheen { 0% { background-position: 150% 0; } 60%, 100% { background-position: -100% 0; } }
@keyframes ripple { to { transform: scale(4); opacity: 0; } }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 3px rgba(184, 115, 47, .25); } 50% { box-shadow: 0 0 0 6px rgba(184, 115, 47, .05); } }
@keyframes toastIn { from { opacity: 0; transform: translateY(-20px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-16px); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } .fx, .tile { opacity: 1; } }
