/* ==========================================================
   KlinikPDF — Alat PDF
   ========================================================== */

/* ---------- Landing: tautan di hero ---------- */
.hero-tools {
  display: inline-flex; align-items: center; gap: 12px; margin-top: 22px; padding: 9px 16px 9px 10px;
  border-radius: 14px; background: #fff; border: 1px solid var(--ink-200); color: var(--ink-700);
  font-size: 14px; line-height: 1.4; box-shadow: var(--shadow-sm); transition: border-color .15s, box-shadow .15s;
}
.hero-tools:hover { border-color: var(--brand-200); box-shadow: var(--shadow); color: var(--ink-900); }
.hero-tools b { color: var(--brand-600); font-weight: 700; white-space: nowrap; }
.hero-tools-icons { display: flex; flex: none; }
.hero-tools-icons svg { width: 32px; height: 32px; padding: 7px; border-radius: 10px; background: var(--brand-50); color: var(--brand-600); border: 2px solid #fff; margin-left: -8px; }
.hero-tools-icons svg:first-child { margin-left: 0; }

/* ---------- Landing: grid alat ---------- */
.tgrid-tools { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin: -24px 0 28px; }
.tsearch { position: relative; flex: 1 1 260px; max-width: 380px; }
.tsearch svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--ink-400); pointer-events: none; }
.tsearch input { width: 100%; height: 44px; border-radius: 12px; border: 1px solid var(--ink-200); padding: 0 14px 0 42px; background: #fff; font-size: 15px; }
.tsearch input:focus { outline: none; border-color: var(--brand-500); box-shadow: 0 0 0 4px var(--brand-100); }
.tchips { display: flex; flex-wrap: wrap; gap: 6px; }
.tchip { height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--ink-200); background: #fff; font-size: 13.5px; font-weight: 600; color: var(--ink-700); cursor: pointer; transition: background .15s, border-color .15s, color .15s; }
.tchip:hover { border-color: var(--ink-400); }
.tchip.active { background: var(--ink-900); border-color: var(--ink-900); color: #fff; }
.tgroup + .tgroup { margin-top: 32px; }
.tgroup-title { margin: 0 0 12px; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-500); }
.tcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.tcard {
  display: flex; gap: 14px; align-items: flex-start; padding: 16px; border-radius: 14px; background: #fff;
  border: 1px solid var(--ink-200); color: var(--ink-900); transition: border-color .15s, box-shadow .15s, transform .15s;
}
.tcard:hover { border-color: var(--brand-200); box-shadow: var(--shadow); transform: translateY(-1px); color: var(--ink-900); }
.tcard-icon { flex: none; width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; }
.tcard-icon svg { width: 22px; height: 22px; }
.tcard-text { min-width: 0; }
.tcard-text b { display: block; font-size: 15px; letter-spacing: -.01em; margin-bottom: 2px; }
.tcard-text small { display: block; font-size: 13px; color: var(--ink-500); line-height: 1.45; }
.tcards-sm { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.tcard-sm { padding: 10px 12px; align-items: center; gap: 10px; }
.tcard-sm .tcard-icon { width: 34px; height: 34px; border-radius: 9px; }
.tcard-sm .tcard-icon svg { width: 18px; height: 18px; }
.tcard-sm b { font-size: 14px; margin: 0; }
.tgrid-empty { text-align: center; color: var(--ink-500); }

.cat-atur { background: #eef2ff; color: #4f46e5; }
.cat-konversi { background: #e0f2fe; color: #0369a1; }
.cat-edit { background: #fae8ff; color: #a21caf; }
.cat-aman { background: #dcfce7; color: #15803d; }
.cat-info { background: #fef3c7; color: #b45309; }
.cat-buat { background: #ffe4e6; color: #be123c; }

/* ---------- Tampilan alat ---------- */
body.tooling { overflow: hidden; }
body.tooling .site { display: none; }
.tv { display: none; position: fixed; inset: 0; z-index: 90; background: #f4f6fa; flex-direction: column; }
body.tooling .tv { display: flex; }
body.editing .tv { display: none; }

.tv-top { display: flex; align-items: center; gap: 12px; height: 64px; padding: 0 16px; background: #fff; border-bottom: 1px solid var(--ink-200); flex: none; }
.tv-top .logo { font-size: 18px; }
.tv-top .logo img { width: 30px; height: 30px; }
.tv-back { margin-left: 4px; }
.tv-back svg { width: 16px; height: 16px; }
.tv-scroll { flex: 1; overflow-y: auto; position: relative; }
.tv-wrap { max-width: 1140px; margin: 0 auto; padding: 28px 20px 80px; }

.tv-head { display: flex; gap: 16px; align-items: center; margin-bottom: 22px; }
.tv-icon { flex: none; width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; }
.tv-icon svg { width: 28px; height: 28px; }
.tv-head h1 { margin: 0 0 2px; font-size: 26px; letter-spacing: -.025em; line-height: 1.2; }
.tv-head p { margin: 0; color: var(--ink-500); font-size: 15px; }

.tv-drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  min-height: 320px; padding: 32px 24px; border: 2px dashed var(--brand-200); border-radius: 20px;
  background: linear-gradient(180deg, #fff, var(--brand-50)); cursor: pointer; transition: border-color .15s, background .15s;
}
.tv-drop:hover { border-color: var(--brand-500); }
.tv-drop h3 { margin: 0 0 6px; font-size: 21px; letter-spacing: -.01em; }
.tv-drop p { margin: 0 0 20px; color: var(--ink-500); font-size: 14px; }

.tv-work { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.tv-main, .tv-side { background: #fff; border: 1px solid var(--ink-200); border-radius: 18px; padding: 18px; }
.tv-main { min-width: 0; min-height: 200px; }
.tv-side { position: sticky; top: 16px; display: grid; gap: 16px; }
.tv-run { width: 100%; }
.tv-run svg { order: 2; }
.tv-privacy { display: flex; gap: 8px; align-items: flex-start; margin: -4px 0 0; font-size: 12.5px; color: var(--ink-500); }
.tv-privacy svg { width: 15px; height: 15px; flex: none; margin-top: 2px; color: var(--ok); }
.tv-related { margin-top: 48px; }
.tv-related h3 { margin: 0 0 12px; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-500); }

/* Opsi */
.tv-opts { display: grid; gap: 14px; }
.tv-opts:empty { display: none; }
.opt { display: grid; gap: 6px; margin: 0; min-width: 0; }
.opt-label { font-size: 13px; font-weight: 600; color: var(--ink-700); display: flex; justify-content: space-between; gap: 8px; }
.opt-label b { color: var(--brand-700); }
.tv-opts .field, .cform .field { height: 42px; font-size: 15px; padding: 0 12px; border-radius: 10px; }
select.field { padding-right: 8px; cursor: pointer; }
.opt.check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; color: var(--ink-700); cursor: pointer; }
.opt.check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--brand-600); flex: none; }
.opt-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; }
.seg { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--ink-100); border-radius: 11px; }
.seg button {
  flex: 1 1 auto; min-height: 34px; padding: 6px 10px; border: 0; border-radius: 8px; background: transparent;
  font-size: 13px; font-weight: 600; color: var(--ink-700); cursor: pointer; line-height: 1.25;
}
.seg button:hover { color: var(--ink-900); }
.seg button.on { background: #fff; color: var(--brand-700); box-shadow: var(--shadow-sm), 0 0 0 1px var(--ink-200); }
.opt-help { display: block; font-size: 12.5px; color: var(--ink-500); line-height: 1.45; }
.opt-note { font-size: 13px; color: var(--ink-700); background: var(--brand-50); border: 1px solid var(--brand-100); border-radius: 10px; padding: 10px 12px; line-height: 1.5; }
.opt-color input[type="color"] { width: 100%; height: 42px; border: 1px solid var(--ink-200); border-radius: 10px; padding: 4px; background: #fff; cursor: pointer; }
.opt input[type="range"] { width: 100%; accent-color: var(--brand-600); }
.opt-file { justify-content: flex-start; overflow: hidden; text-overflow: ellipsis; }
.opt-empty { margin: 0; font-size: 13.5px; color: var(--ink-500); }
.meta-dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 8px 0 0; }
.meta-dl dt { font-weight: 600; color: var(--ink-500); }
.meta-dl dd { margin: 0; word-break: break-word; }

/* Daftar file */
.flist { display: grid; gap: 8px; }
.frow { display: flex; align-items: center; gap: 12px; padding: 10px; border: 1px solid var(--ink-200); border-radius: 12px; background: #fff; user-select: none; -webkit-user-select: none; transition: box-shadow .1s; }
.frow .grip { width: 18px; height: 18px; flex: none; color: var(--ink-400); cursor: grab; touch-action: none; }
.fthumb { width: 52px; height: 64px; flex: none; border-radius: 6px; background: var(--ink-50); border: 1px solid var(--ink-200); display: grid; place-items: center; overflow: hidden; }
.fthumb canvas, .fthumb img { max-width: 100%; max-height: 100%; display: block; object-fit: contain; }
.fthumb-lg { width: 96px; height: 124px; }
.fbadge { font-size: 11px; font-weight: 800; color: var(--brand-700); letter-spacing: .04em; }
.finfo { min-width: 0; flex: 1; display: grid; gap: 2px; }
.finfo b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.finfo small { font-size: 12.5px; color: var(--ink-500); }
.flabel { font-size: 11px; font-weight: 700; color: var(--brand-600); text-transform: uppercase; letter-spacing: .05em; }
.facts { display: flex; gap: 2px; flex: none; }
.facts .icon-btn { width: 34px; height: 34px; }
.icon-btn.danger:hover { background: #fee2e2; color: var(--danger); }
.icon-btn[disabled] { opacity: .3; cursor: default; pointer-events: none; }
.fbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.fbar .btn svg { width: 16px; height: 16px; }
.fbar-hint { font-size: 13px; color: var(--ink-500); }
.fsingle { display: flex; gap: 16px; align-items: center; }
.fsingle .finfo { gap: 4px; }
.fsingle .finfo b { font-size: 15px; }
.fsingle .finfo .btn { justify-self: start; margin-top: 8px; }
.fsingle .finfo .btn svg { width: 16px; height: 16px; }

.dragging { opacity: .3; }
.sort-ghost { position: fixed; left: 0; top: 0; z-index: 500; pointer-events: none; box-shadow: var(--shadow-lg); opacity: .95; margin: 0; }
.frow.drop-before { box-shadow: 0 -3px 0 var(--brand-500); }
.frow.drop-after { box-shadow: 0 3px 0 var(--brand-500); }
.pg.drop-before .pg-box { box-shadow: -5px 0 0 var(--brand-500); }
.pg.drop-after .pg-box { box-shadow: 5px 0 0 var(--brand-500); }

/* Grid halaman */
.pbar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 10px; }
.pbar .btn { height: 34px; padding: 0 12px; font-size: 13px; }
.pbar .btn svg { width: 16px; height: 16px; }
.pcount { font-size: 13px; font-weight: 600; color: var(--brand-700); margin-left: 4px; }
.phint { margin: 0 0 14px; font-size: 13px; color: var(--ink-500); }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 16px 14px; }
.pg { user-select: none; -webkit-user-select: none; min-width: 0; }
.pg-box {
  position: relative; aspect-ratio: 1 / 1.1; border-radius: 10px; background: var(--ink-50);
  border: 1.5px solid var(--ink-200); display: grid; place-items: center; overflow: hidden; transition: border-color .15s, box-shadow .15s;
}
.pgrid.selectable .pg-box { cursor: pointer; }
.pgrid.reorder .pg-box { cursor: grab; }
.pgrid.selectable .pg-box:hover, .pgrid.reorder .pg-box:hover { border-color: var(--brand-200); }
.pg-thumb { width: 86%; height: 86%; display: grid; place-items: center; }
.pg-thumb canvas { max-width: 100%; max-height: 100%; background: #fff; box-shadow: 0 1px 4px rgba(15, 23, 42, .18); transform: rotate(var(--rot, 0deg)); transition: transform .2s; }
.pg-thumb.sideways canvas { max-width: 88%; max-height: 88%; }
.pg-blank { width: 70%; aspect-ratio: 1 / 1.41; background: #fff; border: 1px dashed var(--ink-400); display: grid; place-items: center; font-size: 12px; color: var(--ink-400); }
.pg-mark { position: absolute; top: 8px; right: 8px; width: 24px; height: 24px; border-radius: 50%; background: #fff; border: 2px solid var(--ink-200); display: grid; place-items: center; color: transparent; }
.pg-mark svg { width: 14px; height: 14px; }
.pg.sel .pg-box { border-color: var(--brand-500); box-shadow: 0 0 0 3px var(--brand-100); }
.pg.sel .pg-mark { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
.pg.del .pg-box { border-color: var(--danger); box-shadow: 0 0 0 3px #fee2e2; }
.pg.del .pg-thumb { opacity: .35; }
.pg.del .pg-mark { background: var(--danger); border-color: var(--danger); color: #fff; }
.pg .grip { position: absolute; left: 6px; top: 6px; width: 26px; height: 26px; padding: 5px; border-radius: 7px; background: rgba(255, 255, 255, .92); color: var(--ink-500); touch-action: none; cursor: grab; box-shadow: var(--shadow-sm); }
.pg .grip svg { width: 100%; height: 100%; }
.pg-foot { display: flex; align-items: center; gap: 6px; margin-top: 6px; min-height: 28px; }
.pg-num { font-size: 12.5px; font-weight: 700; color: var(--ink-700); }
.pg-src { font-size: 11px; color: var(--ink-400); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.pg-tools { margin-left: auto; display: flex; gap: 2px; }
.pg-tools button { width: 28px; height: 28px; border: 0; border-radius: 7px; background: transparent; color: var(--ink-500); cursor: pointer; display: grid; place-items: center; }
.pg-tools button:hover { background: var(--ink-100); color: var(--ink-900); }
.pg-tools button.danger:hover { background: #fee2e2; color: var(--danger); }
.pg-tools svg { width: 16px; height: 16px; }
.th-spin { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--brand-100); border-top-color: var(--brand-500); animation: spin .8s linear infinite; }

/* Pratinjau potong */
.crop-prev { margin-top: 20px; }
.crop-page { position: relative; max-width: 400px; margin: 0 auto; background: #fff; box-shadow: 0 2px 12px rgba(15, 23, 42, .16); overflow: hidden; }
.crop-canvas, .crop-canvas canvas { display: block; width: 100%; height: 100%; }
.crop-box { position: absolute; inset: 0; border: 2px dashed var(--brand-600); box-shadow: 0 0 0 9999px rgba(15, 23, 42, .45); pointer-events: none; transition: all .15s; }
.crop-cap { text-align: center; font-size: 12.5px; color: var(--ink-500); margin: 10px 0 0; }

/* Sibuk & tarik-lepas */
.tv-busy { position: absolute; inset: 0; display: none; place-items: center; background: rgba(244, 246, 250, .82); backdrop-filter: blur(2px); z-index: 50; }
.tv.busy .tv-busy { display: grid; }
.tv-busy-card { width: min(380px, calc(100% - 32px)); padding: 26px 24px; background: #fff; border-radius: 18px; box-shadow: var(--shadow-lg); text-align: center; }
.tv-busy-card p { margin: 0 0 14px; font-weight: 600; color: var(--ink-700); font-size: 14.5px; }
.tv-bar { height: 6px; border-radius: 99px; background: var(--brand-100); overflow: hidden; }
.tv-bar span { display: block; height: 100%; width: 0; background: var(--brand-600); border-radius: inherit; transition: width .25s; }
.tv-bar.indet span { width: 35% !important; animation: tv-indet 1.1s ease-in-out infinite; }
@keyframes tv-indet { 0% { transform: translateX(-100%); } 100% { transform: translateX(290%); } }
.tv-dropover { position: absolute; inset: 12px; border: 3px dashed var(--brand-500); border-radius: 20px; background: rgba(238, 242, 255, .9); display: none; place-items: center; z-index: 40; pointer-events: none; font-size: 20px; font-weight: 700; color: var(--brand-700); }
.tv.dragover .tv-dropover { display: grid; }

/* Hasil */
.done-card { background: #fff; border: 1px solid var(--ink-200); border-radius: 20px; padding: 24px; max-width: 780px; margin: 0 auto; box-shadow: var(--shadow); }
.done-card.wide { max-width: none; }
.done-head { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 18px; }
.done-icon { flex: none; width: 48px; height: 48px; border-radius: 50%; background: var(--ok); color: #fff; display: grid; place-items: center; }
.done-icon svg { width: 24px; height: 24px; }
.done-head h2 { margin: 2px 0 4px; font-size: 21px; letter-spacing: -.02em; line-height: 1.3; }
.done-head p { margin: 0; color: var(--ink-500); font-size: 14.5px; }
.dlist { display: grid; gap: 8px; max-height: 440px; overflow-y: auto; }
.drow { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--ink-200); border-radius: 12px; }
.dicon { width: 38px; height: 38px; border-radius: 10px; background: var(--brand-50); color: var(--brand-600); display: grid; place-items: center; flex: none; }
.dicon svg { width: 20px; height: 20px; }
.dinfo { flex: 1; min-width: 0; display: grid; }
.dinfo b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dinfo small { font-size: 12.5px; color: var(--ink-500); }
.dacts { display: flex; gap: 6px; flex: none; }
.dacts .btn svg { width: 16px; height: 16px; }
.dmore { font-size: 13px; color: var(--ink-500); margin: 4px 0 0; }
.done-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.done-actions .btn svg { width: 17px; height: 17px; }

/* Bandingkan */
.cmp { margin-top: 4px; }
.cmp-sec + .cmp-sec { margin-top: 28px; }
.cmp-sec h3 { margin: 0 0 10px; font-size: 17px; }
.cmp-stats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.cmp-stats span { font-size: 12.5px; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.st-chg { background: #fef3c7; color: #92400e; }
.st-add { background: #dcfce7; color: #166534; }
.st-del { background: #fee2e2; color: #991b1b; }
.cmp-table-wrap { max-height: 560px; overflow: auto; border: 1px solid var(--ink-200); border-radius: 12px; }
.cmp-table { width: 100%; border-collapse: collapse; font-size: 13px; table-layout: fixed; }
.cmp-table th { position: sticky; top: 0; background: var(--ink-50); text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--ink-200); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; z-index: 1; }
.cmp-table td { padding: 5px 10px; vertical-align: top; border-bottom: 1px solid var(--ink-100); word-break: break-word; }
.cmp-table .pn { width: 44px; color: var(--ink-400); font-size: 11.5px; text-align: right; }
.cmp-table tr.chg td { background: #fffbeb; }
.cmp-table tr.add td { background: #f0fdf4; }
.cmp-table tr.del td { background: #fef2f2; }
.cmp-table tr.eq td { color: var(--ink-500); }
.cmp-table tr.skip td { text-align: center; color: var(--ink-400); font-style: italic; background: var(--ink-50); }
.cmp del { background: #fecaca; color: #991b1b; text-decoration: line-through; border-radius: 3px; }
.cmp ins { background: #bbf7d0; color: #166534; text-decoration: none; border-radius: 3px; }
.cmp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.cmp-card { margin: 0; border: 1px solid var(--ink-200); border-radius: 12px; overflow: hidden; background: #fff; }
.cmp-card.diff { border-color: #fca5a5; }
.cmp-card img { display: block; width: 100%; height: auto; }
.cmp-card figcaption { padding: 8px 10px; font-size: 12.5px; font-weight: 600; color: var(--ink-700); border-top: 1px solid var(--ink-100); }
.cmp-card.diff figcaption { color: #b91c1c; }
.cmp-miss { aspect-ratio: 1 / 1.3; display: grid; place-items: center; color: var(--ink-500); font-size: 13px; background: var(--ink-50); padding: 12px; text-align: center; }
.cmp-note { font-size: 13.5px; color: var(--ink-500); margin: 0 0 12px; }
.cmp-note .red { color: #ef4444; }
.cmp-same, .cmp-empty { margin: 0; padding: 14px; border-radius: 12px; background: var(--ok-bg); color: var(--ok); font-weight: 600; font-size: 14px; }
.cmp-empty { background: var(--ink-50); color: var(--ink-700); }

/* Formulir khusus (invoice, surat lamaran) */
.cform { display: grid; gap: 24px; }
.cf-sec h3 { margin: 0 0 12px; font-size: 15px; letter-spacing: -.01em; }
.cf-sec h3 small { font-weight: 500; color: var(--ink-500); font-size: 13px; }
.cf-sec > .btn { margin-top: 2px; }
.cf-sec .btn svg { width: 16px; height: 16px; }
.cf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cf-grid .wide { grid-column: 1 / -1; }
.cf-grid-3 { grid-template-columns: repeat(3, 1fr); margin-top: 16px; }
.field.area { height: auto !important; padding: 10px 12px !important; line-height: 1.55; resize: vertical; font-size: 14.5px !important; font-family: inherit; }
.cf-logo { display: flex; align-items: center; gap: 8px; min-height: 42px; }
.cf-logo img { height: 42px; max-width: 120px; object-fit: contain; border: 1px solid var(--ink-200); border-radius: 8px; padding: 3px; background: #fff; }
.items { display: grid; gap: 6px; margin-bottom: 10px; }
.items-head, .items-row { display: grid; grid-template-columns: minmax(0, 1fr) 70px 140px 120px 36px; gap: 6px; align-items: center; }
.items-head span { font-size: 12px; font-weight: 600; color: var(--ink-500); }
.items-head span:nth-child(4) { text-align: right; }
.items-row .field { height: 40px; font-size: 14px; padding: 0 10px; }
.items-sum { font-size: 13.5px; font-weight: 600; text-align: right; white-space: nowrap; }
.inv-total { margin-top: 16px; text-align: right; font-size: 15px; color: var(--ink-700); }
.inv-total b { font-size: 21px; color: var(--brand-700); margin-left: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chipcheck { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border: 1px solid var(--ink-200); border-radius: 999px; font-size: 13.5px; cursor: pointer; background: #fff; color: var(--ink-700); }
.chipcheck:has(input:checked) { border-color: var(--brand-500); background: var(--brand-50); color: var(--brand-700); }
.chipcheck input { accent-color: var(--brand-600); width: 16px; height: 16px; margin: 0; }
.sigpick { display: flex; flex-wrap: wrap; gap: 8px; }
.sigpick button { height: 56px; min-width: 96px; padding: 6px 10px; border: 1.5px solid var(--ink-200); border-radius: 10px; background: #fff; cursor: pointer; display: grid; place-items: center; font-size: 13px; font-weight: 600; color: var(--ink-700); }
.sigpick button:hover { border-color: var(--ink-400); }
.sigpick button.on { border-color: var(--brand-500); box-shadow: 0 0 0 3px var(--brand-100); }
.sigpick img { max-height: 40px; max-width: 110px; object-fit: contain; }

/* Bookmark */
.bm-bar { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 12px; }
.bm-bar .btn svg { width: 16px; height: 16px; }
.bm-list { display: grid; gap: 6px; }
.bm-row { display: flex; align-items: center; gap: 6px; padding-left: calc(var(--lvl, 0) * 22px); }
.bm-indent, .bm-acts { display: flex; flex: none; }
.bm-indent .icon-btn, .bm-acts .icon-btn { width: 30px; height: 30px; }
.bm-indent svg, .bm-acts svg { width: 17px; height: 17px; }
.bm-row .bm-title { flex: 1; min-width: 0; height: 40px; font-size: 14px; padding: 0 10px; border-radius: 10px; }
.bm-page { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-500); white-space: nowrap; flex: none; }
.bm-page .field { width: 70px; height: 40px; padding: 0 8px; font-size: 14px; border-radius: 10px; }
.bm-empty { padding: 16px; border: 1px dashed var(--ink-200); border-radius: 12px; text-align: center; color: var(--ink-500); font-size: 14px; margin: 0; }

.pw-err { color: var(--danger); font-size: 13px; margin: 8px 0 0; font-weight: 600; }

/* ---------- Responsif ---------- */
@media (max-width: 960px) {
  .tv-work { grid-template-columns: 1fr; }
  .tv-side { position: static; }
}
@media (max-width: 720px) {
  .hero-tools { font-size: 13px; padding-right: 12px; }
  .hero-tools b { white-space: normal; }
  .tgrid-tools { margin-top: -28px; }
  .tsearch { max-width: none; }
  .tchips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; width: calc(100% + 32px); }
  .tchips::-webkit-scrollbar { display: none; }
  .tchip { flex: none; }
  .tcards { grid-template-columns: 1fr; }
  .tcards-sm { grid-template-columns: 1fr 1fr; }

  .tv-top { padding: 0 10px; gap: 6px; }
  .tv-top .logo span, .tv-top .ed-secure { display: none; }
  .tv-wrap { padding: 18px 16px 110px; }
  .tv-head { gap: 12px; margin-bottom: 16px; }
  .tv-icon { width: 46px; height: 46px; border-radius: 13px; }
  .tv-icon svg { width: 24px; height: 24px; }
  .tv-head h1 { font-size: 21px; }
  .tv-head p { font-size: 14px; }
  .tv-drop { min-height: 260px; padding: 24px 16px; }
  .tv-main, .tv-side { padding: 14px; border-radius: 16px; }
  .tv-side .tv-run { position: sticky; bottom: 12px; z-index: 5; box-shadow: 0 10px 24px -8px rgba(79, 70, 229, .7); }
  .pgrid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 12px 10px; }
  .pg-tools button { width: 26px; height: 26px; }
  .frow { gap: 8px; padding: 8px; }
  .fthumb { width: 42px; height: 52px; }
  .facts .icon-btn { width: 30px; height: 30px; }
  .fsingle { align-items: flex-start; }
  .fthumb-lg { width: 72px; height: 94px; }

  .cf-grid, .cf-grid-3 { grid-template-columns: 1fr; }
  .items-head { display: none; }
  .items-row { grid-template-columns: 1fr 1fr 36px; padding: 10px; border: 1px solid var(--ink-200); border-radius: 12px; }
  .items-row [data-it="desc"] { grid-column: 1 / -1; }
  .items-row [data-it="qty"] { grid-column: 1; }
  .items-row [data-it="price"] { grid-column: 2 / 4; }
  .items-sum { grid-column: 1 / 3; text-align: left; }
  .bm-row { flex-wrap: wrap; padding-left: calc(var(--lvl, 0) * 14px); padding-bottom: 8px; border-bottom: 1px solid var(--ink-100); }
  .bm-row .bm-title { flex-basis: calc(100% - 70px); }
  .bm-acts { margin-left: auto; }

  .done-card { padding: 18px; border-radius: 18px; }
  .drow { flex-wrap: wrap; }
  .dacts { width: 100%; justify-content: flex-end; }
  .done-actions .btn { flex: 1 1 100%; }
}
