/* =====================================================================
   Assessor Portal — shared styles (same palette as the generator)
   ===================================================================== */
:root{
  --tuv-blue:#0e5aa7; --tuv-blue-dark:#003b73; --ink:#1c2530;
  --muted:#6b7785; --line:#e3e8ee; --bg:#eef2f6; --panel:#fff;
  --accent:#1063b5; --shadow:0 10px 40px rgba(16,49,89,.10);
  --ok:#0a7d3c; --ok-bg:#e7f7ed; --warn:#9a5b00; --warn-bg:#fff4e0;
  --bad:#b3261e; --bad-bg:#fdeeee; --info:#1063b5; --info-bg:#e8f1fb;
  --issued:#5b3fb0; --issued-bg:#f0ecfb;
}
*{ box-sizing:border-box; margin:0; padding:0; }
html{ -webkit-text-size-adjust:100%; }
body{
  font-family:'Archivo','Helvetica Neue',Arial,sans-serif;
  background:radial-gradient(1200px 600px at 80% -10%,#dbe8f6 0%,transparent 60%),var(--bg);
  color:var(--ink); min-height:100vh; line-height:1.5; font-size:14px;
}
button,input,select,textarea{ font:inherit; color:inherit; }
[hidden]{ display:none !important; }

/* ---------- top bar ---------- */
header.topbar{
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:12px 20px; background:#fff; border-bottom:1px solid var(--line);
  position:sticky; top:0; z-index:50;
}
.brand{ display:flex; align-items:center; gap:12px; min-width:0; }
.brand svg{ width:34px; height:34px; flex-shrink:0; }
.brand h1{ font-size:17px; font-weight:700; letter-spacing:-.01em; color:var(--tuv-blue-dark); line-height:1.2; }
.brand p{ font-size:12px; color:var(--muted); }
.who{ display:flex; align-items:center; gap:8px; }
.who .name{ font-size:13px; font-weight:600; color:var(--tuv-blue-dark); text-align:right; line-height:1.2; }
.who .name small{ display:block; font-weight:500; color:var(--muted); font-size:11.5px; }
@media (max-width:560px){ .who .name{ display:none; } .brand p{ display:none; } }

/* ---------- layout ---------- */
.wrap{ max-width:1320px; margin:0 auto; padding:20px 16px 40px; }
.narrow{ max-width:640px; }
.panel{ background:var(--panel); border:1px solid var(--line); border-radius:16px; box-shadow:var(--shadow); }
.panel-head{ padding:15px 20px 12px; border-bottom:1px solid var(--line); background:linear-gradient(180deg,#f6f9fc,#fff); border-radius:16px 16px 0 0; display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap; }
.panel-head h2{ font-size:16px; font-weight:700; color:var(--tuv-blue-dark); }
.panel-head p{ font-size:12.5px; color:var(--muted); margin-top:1px; }
.panel-body{ padding:18px 20px; }
.panel-foot{ padding:14px 20px; border-top:1px solid var(--line); background:#fafcfe; border-radius:0 0 16px 16px; display:flex; gap:10px; flex-wrap:wrap; }

/* ---------- tabs ---------- */
.tabs{ display:flex; gap:4px; background:#e3eaf2; padding:4px; border-radius:12px; margin-bottom:16px; width:max-content; max-width:100%; overflow-x:auto; }
.tab{ border:0; background:transparent; padding:8px 16px; border-radius:9px; font-weight:600; font-size:13.5px; color:#4a5a6b; cursor:pointer; white-space:nowrap; display:inline-flex; gap:7px; align-items:center; }
.tab.active{ background:#fff; color:var(--tuv-blue-dark); box-shadow:0 2px 8px rgba(16,49,89,.10); }
.tab .badge{ background:var(--tuv-blue); color:#fff; font-size:11px; padding:0 7px; border-radius:20px; line-height:18px; }

/* ---------- form fields ---------- */
.section-label{ font-size:11px; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:var(--accent); margin:18px 0 10px; display:flex; align-items:center; gap:8px; }
.section-label:first-child{ margin-top:0; }
.section-label::after{ content:""; flex:1; height:1px; background:var(--line); }
.field{ margin-bottom:13px; }
.field label{ display:block; font-size:12.5px; font-weight:600; color:#44505d; margin-bottom:5px; }
.field label .req{ color:var(--bad); }
.field .help{ font-size:11.5px; color:var(--muted); margin-top:4px; }
.input, .field input[type=text], .field input[type=password], .field input[type=date], .field input[type=number], .field select, .field textarea{
  width:100%; padding:10px 12px; font-size:15px; border:1px solid #d6dee6; border-radius:10px; background:#fbfcfe;
  transition:border-color .15s, box-shadow .15s; min-height:42px;
}
.field textarea{ min-height:80px; resize:vertical; font-size:14px; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus{ outline:none; border-color:var(--accent); box-shadow:0 0 0 3px rgba(16,99,181,.12); background:#fff; }
.row2{ display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.row3{ display:grid; grid-template-columns:1fr 1fr 1fr; gap:12px; }
@media (max-width:520px){ .row2,.row3{ grid-template-columns:1fr; gap:0; } }
.check{ display:flex; gap:9px; align-items:flex-start; font-size:13px; color:#44505d; cursor:pointer; }
.check input{ width:18px; height:18px; margin-top:1px; accent-color:var(--tuv-blue); }

/* ---------- buttons ---------- */
.btn{ padding:10px 16px; font-size:14px; font-weight:600; border-radius:10px; cursor:pointer; border:1px solid transparent; transition:transform .08s, box-shadow .15s, background .15s; display:inline-flex; align-items:center; justify-content:center; gap:7px; white-space:nowrap; min-height:42px; text-decoration:none; }
.btn:active{ transform:translateY(1px); }
.btn:disabled{ opacity:.5; cursor:not-allowed; }
.btn-primary{ background:linear-gradient(180deg,#1370c9,var(--tuv-blue)); color:#fff; box-shadow:0 4px 14px rgba(14,90,167,.28); }
.btn-primary:hover:not(:disabled){ box-shadow:0 6px 20px rgba(14,90,167,.40); }
.btn-ghost{ background:#fff; color:var(--tuv-blue-dark); border-color:#cdd8e3; }
.btn-ghost:hover:not(:disabled){ background:#f3f7fb; }
.btn-ok{ background:var(--ok); color:#fff; }
.btn-ok:hover:not(:disabled){ background:#086b33; }
.btn-bad{ background:#fff; color:var(--bad); border-color:#e7c3c0; }
.btn-bad:hover:not(:disabled){ background:var(--bad-bg); }
.btn-sm{ padding:6px 11px; font-size:12.5px; min-height:32px; border-radius:8px; }
.btn-block{ width:100%; }
.btn-icon{ width:36px; height:36px; padding:0; min-height:0; }
.grow{ flex:1; }

/* ---------- status chips ---------- */
.chip{ display:inline-flex; align-items:center; gap:5px; font-size:11.5px; font-weight:700; padding:2px 9px; border-radius:20px; white-space:nowrap; text-transform:capitalize; }
.chip::before{ content:""; width:6px; height:6px; border-radius:50%; background:currentColor; }
.chip.pending{ color:var(--warn); background:var(--warn-bg); }
.chip.approved{ color:var(--ok); background:var(--ok-bg); }
.chip.rejected{ color:var(--bad); background:var(--bad-bg); }
.chip.issued{ color:var(--issued); background:var(--issued-bg); }
.chip.inactive{ color:#6b7785; background:#eef1f4; }

/* ---------- photo picker ---------- */
.photo-pick{ display:flex; gap:14px; align-items:center; }
.photo-box{ width:92px; height:101px; border-radius:10px; border:1.5px dashed #b9c8d8; background:#f1f6fc; display:flex; align-items:center; justify-content:center; overflow:hidden; cursor:pointer; flex-shrink:0; color:var(--accent); position:relative; }
.photo-box:hover{ border-color:var(--accent); }
.photo-box img{ width:100%; height:100%; object-fit:cover; }
.photo-box .ph-empty{ display:flex; flex-direction:column; align-items:center; gap:4px; font-size:11px; font-weight:600; text-align:center; padding:4px; }
.photo-actions{ display:flex; flex-direction:column; gap:8px; }
.photo-actions .help{ font-size:11.5px; color:var(--muted); }

/* ---------- login ---------- */
.login-wrap{ min-height:calc(100vh - 70px); display:grid; place-items:center; padding:24px 16px; }
.login-card{ width:min(400px,100%); }
.login-card .panel-body{ padding:22px; }
.err{ background:var(--bad-bg); color:var(--bad); border:1px solid #f1cfcc; padding:9px 12px; border-radius:9px; font-size:13px; margin-bottom:12px; }
.note-box{ background:var(--info-bg); color:#20466e; border:1px solid #cfe0f3; padding:10px 12px; border-radius:10px; font-size:12.5px; }

/* ---------- entry cards (assessor list) ---------- */
.filters{ display:flex; gap:6px; flex-wrap:wrap; margin-bottom:12px; }
.filter{ border:1px solid #cdd8e3; background:#fff; padding:5px 12px; border-radius:20px; font-size:12.5px; font-weight:600; color:#4a5a6b; cursor:pointer; }
.filter.active{ background:var(--tuv-blue-dark); border-color:var(--tuv-blue-dark); color:#fff; }
.filter .n{ opacity:.7; margin-left:3px; }
.cards{ display:flex; flex-direction:column; gap:10px; }
.ecard{ display:grid; grid-template-columns:56px 1fr auto; gap:12px; align-items:start; border:1px solid var(--line); border-radius:13px; padding:11px 12px; background:#fbfcfe; }
.ecard .th{ width:56px; height:62px; border-radius:8px; object-fit:cover; background:#e6edf4; }
.ecard .nm{ font-weight:700; font-size:14.5px; line-height:1.25; }
.ecard .mt{ font-size:12px; color:#55626f; margin-top:2px; word-break:break-word; }
.ecard .mt b{ color:#8693a0; font-weight:600; }
.ecard .rej{ margin-top:6px; font-size:12px; color:var(--bad); background:var(--bad-bg); border-radius:7px; padding:5px 8px; }
.ecard .side{ display:flex; flex-direction:column; align-items:flex-end; gap:8px; }
.empty{ text-align:center; color:var(--muted); padding:40px 16px; }
.empty b{ display:block; color:#7a8794; font-size:14px; margin-bottom:3px; }

/* ---------- table (admin) ---------- */
.toolbar{ display:flex; gap:8px; flex-wrap:wrap; align-items:center; padding:12px 16px; border-bottom:1px solid var(--line); }
.toolbar .input{ min-height:36px; padding:7px 11px; font-size:13.5px; width:auto; }
.selbar{ display:flex; gap:8px; flex-wrap:wrap; align-items:center; padding:10px 16px; background:#eef5fd; border-bottom:1px solid #d6e5f5; font-size:13px; }
.selbar .cnt{ font-weight:700; color:var(--tuv-blue-dark); margin-right:4px; }
.tbl-wrap{ overflow-x:auto; }
table.tbl{ width:100%; border-collapse:collapse; font-size:13px; }
.tbl th{ text-align:left; font-size:11px; letter-spacing:.06em; text-transform:uppercase; color:var(--muted); font-weight:700; padding:9px 10px; border-bottom:1px solid var(--line); background:#f8fafc; white-space:nowrap; position:sticky; top:0; }
.tbl td{ padding:8px 10px; border-bottom:1px solid #eef1f4; vertical-align:middle; }
.tbl tr:hover td{ background:#fafcff; }
.tbl tr.sel td{ background:#eef5fd; }
.tbl .th-img{ width:38px; height:42px; border-radius:6px; object-fit:cover; background:#e6edf4; display:block; cursor:zoom-in; }
.tbl .nm{ font-weight:700; }
.tbl .sub{ font-size:11.5px; color:var(--muted); }
.tbl input[type=checkbox]{ width:17px; height:17px; accent-color:var(--tuv-blue); cursor:pointer; }
.tbl .cert{ font-family:'Consolas','Menlo',monospace; font-size:12.5px; white-space:nowrap; }
.tbl .acts{ display:flex; gap:5px; justify-content:flex-end; }
.muted{ color:var(--muted); }
.mono{ font-family:'Consolas','Menlo',monospace; }

/* ---------- modal ---------- */
.modal{ position:fixed; inset:0; background:rgba(14,30,48,.55); display:none; align-items:center; justify-content:center; z-index:200; padding:16px; }
.modal.show{ display:flex; }
.modal-card{ background:#fff; border-radius:16px; width:min(560px,100%); max-height:calc(100vh - 32px); display:flex; flex-direction:column; overflow:hidden; box-shadow:0 30px 80px rgba(0,0,0,.4); }
.modal-card.wide{ width:min(720px,100%); }
.modal-head{ padding:14px 20px; border-bottom:1px solid var(--line); font-weight:700; color:var(--tuv-blue-dark); display:flex; justify-content:space-between; align-items:center; }
.modal-body{ padding:16px 20px; overflow-y:auto; }
.modal-foot{ padding:12px 20px; border-top:1px solid var(--line); display:flex; gap:10px; justify-content:flex-end; flex-wrap:wrap; }
.crop-area{ max-height:58vh; }
.crop-area img{ max-width:100%; display:block; }
.x{ border:0; background:transparent; font-size:22px; line-height:1; cursor:pointer; color:var(--muted); }

.hist{ font-size:12px; color:#55626f; border-top:1px dashed var(--line); margin-top:12px; padding-top:10px; }
.hist div{ padding:2px 0; }

/* ---------- toast ---------- */
.toast{ position:fixed; bottom:22px; left:50%; transform:translateX(-50%) translateY(20px); background:#10324f; color:#fff; padding:12px 20px; border-radius:11px; font-size:13.5px; font-weight:500; box-shadow:0 10px 30px rgba(0,0,0,.3); opacity:0; pointer-events:none; transition:all .3s; z-index:400; max-width:calc(100vw - 32px); text-align:center; }
.toast.show{ opacity:1; transform:translateX(-50%) translateY(0); }
.toast.bad{ background:var(--bad); }

.stats{ display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:10px; margin-bottom:16px; }
.stat{ background:#fff; border:1px solid var(--line); border-radius:13px; padding:11px 14px; cursor:pointer; transition:border-color .15s; }
.stat:hover{ border-color:#bcd0e6; }
.stat.active{ border-color:var(--tuv-blue); box-shadow:0 0 0 3px rgba(16,99,181,.10); }
.stat .k{ font-size:11.5px; color:var(--muted); font-weight:600; }
.stat .v{ font-size:22px; font-weight:700; color:var(--tuv-blue-dark); line-height:1.2; }
@media (max-width:760px){ .stats{ grid-template-columns:repeat(3,minmax(0,1fr)); } }

footer.sitefoot{ text-align:center; font-size:12px; color:var(--muted); padding:8px 20px 26px; }

/* ---------- bulk upload (assessor) ---------- */
.bk-drop{ border:1.5px dashed var(--accent); border-radius:12px; background:#f1f7fd; padding:12px; }
.bk-drop textarea{ width:100%; min-height:120px; resize:vertical; border:1px solid #cfdcea; border-radius:8px; padding:9px 11px; font-size:13px; font-family:'Consolas','Menlo',monospace; background:#fff; }
.bk-drop textarea:focus{ outline:none; border-color:var(--accent); box-shadow:0 0 0 3px rgba(16,99,181,.12); }
.bk-actions{ display:flex; gap:8px; align-items:center; flex-wrap:wrap; margin-top:10px; }
.bk-actions .help{ font-size:12px; color:var(--muted); }
.bk-defaults{ margin-top:14px; border:1px solid var(--line); border-radius:12px; padding:10px 14px; background:#fbfcfe; }
.bk-defaults summary{ cursor:pointer; font-weight:600; font-size:13px; color:var(--tuv-blue-dark); }
.bk-summary{ display:flex; gap:10px; align-items:center; flex-wrap:wrap; margin-bottom:10px; font-size:13px; }
.bk-summary b{ color:var(--tuv-blue-dark); }
.bk-summary .warn{ color:var(--warn); font-weight:600; }
.bk-summary .bad{ color:var(--bad); font-weight:600; }
.bk-rows{ display:flex; flex-direction:column; gap:10px; }
.bk-row{ display:grid; grid-template-columns:28px 64px 1fr 36px; gap:10px; align-items:start; border:1px solid var(--line); border-radius:12px; padding:10px; background:#fbfcfe; }
.bk-row.has-err{ border-color:#efc4c0; background:#fffafa; }
.bk-row .num{ font-size:12px; font-weight:700; color:var(--muted); padding-top:8px; text-align:center; }
.bk-row .photo-box{ width:64px; height:70px; }
.bk-row .photo-box .ph-empty{ font-size:10px; }
.bk-grid{ display:grid; grid-template-columns:1.4fr 1fr 1.3fr; gap:6px 8px; min-width:0; }
.bk-grid .w2{ grid-column:span 2; }
.bk-grid input{ width:100%; min-height:34px; padding:6px 9px; font-size:13.5px; border:1px solid #d6dee6; border-radius:8px; background:#fff; }
.bk-grid input:focus{ outline:none; border-color:var(--accent); box-shadow:0 0 0 3px rgba(16,99,181,.12); }
.bk-grid input.bad{ border-color:#e39a94; background:#fff6f5; }
.bk-grid label{ display:block; font-size:10.5px; font-weight:700; letter-spacing:.04em; text-transform:uppercase; color:#8693a0; margin-bottom:2px; }
.bk-issues{ grid-column:1 / -1; display:flex; gap:6px; flex-wrap:wrap; }
.bk-tag{ font-size:11.5px; font-weight:600; padding:2px 8px; border-radius:20px; }
.bk-tag.bad{ color:var(--bad); background:var(--bad-bg); }
.bk-tag.warn{ color:var(--warn); background:var(--warn-bg); }
.bk-tag.ok{ color:var(--ok); background:var(--ok-bg); }
@media (max-width:720px){
  .bk-row{ grid-template-columns:56px 1fr 34px; }
  .bk-row .num{ display:none; }
  .bk-row .photo-box{ width:56px; height:62px; }
  .bk-grid{ grid-template-columns:1fr 1fr; }
  .bk-grid .w2{ grid-column:span 2; }
  .bk-grid .full-sm{ grid-column:1 / -1; }
}
.bk-grid > div{ min-width:0; }
.bk-grid input[type=date]{ min-width:0; }

/* ---------- signatures ---------- */
.checker{ background-color:#fff; background-image:linear-gradient(45deg,#eef2f6 25%,transparent 25%),linear-gradient(-45deg,#eef2f6 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#eef2f6 75%),linear-gradient(-45deg,transparent 75%,#eef2f6 75%); background-size:12px 12px; background-position:0 0,0 6px,6px -6px,-6px 0; }
.sig-thumb{ width:74px; height:36px; border:1px solid var(--line); border-radius:6px; display:flex; align-items:center; justify-content:center; overflow:hidden; flex-shrink:0; }
.sig-thumb img{ max-width:100%; max-height:100%; object-fit:contain; }
.sig-prev{ width:150px; height:76px; border:1px solid var(--line); border-radius:9px; display:flex; align-items:center; justify-content:center; overflow:hidden; flex-shrink:0; padding:4px; }
.sig-prev img{ max-width:100%; max-height:100%; object-fit:contain; }
.sig-prev.big{ width:100%; height:120px; }
.sig-pick{ display:flex; gap:14px; align-items:flex-start; }
@media (max-width:520px){ .sig-pick{ flex-direction:column; } .sig-prev{ width:100%; } }
.sig-grid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(190px,1fr)); gap:12px; }
.sig-card{ text-align:left; border:1px solid var(--line); background:#fbfcfe; border-radius:12px; padding:10px; cursor:pointer; display:flex; flex-direction:column; gap:6px; transition:border-color .15s, box-shadow .15s; }
.sig-card:hover{ border-color:#bcd0e6; box-shadow:0 6px 18px rgba(16,49,89,.08); }
.sig-card .sig-prev{ width:100%; height:70px; }
.sig-card .nm{ font-weight:700; font-size:13.5px; }
.sig-card .sub{ font-size:11.5px; color:var(--muted); }
.sig-card.off{ opacity:.6; }
@media (max-width:560px){ .hide-sm{ display:none; } }
@media (max-width:560px){ .hide-sm{ display:none; } }
