/* RasyidBook — gaya bersama toko & admin */
:root {
  --ink: #1c2541; --ink-2: #3d4766; --muted: #6b7280; --faint: #9aa0ab;
  --bg: #faf7f2; --surface: #fff; --soft: #f4efe6; --line: #e8e1d4; --line-2: #d9d0bf;
  --accent: #c2410c; --accent-hover: #a5370a; --accent-soft: #fff1e7; --accent-ink: #9a3412;
  --green: #15803d; --green-soft: #e9f7ee; --amber: #b45309; --amber-soft: #fff6e0;
  --blue: #1d4ed8; --blue-soft: #eaf0ff; --violet: #6d28d9; --violet-soft: #f2ecff;
  --teal: #0f766e; --teal-soft: #e3f6f3; --red: #b91c1c; --red-soft: #fdecec; --grey-soft: #eef0f3;
  --radius: 14px; --radius-sm: 10px; --shadow: 0 1px 2px rgba(28,37,65,.06), 0 8px 24px rgba(28,37,65,.06);
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 15px; line-height: 1.55; }
img { max-width: 100%; display: block; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid rgba(194,65,12,.45); outline-offset: 2px; border-radius: 6px; }
.ic { flex: none; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); } .small { font-size: 13px; } .tiny { font-size: 12px; }
.num { font-variant-numeric: tabular-nums; }
.row { display: flex; align-items: center; gap: 8px; } .row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stack > * + * { margin-top: 12px; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.01em; line-height: 1.25; }

/* Tombol */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid transparent; font-weight: 700; font-size: 15px; cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s, transform .05s; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #fff; } .btn-primary:hover:not([disabled]) { background: var(--accent-hover); }
.btn-dark { background: var(--ink); color: #fff; } .btn-dark:hover:not([disabled]) { background: #121a33; }
.btn-outline { background: var(--surface); border-color: var(--line-2); color: var(--ink); } .btn-outline:hover:not([disabled]) { border-color: var(--ink); }
.btn-ghost { background: transparent; color: var(--ink-2); } .btn-ghost:hover { background: var(--soft); }
.btn-wa { background: #1fa855; color: #fff; } .btn-wa:hover:not([disabled]) { background: #178a45; }
.btn-danger { background: var(--surface); border-color: #f1c4c4; color: var(--red); } .btn-danger:hover { background: var(--red-soft); }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
.btn-block { width: 100%; white-space: normal; text-align: center; line-height: 1.3; padding-top: 10px; padding-bottom: 10px; }
.btn svg { flex: none; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; color: var(--ink-2); }
.icon-btn:hover { border-color: var(--ink-2); color: var(--ink); }
.link { color: var(--accent-ink); font-weight: 600; text-decoration: none; background: none; border: 0; padding: 0; cursor: pointer; }
.link:hover { text-decoration: underline; }

/* Badge */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.badge-amber { background: var(--amber-soft); color: var(--amber); } .badge-blue { background: var(--blue-soft); color: var(--blue); }
.badge-violet { background: var(--violet-soft); color: var(--violet); } .badge-teal { background: var(--teal-soft); color: var(--teal); }
.badge-green { background: var(--green-soft); color: var(--green); } .badge-grey { background: var(--grey-soft); color: #4b5563; }
.badge-red { background: var(--red-soft); color: var(--red); } .badge-accent { background: var(--accent); color: #fff; }
.badge-po { background: var(--ink); color: #fff; }

/* Kartu */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.card-pad { padding: 20px; }
.card h2, .card h3 { font-size: 17px; }
.note { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--radius-sm); font-size: 14px; }
.note .ic { margin-top: 2px; }
.note-info { background: var(--blue-soft); color: #1e3a8a; } .note-warn { background: var(--amber-soft); color: #7c3d06; }
.note-ok { background: var(--green-soft); color: #14532d; } .note-soft { background: var(--soft); color: var(--ink-2); }

/* Form */
.field { display: block; }
.field > span.lbl { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
[hidden] { display: none !important; }
.field .hint { font-size: 12.5px; color: var(--muted); margin-top: 5px; }
.field .err { font-size: 12.5px; color: var(--red); margin-top: 5px; display: none; }
.field.invalid .err { display: block; }
.field.invalid .input { border-color: var(--red); }
.input { width: 100%; min-height: 46px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); outline: none; transition: border-color .15s, box-shadow .15s; }
.input:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(28,37,65,.1); }
.input:disabled { background: var(--soft); color: var(--faint); }
textarea.input { min-height: 90px; resize: vertical; }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 40px; }
.input-group { display: flex; align-items: stretch; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface); overflow: hidden; }
.input-group:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(28,37,65,.1); }
.input-group .addon { display: grid; place-items: center; padding: 0 12px; background: var(--soft); color: var(--ink-2); font-weight: 600; border-right: 1px solid var(--line); }
.input-group .input { border: 0; box-shadow: none; border-radius: 0; }
.grid-2 { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
.grid-3 { display: grid; gap: 14px; grid-template-columns: repeat(3, 1fr); }
@media (max-width: 640px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; font-size: 14px; }
.switch input { appearance: none; width: 42px; height: 24px; border-radius: 99px; background: var(--line-2); position: relative; cursor: pointer; transition: background .15s; flex: none; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: left .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked { background: var(--green); } .switch input:checked::after { left: 21px; }

/* Toast */
#toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 1000; display: grid; gap: 8px; pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 12px; font-weight: 600; font-size: 14px; box-shadow: var(--shadow); animation: tin .2s ease; text-align: center; }
.toast-err { background: var(--red); } .toast.out { opacity: 0; transition: opacity .3s; }
@keyframes tin { from { opacity: 0; transform: translateY(8px); } }

/* Skeleton & status */
.skel { background: linear-gradient(90deg, #efe9de 25%, #f7f3ec 50%, #efe9de 75%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 10px; }
@keyframes sk { to { background-position: -200% 0; } }
.empty { text-align: center; padding: 56px 16px; color: var(--muted); }
.empty h3 { color: var(--ink); margin-bottom: 6px; font-size: 18px; }
.spinner { width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Modal */
.modal-back { position: fixed; inset: 0; background: rgba(17,24,39,.45); z-index: 500; display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; }
@media (min-width: 720px) { .modal-back { align-items: center; padding: 24px; } }
.modal { background: var(--surface); width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; border-radius: 20px 20px 0 0; box-shadow: var(--shadow); }
@media (min-width: 720px) { .modal { border-radius: 20px; } }
.modal-wide { max-width: 860px; }
.modal-head { position: sticky; top: 0; background: var(--surface); z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 18px; }
.modal-body { padding: 20px; }
.modal-foot { position: sticky; bottom: 0; background: var(--surface); display: flex; gap: 10px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--line); flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } }

/* Demo banner */
.demo-bar { background: #fff7d6; color: #6b4e00; font-size: 13px; text-align: center; padding: 6px 12px; border-bottom: 1px solid #f1e2a6; }
.demo-bar button { font-weight: 700; color: #6b4e00; background: none; border: 0; text-decoration: underline; cursor: pointer; }

.field .hint.hint-warn { color: #b45309; font-weight: 600; }
