:root {
  --ink: #17231f;
  --muted: #68756f;
  --green-950: #092d28;
  --green-900: #123b35;
  --green-800: #1d574d;
  --green-700: #287064;
  --green-100: #dcefe9;
  --green-50: #eef8f4;
  --gold: #d9a74e;
  --gold-soft: #fff4dc;
  --blue-soft: #e8f1f6;
  --danger: #b44747;
  --danger-soft: #fff0f0;
  --bg: #f5f7f6;
  --panel: #ffffff;
  --line: #dfe6e3;
  --shadow: 0 18px 48px rgba(17, 48, 42, .10);
  --radius: 20px;
  --sidebar: 244px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body { min-width: 320px; min-height: 100vh; margin: 0; background: var(--bg); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
h1, h2, h3, p { margin-top: 0; }
.hidden { display: none !important; }

.loading-screen { position: fixed; z-index: 500; inset: 0; display: grid; place-items: center; align-content: center; gap: 9px; color: var(--green-900); background: var(--bg); }
.loading-screen strong { font-size: 1.35rem; }
.loading-screen span { color: var(--muted); font-size: .8rem; }
.brand-mark { width: 40px; height: 40px; display: grid; place-items: center; color: white; background: linear-gradient(145deg, var(--green-700), var(--green-950)); border-radius: 12px; box-shadow: 0 10px 26px rgba(9,45,40,.24); font-family: Georgia, serif; font-size: 1.35rem; font-weight: 900; }
.brand { display: flex; align-items: center; gap: 11px; }
.brand > span:last-child { display: grid; }
.brand b { font-family: Georgia, serif; font-size: 1.15rem; letter-spacing: -.02em; }
.brand small { margin-top: 1px; color: var(--muted); font-size: .61rem; }
.brand-light { color: white; }
.brand-light small { color: rgba(255,255,255,.68); }

.auth-screen { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, 1.1fr) minmax(430px, .9fr); }
.auth-story { position: relative; min-height: 100vh; overflow: hidden; padding: clamp(34px, 6vw, 72px); color: white; background: radial-gradient(circle at 80% 20%, rgba(70,148,130,.42), transparent 36%), linear-gradient(145deg, #0a2e29, #174c43 65%, #0a2e29); }
.auth-story::after { content: ""; position: absolute; right: -120px; bottom: -160px; width: 500px; height: 500px; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; box-shadow: 0 0 0 58px rgba(255,255,255,.025), 0 0 0 116px rgba(255,255,255,.025); }
.auth-copy { position: relative; z-index: 1; max-width: 610px; margin: clamp(90px, 15vh, 170px) 0 0; }
.eyebrow { margin-bottom: 10px; color: #c8e8df; font-size: .68rem; font-weight: 850; letter-spacing: .13em; text-transform: uppercase; }
.eyebrow.dark { color: var(--green-700); }
.auth-copy h1 { max-width: 650px; margin-bottom: 20px; font-family: Georgia, serif; font-size: clamp(2.7rem, 5.4vw, 5.2rem); font-weight: 600; line-height: .98; letter-spacing: -.055em; }
.auth-copy > p:not(.eyebrow) { max-width: 570px; color: rgba(255,255,255,.76); font-size: 1rem; line-height: 1.7; }
.auth-copy ul { display: grid; gap: 12px; margin: 28px 0 0; padding: 0; list-style: none; color: rgba(255,255,255,.88); font-size: .86rem; }
.auth-copy li { display: flex; align-items: center; gap: 9px; }
.auth-copy li span { width: 23px; height: 23px; display: grid; place-items: center; color: var(--green-950); background: #c8e8df; border-radius: 50%; font-weight: 900; }
.receipt-teaser { position: absolute; z-index: 1; right: 7%; bottom: 6%; width: 230px; padding: 23px; color: var(--ink); background: #fffdf7; border-radius: 4px; box-shadow: 0 25px 60px rgba(0,0,0,.32); transform: rotate(-4deg); font-size: .69rem; }
.receipt-teaser div, .receipt-teaser p, .receipt-teaser strong { display: flex; justify-content: space-between; gap: 12px; }
.receipt-teaser hr { border: 0; border-top: 1px dashed #acb4b0; }
.receipt-teaser p { margin: 8px 0; }
.auth-panel { min-height: 100vh; display: grid; place-items: center; align-content: center; padding: 42px; background: #f8faf9; }
.auth-card { width: min(520px, 100%); padding: clamp(26px, 4vw, 44px); background: white; border: 1px solid var(--line); border-radius: 26px; box-shadow: var(--shadow); }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-bottom: 32px; padding: 5px; background: var(--bg); border-radius: 13px; }
.auth-tabs button { min-height: 42px; border: 0; border-radius: 9px; color: var(--muted); background: transparent; font-size: .8rem; font-weight: 800; }
.auth-tabs button.active { color: var(--green-900); background: white; box-shadow: 0 4px 14px rgba(13,52,45,.10); }
.auth-form { display: grid; gap: 17px; }
.form-intro { margin-bottom: 3px; }
.form-intro h2 { margin-bottom: 6px; font-family: Georgia, serif; font-size: 1.75rem; }
.form-intro p { margin: 0; color: var(--muted); font-size: .81rem; }
.auth-note { width: min(480px, 100%); margin: 16px 0 0; color: #8a9591; text-align: center; font-size: .68rem; line-height: 1.5; }

.field-grid { display: grid; gap: 17px; }
.field-grid.two { grid-template-columns: 1fr 1fr; }
.field { display: grid; gap: 7px; }
.field > span { color: #34453f; font-size: .74rem; font-weight: 780; }
.field em { margin-left: 4px; color: #93a09b; font-size: .65rem; font-style: normal; font-weight: 600; }
.field input, .field textarea, .field select, .search-row input, .search-row select, .summary-card input { width: 100%; min-height: 46px; padding: 11px 13px; color: var(--ink); background: white; border: 1px solid #ccd7d2; border-radius: 11px; outline: 0; transition: .16s ease; }
.field textarea { resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus, .search-row input:focus, .search-row select:focus, .summary-card input:focus { border-color: var(--green-700); box-shadow: 0 0 0 3px rgba(40,112,100,.13); }
.form-error { min-height: 0; margin: 0; color: var(--danger); font-size: .73rem; line-height: 1.45; }
.form-error:empty { display: none; }
.button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 17px; border: 1px solid transparent; border-radius: 11px; font-size: .78rem; font-weight: 820; transition: transform .14s ease, opacity .14s ease, background .14s ease; }
.button:hover { transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: .55; transform: none; }
.button.primary { color: white; background: var(--green-900); }
.button.secondary { color: var(--green-900); background: var(--green-50); border-color: #c9ded7; }
.button.quiet { color: var(--muted); background: white; border-color: var(--line); }
.button.light { color: var(--green-950); background: white; }
.button.ghost-light { color: white; background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.28); }
.button.whatsapp { color: white; background: #1f9d5b; }
.button.wide { width: 100%; }
.button.compact { min-height: 38px; padding-inline: 13px; font-size: .72rem; }
.text-button { padding: 0; color: var(--green-700); background: transparent; border: 0; font-size: .72rem; font-weight: 800; }
.text-button.danger { color: var(--danger); }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; z-index: 40; inset: 0 auto 0 0; width: var(--sidebar); display: flex; flex-direction: column; padding: 27px 20px 22px; background: white; border-right: 1px solid var(--line); }
.sidebar .brand { margin: 0 9px 32px; }
.side-nav { display: grid; gap: 5px; }
.side-nav button { min-height: 45px; display: flex; align-items: center; gap: 12px; padding: 0 13px; border: 0; border-radius: 11px; color: #66736e; background: transparent; text-align: left; font-size: .77rem; font-weight: 720; }
.side-nav button span { width: 25px; color: var(--green-700); font-size: 1rem; text-align: center; }
.side-nav button:hover, .side-nav button.active { color: var(--green-900); background: var(--green-50); }
.side-plan { margin-top: auto; padding: 16px; background: linear-gradient(150deg, var(--green-50), #fff); border: 1px solid #d3e4df; border-radius: 15px; }
.side-plan span, .side-plan strong { display: block; }
.side-plan span { color: var(--green-700); font-size: .64rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.side-plan strong { margin: 5px 0 10px; font-size: .75rem; }
.progress { height: 5px; overflow: hidden; background: #d9e5e1; border-radius: 99px; }
.progress i { width: 0; height: 100%; display: block; background: var(--green-700); border-radius: inherit; transition: width .3s ease; }
.side-plan button { margin-top: 11px; padding: 0; color: var(--green-700); background: transparent; border: 0; font-size: .68rem; font-weight: 800; }
.logout-button { min-height: 42px; display: flex; align-items: center; gap: 11px; margin-top: 10px; padding: 0 13px; color: #7c8984; background: transparent; border: 0; border-radius: 11px; font-size: .74rem; font-weight: 700; }
.logout-button:hover { color: var(--danger); background: var(--danger-soft); }
.topbar { position: fixed; z-index: 30; top: 0; right: 0; left: var(--sidebar); height: 72px; display: flex; align-items: center; gap: 18px; padding: 0 30px; background: rgba(255,255,255,.92); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px); }
.top-title { display: grid; }
.top-title strong { font-size: .86rem; }
.top-title small { margin-top: 2px; color: var(--muted); font-size: .65rem; }
.top-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.connection-state { color: #41806e; font-size: .65rem; font-weight: 800; }
.avatar { width: 38px; height: 38px; display: grid; place-items: center; color: white; background: var(--green-800); border: 0; border-radius: 12px; font-size: .78rem; font-weight: 900; }
.icon-button { width: 40px; height: 40px; display: grid; place-items: center; color: var(--green-900); background: white; border: 1px solid var(--line); border-radius: 11px; }
.mobile-menu { display: none; }
.workspace { margin-left: var(--sidebar); padding: 104px 30px 60px; }
.view { display: none; max-width: 1240px; margin: 0 auto; }
.view.active { display: block; }
.mobile-drawer, .bottom-nav { display: none; }

.hero-card { min-height: 310px; display: grid; grid-template-columns: 1.25fr .75fr; align-items: center; overflow: hidden; padding: clamp(30px, 5vw, 58px); color: white; background: radial-gradient(circle at 80% 30%, rgba(80,166,146,.42), transparent 32%), linear-gradient(135deg, var(--green-950), #1b584d); border-radius: 28px; box-shadow: 0 20px 54px rgba(9,45,40,.18); }
.hero-card h1 { max-width: 650px; margin-bottom: 14px; font-family: Georgia, serif; font-size: clamp(2.3rem, 4vw, 4rem); font-weight: 600; line-height: 1.02; letter-spacing: -.045em; }
.hero-card > div > p:not(.eyebrow) { max-width: 610px; margin-bottom: 24px; color: rgba(255,255,255,.72); font-size: .88rem; line-height: 1.7; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-visual { min-height: 220px; display: grid; place-items: center; perspective: 700px; }
.mini-receipt { width: min(250px, 85%); display: grid; gap: 10px; padding: 26px; color: var(--ink); background: #fffdf8; border-radius: 5px; box-shadow: 0 28px 55px rgba(0,0,0,.32); transform: rotate(5deg) rotateY(-7deg); font-size: .72rem; }
.mini-receipt small { color: var(--muted); }
.mini-receipt hr { width: 100%; border: 0; border-top: 1px dashed #aeb8b4; }
.mini-receipt strong { text-align: right; font-size: 1.2rem; }
.mini-receipt em { color: #25805e; font-style: normal; font-weight: 800; }
.section-heading, .page-heading, .panel-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.section-heading { margin: 38px 0 17px; }
.section-heading h2, .panel-head h2 { margin: 0; font-size: 1.12rem; }
.page-heading { align-items: flex-end; margin-bottom: 25px; }
.page-heading h1 { margin-bottom: 7px; font-family: Georgia, serif; font-size: clamp(2rem, 4vw, 3.1rem); letter-spacing: -.035em; }
.page-heading p:last-child, .panel-head p { margin: 5px 0 0; color: var(--muted); font-size: .77rem; }
.chip { padding: 8px 11px; color: var(--green-800); background: var(--green-100); border-radius: 99px; font-size: .67rem; font-weight: 800; white-space: nowrap; }
.chip.warn { color: #8a5d18; background: var(--gold-soft); }
.chip.pro { color: white; background: linear-gradient(135deg, #a97925, #d7a84d); }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }
.stat-card { min-height: 122px; display: flex; align-items: center; gap: 15px; padding: 20px; background: white; border: 1px solid var(--line); border-radius: 17px; }
.stat-icon { width: 47px; height: 47px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 14px; font-weight: 850; }
.stat-icon.green { color: var(--green-800); background: var(--green-100); }
.stat-icon.gold { color: #98641a; background: var(--gold-soft); }
.stat-icon.blue { color: #426d86; background: var(--blue-soft); }
.stat-card small, .stat-card span:last-child { display: block; color: var(--muted); font-size: .65rem; }
.stat-card strong { display: block; margin: 4px 0 1px; font-size: 1.36rem; letter-spacing: -.035em; }
.panel { background: white; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 28px rgba(15,47,41,.035); }
.recent-panel, .history-panel { margin-top: 18px; padding: 24px; }
.panel-head { padding-bottom: 17px; border-bottom: 1px solid var(--line); }
.invoice-list { display: grid; }
.invoice-row { display: grid; grid-template-columns: minmax(150px,1.1fr) minmax(120px,.9fr) minmax(110px,.7fr) minmax(110px,.7fr) auto; gap: 15px; align-items: center; padding: 16px 3px; border-bottom: 1px solid var(--line); }
.invoice-row:last-child { border-bottom: 0; }
.invoice-row strong, .invoice-row small { display: block; }
.invoice-row strong { font-size: .78rem; }
.invoice-row small { margin-top: 3px; color: var(--muted); font-size: .66rem; }
.status-pill { width: fit-content; padding: 6px 9px; color: #8a5d18; background: var(--gold-soft); border-radius: 99px; font-size: .62rem; font-weight: 850; }
.status-pill.paid, .status-pill.approved { color: #286746; background: #e0f2e6; }
.status-pill.pending_review { color: #8a5d18; background: var(--gold-soft); }
.status-pill.rejected { color: var(--danger); background: var(--danger-soft); }
.status-pill.expired, .status-pill.superseded { color: #626d69; background: #edf1ef; }
.row-actions { display: flex; gap: 6px; }
.row-actions button { min-width: 34px; height: 34px; padding: 0 9px; color: var(--green-800); background: white; border: 1px solid var(--line); border-radius: 9px; font-size: .68rem; font-weight: 800; }
.row-actions button.danger { color: var(--danger); }
.empty-state { padding: 42px 18px; color: var(--muted); text-align: center; }
.empty-state i { width: 52px; height: 52px; display: grid; place-items: center; margin: 0 auto 12px; color: var(--green-800); background: var(--green-50); border-radius: 16px; font-style: normal; font-size: 1.3rem; }
.empty-state strong { display: block; color: var(--ink); }
.empty-state p { margin: 6px 0 0; font-size: .72rem; }
.skeleton { min-height: 72px; margin: 10px 0; border-radius: 12px; background: linear-gradient(90deg, #eef2f0, #f8faf9, #eef2f0); background-size: 200% 100%; animation: shine 1.2s infinite linear; }
@keyframes shine { to { background-position: -200% 0; } }

.form-layout, .profile-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 20px; align-items: start; }
.form-main { display: grid; gap: 17px; }
.form-card { padding: 24px; }
.card-title { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 22px; }
.card-title > span { width: 29px; height: 29px; flex: 0 0 auto; display: grid; place-items: center; color: white; background: var(--green-900); border-radius: 9px; font-size: .72rem; font-weight: 850; }
.card-title h2 { margin: 0; font-size: 1rem; }
.card-title p { margin: 4px 0 0; color: var(--muted); font-size: .7rem; }
.card-title.with-action > div { flex: 1; }
.summary-column { position: sticky; top: 92px; display: grid; gap: 14px; }
.summary-card { padding: 23px; }
.summary-card h2 { font-size: 1rem; }
.summary-card dl { margin: 18px 0; }
.summary-card dl > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; color: var(--muted); font-size: .75rem; }
.summary-card dd { margin: 0; color: var(--ink); font-weight: 800; }
.summary-card input { width: 120px; min-height: 38px; padding: 7px 9px; text-align: right; }
.summary-card .grand-total { margin-top: 8px; padding-top: 17px; color: var(--ink); border-top: 1px dashed #bdc9c4; font-size: .92rem; }
.summary-card .grand-total dd { color: var(--green-800); font-size: 1.35rem; }
.summary-hint { padding: 11px; color: var(--muted); background: var(--green-50); border-radius: 10px; font-size: .65rem; line-height: 1.5; }
.item-table-head, .item-row { display: grid; grid-template-columns: minmax(160px,1.6fr) 88px 100px 128px 105px 38px; gap: 8px; align-items: center; }
.item-table-head { padding: 0 2px 8px; color: var(--muted); font-size: .62rem; font-weight: 800; }
.item-row { padding: 10px 0; border-top: 1px solid var(--line); }
.item-row input { width: 100%; min-height: 40px; padding: 8px 9px; border: 1px solid #ccd7d2; border-radius: 9px; outline: 0; }
.item-row input:focus { border-color: var(--green-700); box-shadow: 0 0 0 3px rgba(40,112,100,.1); }
.item-line-total { font-size: .72rem; font-weight: 850; text-align: right; }
.remove-item { width: 36px; height: 36px; display: grid; place-items: center; color: var(--danger); background: var(--danger-soft); border: 0; border-radius: 9px; }
.mobile-add { display: none; margin-top: 11px; }
.check-row { display: flex; align-items: flex-start; gap: 11px; margin-top: 17px; padding: 14px; background: var(--green-50); border-radius: 11px; }
.check-row input { margin-top: 3px; accent-color: var(--green-800); }
.check-row b, .check-row small { display: block; }
.check-row b { font-size: .76rem; }
.check-row small { margin-top: 3px; color: var(--muted); font-size: .66rem; }
.search-row { display: grid; grid-template-columns: 1fr 170px auto; gap: 10px; padding-bottom: 17px; border-bottom: 1px solid var(--line); }
.search-box { position: relative; }
.search-box span { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-box input { padding-left: 36px; }
.pagination { display: flex; justify-content: center; gap: 7px; padding-top: 18px; }
.pagination button { min-width: 34px; height: 34px; color: var(--green-800); background: white; border: 1px solid var(--line); border-radius: 9px; font-size: .68rem; }
.pagination button.active { color: white; background: var(--green-800); }
.upload-row { display: flex; align-items: flex-start; gap: 20px; }
.upload-preview { width: 112px; height: 112px; flex: 0 0 auto; display: grid; place-items: center; overflow: hidden; color: var(--muted); background: var(--bg); border: 1px dashed #96aaa2; border-radius: 17px; text-align: center; font-size: .65rem; }
.upload-preview.qris { border-radius: 9px; }
.upload-preview img { width: 100%; height: 100%; object-fit: contain; background: white; }
.file-button { position: relative; }
.file-button input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.upload-row .text-button { display: block; margin-top: 13px; }
.upload-row p { margin: 10px 0 0; color: var(--muted); font-size: .65rem; line-height: 1.5; }
.notice { margin-bottom: 18px; padding: 14px; color: #6f4d1e; background: #fff6e6; border: 1px solid #f0dab5; border-radius: 11px; }
.notice strong { font-size: .74rem; }
.notice p { margin: 4px 0 0; font-size: .66rem; line-height: 1.55; }
.profile-save-card p { color: var(--muted); font-size: .72rem; line-height: 1.5; }

.subscription-overview { margin-bottom: 18px; }
.subscription-card { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 22px; padding: 25px; color: white; background: linear-gradient(135deg, var(--green-950), var(--green-700)); border-radius: 20px; }
.subscription-card h2 { margin-bottom: 5px; font-size: 1.3rem; }
.subscription-card p { margin: 0; color: rgba(255,255,255,.72); font-size: .74rem; }
.subscription-meter { min-width: 190px; text-align: right; }
.subscription-meter strong { display: block; font-size: 1.4rem; }
.subscription-meter span { color: rgba(255,255,255,.72); font-size: .66rem; }
.plan-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.plans-list, .orders-list { display: grid; gap: 12px; padding-top: 18px; }
.plan-card, .order-card { padding: 17px; border: 1px solid var(--line); border-radius: 14px; }
.plan-card { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 15px; }
.plan-card h3, .order-card h3 { margin-bottom: 4px; font-size: .88rem; }
.plan-card p, .order-card p { margin: 0; color: var(--muted); font-size: .67rem; }
.plan-price { text-align: right; }
.plan-price strong { display: block; color: var(--green-800); font-size: 1.05rem; }
.plan-price small { color: var(--muted); font-size: .62rem; }
.plan-card .button { grid-column: 1 / -1; }
.order-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.order-card dl { display: grid; grid-template-columns: 1fr 1fr; gap: 7px 15px; margin: 0; font-size: .66rem; }
.order-card dt { color: var(--muted); }
.order-card dd { margin: 0; font-weight: 760; text-align: right; }
.order-card .button { margin-top: 13px; }

.modal { position: fixed; z-index: 100; inset: 0; display: none; align-items: center; justify-content: center; padding: 22px; }
.modal.open { display: flex; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(6,25,22,.76); backdrop-filter: blur(7px); }
.modal-panel { position: relative; z-index: 1; width: min(620px,100%); max-height: calc(100vh - 40px); overflow: auto; padding: 24px; background: var(--bg); border-radius: 22px; box-shadow: 0 30px 90px rgba(0,0,0,.38); }
.modal-panel.large { width: min(920px,100%); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 17px; }
.modal-head h2 { margin: 0; }
.modal-close { width: 38px; height: 38px; flex: 0 0 auto; color: var(--muted); background: white; border: 0; border-radius: 50%; font-size: 1.35rem; }
.modal-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 9px; margin-top: 17px; }
.invoice-paper { width: min(760px,100%); min-height: 520px; margin: 0 auto; padding: clamp(25px, 5vw, 48px); color: #202723; background: white; box-shadow: 0 12px 38px rgba(0,0,0,.08); }
.invoice-header { display: flex; justify-content: space-between; gap: 22px; padding-bottom: 21px; border-bottom: 2px solid var(--green-900); }
.invoice-business { display: flex; align-items: flex-start; gap: 12px; }
.invoice-logo { width: 58px; height: 58px; flex: 0 0 auto; display: grid; place-items: center; overflow: hidden; color: white; background: var(--green-900); border-radius: 12px; font-family: Georgia,serif; font-size: 1.3rem; font-weight: 900; }
.invoice-logo img { width: 100%; height: 100%; object-fit: contain; background: white; }
.invoice-business h3 { margin-bottom: 4px; font-size: 1.15rem; }
.invoice-business p { margin: 2px 0; color: #6d7974; font-size: .68rem; }
.invoice-meta { text-align: right; }
.invoice-meta strong { display: block; color: var(--green-900); font-size: 1.16rem; }
.invoice-meta span { display: block; margin-top: 4px; color: #6d7974; font-size: .68rem; }
.invoice-customer { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; padding: 18px 0; }
.invoice-customer span { display: block; color: #7c8783; font-size: .6rem; letter-spacing: .07em; text-transform: uppercase; }
.invoice-customer strong { display: block; margin-top: 4px; font-size: .76rem; }
.invoice-table { width: 100%; border-collapse: collapse; font-size: .7rem; }
.invoice-table th { padding: 10px 7px; color: white; background: var(--green-900); text-align: left; }
.invoice-table th:nth-child(n+2), .invoice-table td:nth-child(n+2) { text-align: right; }
.invoice-table td { padding: 11px 7px; border-bottom: 1px solid #e3e8e6; }
.invoice-bottom { display: grid; grid-template-columns: 1fr 240px; gap: 26px; margin-top: 22px; }
.invoice-qris { display: flex; align-items: center; gap: 11px; }
.invoice-qris img { width: 100px; height: 100px; object-fit: contain; border: 1px solid #dce3e0; }
.invoice-qris p { max-width: 150px; margin: 0; color: #6d7974; font-size: .62rem; line-height: 1.5; }
.invoice-totals dl { margin: 0; }
.invoice-totals div { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; font-size: .7rem; }
.invoice-totals dd { margin: 0; font-weight: 800; }
.invoice-totals .invoice-grand { margin-top: 7px; padding-top: 11px; border-top: 1px solid #ccd5d1; font-size: .9rem; }
.invoice-status { width: fit-content; margin: 13px 0 0 auto; padding: 6px 9px; border-radius: 99px; font-size: .62rem; font-weight: 900; text-transform: uppercase; }
.invoice-note { margin-top: 22px; padding: 12px 14px; color: #5d6864; background: #f5f7f6; border-radius: 9px; font-size: .66rem; line-height: 1.55; }
.invoice-footer { margin-top: 24px; padding-top: 14px; color: #7c8783; border-top: 1px dashed #bdc7c3; text-align: center; font-size: .65rem; }
.payment-panel h3 { margin-bottom: 5px; }
.payment-panel p { color: var(--muted); font-size: .74rem; line-height: 1.55; }
.payment-methods { display: grid; gap: 10px; margin: 18px 0; }
.payment-method { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 13px; border: 1px solid var(--line); border-radius: 12px; }
.payment-method:has(input:checked) { border-color: var(--green-700); background: var(--green-50); }
.payment-method input { accent-color: var(--green-800); }
.payment-method b, .payment-method small { display: block; }
.payment-method small { margin-top: 2px; color: var(--muted); font-size: .62rem; }
.payment-method img { width: 52px; height: 52px; object-fit: contain; background: white; }
.payment-instruction { padding: 15px; background: white; border: 1px solid var(--line); border-radius: 13px; }
.payment-instruction dl { margin: 0; }
.payment-instruction div { display: flex; justify-content: space-between; gap: 15px; padding: 6px 0; font-size: .7rem; }
.payment-instruction dd { margin: 0; font-weight: 800; text-align: right; }
.proof-upload { display: grid; gap: 10px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.toast { position: fixed; z-index: 300; left: 50%; bottom: 28px; max-width: calc(100% - 30px); padding: 13px 17px; color: white; background: var(--green-950); border-radius: 11px; box-shadow: 0 16px 40px rgba(0,0,0,.25); transform: translate(-50%, 20px); opacity: 0; pointer-events: none; font-size: .75rem; transition: .24s ease; }
.toast.show { transform: translate(-50%,0); opacity: 1; }
.toast.error { background: #8f3232; }

/* Admin */
.admin-body { min-height: 100vh; }
.admin-header { position: sticky; z-index: 20; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 72px; padding: 0 28px; color: white; background: var(--green-950); }
.admin-header .brand small { color: rgba(255,255,255,.65); }
.admin-main { max-width: 1200px; margin: 0 auto; padding: 34px 24px 60px; }
.admin-grid { display: grid; grid-template-columns: minmax(340px,.85fr) minmax(0,1.15fr); gap: 18px; align-items: start; }
.admin-list, .admin-detail { padding: 22px; }
.admin-detail { position: sticky; top: 92px; }
.admin-order-button { width: 100%; display: grid; grid-template-columns: 1fr auto; gap: 7px 12px; padding: 14px; text-align: left; background: white; border: 1px solid var(--line); border-radius: 12px; }
.admin-order-button.active { border-color: var(--green-700); background: var(--green-50); }
.admin-order-button small { color: var(--muted); }
.proof-image { width: 100%; max-height: 420px; object-fit: contain; margin: 12px 0; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; }
.admin-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 16px; }
.button.danger { color: white; background: var(--danger); }

@media (max-width: 1000px) {
  :root { --sidebar: 214px; }
  .auth-screen { grid-template-columns: .85fr 1.15fr; }
  .receipt-teaser { display: none; }
  .form-layout, .profile-layout { grid-template-columns: minmax(0,1fr) 290px; }
  .item-table-head, .item-row { grid-template-columns: minmax(135px,1.5fr) 72px 85px 105px 90px 36px; }
  .plan-layout { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  :root { --sidebar: 0px; }
  body { padding-bottom: 84px; }
  .auth-screen { display: block; }
  .auth-story { min-height: 330px; padding: 28px 24px 42px; }
  .auth-copy { margin-top: 55px; }
  .auth-copy h1 { max-width: 600px; font-size: clamp(2.4rem, 10vw, 4rem); }
  .auth-copy ul { display: none; }
  .auth-panel { min-height: auto; padding: 0 16px 42px; background: var(--green-950); }
  .auth-card { margin-top: -18px; }
  .sidebar { display: none; }
  .topbar { left: 0; height: 66px; padding: 0 16px; }
  .mobile-menu { display: grid; }
  .connection-state, .top-actions .button { display: none; }
  .workspace { margin-left: 0; padding: 88px 15px 38px; }
  .bottom-nav { position: fixed; z-index: 45; right: 10px; bottom: max(9px, env(safe-area-inset-bottom)); left: 10px; height: 68px; display: grid; grid-template-columns: repeat(5,1fr); align-items: center; padding: 6px; background: rgba(255,255,255,.96); border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 18px 48px rgba(14,48,41,.18); backdrop-filter: blur(16px); }
  .bottom-nav button { height: 54px; display: grid; place-items: center; align-content: center; gap: 2px; color: #7b8883; background: transparent; border: 0; font-size: 1rem; }
  .bottom-nav small { font-size: .56rem; }
  .bottom-nav button.active { color: var(--green-900); font-weight: 850; }
  .bottom-nav .create-fab span { width: 45px; height: 45px; display: grid; place-items: center; margin-top: -27px; color: white; background: var(--green-900); border: 4px solid var(--bg); border-radius: 50%; box-shadow: 0 8px 20px rgba(9,45,40,.28); }
  .mobile-drawer { position: fixed; z-index: 70; top: 66px; right: 12px; left: 12px; display: none; padding: 10px; background: white; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
  .mobile-drawer.open { display: grid; }
  .mobile-drawer button { min-height: 43px; padding: 0 12px; color: var(--green-900); background: transparent; border: 0; border-radius: 9px; text-align: left; font-size: .74rem; font-weight: 750; }
  .mobile-drawer button:hover { background: var(--green-50); }
  .hero-card { grid-template-columns: 1fr; min-height: auto; padding: 30px 23px; }
  .hero-visual { display: none; }
  .stat-grid { grid-template-columns: 1fr; }
  .stat-card { min-height: 98px; }
  .form-layout, .profile-layout { display: block; }
  .summary-column { position: static; margin-top: 17px; }
  .profile-save-card { position: sticky; z-index: 8; bottom: 86px; box-shadow: var(--shadow); }
  .admin-grid { grid-template-columns: 1fr; }
  .admin-detail { position: static; }
}

@media (max-width: 620px) {
  .auth-card { padding: 24px 20px; }
  .field-grid.two { grid-template-columns: 1fr; }
  .auth-copy > p:not(.eyebrow) { font-size: .84rem; }
  .top-title small { display: none; }
  .page-heading, .section-heading { align-items: flex-start; }
  .page-heading .button { min-height: 39px; padding-inline: 11px; font-size: .68rem; }
  .form-card, .recent-panel, .history-panel { padding: 18px; border-radius: 17px; }
  .card-title.with-action .button { display: none; }
  .item-table-head { display: none; }
  .item-row { grid-template-columns: 1fr 1fr 38px; gap: 8px; margin-bottom: 10px; padding: 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; }
  .item-row .item-name { grid-column: 1 / -1; }
  .item-row .item-line-total { grid-column: 1 / 3; padding: 5px 2px; text-align: left; }
  .item-row .item-line-total::before { content: "Total item: "; color: var(--muted); font-weight: 500; }
  .item-row .remove-item { grid-column: 3; grid-row: 2; }
  .mobile-add { display: inline-flex; }
  .invoice-row { grid-template-columns: 1fr auto; gap: 8px 12px; }
  .invoice-row > div:nth-child(2), .invoice-row > div:nth-child(3), .invoice-row > div:nth-child(4) { grid-column: 1; }
  .invoice-row .row-actions { grid-column: 2; grid-row: 1 / span 4; flex-direction: column; }
  .search-row { grid-template-columns: 1fr; }
  .upload-row { gap: 14px; }
  .upload-preview { width: 92px; height: 92px; }
  .subscription-card { grid-template-columns: 1fr; }
  .subscription-meter { min-width: 0; text-align: left; }
  .modal { align-items: flex-end; padding: 0; }
  .modal-panel { max-height: 94vh; padding: 18px; border-radius: 22px 22px 0 0; }
  .invoice-paper { padding: 22px 16px; }
  .invoice-header { display: grid; }
  .invoice-meta { text-align: left; }
  .invoice-bottom { grid-template-columns: 1fr; }
  .invoice-qris { order: 2; }
  .invoice-status { margin-left: 0; }
  .modal-actions { display: grid; }
  .plan-card { grid-template-columns: 1fr; }
  .plan-price { text-align: left; }
  .order-card dl { grid-template-columns: 1fr; }
  .order-card dd { text-align: left; }
  .admin-header { padding: 0 16px; }
  .admin-main { padding: 24px 14px 45px; }
}

@media print {
  @page { size: A4; margin: 14mm; }
  body { padding: 0 !important; background: white; }
  body * { visibility: hidden !important; }
  #invoicePrint, #invoicePrint * { visibility: visible !important; }
  #invoicePrint { position: absolute; inset: 0 auto auto 0; width: 100%; min-height: 0; padding: 0; box-shadow: none; }
  .no-print { display: none !important; }
}
