/* NK Customer Portal — one stylesheet for every page. */
:root {
  --nk-blue: #1a237e;
  --nk-blue-2: #283593;
  --nk-accent: #ffca28;
  --nk-green: #e2efd9;     /* from customer Proforma Invoice */
  --nk-green-h: #c6e0b4;
  --nk-peach: #fbe4d5;     /* from agent booking */
  --nk-peach-h: #f8cbad;
  --nk-yellow: #fff9c4;    /* 0409 declaration date */
  --nk-yellow-h: #ffeb3b;
  --nk-head: #e8f5e9;
  --bg: #f3f5fa;
  --line: #e3e7ef;
  --muted: #6b7280;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08);
  --sidebar-w: 240px;
  --topbar-h: 56px;
  --bs-body-font-family: "IBM Plex Sans Thai", system-ui, -apple-system, "Segoe UI", sans-serif;
}
html, body { font-family: var(--bs-body-font-family); }
body { background: var(--bg); font-size: .9rem; color: #1f2937; }
body.bare { background: linear-gradient(135deg, #1a237e 0%, #3949ab 60%, #5c6bc0 100%); min-height: 100vh; }
.tiny { font-size: .72rem; }
.text-muted { color: var(--muted) !important; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #c7ccd8; border-radius: 9px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ── sidebar (collapsible, like nksl_plans) ── */
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); background: var(--nk-blue); color: #fff; z-index: 1040;
  display: flex; flex-direction: column; transition: transform .22s ease; }
.sidebar .brand { height: var(--topbar-h); padding: 0 1rem; display: flex; align-items: center; gap: .65rem; border-bottom: 1px solid rgba(255,255,255,.12); flex-shrink: 0; }
.brand-logo { width: 34px; height: 34px; border-radius: 9px; background: rgba(255,255,255,.14); display: inline-flex; align-items: center; justify-content: center; }
.brand-text { font-weight: 600; line-height: 1.1; font-size: .95rem; }
.brand-text small { display: block; font-weight: 400; font-size: .7rem; color: rgba(255,255,255,.65); }
.sidebar nav { overflow-y: auto; flex: 1; padding-bottom: 1rem; }
.sidebar .nav-group { padding: 1rem 1.1rem .35rem; font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: rgba(255,255,255,.5); }
.sidebar .nav-link { color: rgba(255,255,255,.85); padding: .55rem 1.1rem; margin: 1px .5rem; border-radius: 8px; display: flex; gap: .7rem; align-items: center; }
.sidebar .nav-link i { width: 1.1rem; text-align: center; opacity: .9; }
.sidebar .nav-link:hover { background: rgba(255,255,255,.09); color: #fff; }
.sidebar .nav-link.active { background: rgba(255,255,255,.16); color: #fff; box-shadow: inset 3px 0 0 var(--nk-accent); }
.sidebar-foot { padding: .75rem 1.1rem; border-top: 1px solid rgba(255,255,255,.12); color: rgba(255,255,255,.8); }
.main { margin-left: var(--sidebar-w); min-height: 100vh; transition: margin-left .22s ease; }
html.sidebar-collapsed .sidebar { transform: translateX(-100%); }
html.sidebar-collapsed .main { margin-left: 0; }
.sidebar-backdrop { display: none; }
@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.show { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.35); }
  .main { margin-left: 0 !important; }
  .sidebar-backdrop.show { display: block; position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 1035; }
}

/* ── topbar ── */
.topbar { position: sticky; top: 0; z-index: 1030; height: var(--topbar-h); background: rgba(255,255,255,.92); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line); padding: 0 1.25rem; display: flex; align-items: center; gap: .8rem; }
.sidebar-toggle { background: #fff; border: 1px solid var(--line); color: #4b5563; width: 36px; height: 36px; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; transition: background .15s; }
.sidebar-toggle:hover { background: #eef1f8; color: var(--nk-blue); }
.topbar-title { font-weight: 600; color: #374151; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.role-pill { align-items: center; gap: .35rem; font-size: .75rem; background: #eef1fb; color: var(--nk-blue); border-radius: 99px; padding: .25rem .7rem; }
.user-btn { display: inline-flex; align-items: center; gap: .45rem; border-radius: 99px; padding: .2rem .7rem .2rem .25rem; }
.avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--nk-blue); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: .75rem; font-weight: 600; }
.content { padding: 1.25rem 1.5rem 3rem; }   /* no max-width: browser zoom-out must widen every page */
@media (max-width: 991.98px) { .content { padding: .9rem .7rem 4rem; } .topbar { padding: 0 .7rem; } }

/* ── page header ── */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.page-title { font-size: 1.35rem; font-weight: 600; margin: 0; color: #111827; }
.page-sub { color: var(--muted); font-size: .85rem; margin-top: .15rem; }
.page-actions { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }

/* ── cards ── */
.card { border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: var(--radius); }
.card > .card-header:first-child { border-radius: var(--radius) var(--radius) 0 0; }
.card-header { background: #fff; font-weight: 600; border-bottom: 1px solid var(--line); padding: .75rem 1rem; display: flex; align-items: center; gap: .5rem; }
.card-header .ms-auto { font-weight: 400; }
.card-footer { background: #fafbfd; border-top: 1px solid var(--line); }
.btn { border-radius: 8px; }
.btn-sm { border-radius: 7px; }
.form-control, .form-select { border-radius: 8px; border-color: #d5dae4; }
.form-control:focus, .form-select:focus { border-color: #7986cb; box-shadow: 0 0 0 .2rem rgba(57,73,171,.15); }

/* ── filter bar ── */
.filter-bar { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(170px, 100%), 1fr)); gap: .65rem .75rem; align-items: end; padding: .9rem 1rem; }
.filter-bar .f-label { display: block; font-size: .72rem; font-weight: 600; color: var(--muted); margin-bottom: .2rem; text-transform: none; }
.filter-bar .form-control, .filter-bar .form-select, .filter-bar .btn { height: 34px; font-size: .85rem; }
.filter-bar .f-wide { grid-column: span 2; }
.filter-bar .f-actions { display: flex; gap: .4rem; justify-content: flex-end; align-items: end; grid-column: -2 / -1; }
.filter-bar .input-group .btn { display: inline-flex; align-items: center; }
.filter-bar > * { min-width: 0; }
.filter-bar .input-group { flex-wrap: nowrap; }
.filter-bar .input-group > .form-control { min-width: 0; }
@media (max-width: 575.98px) {
  .filter-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: .75rem; }
  .filter-bar .f-wide, .filter-bar .f-actions { grid-column: 1 / -1; }
  .filter-bar .f-actions .btn-primary { flex: 1; }
  .page-head { align-items: flex-start; }
  .page-actions { width: 100%; }
  .stat-chip { padding: .35rem .6rem; }
  .sched-meta dl { grid-template-columns: 7rem 1fr; }
}
.content { min-width: 0; }
.main { min-width: 0; overflow-x: clip; }
.input-icon { position: relative; }
.input-icon i { position: absolute; left: .65rem; top: 50%; transform: translateY(-50%); color: #9ca3af; font-size: .8rem; }
.input-icon .form-control { padding-left: 1.9rem; }

/* ── stat chips / dashboard cards ── */
.stat-chips { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 .9rem; }
.stat-chip { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: .45rem .8rem; display: inline-flex; align-items: center; gap: .55rem; box-shadow: var(--shadow); }
.stat-chip .v { font-weight: 600; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.stat-chip .l { color: var(--muted); font-size: .78rem; }
.stat-chip i { color: var(--nk-blue); opacity: .75; }
.kpi { border-radius: var(--radius); background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); padding: 1rem 1.1rem; height: 100%; display: flex; gap: .85rem; align-items: center; color: inherit; text-decoration: none; transition: transform .12s, box-shadow .12s; }
a.kpi:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(16,24,40,.08); }
.kpi .ico { width: 44px; height: 44px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.1rem; flex-shrink: 0; }
.kpi .v { font-size: 1.5rem; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi .l { color: var(--muted); font-size: .8rem; }
.ico-blue { background: #e8eaf6; color: #3949ab; } .ico-green { background: #e8f5e9; color: #2e7d32; } .ico-amber { background: #fff8e1; color: #f57f17; }
.ico-red { background: #ffebee; color: #c62828; } .ico-teal { background: #e0f2f1; color: #00796b; } .ico-purple { background: #f3e5f5; color: #6a1b9a; }

/* ── status badge ── */
.status-badge { display: inline-flex; align-items: center; gap: .35rem; font-size: .75rem; font-weight: 600; padding: .18rem .55rem; border-radius: 99px; white-space: nowrap; }
.status-badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.sb-secondary { background: #f1f3f5; color: #5c636a; } .sb-info { background: #e3f2fd; color: #1565c0; } .sb-warning { background: #fff8e1; color: #b26a00; }
.sb-success { background: #e8f5e9; color: #2e7d32; } .sb-dark { background: #eceff1; color: #263238; } .sb-danger { background: #ffebee; color: #c62828; } .sb-primary { background: #e8eaf6; color: #283593; }

/* ── empty state ── */
.empty-state { text-align: center; color: var(--muted); padding: 2.5rem 1rem; }
.empty-state i { font-size: 2.2rem; color: #c5cae9; display: block; margin-bottom: .6rem; }

/* ── list footer (pagination) ── */
.list-footer { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; font-size: .82rem; padding: .55rem 1rem; }
.list-footer .sep { color: #cbd2dc; margin: 0 .25rem; }
.list-footer nav { margin-left: auto; }
.per-page-form { display: flex; align-items: center; gap: .35rem; }
.per-page-form .form-select { width: auto; padding-top: .15rem; padding-bottom: .15rem; }
.list-footer nav + .per-page-form { margin-left: .5rem; }
.list-footer > .per-page-form:nth-child(2) { margin-left: auto; }

/* ── tables ── */
.table { --bs-table-hover-bg: #f6f8ff; }
.table > :not(caption) > * > * { border-color: var(--line); }
.table thead th { font-size: .78rem; font-weight: 600; color: #4b5563; background: #f7f8fb; white-space: nowrap; }
.table-tight td, .table-tight th { padding: .45rem .6rem; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.row-selected > td { box-shadow: inset 0 0 0 9999px rgba(57,73,171,.08) !important; }
th.col-check, td.col-check { width: 34px; text-align: center; }
.col-check .form-check-input { cursor: pointer; margin: 0; }

/* ── bulk bar ── */
.bulk-bar { position: sticky; top: calc(var(--topbar-h) + .4rem); z-index: 20; display: none; align-items: center; gap: .5rem; flex-wrap: wrap;
  background: #1a237e; color: #fff; border-radius: 10px; padding: .45rem .6rem .45rem 1rem; margin-bottom: .6rem; box-shadow: 0 6px 18px rgba(26,35,126,.25); }
.bulk-bar.show { display: flex; }
.bulk-bar .count { font-weight: 600; margin-right: .5rem; }
.bulk-bar .btn { border-color: rgba(255,255,255,.35); color: #fff; }
.bulk-bar .btn:hover { background: rgba(255,255,255,.14); }
.bulk-bar .btn-clear { margin-left: auto; }

/* ── schedule board (sheet "20 JUNE SODA") ── */
.sched-card .sched-title { text-align: center; font-weight: 600; font-size: 1.1rem; letter-spacing: .02em; color: var(--nk-blue); margin-bottom: .6rem; }
.sched-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: .1rem 2rem; font-size: .85rem; }
.sched-meta dl { display: grid; grid-template-columns: 9rem 1fr; margin: 0; row-gap: .15rem; }
.sched-meta dt { color: var(--muted); font-weight: 400; }
.sched-meta dd { margin: 0; font-weight: 500; }
.board-toolbar { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; font-size: .8rem; margin: .2rem 0 .5rem; }
.legend .sw { display: inline-block; width: 13px; height: 13px; border-radius: 3px; border: 1px solid rgba(0,0,0,.15); vertical-align: -2px; margin-right: 4px; }
.board-wrap { overflow: auto; max-height: calc(100vh - 230px); border-radius: var(--radius) var(--radius) 0 0; background: #fff; }
table.board { font-size: .82rem; margin: 0; white-space: nowrap; border-collapse: separate; border-spacing: 0; }
table.board th, table.board td { border-right: 1px solid #e3e7ee; border-bottom: 1px solid #e3e7ee; padding: .35rem .5rem; vertical-align: middle; }
table.board thead th { position: sticky; top: 0; z-index: 3; background: var(--nk-head); text-align: center; font-weight: 600; color: #1f2937; }
table.board thead tr:nth-child(2) th { top: 2rem; }
table.board thead th.g { background: var(--nk-green-h); }
table.board thead th.p { background: var(--nk-peach-h); }
table.board thead th.y { background: var(--nk-yellow-h); }
table.board td.g { background: var(--nk-green); }
table.board td.p { background: var(--nk-peach); }
table.board td.y { background: var(--nk-yellow); }
table.board td.c { text-align: center; }
table.board td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.board tbody tr:hover td { filter: brightness(.975); }
/* pinned columns (checkbox → P/O NO.): board.js sets each one's left offset from the real widths */
table.board .pin { position: sticky; left: 0; z-index: 2; }
table.board td.pin { background: #fff; }
table.board td.pin.g { background: var(--nk-green); }
table.board thead th.pin { z-index: 5; }
table.board tfoot td.pin { z-index: 3; background: #fffbe6; }
table.board .pin-last { box-shadow: 1px 0 0 #c5cbd6, 5px 0 6px -4px rgba(16,24,40,.18); }
table.board.cols-collapsed .col-x { display: none; }
table.board .col-toggle { border: 1px solid rgba(0,0,0,.18); background: rgba(255,255,255,.7); border-radius: 5px; font-size: .68rem; line-height: 1;
  padding: .15rem .3rem; margin-left: .3rem; color: #374151; vertical-align: 1px; }
table.board .col-toggle:hover { background: #fff; color: var(--nk-blue); }
table.board.cols-collapsed .col-toggle i { transform: scaleX(-1); }
@media (max-width: 991.98px) { table.board .pin-wide { position: static; } }   /* small screens: only checkbox / No / เลขคุม stay */
table.board tfoot td { position: sticky; bottom: 0; background: #fffbe6; font-weight: 600; z-index: 2; border-top: 2px solid #f0d77a; }
table.board td.multi, table.board tfoot td { white-space: pre; }
table.board select.cell-input { min-width: 7rem; }
table.board td.editable { cursor: text; }
table.board td.editable:hover { outline: 2px solid #90caf9; outline-offset: -2px; }
table.board td.saving { opacity: .5; }
table.board td.saved { animation: flashok 1.2s; }
table.board td.err { outline: 2px solid #e53935; outline-offset: -2px; }
table.board td input.cell-input { width: 100%; min-width: 7rem; border: 0; padding: 0; background: #fff; font-size: inherit; outline: 2px solid #1e88e5; }
@keyframes flashok { from { box-shadow: inset 0 0 0 99px #c8e6c9; } to { box-shadow: none; } }
tr.cancelled td { text-decoration: line-through; color: #9ca3af; }

/* ── create grid ── */
table.grid-form thead th { position: sticky; top: 0; z-index: 2; }
table.grid-form td { padding: .25rem; }
table.grid-form .form-control, table.grid-form .form-select { font-size: .85rem; padding: .25rem .45rem; min-width: 6rem; }
table.grid-form .is-invalid { background-image: none; }
table.grid-form td.rowno { color: #9ca3af; text-align: center; width: 2rem; }
table.grid-form .opt { display: none; }
table.grid-form.show-opt .opt { display: table-cell; }
.sticky-actions { position: sticky; bottom: 0; z-index: 10; background: rgba(255,255,255,.96); backdrop-filter: blur(4px); border-top: 1px solid var(--line);
  padding: .6rem 1rem; display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; border-radius: 0 0 var(--radius) var(--radius); }

/* ── import steps ── */
.steps { display: flex; gap: .5rem; margin-bottom: 1rem; flex-wrap: wrap; }
.step { display: flex; align-items: center; gap: .5rem; padding: .45rem .9rem; border-radius: 99px; background: #fff; border: 1px solid var(--line); color: var(--muted); font-size: .85rem; }
.step .n { width: 22px; height: 22px; border-radius: 50%; background: #e5e7eb; color: #4b5563; display: inline-flex; align-items: center; justify-content: center; font-size: .75rem; font-weight: 600; }
.step.active { border-color: #9fa8da; color: var(--nk-blue); background: #eef1fb; }
.step.active .n, .step.done .n { background: var(--nk-blue); color: #fff; }
.dropzone { border: 2px dashed #c5cae9; border-radius: var(--radius); padding: 1.6rem 1rem; text-align: center; background: #fafbff; cursor: pointer; transition: background .15s, border-color .15s; }
.dropzone.drag { background: #eef1fb; border-color: #5c6bc0; }
.dropzone i { font-size: 1.8rem; color: #7986cb; }

/* ── dispatch ── */
.info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .9rem 1.2rem; }
.info-grid .k { font-size: .72rem; color: var(--muted); }
.info-grid .v { font-weight: 600; font-size: 1rem; }
.progress-mini { height: 7px; border-radius: 9px; background: #edf0f5; min-width: 90px; }
.progress-mini .progress-bar { border-radius: 9px; }
.supplier-card { border: 1px solid var(--line); border-radius: 10px; padding: .6rem .75rem; display: flex; align-items: center; gap: .6rem; background: #fff; }
.chk { font-size: .75rem; }
.chk-match { color: #2e7d32; } .chk-mismatch { color: #c62828; } .chk-unreadable { color: #ef6c00; } .chk-pending { color: #9e9e9e; } .chk-overridden { color: #6a1b9a; } .chk-confirmed { color: #e65100; }
.nav-tabs-soft { border: 0; gap: .3rem; }
.nav-tabs-soft .nav-link { border: 1px solid var(--line); border-radius: 99px; color: #4b5563; padding: .3rem .9rem; background: #fff; font-size: .85rem; }
.nav-tabs-soft .nav-link.active { background: var(--nk-blue); border-color: var(--nk-blue); color: #fff; }

/* ── fill form ── */
.step-title { display: flex; align-items: center; gap: .5rem; }
.step-title .n { width: 24px; height: 24px; border-radius: 50%; background: var(--nk-blue); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: .8rem; }
.photo-field { border: 1px dashed #c5cad6; border-radius: var(--radius); padding: .85rem; background: #fafbff; height: 100%; }
.photo-field.has-photo { border-style: solid; border-color: #9fa8da; background: #fff; }
.photo-field.chk-bad { border: 2px solid #c62828; background: #fff5f5; }
.photo-field.chk-bad .ai-read { color: #c62828 !important; }
.photo-field.chk-self { border: 2px solid #ef6c00; background: #fff8f0; }
.photo-field img.preview { max-height: 150px; max-width: 100%; border-radius: 8px; display: block; margin-top: .5rem; }
.photo-btn { width: 100%; padding: .6rem; font-weight: 600; }
.ai-read { font-size: .8rem; }
.action-bar { position: sticky; bottom: .5rem; z-index: 10; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem .8rem;
  display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; box-shadow: 0 8px 24px rgba(16,24,40,.12); }
@media (max-width: 575.98px) { .action-bar .btn { flex: 1; } }

/* ── login ── */
.main-bare { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.login-wrap { width: 100%; max-width: 880px; display: grid; grid-template-columns: 1fr 1fr; border-radius: 18px; overflow: hidden; box-shadow: 0 30px 60px rgba(0,0,0,.28); background: #fff; }
.login-brand { background: linear-gradient(160deg, rgba(255,255,255,.08), rgba(255,255,255,0)), #1a237e; color: #fff; padding: 2.5rem 2.2rem; display: flex; flex-direction: column; gap: 1rem; }
.login-brand .logo { width: 54px; height: 54px; border-radius: 14px; background: rgba(255,255,255,.15); display: inline-flex; align-items: center; justify-content: center; font-size: 1.5rem; }
.login-brand ul { list-style: none; padding: 0; margin: .5rem 0 0; display: grid; gap: .55rem; font-size: .9rem; color: rgba(255,255,255,.88); }
.login-brand li i { width: 1.4rem; color: var(--nk-accent); }
.login-form { padding: 2.5rem 2.2rem; }
.login-form .alert-dismissible.py-2 .btn-close { padding: .75rem 1rem; }
.login-card { width: 100%; max-width: 430px; border: 0; border-radius: 16px; box-shadow: 0 25px 50px rgba(0,0,0,.25); }
@media (max-width: 767.98px) { .login-wrap { grid-template-columns: 1fr; max-width: 430px; } .login-brand { display: none; } .login-form { padding: 2rem 1.5rem; } }

/* ── print ── */
@media print {
  .sidebar, .topbar, .no-print, .bulk-bar, .list-footer, .page-actions { display: none !important; }
  body, .main { background: #fff !important; }
  .main { margin: 0 !important; } .content { padding: 0; }
  .board-wrap { max-height: none; overflow: visible; }
  .card { box-shadow: none; border: 0; }
  table.board .pin, table.board thead th, table.board tfoot td { position: static; box-shadow: none; }
  table.board tbody tr { break-inside: avoid; }
  .stat-chips { display: none; }
  table.board td.editable:hover { outline: 0; }
}
/* Job Board print (A4 landscape, compact, zoomed to fit) lives in board_print.css, loaded only by jobs/board.php */

/* ── history timeline ── */
.timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.timeline::before { content: ''; position: absolute; left: 17px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.timeline li { display: flex; gap: .8rem; padding: .55rem 0; position: relative; }
.timeline .ico { width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: .85rem; position: relative; z-index: 1; border: 3px solid #fff; }
.list-group-item.active .status-badge { background: rgba(255,255,255,.2); color: #fff; }

/* แจ้งงาน: close-out document columns + modal */
th.doc-group { background: #eef1fb; white-space: nowrap; }
td.doc-cell { white-space: nowrap; }
.doc-btn { min-width: 2.6rem; font-size: .75rem; }
.doc-miss { color: #c62828; opacity: .7; }
.doc-sec { padding: .6rem .5rem; border-radius: .5rem; }
.doc-sec + .doc-sec { border-top: 1px solid var(--bs-border-color); }
.doc-sec.focus { background: #fffbea; }
.doc-list .min-w-0 { min-width: 0; }
.out-time { width: 4.4rem; margin: 0 auto; text-align: center; }
.out-time.ot-d { width: 6.4rem; margin-bottom: 2px; }
.out-time.ot-dt { width: 9.6rem; }
.time-box { display: flex; align-items: center; justify-content: center; gap: 2px; }
.time-box + .time-box { margin-top: 2px; }
.time-box .out-time { margin: 0; }
.time-box .out-time.ot-d { margin-bottom: 0; }
.out-time.is-invalid { border-color: #dc3545; background: #fdf1f2; background-image: none; padding-right: .5rem; }
.time-pick { padding: .1rem .3rem; line-height: 1.2; font-size: .75rem; flex: none; }
#timePicker .tp-time { display: flex; align-items: center; gap: .35rem; }
#timePicker .tp-time select { width: 5rem; }
.time-warn .out-time, .time-warn .out-time.has-value { border-color: #dc3545; background: #fdf1f2; }
.time-warn { color: #dc3545; }
.out-time.has-value { border-color: #198754; background: #f1f9f4; }

/* ── transport report (สรุปข้อมูลขนส่งรายตู้) ── */
.cell-chip { border: 1px solid rgba(0,0,0,.18); background: rgba(255,255,255,.75); border-radius: 99px; font-size: .7rem; line-height: 1; padding: .2rem .45rem; margin-left: .4rem; color: #6b7280; cursor: pointer; }
.cell-chip.has { color: var(--nk-blue); border-color: #9fa8da; font-weight: 600; }
.cell-chip:hover { background: #fff; color: var(--nk-blue); }
.trans-link { margin-left: .25rem; font-size: .85em; }
.trans-tabs { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .75rem; }
.trans-tabs a { border: 1px solid var(--line); border-radius: 99px; background: #fff; padding: .3rem .8rem; font-size: .85rem; text-decoration: none; color: #374151; }
.trans-tabs a.active { background: var(--nk-blue); border-color: var(--nk-blue); color: #fff; }
table.trans { margin: 0; }
table.trans thead th { background: #dcefd5; font-weight: 600; }
table.trans th, table.trans td { border: 1px solid #d9dee6; padding: .45rem .65rem; vertical-align: top; }
table.trans td.no { width: 3.2rem; text-align: center; color: var(--muted); }
table.trans td.lbl { width: 36%; white-space: pre-line; }
table.trans td.val { background: #fff7dc; overflow-wrap: anywhere; }
table.trans td.val.missing { background: #fffdf5; }
table.trans .t-note { font-size: .75rem; color: var(--muted); }
table.trans .t-input { max-width: 26rem; }
table.trans .t-files { display: flex; flex-wrap: wrap; gap: .4rem; }
table.trans .t-file { display: inline-flex; align-items: center; gap: .35rem; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: .2rem .5rem; font-size: .82rem; max-width: 100%; }
table.trans .t-file a { overflow-wrap: anywhere; text-decoration: none; }
table.trans .t-file img { height: 110px; max-width: 160px; object-fit: cover; border-radius: 6px; display: block; }
table.trans .t-upload { margin-top: .4rem; }
table.trans tr.group td { background: #eef1fb; font-weight: 600; font-size: .85rem; }
@media (max-width: 575.98px) {
  table.trans thead { display: none; }
  table.trans tr { display: grid; grid-template-columns: 2.4rem 1fr; }
  table.trans td.lbl { width: auto; font-weight: 600; }
  table.trans td.val { grid-column: 1 / -1; min-height: 2.2rem; }
  table.trans tr.group td { grid-column: 1 / -1; }
}
