* { box-sizing: border-box; }
body { margin: 0; font-family: Calibri, "Segoe UI", "Nirmala UI", "Noto Sans Bengali", "Kalpurush", Arial, sans-serif; background: #eef0f3; color: #111; }

/* ---------- top bar / toolbar ---------- */
.topbar { background: #1f2d3d; color: #fff; display: flex; justify-content: space-between; align-items: center; padding: 10px 18px; }
.topbar .brand { font-weight: bold; letter-spacing: .5px; }
.topbar a { color: #cfe3ff; margin-left: 16px; text-decoration: none; }
.topbar a:hover { text-decoration: underline; }
.topbar .user { margin-left: 18px; color: #ffd966; }
.toolbar { padding: 10px 18px; display: flex; gap: 10px; align-items: center; }
.toolbar button, .toolbar .btn, .filters button { padding: 8px 18px; border: 1px solid #888; background: #fff; border-radius: 4px; cursor: pointer; font-size: 14px; text-decoration: none; color: #111; }
.toolbar button.primary { background: #198754; color: #fff; border-color: #198754; }
#msg.err { color: #c00; font-weight: bold; }
#msg.ok { color: #198754; font-weight: bold; }

/* ---------- login ---------- */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-box { background: #fff; padding: 30px 34px; width: 340px; border-radius: 8px; box-shadow: 0 4px 18px rgba(0,0,0,.15); }
.login-box h1 { margin: 0; text-align: center; font-size: 22px; }
.login-box h2 { margin: 4px 0 20px; text-align: center; font-size: 15px; font-weight: normal; color: #555; }
.login-box label { display: block; margin: 12px 0 4px; font-size: 14px; }
.login-box input { width: 100%; padding: 9px; border: 1px solid #aaa; border-radius: 4px; font-size: 15px; }
.login-box button { margin-top: 20px; width: 100%; padding: 10px; background: #1f2d3d; color: #fff; border: 0; border-radius: 4px; font-size: 16px; cursor: pointer; }
.alert { background: #fde2e2; color: #a40000; padding: 8px 10px; border-radius: 4px; font-size: 14px; }

/* ---------- list page ---------- */
.page-wrap { padding: 16px 20px; }
.filters { margin-bottom: 12px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.filters input { padding: 7px; border: 1px solid #aaa; border-radius: 4px; }
.table-scroll { overflow-x: auto; }
table.list { border-collapse: collapse; background: #fff; width: 10%; font-size: 14px; }
table.list th, table.list td { border: 1px solid #ccc; padding: 6px 8px; text-align: left; white-space: nowrap; }
table.list th { background: #e3e8ee; }
.res-pass { color: #0a7a2f; font-weight: bold; }
.res-fail { color: #c00; font-weight: bold; }

/* ---------- AQL sheet ---------- */
.sheet-wrap { overflow-x: auto; padding: 0 18px 30px; }
table.sheet { border-collapse: collapse; background: #fff; table-layout: fixed; width: 300px; margin: 0 auto; font-size: 14px; }
table.sheet td { border: 1px solid #000; padding: 2px 6px; height: 28px; vertical-align: middle; overflow: hidden; }
table.sheet tr.spacer td { height: 8px; border: 0; padding: 0; }
.c { text-align: center; } .b { font-weight: bold; }
.company { font-size: 15px; height: 48px !important; }
.title { font-size: 22px; height: 44px !important; }
.lbl { text-align: left; font-size: 14px; }
.yel { background: #f0f0ef; }
table.sheet td.yel input, table.sheet td.yel select, table.sheet td.yel textarea { background: #f1f1f1; }

/* fields */
table.sheet input[type=text], table.sheet input[type=date], table.sheet input[type=time], table.sheet input[type=number],
table.sheet select, table.sheet textarea {
    font: inherit; border: 0; outline: 0; padding: 2px 4px; width: 70%; background: transparent;
}
table.sheet input.inl, table.sheet select.inl { width: auto; border-bottom: 1px dotted #666; }
table.sheet input.w220 { width: 220px; } table.sheet input.w100 { width: 110px; }
table.sheet input.auto, table.sheet textarea.auto { width: calc(100% - 110px); background: #f5f5f5; }
.desc textarea.auto { width: 100%; resize: none; }
.cm textarea { width: 100%; resize: vertical; background: #fdfdfd; border: 0; }
table.sheet input:focus, table.sheet select:focus, table.sheet textarea:focus { background: #f7f6f5 !important; }
.select2-container { vertical-align: middle; }

/* AQL table */
.hdr { background: #f2f2f2; }
.hdr.s { font-size: 13px; }
.lvl-head { cursor: pointer; }
.lvl-head.active { background: #ffc000; }
.aql-cell { font-size: 18px; transition: background .15s; }
.qty-cell { cursor: pointer; text-align: center; }
.qty-cell label { cursor: pointer; display: block; }
.qty-cell input { margin-right: 6px; }
.aql-cell.locked { background: #f0f0f0; color: #999; }
.aql-cell.dim { background: #e4e4e4; color: #a8a8a8; }
.aql-cell.active { background: #ffc000; color: #000; font-weight: bold; }
.qty-cell.suggest { outline: 2px dashed #198754; outline-offset: -3px; }

/* result block */
.res { font-size: 15px; background: #f2f2f2; color: #999; }
.res.on.res-f { background: #ff0000; color: #fff; }
.res.on.res-p { background: #00b050; color: #fff; }
.acc { background: #f7f6f6; }
.acc.bad { background: #ff0000; color: #fff; }

/* defects */
tr.dh td { background: #f2f2f2; }
td.sl { font-size: 14px; }
td.dname { font-size: 13px; white-space: nowrap; }
td.dq input { text-align: center; font-size: 15px; }
td.dq input:disabled { cursor: not-allowed; }
input.other-name { border-bottom: 1px dotted #888 !important; }
tr.drow td { height: 80px; }
tr.tot td { font-size: 15px; }
tr.tot td.c { background: #ffffff; }
tr.sign td { height: 90px; } tr.sign td:empty { border: 0; }
tr.sign td.yel { border: 1px solid #000; }
tr.signlbl td { border: 0 !important; height: 8px; }
tr.sign td:not(.yel) { border: 0; }
tr.sign td:empty, tr.signlbl td { border: 0; }
.r-title td, .r-title2 td { border: 0 !important; }
tr:has(> td > input[name=qc_name]) td:nth-child(n+8) { border: 0; }

/* print */
@media print {
    @page { size: A4 portrait; margin: 6mm; }
    body { background: #fff; }
    .no-print { display: none !important; }
    .sheet-wrap { padding: 0; overflow: visible; }
    table.sheet { zoom: .56; margin: 0; }
}

