/* Page Builder theme - same design language as bills.shinesun.in: white sidebar, soft cards, purple / teal accents. */
:root {
  --bg: #f5f6fa; --card: #fff; --hover: #f0f1f5; --input: #f8f9fc;
  --accent: #5b52e0; --accent-dark: #4a41cf; --accent-2: #0ea5a0;
  --err: #e74c3c; --ok: #1f9d55; --warn: #b36b00;
  --text: #1a1d2e; --text-2: #5a5f7a; --muted: #8e93ad; --line: #e2e4ed;
  --shadow: 0 2px 12px rgba(0,0,0,.06); --shadow-lg: 0 8px 24px rgba(0,0,0,.08);
  --radius: 12px; --radius-sm: 8px; --side: 260px;
  --brand: linear-gradient(135deg, var(--accent), var(--accent-2));
  --g: var(--accent); /* legacy name used by older rules */
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.55 Inter, -apple-system, "Segoe UI", system-ui, sans-serif; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); } a:hover { color: var(--accent-dark); }
::-webkit-scrollbar { width: 6px; height: 6px; } ::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }
[hidden] { display: none !important; }

/* ---------- sidebar + frame ---------- */
.hz-sidebar { width: var(--side); background: #fff; border-right: 1px solid var(--line); box-shadow: 2px 0 8px rgba(0,0,0,.03); position: fixed; inset: 0 auto 0 0; z-index: 1040; display: flex; flex-direction: column; transition: transform .2s ease; }
.sidebar-header { padding: 20px 20px 16px; border-bottom: 1px solid var(--line); }
.sidebar-header a { text-decoration: none; display: flex; align-items: center; gap: 10px; }
.hz-brand-logo { width: 34px; height: 34px; border-radius: 10px; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 16px; flex-shrink: 0; }
.hz-brand-text h2 { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: -.3px; line-height: 1.2; background: var(--brand); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.hz-brand-text .company { font-size: 11px; color: var(--muted); margin-top: 2px; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 8px; }
.sidebar-section-title { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); padding: 10px 12px 4px; }
.nav-link { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--radius-sm); color: var(--text-2); font-size: 13px; font-weight: 500; text-decoration: none; transition: all .2s ease; margin-bottom: 2px; }
.nav-link:hover { background: var(--hover); color: var(--text); }
.nav-link .nav-ic { width: 18px; display: grid; place-items: center; color: var(--muted); flex-shrink: 0; }
.nav-link.active { background: rgba(91,82,224,.08); color: var(--accent); font-weight: 600; } .nav-link.active .nav-ic { color: var(--accent); }
.sidebar-footer { padding: 12px; border-top: 1px solid var(--line); }
.hz-user { display: flex; align-items: center; gap: 10px; padding: 6px; }
.hz-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 600; flex-shrink: 0; }
.user-details { flex: 1; min-width: 0; } .user-details .name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.role-badge { font-size: 10px; font-weight: 600; letter-spacing: .5px; text-transform: uppercase; color: var(--accent-2); }
.hz-logout { width: 32px; height: 32px; padding: 0; border-radius: var(--radius-sm); display: grid; place-items: center; color: var(--text-2); }
.hz-logout:hover { background: #fdecea; color: var(--err); border-color: #f5c6c0; }
.hz-main { margin-left: var(--side); min-height: 100vh; }
.hz-top { background: #fff; border-bottom: 1px solid var(--line); padding: 16px 28px; display: flex; align-items: center; gap: 14px; position: sticky; top: 0; z-index: 30; }
.hz-top h1 { margin: 0; font-size: 18px; font-weight: 700; letter-spacing: -.2px; } .hz-top p { margin: 2px 0 0; color: var(--text-2); font-size: 13px; }
.hz-menu { display: none; width: 38px; height: 38px; padding: 0; font-size: 18px; }
#scrim { display: none; }
main { max-width: 1080px; margin: 24px auto; padding: 0 24px 60px; display: grid; gap: 18px; }

/* ---------- cards, forms, buttons ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow); }
.card h2 { margin: 0 0 14px; font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 10px; color: var(--text); }
.card h3 { font-size: 14px; }
.n { background: var(--brand); color: #fff; width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 12px; font-weight: 600; flex-shrink: 0; }
.row { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 12px; }
.row.end { justify-content: flex-end; margin: 14px 0 0; }
label { display: grid; gap: 5px; font-weight: 600; font-size: 12.5px; color: var(--text-2); min-width: 190px; }
label.grow { flex: 1; } label.check { display: flex; gap: 8px; align-items: center; font-weight: 400; margin-bottom: 12px; min-width: 0; }
small { font-weight: 400; color: var(--muted); font-size: 12px; }
input, select, textarea { font: inherit; color: var(--text); padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--input); width: 100%; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(91,82,224,.15); background: #fff; }
input[type=checkbox] { width: auto; accent-color: var(--accent); }
button { font: inherit; font-weight: 500; padding: 8px 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; color: var(--text); cursor: pointer; transition: all .15s ease; }
button:hover:not(:disabled) { background: var(--hover); }
button.primary { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; box-shadow: 0 2px 8px rgba(91,82,224,.25); }
button.primary:hover:not(:disabled) { background: var(--accent-dark); }
button:disabled { opacity: .5; cursor: not-allowed; }
button:focus-visible, a:focus-visible, .drop:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.row button + button { margin-left: 0; }
.drop { border: 2px dashed #cfd2e4; border-radius: var(--radius); padding: 30px; text-align: center; cursor: pointer; margin: 6px 0 12px; background: var(--input); color: var(--text-2); transition: all .15s; }
.drop:hover, .drop.over { border-color: var(--accent); background: rgba(91,82,224,.05); }
.drop strong { color: var(--accent); }
.muted { color: var(--text-2); font-size: 13px; }
code { background: #eef0f7; padding: 1px 6px; border-radius: 5px; font-size: 12.5px; color: var(--accent-dark); }
.err { color: var(--err); margin-top: 8px; white-space: pre-wrap; } .okmsg { color: var(--ok); }
.warnbox { background: #fff7e6; border: 1px solid #f3d9a0; color: var(--warn); padding: 10px 14px; border-radius: var(--radius-sm); margin-bottom: 12px; }
.badge { padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; } .badge.ok { background: #e3f6ea; color: var(--ok); } .badge.no { background: #fdecea; color: var(--err); }
.card .head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; } .card .head h2 { margin: 0; }
#list .card { margin-bottom: 4px; }
details > summary { cursor: pointer; padding: 6px 0; color: var(--accent); } details[open] > summary { margin-bottom: 8px; }

/* ---------- converted pages ---------- */
.item { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; margin-bottom: 12px; background: #fff; }
.item.bad { border-color: #f1b9b3; background: #fff7f6; }
.item .head { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; } .item .head b { flex: 1; word-break: break-word; }
.item .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; } .item .grid .full { grid-column: 1 / -1; }
.cnt { font-weight: 400; color: var(--muted); } .cnt.over { color: var(--err); font-weight: 600; }
.warns { margin: 10px 0 0; padding-left: 18px; color: var(--warn); font-size: 13px; } .warns:empty { display: none; }
.path-line { font-size: 13px; color: var(--text-2); margin-top: 8px; } .path-line code { word-break: break-all; }
.acts { display: flex; gap: 8px; margin-top: 10px; }
.live { margin: 6px 0; font-size: 13px; } .live a, #resList a { word-break: break-all; font-weight: 500; }
#resList { padding-left: 18px; } #resList li { margin: 4px 0; } #progress { margin: 6px 0; }
.imgbox { margin: 10px 0; padding: 10px 12px; border: 1px dashed #cfd2e4; border-radius: var(--radius-sm); background: var(--input); }
.thumb { max-width: 220px; max-height: 140px; display: block; margin: 6px 0; border: 1px solid var(--line); border-radius: 6px; } .imginfo { font-size: 12.5px; word-break: break-all; }
.dupflag { font-size: 12.5px; margin-left: 8px; font-weight: 500; } .warnflag { color: var(--warn); font-weight: 600; }
pre#log { background: #1a1d2e; color: #d9dcf5; padding: 14px; border-radius: var(--radius-sm); white-space: pre-wrap; max-height: 280px; overflow: auto; font-size: 12.5px; }

/* ---------- history, tables, quick ranges ---------- */
.daygroup { margin: 18px 0; } .daygroup h3 { margin: 0 0 6px; padding-bottom: 6px; border-bottom: 2px solid var(--line); color: var(--text); }
table.hist { width: 100%; border-collapse: collapse; font-size: 13px; }
table.hist th { text-align: left; padding: 7px 10px; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .6px; font-weight: 600; }
table.hist td { text-align: left; padding: 8px 10px; border-top: 1px solid var(--line); vertical-align: top; } table.hist a { word-break: break-all; }
table.hist tbody tr:hover { background: var(--input); }
.quick { gap: 8px; flex-wrap: wrap; align-items: center; }
.quick button { border-radius: 99px; padding: 6px 14px; font-size: 13px; }
.quick button.on { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ---------- dialogs ---------- */
dialog { border: 0; border-radius: var(--radius); padding: 20px 22px; max-width: 520px; width: 92vw; box-shadow: var(--shadow-lg); }
dialog::backdrop { background: rgba(26,29,46,.45); }
#blist { list-style: none; padding: 0; margin: 8px 0; max-height: 280px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }
#blist li { padding: 8px 12px; cursor: pointer; border-bottom: 1px solid var(--line); } #blist li:hover { background: rgba(91,82,224,.06); }
.path { font-family: ui-monospace, Consolas, monospace; background: #eef0f7; padding: 6px 10px; border-radius: 6px; word-break: break-all; }
dialog#preview { max-width: 1200px; width: 96vw; height: 92vh; padding: 0; overflow: hidden; } .pv { display: grid; grid-template-rows: auto 1fr; height: 100%; }
.pvbar { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--line); } #pvFrame { width: 100%; height: 100%; border: 0; }

/* ---------- sign-in ---------- */
body.hz-login { min-height: 100vh; display: grid; place-items: center; background: var(--bg); padding: 20px; }
.login-box { width: 100%; max-width: 400px; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 32px 30px; box-shadow: var(--shadow-lg); display: grid; gap: 14px; }
.login-box .hz-brand-logo { width: 46px; height: 46px; font-size: 22px; border-radius: 13px; margin: 0 auto 4px; }
.login-box h1 { margin: 0; text-align: center; font-size: 20px; letter-spacing: -.3px; } .login-box p { margin: 0 0 6px; text-align: center; color: var(--text-2); }
.login-box button.primary { width: 100%; padding: 10px; }

/* ---------- small screens ---------- */
@media (max-width: 900px) {
  .hz-sidebar { transform: translateX(-100%); }
  body.hz-side-open .hz-sidebar { transform: none; box-shadow: var(--shadow-lg); }
  body.hz-side-open #scrim { display: block; position: fixed; inset: 0; background: rgba(26,29,46,.4); z-index: 1030; }
  .hz-main { margin-left: 0; } .hz-menu { display: grid; place-items: center; } .hz-top { padding: 12px 16px; }
  main { padding: 0 14px 50px; margin-top: 16px; }
}
@media (max-width: 700px) { .item .grid { grid-template-columns: 1fr; } label { min-width: 0; width: 100%; } }

/* collapsible project cards */
.cardtoggle{display:flex;align-items:center;gap:8px;border:0;background:none;padding:2px 4px;font-size:15px;color:var(--text);text-align:left}.cardtoggle:hover:not(:disabled){background:var(--hover)}.cardtoggle .chev{width:14px;color:var(--accent);flex-shrink:0}.card .head .cardsum{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:right}.card .head{margin-bottom:0}.cardbody{margin-top:14px;padding-top:14px;border-top:1px solid var(--line)}#listBar{align-items:center;margin-bottom:0}
