:root { --bg: #0b1220; --panel: #121b2e; --panel2: #18233a; --line: #26344f; --tx: #e6edf7; --tx2: #9fb0c8; --acc: #14b8a6; --acc2: #2563eb; --ok: #22c55e; --warn: #f59e0b; --bad: #ef4444; --jul: #a78bfa; --HH: #b91c1c; --H: #ef4444; --M: #f59e0b; --L: #94a3b8; }
[data-theme=light] { --bg: #eef2f7; --panel: #ffffff; --panel2: #f4f7fb; --line: #d8e0ec; --tx: #0f172a; --tx2: #55657e; --jul: #7c3aed; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--tx); font: 15px/1.45 -apple-system, "Segoe UI", Roboto, Arial, sans-serif; -webkit-tap-highlight-color: transparent; }
a { color: var(--acc); cursor: pointer; text-decoration: none; }
button { font: inherit; color: inherit; }
input, textarea, select { font: inherit; color: var(--tx); background: var(--panel2); border: 1px solid var(--line); border-radius: 9px; padding: 9px 10px; width: 100%; outline: none; }
input:focus, textarea:focus, select:focus { border-color: var(--acc); }
textarea { resize: vertical; min-height: 64px; }
.muted { color: var(--tx2); }
.row { display: flex; gap: 8px; align-items: center; } .wrap { flex-wrap: wrap; } .grow { flex: 1; min-width: 0; } .col { display: flex; flex-direction: column; gap: 8px; }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel2); cursor: pointer; font-weight: 600; white-space: nowrap; }
.btn:hover { border-color: var(--acc); }
.btn.pri { background: linear-gradient(135deg, var(--acc), var(--acc2)); border: 0; color: #fff; }
.btn.jul { background: linear-gradient(135deg, #8b5cf6, #6366f1); border: 0; color: #fff; }
.btn.sm { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 20px; font-size: 12px; font-weight: 700; background: var(--panel2); border: 1px solid var(--line); }
.c-HH { background: var(--HH); color: #fff; border-color: var(--HH); } .c-H { background: var(--H); color: #fff; border-color: var(--H); } .c-M { background: var(--M); color: #111; border-color: var(--M); } .c-L { background: var(--L); color: #111; border-color: var(--L); }
.s-ok { color: var(--ok); } .s-bad { color: var(--bad); } .s-warn { color: var(--warn); }

/* app shell */
#app { display: grid; grid-template-rows: auto 1fr; height: 100%; }
.top { display: flex; align-items: center; gap: 10px; padding: 8px 14px; background: var(--panel); border-bottom: 1px solid var(--line); position: relative; z-index: 5; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 800; white-space: nowrap; cursor: pointer; }
.logo i { font-style: normal; width: 32px; height: 32px; border-radius: 9px; background: linear-gradient(135deg, var(--acc), var(--acc2)); display: grid; place-items: center; color: #fff; }
.logo small { display: block; font-weight: 500; font-size: 11px; color: var(--tx2); }
.crumb { color: var(--tx2); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.julia { display: flex; align-items: center; gap: 8px; padding: 5px 12px 5px 5px; border-radius: 30px; border: 1px solid var(--line); background: var(--panel2); cursor: pointer; max-width: 46vw; min-width: 0; }
.julia .av { width: 28px; height: 28px; border-radius: 50%; background: linear-gradient(135deg, #a78bfa, #6366f1); color: #fff; display: grid; place-items: center; font-weight: 800; flex: none; }
.julia.busy .av { animation: pulse 1.2s infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 #a78bfa88; } 50% { box-shadow: 0 0 0 7px #a78bfa00; } }
.julia .jt { font-size: 13px; line-height: 1.2; min-width: 0; } .julia .jt b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .julia .jt span { color: var(--tx2); font-size: 11.5px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jbar { position: absolute; left: 0; right: 0; bottom: -3px; height: 3px; background: transparent; }
.jbar i { display: block; height: 100%; background: linear-gradient(90deg, #a78bfa, #14b8a6); transition: width .4s; }
.ibtn { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel2); cursor: pointer; display: grid; place-items: center; flex: none; }
.main { display: grid; grid-template-columns: 200px 1fr; min-height: 0; }
.nav { background: var(--panel); border-right: 1px solid var(--line); padding: 10px 8px; display: flex; flex-direction: column; gap: 3px; overflow: auto; }
.nav a { display: flex; align-items: center; gap: 9px; padding: 9px 10px; border-radius: 9px; color: var(--tx); font-weight: 600; font-size: 14px; }
.nav a.on { background: linear-gradient(135deg, #14b8a633, #2563eb33); color: var(--acc); }
.nav a .n { margin-left: auto; font-size: 11px; }
.nav .lab { font-size: 11px; text-transform: uppercase; color: var(--tx2); padding: 10px 10px 2px; letter-spacing: .05em; }
.page { overflow: auto; padding: 14px; min-height: 0; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.panel h3 { margin: 0 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--tx2); display: flex; align-items: center; gap: 8px; }
.grid { display: grid; gap: 12px; } .g2 { grid-template-columns: 1fr 1fr; } .g3 { grid-template-columns: repeat(3, 1fr); } .g4 { grid-template-columns: repeat(4, 1fr); }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px; cursor: pointer; } .kpi b { display: block; font-size: 28px; line-height: 1.1; } .kpi span { color: var(--tx2); font-size: 13px; }
.tabs { display: flex; gap: 4px; margin-bottom: 12px; overflow-x: auto; } .tabs a { padding: 8px 14px; border-radius: 9px; font-weight: 700; color: var(--tx2); white-space: nowrap; } .tabs a.on { background: var(--panel); color: var(--tx); border: 1px solid var(--line); }
h2 { margin: 0 0 12px; font-size: 22px; }

/* audit cards */
.acard { display: flex; gap: 14px; align-items: center; padding: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; cursor: pointer; }
.acard:hover { border-color: var(--acc); }
.ring { --p: 0; width: 64px; height: 64px; border-radius: 50%; background: conic-gradient(var(--acc) calc(var(--p) * 1%), var(--line) 0); display: grid; place-items: center; flex: none; }
.ring b { width: 50px; height: 50px; border-radius: 50%; background: var(--panel); display: grid; place-items: center; font-size: 14px; }
.sbar { display: flex; align-items: center; gap: 8px; padding: 6px 4px; cursor: pointer; border-radius: 8px; } .sbar:hover { background: var(--panel2); }
.sbar .t { width: 44%; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sbar .b { flex: 1; height: 10px; border-radius: 6px; background: var(--line); overflow: hidden; display: flex; } .sbar .b i { height: 100%; }
.sbar .v { width: 92px; text-align: right; font-size: 12.5px; color: var(--tx2); }

/* checklist */
.ck { display: grid; grid-template-columns: 340px 1fr; gap: 12px; height: calc(100vh - 150px); min-height: 420px; }
.ck .list { overflow: auto; padding: 6px; }
.it { display: flex; gap: 8px; padding: 8px; border-radius: 9px; cursor: pointer; font-size: 13.5px; align-items: flex-start; }
.it:hover { background: var(--panel2); } .it.on { background: linear-gradient(135deg, #14b8a622, #2563eb22); outline: 1px solid var(--acc); }
.it .no { font-weight: 800; width: 40px; flex: none; } .it .q { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--line); flex: none; margin-top: 3px; }
.dot.Yes { background: var(--ok); border-color: var(--ok); } .dot.No { background: var(--bad); border-color: var(--bad); } .dot.Partly { background: var(--warn); border-color: var(--warn); } .dot.NA { background: var(--L); border-color: var(--L); }
.sechd { font-size: 12px; font-weight: 800; color: var(--tx2); text-transform: uppercase; padding: 10px 8px 4px; position: sticky; top: -6px; background: var(--panel); z-index: 1; cursor: pointer; }
.card { overflow: auto; display: flex; flex-direction: column; gap: 10px; }
.card .qn { font-size: 13px; color: var(--tx2); font-weight: 700; } .card .qq { font-size: 19px; font-weight: 700; line-height: 1.35; }
.hint { border: 1px solid #a78bfa66; background: #a78bfa14; border-radius: 12px; padding: 9px 11px; font-size: 14px; }
.hint .j { color: var(--jul); font-weight: 800; }
.stb { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stb button { padding: 13px 6px; border-radius: 12px; border: 2px solid var(--line); background: var(--panel2); font-weight: 800; font-size: 15px; cursor: pointer; }
.stb button.on.Yes { background: var(--ok); border-color: var(--ok); color: #fff; } .stb button.on.Partly { background: var(--warn); border-color: var(--warn); color: #111; } .stb button.on.No { background: var(--bad); border-color: var(--bad); color: #fff; } .stb button.on.NA { background: var(--L); border-color: var(--L); color: #111; }
.crb { display: flex; gap: 6px; } .crb button { flex: 1; padding: 9px; border-radius: 10px; border: 2px solid var(--line); background: var(--panel2); font-weight: 800; cursor: pointer; }
.crb button.on { border-color: transparent; }
label.f { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 700; color: var(--tx2); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; } .chip { padding: 4px 10px; border-radius: 20px; border: 1px solid var(--line); background: var(--panel2); font-size: 12.5px; cursor: pointer; } .chip.on { background: var(--acc); color: #fff; border-color: var(--acc); } .chip.j { border-color: #a78bfa; color: var(--jul); }
.photos { display: flex; gap: 8px; flex-wrap: wrap; } .photos img { width: 84px; height: 84px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); cursor: pointer; }
.addph { width: 84px; height: 84px; border-radius: 10px; border: 2px dashed var(--line); display: grid; place-items: center; cursor: pointer; color: var(--tx2); font-size: 12px; text-align: center; }
.saved { font-size: 12px; color: var(--ok); }
.navbtns { display: flex; gap: 8px; position: sticky; bottom: 0; background: var(--panel); padding-top: 6px; }
table.t { width: 100%; border-collapse: collapse; font-size: 13.5px; } table.t th { text-align: left; color: var(--tx2); font-size: 12px; padding: 6px; border-bottom: 1px solid var(--line); } table.t td { padding: 4px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t td input { padding: 6px 8px; border-radius: 7px; }
.sg { display: flex; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); align-items: flex-start; }
.sg.done { opacity: .5; }

/* modal + toast */
.ov { position: fixed; inset: 0; background: #0008; display: grid; place-items: center; z-index: 50; padding: 12px; }
.modal { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; width: min(560px, 100%); max-height: 92vh; overflow: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.modal h3 { margin: 0; font-size: 18px; }
.done-pop { text-align: center; } .done-pop .big { font-size: 46px; }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: #111827; color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 60; font-weight: 600; box-shadow: 0 6px 20px #0006; }
.login { display: grid; place-items: center; height: 100%; padding: 16px; }
.login form { width: min(380px, 100%); display: flex; flex-direction: column; gap: 10px; }
.bnav { display: none; }

/* phone */
@media (max-width: 760px) {
  body { font-size: 16px; }
  .main { grid-template-columns: 1fr; }
  .nav { display: none; }
  .page { padding: 10px 10px 80px; }
  .g2, .g3, .g4 { grid-template-columns: 1fr 1fr; }
  .ck { grid-template-columns: 1fr; height: auto; }
  .ck.editing .list { display: none; } .ck:not(.editing) .card { display: none; }
  .crumb, .logo small { display: none; }
  .julia { max-width: none; flex: 1; }
  .bnav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; background: var(--panel); border-top: 1px solid var(--line); z-index: 20; padding-bottom: env(safe-area-inset-bottom); }
  .bnav a { flex: 1; text-align: center; padding: 8px 2px; font-size: 11.5px; color: var(--tx2); font-weight: 700; } .bnav a b { display: block; font-size: 19px; } .bnav a.on { color: var(--acc); }
  .stb button { padding: 16px 4px; }
  .card .qq { font-size: 18px; }
  .hide-m { display: none !important; }
}
@media print { .top, .nav, .bnav { display: none; } }
