/* Shared look for the customer dashboard and the superadmin panel. */
:root {
  --ink: #22184a; --ink-soft: #5b5185; --line: #e8e3f5; --bg: #f6f3ff; --card: #fff;
  --grape: #7c5cff; --grape-soft: #efeaff; --sun: #ffd23f; --mint: #20b77a; --mint-soft: #e2f8ee;
  --coral: #e5484d; --coral-soft: #fdecec; --sky: #1f9ed8; --amber: #b7791f; --amber-soft: #fff4d9;
  --r: 18px;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Fredoka, ui-rounded, system-ui, sans-serif; color: var(--ink); background: var(--bg); font-size: 16px; line-height: 1.5; }
a { color: var(--grape); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.15; }
.hidden { display: none !important; }
.muted { color: var(--ink-soft); }
.small { font-size: .88rem; }

/* auth */
.auth { min-height: 100svh; display: grid; place-items: center; padding: 16px; background: url(/img/aq_bg.svg) center / cover; }
.auth-card { width: min(440px, 100%); background: #fff; border-radius: 28px; padding: 28px; box-shadow: 0 30px 60px -30px rgba(0,0,0,.5); }
.auth-card .brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 1.3rem; text-decoration: none; color: var(--ink); margin-bottom: 14px; }
.auth-card .brand img { width: 42px; }
.auth-card .brand b { color: var(--grape); }
.tabs { display: flex; gap: 6px; background: var(--grape-soft); border-radius: 999px; padding: 4px; margin: 10px 0 18px; }
.tabs button { flex: 1; border: 0; border-radius: 999px; padding: .55em; background: transparent; cursor: pointer; font-weight: 600; color: var(--ink-soft); }
.tabs button.on { background: #fff; color: var(--ink); box-shadow: 0 2px 8px rgba(0,0,0,.08); }

/* form bits */
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-weight: 600; font-size: .92rem; }
.field input, .field select, .field textarea { border: 2px solid var(--line); border-radius: 12px; padding: .65em .85em; background: #fff; outline: none; width: 100%; }
.field input:focus, .field select:focus { border-color: var(--grape); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row > .grow { flex: 1; min-width: 180px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45em; border: 0; border-radius: 999px; padding: .62em 1.25em; font-weight: 600; cursor: pointer; background: var(--grape); color: #fff; text-decoration: none; white-space: nowrap; transition: transform .12s, filter .12s; }
.btn:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn.sun { background: var(--sun); color: var(--ink); }
.btn.ghost { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 2px var(--line); }
.btn.danger { background: var(--coral-soft); color: var(--coral); }
.btn.sm { padding: .4em .9em; font-size: .9rem; }
.btn.block { width: 100%; }
.msg { min-height: 1.4em; margin: 8px 0 0; font-size: .92rem; }
.msg.err { color: var(--coral); }
.msg.ok { color: var(--mint); }

/* app shell */
.shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100svh; }
.side { background: var(--ink); color: #fff; padding: 18px 14px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100svh; }
.side .brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 600; font-size: 1.15rem; padding: 4px 8px 16px; }
.side .brand img { width: 36px; }
.side .brand b { color: var(--sun); }
.side .who { padding: 10px 10px 14px; border-bottom: 1px solid rgba(255,255,255,.12); margin-bottom: 8px; font-size: .92rem; }
.side .who b { display: block; font-size: 1rem; }
.side nav a { display: flex; align-items: center; gap: 10px; padding: .6em .8em; border-radius: 12px; color: rgba(255,255,255,.82); text-decoration: none; font-weight: 500; }
.side nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.side nav a.on { background: #fff; color: var(--ink); }
.side nav a .ic { width: 22px; text-align: center; }
.side .bottom { margin-top: auto; display: grid; gap: 6px; }
.side .bottom a, .side .bottom button { background: transparent; border: 0; color: rgba(255,255,255,.7); text-align: left; padding: .5em .8em; cursor: pointer; border-radius: 10px; text-decoration: none; }
.side .bottom a:hover, .side .bottom button:hover { background: rgba(255,255,255,.08); color: #fff; }
.main { padding: 26px clamp(16px, 3vw, 40px) 60px; max-width: 1200px; width: 100%; min-width: 0; }
.page-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-title h1 { font-size: 1.9rem; }
.mobile-bar { display: none; }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 30; transform: translateX(-105%); transition: transform .25s; }
  .side.open { transform: none; }
  .backdrop.on { position: fixed; inset: 0; background: rgba(20,12,50,.45); z-index: 25; }
  .mobile-bar { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: var(--ink); color: #fff; position: sticky; top: 0; z-index: 20; }
  .mobile-bar button { background: transparent; border: 0; color: #fff; font-size: 1.5rem; cursor: pointer; }
}

/* cards */
.grid { display: grid; gap: 16px; }
.grid.c2 { grid-template-columns: repeat(2, 1fr); }
.grid.c3 { grid-template-columns: repeat(3, 1fr); }
.grid.c4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 980px) { .grid.c3, .grid.c4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .grid.c2, .grid.c3, .grid.c4 { grid-template-columns: 1fr; } }
.card { background: var(--card); border-radius: var(--r); padding: 20px; box-shadow: 0 10px 30px -22px rgba(34,24,74,.5); }
.card h2 { font-size: 1.2rem; margin-bottom: 10px; }
.card h3 { font-size: 1.05rem; }
.stat b { display: block; font-size: 2rem; line-height: 1.1; }
.stat span { color: var(--ink-soft); font-size: .92rem; }

/* licence banner */
.banner { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; border-radius: var(--r); padding: 16px 20px; margin-bottom: 18px; font-weight: 500; }
.banner.trial { background: var(--amber-soft); color: var(--amber); }
.banner.active { background: var(--mint-soft); color: #137a52; }
.banner.expired, .banner.suspended { background: var(--coral-soft); color: var(--coral); }
.banner b { color: var(--ink); }

.pill { display: inline-block; padding: .15em .7em; border-radius: 999px; font-size: .82rem; font-weight: 600; background: var(--grape-soft); color: var(--grape); }
.pill.ok { background: var(--mint-soft); color: #137a52; }
.pill.warn { background: var(--amber-soft); color: var(--amber); }
.pill.bad { background: var(--coral-soft); color: var(--coral); }
.pill.off { background: #eee; color: #777; }

/* tables / lists */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { font-size: .82rem; color: var(--ink-soft); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.table-wrap { overflow-x: auto; }
.empty { text-align: center; padding: 34px 10px; color: var(--ink-soft); }
.empty img { width: 70px; opacity: .8; }

.screen { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.screen .thumb { width: 92px; height: 60px; border-radius: 12px; background-size: cover; background-position: center; flex: none; }
.screen .info { flex: 1; min-width: 220px; }
.screen select { border: 2px solid var(--line); border-radius: 999px; padding: .35em .8em; background: #fff; }
.screen .code { font-weight: 700; letter-spacing: .08em; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; background: #bbb; }
.dot.on { background: var(--mint); box-shadow: 0 0 0 4px var(--mint-soft); }

.works { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.work { background: #fff; border-radius: 16px; overflow: hidden; box-shadow: 0 8px 22px -18px rgba(34,24,74,.6); position: relative; }
.work .pic { aspect-ratio: 4 / 3; background: linear-gradient(#e3f6ff, #c6ecff); display: grid; place-items: center; }
.work .pic img { max-width: 88%; max-height: 88%; }
.work .meta { padding: 8px 12px 12px; font-size: .9rem; }
.work .meta b { display: block; }
.work .del { position: absolute; top: 8px; right: 8px; border: 0; background: rgba(255,255,255,.9); border-radius: 50%; width: 32px; height: 32px; cursor: pointer; color: var(--coral); font-weight: 700; }

.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.plan { border: 2px solid var(--line); border-radius: var(--r); padding: 20px; background: #fff; display: grid; gap: 8px; }
.plan.best { border-color: var(--grape); position: relative; }
.plan.best::before { content: 'Paling hemat'; position: absolute; top: -12px; left: 18px; background: var(--grape); color: #fff; font-size: .78rem; font-weight: 600; padding: .15em .7em; border-radius: 999px; }
.plan .price { font-size: 1.8rem; font-weight: 700; }
.plan ul { margin: 0; padding-left: 1.1em; color: var(--ink-soft); }

.switch { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.switch:last-child { border-bottom: 0; }
.switch input[type=checkbox] { appearance: none; width: 52px; height: 30px; border-radius: 999px; background: #d9d3ee; position: relative; cursor: pointer; flex: none; transition: background .2s; }
.switch input[type=checkbox]::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 2px 4px rgba(0,0,0,.2); }
.switch input[type=checkbox]:checked { background: var(--grape); }
.switch input[type=checkbox]:checked::after { transform: translateX(22px); }

/* modal */
.modal { position: fixed; inset: 0; background: rgba(20,12,50,.55); display: grid; place-items: center; padding: 16px; z-index: 50; }
.modal .box { background: #fff; border-radius: 24px; padding: 24px; width: min(460px, 100%); max-height: 92svh; overflow: auto; }
.qris { text-align: center; }
.qris img { width: min(300px, 80vw); border-radius: 12px; border: 1px solid var(--line); }
.qris .amount { font-size: 1.8rem; font-weight: 700; margin: 6px 0; }
#toasts { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 60; display: grid; gap: 8px; justify-items: center; width: min(92vw, 520px); pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: .7em 1.2em; border-radius: 999px; box-shadow: 0 10px 30px rgba(0,0,0,.3); text-align: center; }
.toast.err { background: var(--coral); }
.logo-prev { width: 180px; height: 100px; border-radius: 12px; border: 2px dashed var(--line); display: grid; place-items: center; background: #fafafa; overflow: hidden; }
.logo-prev img { max-width: 100%; max-height: 100%; }
.sheet-prev { width: 100%; border-radius: 12px; border: 1px solid var(--line); background: #fff; }
.table input { border: 2px solid var(--line); border-radius: 8px; padding: .35em .5em; width: 100%; }
