/* Ruang kerja: dashboard, galeri templat, pratinjau, editor */
:root{
  --ws-bg:#F4EFE3;--ws-panel:#FFFDF8;--ws-sidebar:#33352A;--ws-sidebar-ink:#EDE7D6;--ws-sidebar-mute:#B9B4A2;
  --ws-ink:#2D2B24;--ws-mute:#6B6759;--ws-line:#E6DFCB;--ws-olive:#6C6B4E;--ws-olive-ink:#FBF8EF;--ws-chip:#6C6B4E;
  --ws-danger:#A3392C;--ws-ok:#5F7A4E;
  --f-ui:"Gentium Book Plus",Georgia,serif;--f-title:"Cormorant Garamond",Georgia,serif;--f-dialog:"Playfair Display",Georgia,serif;
}
*{box-sizing:border-box}
html,body{margin:0}
body.ws{font-family:var(--f-ui);color:var(--ws-ink);background:var(--ws-bg);-webkit-font-smoothing:antialiased}
.ws a{color:inherit}
.ws button{font-family:inherit}
.ws svg.ic{width:18px;height:18px;stroke:currentColor;fill:none;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round;flex:none}

/* ---------- Kerangka dashboard ---------- */
.ws-shell{display:grid;grid-template-columns:252px 1fr;min-height:100vh}
.ws-side{background:var(--ws-sidebar);color:var(--ws-sidebar-ink);position:sticky;top:0;height:100vh;display:flex;flex-direction:column;padding:22px 16px 14px}
.ws-brand{display:flex;align-items:center;gap:12px;padding:2px 2px 22px;text-decoration:none}
.ws-brand .logo{width:38px;height:38px;border-radius:999px;background:#F6F0E1;color:var(--ws-sidebar);display:flex;align-items:center;justify-content:center;font-family:var(--f-title);font-size:19px;font-weight:600;font-style:italic}
.ws-brand b{display:block;font-family:var(--f-ui);font-size:20px;font-weight:400;letter-spacing:.01em}
.ws-brand small{display:block;font-size:8.5px;letter-spacing:.32em;color:var(--ws-sidebar-mute);text-transform:uppercase;margin-top:2px}
.ws-nav{display:flex;flex-direction:column;gap:2px;flex:1;overflow:auto}
.ws-nav a{display:flex;align-items:center;gap:14px;padding:12px 14px;border-radius:10px;text-decoration:none;font-size:15.5px;color:var(--ws-sidebar-ink);transition:background-color .18s}
.ws-nav a:hover{background:rgba(255,255,255,.06)}
.ws-nav a.on{background:rgba(255,255,255,.1);font-weight:700}
.ws-nav a .count{margin-left:auto;font-size:11px;opacity:.8}
.ws-nav hr{border:0;border-top:1px solid rgba(255,255,255,.1);margin:12px 12px}
.ws-nav .wa svg{stroke:none;fill:#25D366}
.ws-logout{display:flex;align-items:center;gap:14px;padding:12px 14px;border:0;background:none;color:#E58E7E;font-size:15.5px;cursor:pointer;border-radius:10px;width:100%;text-align:left}
.ws-logout:hover{background:rgba(255,255,255,.06)}
.ws-main{min-width:0;display:flex;flex-direction:column}
.ws-top{display:flex;align-items:center;gap:16px;padding:20px 40px;border-bottom:1px solid var(--ws-line);background:var(--ws-bg);position:sticky;top:0;z-index:20}
.ws-top h1{margin:0;font-family:var(--f-title);font-weight:500;font-size:30px;letter-spacing:.005em}
.ws-back{width:40px;height:40px;border-radius:10px;border:1px solid var(--ws-line);background:var(--ws-panel);display:flex;align-items:center;justify-content:center;text-decoration:none;color:var(--ws-ink)}
.ws-user{margin-left:auto;display:flex;align-items:center;gap:12px;text-align:right}
.ws-user b{display:block;font-weight:400;font-size:14.5px}
.ws-user small{display:block;font-size:9px;letter-spacing:.24em;color:var(--ws-mute)}
.ws-avatar{width:36px;height:36px;border-radius:999px;background:var(--ws-sidebar);color:#fff;display:flex;align-items:center;justify-content:center;font-size:14px;font-weight:700}
.ws-body{padding:32px 40px 60px;max-width:1240px;width:100%}
.ws-foot{margin-top:auto;padding:18px 40px;font-size:12.5px;color:var(--ws-mute);border-top:1px solid var(--ws-line)}

/* ---------- Galeri templat ---------- */
.tg-filter{display:flex;gap:10px;margin-bottom:26px}
.tg-search{flex:1;display:flex;align-items:center;gap:12px;background:var(--ws-panel);border:1px solid var(--ws-line);border-radius:14px;padding:0 18px;height:62px}
.tg-search input{flex:1;border:0;background:none;font:inherit;font-size:17px;color:var(--ws-ink);outline:none}
.tg-search input::placeholder{color:#7a7566}
.tg-select{position:relative}
.tg-select select{appearance:none;height:62px;padding:0 44px 0 18px;border:1px solid var(--ws-line);border-radius:14px;background:var(--ws-panel);font:inherit;font-size:16px;color:var(--ws-ink);cursor:pointer}
.tg-select svg{position:absolute;right:16px;top:50%;margin-top:-9px;pointer-events:none}
.tg-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(210px,1fr));gap:22px 18px}
.tg-card{position:relative;background:var(--ws-panel);border:1px solid var(--ws-line);border-radius:16px;padding:14px 14px 14px;display:flex;flex-direction:column;gap:10px}
.tg-chip{position:absolute;left:-9px;top:-10px;z-index:3;background:var(--ws-chip);color:#fff;font-family:"Plus Jakarta Sans",system-ui,sans-serif;font-size:10.5px;font-weight:800;letter-spacing:.12em;padding:5px 12px;border-radius:999px}
.tg-thumb{position:relative;aspect-ratio:1/0.92;border-radius:10px;border:1px solid var(--ws-line);background:#FBF6EC;overflow:hidden;text-decoration:none;display:block}
.tg-thumb .pg{position:absolute;top:13%;width:38%;height:72%;background:#fff;box-shadow:0 6px 14px rgba(40,30,10,.18);overflow:hidden}
.tg-thumb .pg.l{left:6%;rotate:-3deg}.tg-thumb .pg.r{right:6%;rotate:3deg}
.tg-thumb .pg img{width:100%;height:100%;object-fit:cover}
.tg-thumb .phone{position:absolute;left:50%;top:5%;width:40%;height:90%;margin-left:-20%;border-radius:16px;background:#1d1b17;padding:3px;box-shadow:0 10px 22px rgba(30,20,5,.35);z-index:2}
.tg-thumb .phone .scr{display:block;width:100%;height:100%;border-radius:13px;overflow:hidden;position:relative;background:#5A1B0E}
.tg-thumb .phone .scr .fit{position:absolute;left:0;top:0;width:390px;height:860px;transform-origin:0 0}
.tg-thumb .phone .notch{position:absolute;left:50%;top:6px;width:26%;height:7px;margin-left:-13%;border-radius:6px;background:#1d1b17;z-index:3}
.tg-name{margin:2px 0 0;text-align:center;font-family:"Plus Jakarta Sans",system-ui,sans-serif;font-weight:700;font-size:13px;letter-spacing:.04em;text-transform:uppercase}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;height:36px;padding:0 18px;border-radius:999px;font-family:"Plus Jakarta Sans",system-ui,sans-serif;font-size:14px;font-weight:600;text-decoration:none;cursor:pointer;border:1px solid transparent;transition:background-color .18s,border-color .18s,color .18s}
.btn svg.ic{width:15px;height:15px}
.btn-line{background:#fff;border-color:#C9C3B1;color:var(--ws-ink)}
.btn-line:hover{border-color:var(--ws-olive)}
.btn-olive{background:var(--ws-olive);color:var(--ws-olive-ink)}
.btn-olive:hover{background:#5d5c42}
.btn-block{width:100%}
.btn[disabled]{opacity:.55;cursor:default}
.tg-empty{padding:60px 20px;text-align:center;color:var(--ws-mute);background:var(--ws-panel);border:1px dashed var(--ws-line);border-radius:16px}

/* ---------- Pratinjau templat ---------- */
body.pv-page{overflow:hidden;height:100vh}
.pv-bar{height:62px;display:flex;align-items:center;gap:14px;padding:0 18px;background:#FEFBF4;border-bottom:1px solid var(--ws-line);position:relative;z-index:10}
.pv-x{width:36px;height:36px;border-radius:999px;border:0;background:#EFEAE0;display:flex;align-items:center;justify-content:center;color:var(--ws-ink);text-decoration:none}
.pv-title{font-family:var(--f-title);font-size:21px;font-weight:500}
.pv-tools{margin-left:auto;display:flex;align-items:center;gap:8px}
.pv-ib{width:36px;height:36px;border-radius:999px;border:1px solid var(--ws-line);background:#fff;display:flex;align-items:center;justify-content:center;color:var(--ws-ink);cursor:pointer}
.pv-ib[disabled]{opacity:.4;cursor:default}
.pv-ib svg.ic{width:16px;height:16px}
.pv-cta{height:40px;display:inline-flex;align-items:center;gap:12px;padding:0 6px 0 18px;border-radius:10px;border:0;background:var(--ws-olive);color:#fff;font-family:var(--f-ui);font-size:15.5px;cursor:pointer;margin-left:4px}
.pv-cta span.arr{width:30px;height:28px;border-radius:7px;background:rgba(255,255,255,.18);display:flex;align-items:center;justify-content:center}
.pv-stage{position:relative;height:calc(100vh - 62px);overflow:hidden;display:flex;align-items:center;justify-content:center;gap:28px;background:var(--pv-bg,#5A1B0E)}
.pv-stage::before{content:"";position:absolute;inset:-10%;background:radial-gradient(closest-side at 33% 34%,rgba(255,235,215,.55),transparent 70%),radial-gradient(closest-side at 68% 36%,rgba(255,235,215,.45),transparent 70%),radial-gradient(closest-side at 50% 98%,rgba(255,235,215,.3),transparent 70%);filter:blur(30px);pointer-events:none}
.pv-phone{position:relative;z-index:1;height:min(820px,calc(100vh - 62px - 20px));aspect-ratio:390/860;border-radius:28px;background:#171513;padding:4px;box-shadow:0 28px 60px rgba(10,4,2,.45)}
.pv-screen{position:relative;width:100%;height:100%;border-radius:24px;overflow-x:hidden;overflow-y:auto;background:#FEFBF4;scrollbar-width:thin;overscroll-behavior:contain}
.pv-pill{position:relative;z-index:1;background:#F6F1E6;border-radius:999px;padding:6px;display:flex;flex-direction:column;gap:4px;box-shadow:0 10px 30px rgba(0,0,0,.2)}
.pv-pill button{width:58px;border:0;background:none;border-radius:999px;padding:10px 0 9px;display:flex;flex-direction:column;align-items:center;gap:4px;font-family:var(--f-ui);font-size:12.5px;color:#5a564a;cursor:pointer;transition:background-color .2s,color .2s}
.pv-pill button.on{background:var(--ws-olive);color:#fff;font-weight:700}
.pv-pill .sw{width:20px;height:20px;border-radius:6px;border:2px solid #fff;box-shadow:0 0 0 1px rgba(0,0,0,.15)}
.pv-pill.photo button{padding:20px 0 18px;line-height:1.15}
.pv-pill.photo button svg.ic{width:16px;height:16px}

/* ---------- Toast / dialog (melayang di tengah) ---------- */
.ws-toast{position:fixed;left:50%;top:50%;transform:translate(-50%,-50%);z-index:5000;background:#2E2C25;color:#fff;padding:14px 22px;border-radius:12px;font-size:15px;box-shadow:0 16px 40px rgba(0,0,0,.3);max-width:min(420px,90vw);text-align:center}
dialog.ws-dlg{border:0;padding:0;border-radius:22px;background:#FDFBF6;color:var(--ws-ink);width:min(900px,94vw);max-height:90vh;box-shadow:0 30px 80px rgba(0,0,0,.35);font-family:var(--f-ui)}
dialog.ws-dlg.sm{width:min(560px,94vw)}
dialog.ws-dlg::backdrop{background:rgba(40,36,28,.45);backdrop-filter:blur(3px)}
dialog.ws-dlg[open]{display:flex;flex-direction:column}
dialog.ws-dlg:focus{outline:none}
.dlg-head{display:flex;align-items:center;justify-content:space-between;min-height:82px;box-sizing:border-box;padding:16px 28px;border-bottom:1px solid var(--ws-line)}
.dlg-head h2{margin:0;font-family:var(--f-dialog);font-weight:600;font-size:40px;letter-spacing:-.01em;line-height:1.12;color:#2E2D22}
.dlg-x{width:44px;height:44px;flex:none;border-radius:999px;border:0;background:#F2EEE4;cursor:pointer;color:#8A8474;display:flex;align-items:center;justify-content:center}
.dlg-x:focus:not(:focus-visible){outline:none}
.dlg-body{padding:16px 28px 20px;overflow:auto}
.dlg-foot{display:flex;justify-content:flex-end;gap:10px;padding:14px 28px;border-top:1px solid var(--ws-line)}
.dlg-foot .btn{height:46px;padding:0 24px;border-radius:12px;font-family:var(--f-ui);font-size:15px;font-weight:500}
.dlg-label{font-size:10.5px;letter-spacing:.24em;text-transform:uppercase;color:#4a473d;font-weight:700;margin:16px 0 10px}

/* ---------- Formulir ---------- */
.ws-field{display:flex;flex-direction:column;gap:6px;margin-bottom:14px}
.ws-field label{font-size:14px;color:#4a473d}
.ws-input,.ws-field select,.ws-field textarea{width:100%;min-height:46px;border:1px solid #D9D2BE;border-radius:10px;background:#fff;padding:10px 14px;font:inherit;font-size:16px;color:var(--ws-ink)}
.ws-field textarea{min-height:90px;resize:vertical}
.ws-input:focus,.ws-field select:focus,.ws-field textarea:focus{outline:2px solid #B9B48F;outline-offset:1px}
.ws-err{color:var(--ws-danger);font-size:14px}
.pw-wrap{position:relative}
.pw-wrap .ws-input{padding-right:48px}
.pw-eye{position:absolute;right:6px;top:50%;transform:translateY(-50%);width:36px;height:36px;border:0;background:none;color:#6b6759;cursor:pointer;display:flex;align-items:center;justify-content:center}

/* ---------- Responsif ---------- */
@media (max-width:900px){
  .ws-shell{grid-template-columns:1fr}
  .ws-side{position:fixed;inset:0 auto 0 0;width:260px;z-index:60;transform:translateX(-100%);transition:transform .25s}
  .ws-shell.nav-open .ws-side{transform:none}
  .ws-burger{display:flex!important}
  .ws-top{padding:14px 18px}.ws-top h1{font-size:24px}
  .ws-body{padding:20px 16px 50px}
  .tg-grid{grid-template-columns:repeat(2,1fr);gap:18px 12px}
  .tg-search{height:52px}.tg-select select{height:52px}
  .pv-stage{gap:10px}
  .pv-pill button{width:48px;font-size:11px}
  .dlg-head h2{font-size:32px}.dlg-head,.dlg-body,.dlg-foot{padding-left:20px;padding-right:20px}
}
@media (max-width:640px){
  .pv-stage{flex-direction:column;justify-content:flex-start;padding:10px 0;gap:8px}
  .pv-phone{height:calc(100vh - 62px - 90px)}
  .pv-pill{flex-direction:row;order:2;overflow-x:auto;max-width:96vw}
  .pv-pill.photo{order:1}
  .pv-pill button{width:52px}
  .pv-pill.photo button{padding:8px 0}
  .pv-title{font-size:17px}.pv-cta{font-size:14px}
}
.ws-burger{display:none;width:40px;height:40px;border-radius:10px;border:1px solid var(--ws-line);background:var(--ws-panel);align-items:center;justify-content:center;cursor:pointer}
