/* ============================================================================
   field-tools.css — 20/10/2026: LMRA + Quét QR kiểm tra chuyển từ Htit.Hsse sang app hiện trường.
   Các trang Lmra / InspectScan / StopChecksheet / DrawingPinBoard / PermitContextCard mang sẵn <style> riêng;
   file này chỉ bù phần chúng dựa vào ở Htit.Hsse mà app.css của app hiện trường chưa có:
     1. biến --fs-* / --muted / --text / --r-md (Office khai trong FieldLayout + tokens.css)
     2. .fld-mini, .fld-shot* (Office khai trong FieldLayout.razor)
     3. .empty-state (Office: css/components.css)
     4. 2 ô nhỏ LMRA / Quét QR trên Trang chủ (.fld-quick-pair)
   Mọi biến ánh xạ về token của app hiện trường ⇒ chế độ Sáng/Tối/Ngoài trời/Ca đêm vẫn đúng màu.
   ============================================================================ */

.field-shell {
    --fs-navy: var(--navy);
    --fs-blue: var(--primary);
    --fs-gold: var(--gold);
    --fs-line: var(--line);
    --fs-ink: var(--ink);
    --fs-muted: var(--text-2);
    --muted: var(--text-2);
    --text: var(--ink);
    --r-md: 12px;
}

/* ---- Nút nhỏ + ảnh đã chụp (trang LMRA) ---- */
.field-shell .fld-mini { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: 10px;
    border: 1px solid var(--border-strong); background: var(--surface-1); color: var(--fs-ink); font: inherit; font-size: .88rem;
    font-weight: 700; cursor: pointer; }
.field-shell .fld-mini:hover { border-color: var(--fs-blue); color: var(--fs-blue); }
.field-shell .fld-mini.danger { color: #b72a20; border-color: #f5c2bd; background: #fdecea; }
.field-shell .fld-mini.danger:hover { color: #fff; background: #E0362B; border-color: #E0362B; }
@media (pointer: coarse) { .field-shell .fld-mini { min-height: var(--tap-min); } }

.field-shell .fld-shot { display: flex; align-items: center; gap: 14px; margin: .2rem 0 .9rem; padding: 10px; border-radius: 14px;
    border: 1px solid var(--fs-line); background: var(--surface-2); }
.field-shell .fld-shot-img { position: relative; flex: 0 0 auto; width: 112px; height: 112px; padding: 0; border: 0; border-radius: 12px;
    overflow: hidden; cursor: zoom-in; background: var(--surface-3); }
.field-shell .fld-shot-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.field-shell .fld-shot-zoom { position: absolute; right: 6px; bottom: 6px; width: 28px; height: 28px; border-radius: 8px; display: grid;
    place-items: center; color: #fff; background: rgba(15, 23, 42, .6); }
.field-shell .fld-shot-meta { min-width: 0; display: grid; gap: 3px; }
.field-shell .fld-shot-meta b { font-size: .92rem; color: var(--fs-ink); overflow-wrap: anywhere; }
.field-shell .fld-shot-meta small { font-size: .8rem; color: var(--fs-muted); }
.field-shell .fld-shot-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }

/* ---- Trạng thái rỗng (DrawingPinBoard / InspectScan) ---- */
.empty-state { display: grid; justify-items: center; gap: .4rem; padding: 1.2rem .8rem; text-align: center; color: var(--text-2); }
.empty-state-ic { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: var(--surface-2); color: var(--primary); }
.empty-state-title { font-weight: 800; color: var(--ink); }
.empty-state-msg { font-size: var(--text-sm); }
.empty-state-cta { margin-top: .3rem; }

/* ---- Trang chủ: 2 ô nhỏ cạnh nhau (LMRA · Quét QR) dưới 2 nút báo cáo chính ---- */
.field-shell .fld-quick-pair { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); margin-bottom: var(--space-3); }
.field-shell .fld-quick-pair.one { grid-template-columns: 1fr; }
.field-shell .fld-quick-pair .fld-quick { margin-bottom: 0; }
.field-shell .fld-quick.sm { min-height: 88px; padding: .8rem; gap: .6rem; align-items: flex-start; flex-direction: column; }
.field-shell .fld-quick.sm .q-ic { width: 40px; height: 40px; flex: 0 0 40px; border-radius: 12px; }
.field-shell .fld-quick.sm .q-t { font-size: .98rem; line-height: 1.25; }
.field-shell .fld-quick.sm .q-d { font-size: .8rem; }
.field-shell .fld-quick-pair.one .fld-quick.sm { flex-direction: row; align-items: center; min-height: 72px; }
.field-shell .fld-quick.lmra { background: linear-gradient(135deg, #0F6B4F, #16A34A); }
.field-shell .fld-quick.qr { background: linear-gradient(135deg, #0E5F73, #0891B2); }
:root[data-mode="outdoor"] .field-shell .fld-quick.lmra { background: #0F6B4F; }
:root[data-mode="outdoor"] .field-shell .fld-quick.qr { background: #0E5F73; }
:root[data-mode="night"] .field-shell .fld-quick.lmra { background: #12291F; color: var(--text-1); }
:root[data-mode="night"] .field-shell .fld-quick.qr { background: #10262C; color: var(--text-1); }


/* =============================================================================
   22/10/2026 (v3) — Trang chủ: THAO TÁC NHANH GỌN (.qa). 4 ô nhỏ 2×2, cao ~64px:
   icon trái trong ô màu nhạt + tên ngắn (1 dòng) + mô tả 1 dòng. Không khung bao, không mũi tên;
   màu chức năng ở nền ô rất nhạt + viền mảnh cùng tông. Quản trị = 1 dòng chữ nhỏ canh phải.
   ========================================================================== */
.field-shell .qa { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 6px; }
.field-shell .qa.odd .qa-i:last-child { grid-column: 1 / -1; }
.field-shell .qa-i {
    --fc: var(--primary);
    display: flex; align-items: center; gap: 9px; min-width: 0; min-height: 60px; padding: 9px 10px;
    border-radius: 14px; text-decoration: none; color: var(--text-1);
    background: color-mix(in srgb, var(--fc) 6%, var(--surface-1));
    border: 1px solid color-mix(in srgb, var(--fc) 16%, var(--border));
    -webkit-tap-highlight-color: transparent; transition: background .15s, border-color .15s, transform .1s;
}
.field-shell .qa-i:hover { background: color-mix(in srgb, var(--fc) 10%, var(--surface-1)); border-color: color-mix(in srgb, var(--fc) 35%, var(--border)); }
.field-shell .qa-i:active { transform: scale(.98); background: color-mix(in srgb, var(--fc) 14%, var(--surface-1)); }
.field-shell .qa-i:focus-visible { outline: 2px solid var(--fc); outline-offset: 2px; }
.field-shell .qa-i[data-k="obs"]  { --fc: #2E5BA8; }
.field-shell .qa-i[data-k="inc"]  { --fc: #C62828; }
.field-shell .qa-i[data-k="lmra"] { --fc: #1E7A46; }
.field-shell .qa-i[data-k="qr"]   { --fc: #0E7490; }
.field-shell .qa-ic {
    flex: 0 0 auto; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px;
    color: #fff; background: var(--fc);
}
.field-shell .qa-tx { display: grid; min-width: 0; line-height: 1.2; }
.field-shell .qa-tx b { font-size: .86rem; font-weight: 800; color: var(--text-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.field-shell .qa-tx small { margin-top: 2px; font-size: .72rem; line-height: 1.25; color: var(--text-2);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.field-shell .qa-admin {
    display: flex; align-items: center; gap: 10px; min-height: 46px; margin: 2px 0 var(--space-4); padding: 0 14px;
    border-radius: 12px; border: 1px dashed color-mix(in srgb, #B8860B 45%, var(--border));
    background: color-mix(in srgb, #D4A72C 8%, var(--surface-1));
    font-size: .86rem; font-weight: 700; color: var(--text-1); text-decoration: none; -webkit-tap-highlight-color: transparent;
}
.field-shell .qa-admin-ic { display: grid; place-items: center; flex: 0 0 auto; width: 28px; height: 28px; border-radius: 8px;
    color: #8A6510; background: color-mix(in srgb, #D4A72C 22%, var(--surface-1)); }
.field-shell .qa-admin-t { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.field-shell .qa-admin > .pico:last-child { color: var(--text-2); flex: 0 0 auto; }
.field-shell .qa-admin:hover { border-style: solid; background: color-mix(in srgb, #D4A72C 14%, var(--surface-1)); }
.field-shell .qa-admin:active { transform: scale(.99); }
.field-shell .qa-admin:focus-visible { outline: 2px solid #B8860B; outline-offset: 2px; }

/* ---- 22/10/2026 — "Việc được giao" (MyActionsCard v2): một hàng gọn ---- */
.field-shell .fma2 {
    --ac: var(--primary);
    display: flex; align-items: center; gap: 11px; min-height: 62px; margin: 0 0 var(--space-4); padding: 10px 12px;
    border-radius: 14px; border: 1px solid var(--border); background: var(--surface-1); color: var(--text-1);
    text-decoration: none; box-shadow: var(--elev-1, 0 1px 2px rgba(15,27,46,.06)); -webkit-tap-highlight-color: transparent;
}
.field-shell .fma2.is-over { --ac: #C62828; border-color: color-mix(in srgb, #C62828 35%, var(--border)); background: color-mix(in srgb, #C62828 4%, var(--surface-1)); }
.field-shell .fma2.is-soon { --ac: #B45309; border-color: color-mix(in srgb, #B45309 35%, var(--border)); }
.field-shell .fma2.is-empty { --ac: #1E7A46; min-height: 54px; box-shadow: none; }
.field-shell .fma2:active { transform: scale(.99); }
.field-shell .fma2:focus-visible { outline: 2px solid var(--ac); outline-offset: 2px; }
.field-shell .fma2-ic { display: grid; place-items: center; flex: 0 0 auto; width: 36px; height: 36px; border-radius: 11px;
    color: var(--ac); background: color-mix(in srgb, var(--ac) 12%, var(--surface-1)); }
.field-shell .fma2-tx { flex: 1; min-width: 0; display: grid; line-height: 1.2; }
.field-shell .fma2-tx b { font-size: .92rem; font-weight: 800; }
.field-shell .fma2-tx small { margin-top: 2px; font-size: .76rem; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.field-shell .fma2-tags { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: 0 0 auto; }
.field-shell .fma2-tag { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 999px;
    font-size: .72rem; font-weight: 800; white-space: nowrap; }
.field-shell .fma2-tag.over { color: #fff; background: #C62828; }
.field-shell .fma2-tag.soon { color: #8A4B08; background: color-mix(in srgb, #F59E0B 22%, var(--surface-1)); }
.field-shell .fma2-tag.ok { color: #1E7A46; background: color-mix(in srgb, #1E7A46 12%, var(--surface-1)); }
.field-shell .fma2-go { flex: 0 0 auto; color: var(--text-2); display: grid; place-items: center; }
:root[data-mode="night"] .field-shell .fma2-tag.over { background: #8E1F1F; }
:root[data-mode="outdoor"] .field-shell .fma2 { border-width: 2px; box-shadow: none; }

/* màn rất hẹp (≤ 340px): 1 cột để chữ không bị cắt */
@media (max-width: 330px) { .field-shell .qa { grid-template-columns: 1fr; } .field-shell .qa.odd .qa-i:last-child { grid-column: auto; } }
/* máy tính bảng / desktop: 4 ô một hàng */
@media (min-width: 760px) {
    .field-shell .qa { grid-template-columns: repeat(4, 1fr); }
    .field-shell .qa.odd { grid-template-columns: repeat(3, 1fr); }
    .field-shell .qa.odd .qa-i:last-child { grid-column: auto; }
}
@media (prefers-reduced-motion: reduce) { .field-shell .qa-i { transition: none; } .field-shell .qa-i:active { transform: none; } }
/* đêm: nền ô tối, icon dịu; ngoài trời: tương phản cao */
:root[data-mode="night"] .field-shell .qa-i { background: color-mix(in srgb, var(--fc) 10%, var(--surface-1)); border-color: color-mix(in srgb, var(--fc) 25%, var(--border)); }
:root[data-mode="night"] .field-shell .qa-ic { background: color-mix(in srgb, var(--fc) 70%, #000); color: #E6ECF5; }
:root[data-mode="outdoor"] .field-shell .qa-i { background: var(--surface-1); border: 2px solid var(--fc); }
:root[data-mode="outdoor"] .field-shell .qa-tx b { font-weight: 900; }

/* =============================================================================
   22/10/2026 — Trang chủ trên MÁY TÍNH (≥1024px + chuột; iPad/điện thoại giữ 1 cột như cũ):
   lời chào 1 dòng · 4 ô thao tác nhanh thành 1 hàng lớn · 2 cột: "Của tôi" | cột phụ (Việc được giao,
   quản trị, tổng quan theo trạng thái — bấm để lọc). Markup: Components/Pages/Field/Home.razor (.fh).
   ========================================================================== */
.field-shell .fh-stats { display: none; }
@media (min-width: 1024px) and (hover: hover) and (pointer: fine) {
    .field-shell .fh-hello { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 14px; margin: 4px 0 20px; }
    .field-shell .fh-hello .fld-h1 { margin: 0; font-size: 1.75rem; letter-spacing: -.01em; }
    .field-shell .fh-hello .fld-sub { margin: 0; font-size: 1rem; }
    .field-shell .fh .fld-banner { margin-bottom: 14px; }

    .field-shell .fh .qa { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 0 0 22px; }
    .field-shell .fh .qa.odd { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .field-shell .fh .qa.odd .qa-i:last-child { grid-column: auto; }
    .field-shell .fh .qa-i { min-height: 96px; padding: 16px 18px; gap: 14px; border-radius: 16px; transition: background .15s, border-color .15s, transform .15s, box-shadow .15s; }
    .field-shell .fh .qa-i:hover { transform: translateY(-2px); box-shadow: 0 12px 24px -16px color-mix(in srgb, var(--fc) 70%, transparent); }
    .field-shell .fh .qa-ic { width: 48px; height: 48px; border-radius: 14px; }
    .field-shell .fh .qa-ic svg { width: 24px; height: 24px; }
    .field-shell .fh .qa-tx b { font-size: 1.05rem; }
    .field-shell .fh .qa-tx small { margin-top: 3px; font-size: .84rem; }

    .field-shell .fh-cols { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; align-items: start; }
    .field-shell .fh-main { grid-column: 1; grid-row: 1; min-width: 0; }
    .field-shell .fh-main > .fld-card { margin: 0; padding: 20px 22px; }
    .field-shell .fh-side { grid-column: 2; grid-row: 1; display: grid; gap: 14px; position: sticky; top: 84px; }
    .field-shell .fh-side > * { margin: 0; }

    .field-shell .fh-stats {
        display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 14px;
        border-radius: 14px; border: 1px solid var(--border); background: var(--surface-1); box-shadow: var(--elev-1);
    }
    .field-shell .fh-stats-h { grid-column: 1 / -1; margin: 0 0 2px; font-size: .78rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--text-2); }
    .field-shell .fh-stat {
        --sc: var(--text-1);
        display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 12px; min-width: 0;
        border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-1);
        font: inherit; text-align: left; cursor: pointer; transition: border-color .15s, background .15s;
    }
    .field-shell .fh-stat span { font-size: .8rem; font-weight: 700; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
    .field-shell .fh-stat b { font-size: 1.5rem; font-weight: 800; line-height: 1.1; color: var(--sc); font-variant-numeric: tabular-nums; }
    .field-shell .fh-stat.st-new { --sc: #2E5BA8; }
    .field-shell .fh-stat.st-action { --sc: #B45309; }
    .field-shell .fh-stat.st-closed { --sc: #1E7A46; }
    .field-shell .fh-stat:hover { border-color: color-mix(in srgb, var(--sc) 40%, var(--border)); }
    .field-shell .fh-stat.on { border-color: var(--sc); background: color-mix(in srgb, var(--sc) 8%, var(--surface-1)); }
    .field-shell .fh-stat.st-all.on { border-color: var(--primary); }
    .field-shell .fh-stat:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
}
