/* Tampilan meniru iCount (DevExpress WinForms, skin Office 2019 Colorful) */
:root {
  --blue: #2b579a;
  --blue-d: #1e3f73;
  --blue-l: #dce6f4;
  --bg: #f3f3f3;
  --panel: #ffffff;
  --line: #d4d4d4;
  --text: #262626;
  --muted: #6b6b6b;
  --preview: #808080;
  --hover: #e8eef7;
  --sel: #c5d7ef;
  --err: #b3261e;
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  font-size: 13px;
  color: var(--text);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); }
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; }

/* login */
.login { min-height: 100%; display: grid; place-items: center; background: linear-gradient(160deg, #2b579a 0%, #1e3f73 100%); padding: 16px; }
.login-box { background: #fff; width: 100%; max-width: 360px; padding: 28px; border-radius: 4px; box-shadow: 0 10px 30px rgba(0,0,0,.25); display: grid; gap: 14px; }
.login-brand { display: flex; gap: 12px; align-items: center; font-size: 18px; margin-bottom: 6px; }
.login-brand img { width: 40px; height: 40px; }
.login-brand small { display: block; font-size: 12px; color: var(--muted); }
.login label { display: grid; gap: 4px; font-weight: 600; font-size: 12px; }
.login input { padding: 8px 10px; border: 1px solid var(--line); border-radius: 2px; font-weight: 400; font-size: 14px; }
.login input:focus { outline: 2px solid var(--blue); outline-offset: -1px; }
.hint { color: var(--muted); font-size: 12px; margin: 0; }
.err { color: var(--err); font-size: 12px; min-height: 1em; }

/* kerangka */
.app { display: grid; grid-template-rows: auto auto 1fr; height: 100vh; }
.titlebar { background: var(--blue); color: #fff; display: flex; align-items: center; gap: 10px; padding: 4px 10px; min-height: 36px; }
.titlebar .logo { width: 22px; height: 22px; }
.apptitle { font-weight: 600; white-space: nowrap; }
.titlebar select { background: var(--blue-d); color: #fff; border: 1px solid rgba(255,255,255,.35); padding: 3px 6px; border-radius: 2px; max-width: 260px; }
.spacer { flex: 1; }
.who { font-size: 12px; opacity: .9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }
.net { width: 10px; height: 10px; border-radius: 50%; background: #7bd88f; flex: none; }
.net.off { background: #ffb347; }

.btn { border: 1px solid #b9b9b9; background: #fdfdfd; padding: 5px 14px; border-radius: 2px; cursor: pointer; }
.btn:hover { background: var(--hover); border-color: #9ab4dc; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-d); }
.btn.flat { background: transparent; border-color: transparent; color: inherit; }
.titlebar .btn.flat:hover { background: rgba(255,255,255,.15); }

.ribbon { display: flex; background: #fff; border-bottom: 1px solid var(--line); overflow-x: auto; padding: 4px 4px 0; }
.rgroup { display: flex; align-items: center; gap: 2px; padding: 2px 10px 18px; position: relative; border-right: 1px solid #e3e3e3; flex: none; }
.rlabel { position: absolute; bottom: 2px; left: 0; right: 0; text-align: center; font-size: 11px; color: var(--muted); }
.rbtn { display: flex; flex-direction: column; align-items: center; gap: 2px; background: none; border: 1px solid transparent; padding: 3px 8px; cursor: pointer; font-size: 12px; border-radius: 2px; min-width: 52px; }
.rbtn.sm { min-width: 0; padding: 4px 6px; flex-direction: row; }
.rbtn:hover:not(:disabled) { background: var(--hover); border-color: #c3d4ee; }
.rbtn:disabled { opacity: .4; cursor: default; }
.rgroup select { padding: 3px; border: 1px solid var(--line); background: #fff; }
.pginfo { display: flex; align-items: center; gap: 4px; padding: 0 4px; }
.pginfo input { width: 56px; padding: 2px 4px; border: 1px solid var(--line); text-align: right; }
.ic { width: 22px; height: 22px; display: inline-block; background: no-repeat center / contain; }
.ic-print { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23555' d='M6 2h12v5H6z'/%3E%3Crect x='2' y='8' width='20' height='9' rx='1' fill='%232b579a'/%3E%3Cpath fill='%23fff' stroke='%23555' d='M6 13h12v8H6z'/%3E%3C/svg%3E"); }
.ic-xls { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='3' y='2' width='18' height='20' rx='1' fill='%23217346'/%3E%3Cpath stroke='%23fff' stroke-width='2' d='M8 7l8 10M16 7l-8 10'/%3E%3C/svg%3E"); }
.ic-hist { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='9' fill='none' stroke='%232b579a' stroke-width='2'/%3E%3Cpath d='M12 7v5l3 3' stroke='%23555' stroke-width='2' fill='none'/%3E%3C/svg%3E"); }

.work { display: grid; grid-template-columns: 260px 1fr 280px; min-height: 0; }
.work.noparams { grid-template-columns: 260px 1fr; }
.explorer, .params { background: var(--panel); display: flex; flex-direction: column; min-height: 0; }
.explorer { border-right: 1px solid var(--line); }
.params { border-left: 1px solid var(--line); }
.paneltitle { background: #f0f0f0; border-bottom: 1px solid var(--line); padding: 6px 10px; font-weight: 600; font-size: 12px; }
.search { margin: 8px; padding: 5px 8px; border: 1px solid var(--line); }
.tree { overflow: auto; flex: 1; padding-bottom: 12px; }
.tgroup > summary { list-style: none; cursor: pointer; padding: 4px 8px; font-weight: 600; display: flex; align-items: center; gap: 6px; user-select: none; }
.tgroup > summary::-webkit-details-marker { display: none; }
.tgroup > summary::before { content: "▸"; font-size: 10px; width: 10px; color: var(--muted); }
.tgroup[open] > summary::before { content: "▾"; }
.tgroup > summary .folder { width: 16px; height: 13px; background: #e8b84a; border-radius: 1px 3px 2px 2px; display: inline-block; }
.titem { display: flex; align-items: center; gap: 6px; padding: 3px 8px 3px 34px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border: 1px solid transparent; }
.titem::before { content: ""; width: 12px; height: 14px; background: #fff; border: 1px solid #8a8a8a; flex: none; box-shadow: inset 0 3px 0 #2b579a; }
.titem:hover { background: var(--hover); }
.titem.sel { background: var(--sel); border-color: #9ab4dc; }

.preview { background: var(--preview); overflow: auto; position: relative; min-height: 0; }
.pages { display: flex; flex-direction: column; align-items: safe center; gap: 14px; padding: 16px; transform-origin: top center; }
.empty { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; }
.empty-card { background: #fff; padding: 18px 22px; max-width: 420px; line-height: 1.5; border-radius: 2px; box-shadow: 0 2px 8px rgba(0,0,0,.2); }
.banner { position: sticky; top: 0; z-index: 3; background: #fff4ce; border-bottom: 1px solid #e6c84f; padding: 6px 12px; font-size: 12px; }
.busy { position: absolute; inset: 0; background: rgba(255,255,255,.55); display: flex; align-items: center; justify-content: center; gap: 10px; z-index: 5; font-weight: 600; }
.spinner { width: 22px; height: 22px; border: 3px solid var(--blue-l); border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.reptitle { padding: 8px 10px 0; font-weight: 600; color: var(--blue); }
.pform { padding: 8px 10px; display: grid; gap: 10px; overflow: auto; }
.pform label { display: grid; gap: 3px; font-size: 12px; }
.pform input, .pform select { padding: 4px 6px; border: 1px solid #c8c8c8; background: #fff; width: 100%; }
.pform input:focus, .pform select:focus { outline: 2px solid var(--blue); outline-offset: -1px; }
.pactions { display: flex; justify-content: flex-end; gap: 6px; padding: 8px 10px; border-top: 1px solid #eee; }
.params .err { padding: 0 10px 10px; }

/* halaman laporan */
.rx-page { background: #fff; position: relative; box-shadow: 0 1px 6px rgba(0,0,0,.45); flex: none; overflow: hidden; color: #000; }
.rx-layer { position: absolute; }
.rx { position: absolute; display: flex; overflow: hidden; line-height: 1.15; }
.rx > span { min-width: 0; max-width: 100%; }
.rx-ph { background: repeating-linear-gradient(45deg, #fafafa, #fafafa 6px, #f2f2f2 6px, #f2f2f2 12px); }

.dlg { border: 1px solid var(--line); padding: 0; width: min(640px, calc(100vw - 32px)); max-height: 80vh; }
.dlg::backdrop { background: rgba(0,0,0,.3); }
.dlg-head { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; background: var(--blue); color: #fff; font-weight: 600; }
.dlg-foot { padding: 8px 12px; border-top: 1px solid #eee; text-align: right; }
.histlist { max-height: 60vh; overflow: auto; }
.hitem { display: flex; gap: 10px; justify-content: space-between; align-items: center; padding: 8px 12px; border-bottom: 1px solid #f0f0f0; cursor: pointer; }
.hitem:hover { background: var(--hover); }
.hitem small { color: var(--muted); display: block; }

.print-area { display: none; }

@media (max-width: 900px) {
  .work, .work.noparams { grid-template-columns: 1fr; grid-template-rows: auto auto 1fr; }
  .explorer { max-height: 32vh; border-right: 0; border-bottom: 1px solid var(--line); }
  .params { border-left: 0; border-bottom: 1px solid var(--line); order: -1; }
  .apptitle { display: none; }
}

@media print {
  body > *:not(.print-area) { display: none !important; }
  .print-area { display: block; }
  .print-area .rx-page { box-shadow: none; break-after: page; margin: 0; }
  html, body { background: #fff; }
}
