/* The shared finish of every LaoTai Connect screen: motion, focus, depth and loading
 * placeholders. Colours stay each system's own (green and gold); this file only changes how
 * things move and how deep they look. Loaded by auth/sso-client.js into every app, and by
 * the portal itself, so one file changes them all — the compiled Workflow bundle included,
 * without touching it.
 *
 * The procurement and project-management pages draw their cards and buttons with inline
 * styles; the rules marked "inline" below match those styles by their text and override them. */

:root {
  --lt-ease: cubic-bezier(.4, 0, .2, 1);
  --lt-shadow: 0 1px 2px rgba(14, 92, 51, .05), 0 14px 34px -14px rgba(14, 92, 51, .22);
  --lt-shadow-hover: 0 2px 4px rgba(14, 92, 51, .06), 0 20px 40px -14px rgba(14, 92, 51, .30);
  --lt-btn-shadow: 0 6px 16px -6px rgba(14, 92, 51, .55);
}

/* ---------- motion: everything answers in 150 ms ---------- */
button, [role="button"], a, input, select, textarea, label {
  transition: color .15s var(--lt-ease), background-color .15s var(--lt-ease), border-color .15s var(--lt-ease),
              box-shadow .15s var(--lt-ease), transform .15s var(--lt-ease), opacity .15s var(--lt-ease), filter .15s var(--lt-ease);
}
button:not(:disabled):active, [role="button"]:active { transform: scale(.98); }
:focus-visible { outline: 2px solid rgba(243, 192, 31, .85); outline-offset: 2px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(14, 92, 51, .14); }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

/* a page fades in once it is ready instead of popping in (class set by sso-client.js).
   "backwards", not "both": an animation still holding a transform on <body> once it has ended
   makes body the box every position:fixed element is measured against, so a popup's dark
   backdrop stopped at the bottom of a short page and left the rest of the screen white. */
@keyframes ltIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
html.lt-in body { animation: ltIn .28s var(--lt-ease) backwards; }

/* ---------- loading placeholders ---------- */
@keyframes ltSk { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
.lt-skel { background: linear-gradient(90deg, #E9EEEA 25%, #F5F7F4 37%, #E9EEEA 63%); background-size: 400% 100%; animation: ltSk 1.3s ease infinite; border-radius: 12px; }
.lt-skel-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 22px; }
.lt-skel-grid .lt-skel { height: 118px; border-radius: 20px; }
.lt-skel-card { background: #fff; border-radius: 20px; padding: 18px 20px; box-shadow: var(--lt-shadow); }
.lt-skel-row { height: 16px; margin: 14px 0; }
.lt-skel-row:nth-child(2n) { width: 82%; } .lt-skel-row:nth-child(3n) { width: 64%; }

/* ---------- round 17: a quieter header ---------- */
/* Only the person themself signs in on their account, so the line under the name (role or
   department) only adds clutter: hidden in every app and on the portal. The role is still shown
   on the users page, the org chart, the audit trail and in signatures. */
#whorole, .whoami-chip .whoami-role, .lt-who-role, .topbar .who .who-role,
div[style*="color: rgba(233, 240, 230, 0.62); font-size: 10.5px"],
header div[style*="color: rgb(183, 198, 187)"],
header div[style*="font-size:10px;color:rgba(233,240,230,.62)"] { display: none !important; }
/* The first-steps card on the portal home is put away for now (core/help.js still fills it;
   delete this line to bring it back — nobody's ticks are lost). */
#lt-onboard { display: none !important; }
/* Round 19: the name goes too (owner: "do not show who is signed in") — only the round initial
   stays, because in most apps it is the button for the account menu / sign-out. */
.topbar .who, #who, .whoami-chip, .lt-who-line, .lt-who-name,
div[style*="color: rgb(245, 239, 217); font-size: 12.5px"],
header div[style*="font-size: 14px; font-weight: 700; color: rgb(255, 255, 255); white-space: nowrap"],
div[style*="font-size:12px;color:#f5efd9;font-weight:600"] { display: none !important; }
/* Round 20: and the box with the initial letter (owner: "this goes too"). In no app is it a button —
   sign-out stays where it was (portal top bar, the app's own "ອອກ" or menu). */
.top .user:has(> #av), .lt-slot.lt-who,
div[style*="padding: 5px 12px 5px 5px; border-radius: 12px; background: rgba(255, 255, 255, 0.06)"],
div[style*="padding: 6px 14px 6px 6px; border: 1px solid rgb(39, 71, 47)"],
div[style*="padding:6px 11px 6px 7px"] { display: none !important; }

/* ---------- round 19 (L6): one header for every page ----------
   The pages added in rounds 8–14 (quick approve, audit trail, system health, help, memos,
   security) had a thinner bar with a small logo; now the same height, logo and title as the
   other apps. Only their own header is matched (a logo link straight inside .top). */
.top:has(> a[href="/"] > img), .top:has(> a.home > img) { min-height: 64px; padding-top: max(0px, env(safe-area-inset-top)); padding-bottom: 0; padding-left: 24px; padding-right: 24px; gap: 14px; box-sizing: border-box; }
.top > a[href="/"] > img, .top > a.home > img { width: 38px !important; height: 38px !important; border-radius: 9px; object-fit: contain; background: rgba(255,255,255,.06); }
.top > a[href="/"] b, .top > a.home + .t b { font-size: 14.5px !important; font-weight: 700; color: #F5EFD9; line-height: 1.25; white-space: nowrap; }
.top > a[href="/"] small { font-size: 12px !important; font-weight: 600; letter-spacing: .12em; }
@media (max-width: 860px) { .top:has(> a[href="/"] > img), .top:has(> a.home > img) { padding-left: 12px; padding-right: 12px; } }

/* ---------- round 17: taps answer at once ---------- */
/* No waiting to see whether a tap was the first half of a double-tap zoom (phones wait ~0.3 s
   when the page is not at 100% — round 16's screen sizes); pinch-zoom still works. */
/* Round 17 (later): no pinch either — phones feel like an app; size is chosen on the settings page. */
html { touch-action: pan-x pan-y; }
/* The pressed look shows the moment a finger lands, before the app has answered. */
@media (pointer: coarse) {
  button:active, a:active, [role="button"]:active, .btn:active, summary:active { opacity: .7 !important; transition: none !important; }
}
/* round 40: tick boxes big enough for a finger (the label around them takes the tap too) */
@media (pointer: coarse) { input[type="checkbox"], input[type="radio"] { min-width: 20px; min-height: 20px; } .btn.sm { min-height: 40px; min-width: 40px; } }
#lt-busy { position: fixed; top: 0; left: 0; height: 3px; width: 100%; z-index: 2147483600; pointer-events: none;
  background: linear-gradient(90deg, rgba(243,192,31,0), #F3C01F 40%, #0E5C33 60%, rgba(14,92,51,0)); background-size: 50% 100%;
  background-repeat: no-repeat; animation: ltBusy 1s linear infinite; opacity: 0; transition: opacity .15s; }
#lt-busy.on { opacity: 1; }
@keyframes ltBusy { from { background-position: -50% 0 } to { background-position: 150% 0 } }
@media print { #lt-busy { display: none; } }

/* ---------- round 15: phones ---------- */
/* Cards that ask for 380px each no longer open a phone screen sideways (projects, procurement). */
[style*="minmax(380px, 1fr)"] { grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)) !important; }
@media (max-width: 640px) {
  /* Tables in their sliding frame (.tw): one line per row instead of names broken over four
     lines, and the first column stays in place while the rest slides. */
  .tw > table th, .tw > table td { white-space: nowrap; }
  .tw > table td:first-child { position: sticky; left: 0; z-index: 1; background: #fff; }
  .tw > table th:first-child { position: sticky; left: 0; }
  .tw > table th { z-index: 2; }
  .tw > table th:first-child { z-index: 3; }
}

/* ---------- inline: procurement and project-management cards ---------- */
[style*="border-radius: 14px"] { border-radius: 20px !important; }
[style*="rgba(16, 40, 24, 0.05) 0px 6px 16px"] { box-shadow: var(--lt-shadow) !important; transition: box-shadow .18s var(--lt-ease), transform .18s var(--lt-ease); }
[style*="rgba(11, 77, 39, 0.22) 0px 4px 16px"] { box-shadow: 0 14px 34px -12px rgba(11, 77, 39, .45) !important; }
[style*="cursor: pointer"][style*="border-radius: 14px"]:hover { transform: translateY(-2px); box-shadow: var(--lt-shadow-hover) !important; }
/* the white breadcrumb strip under the top bar */
[style*="border-radius: 0px 0px 12px 12px"] { border-radius: 0 0 18px 18px !important; }
/* buttons: primary green, secondary white, soft green — rounder, primary with a green glow */
button[style*="background: rgb(14, 92, 51)"]:not([style*="border-radius: 20px"]) { border-radius: 12px !important; box-shadow: var(--lt-btn-shadow); }
button[style*="background: rgb(14, 92, 51)"]:not([style*="border-radius: 20px"]):not(:disabled):hover { filter: brightness(1.08); transform: translateY(-1px); }
button[style*="border-radius: 7px"], button[style*="border-radius: 8px"] { border-radius: 10px !important; }
button[style*="background: rgb(243, 248, 244)"]:hover { filter: brightness(.97); }
/* fields */
input[style*="border-radius: 7px"], input[style*="border-radius: 8px"], select[style*="border-radius: 7px"], select[style*="border-radius: 8px"],
textarea[style*="border-radius: 7px"], textarea[style*="border-radius: 8px"] { border-radius: 12px !important; }
/* dialogs */
[style*="position: fixed"][style*="rgba(11, 30, 18, 0.5"] > div[style*="background: rgb(255, 255, 255)"] { border-radius: 22px !important; box-shadow: 0 30px 70px -20px rgba(10, 36, 22, .45) !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  html.lt-in body { animation: none; }
}
@media print {
  html.lt-in body { animation: none; }
  .lt-skel { display: none; }
}

/* No flicker on every press. The apps draw a page again when a tab, a filter or a list changes, and
   the page's entrance (slide / fade in) used to play each time — a blink on every click. Once a
   page has settled (html.lt-settled, set a moment after it first shows), that entrance does not
   play again. Pop-ups keep their opening; loading shimmers keep moving. */
html.lt-settled .page,
html.lt-settled .page.page-enter,
html.lt-settled .tab-body.page-enter,
html.lt-settled #lt-tasks .page,
html.lt-settled [style*="animation:ltSlide"],
html.lt-settled [style*="animation: ltSlide"],
html.lt-settled [style*="animation:ltFade"],
html.lt-settled [style*="animation: ltFade"] { animation: none !important; }

/* ======================================================================================
   Round 44 — one look for every page (UX/UI plan G1–G8, T1). Approved by the owner 2026-11-05.
   Only how things look: no data, no rules. core/shell.js marks the page:
     html.lt-v44  every page          html.lt-core  the ~45 module pages (.top .brand / .crumb)
   ====================================================================================== */
:root {
  --lt-g900: #0B2A19; --lt-g700: #0E5C33; --lt-g100: #E6F0EA; --lt-gold: #F3C01F;
  --lt-ink: #17321F; --lt-ink2: #52634F; --lt-ground: #F4F3EE; --lt-line: #E3E8E1;
  --lt-red: #B42318; --lt-amber: #8A5A00; --lt-blue: #1D4E89;
}
/* G2: nothing on screen under 13px (core/shell.js adds .lt-f13 where a page asked for less) */
.lt-f13 { font-size: 13px !important; line-height: 1.5; }
@media print { .lt-f13 { font-size: inherit !important; } }

/* ---------- T1: the module pages' frame ---------- */
html.lt-core body { font-size: 14.5px; line-height: 1.6; }
html.lt-core .brand b { font-size: 16px !important; }
html.lt-core .brand small { font-size: 12px !important; }
html.lt-core .top .nb { font-size: 14.5px; padding: 9px 14px; }
html.lt-core .top .nb .cnt, html.lt-core .menu .cnt { font-size: 12px; }
html.lt-core .menu div { font-size: 14.5px; padding: 10px 12px; }
html.lt-core .crumb { font-size: 14px; }
html.lt-core .crumb .d { font-size: 13px; }
html.lt-h1auto .crumb .d { display: none; }                       /* moved under the page title */
html.lt-core .pt { font-size: 28px; font-weight: 800; line-height: 1.35; margin: 4px 0 4px; text-wrap: balance; }
html.lt-core .ps { font-size: 15px; line-height: 1.6; color: var(--lt-ink2); margin: 0 0 18px; max-width: 900px; }
html.lt-core .card h2 { font-size: 18px; }
html.lt-core .card h3 { font-size: 15px; }

/* ---------- G5: one set of status labels ---------- */
html.lt-core .pill { font-size: 13px; font-weight: 700; padding: 3px 11px; background: #EEF1ED; color: #3F5143; }
html.lt-core .pill.ok { background: var(--lt-g100); color: #0A4A29; }
html.lt-core .pill.wait { background: #FFF4D6; color: #6B4E00; }
html.lt-core .pill.bad { background: #FEF3F2; color: #A01F15; }
html.lt-core .pill.gray { background: #EEF1ED; color: #3F5143; }
html.lt-core .pill.blue { background: #EAF0FB; color: var(--lt-blue); }
html.lt-core .pill.late, html.lt-core .pill.over { background: var(--lt-red); color: #fff; }

/* ---------- G3: buttons (primary stays green; small ones big enough) ---------- */
html.lt-core .btn { font-size: 15px; min-height: 42px; }
html.lt-core .btn.sm { font-size: 14px; min-height: 36px; padding: 6px 12px; }
html.lt-core .btn.ghost { color: var(--lt-g700); }
html.lt-core .btn.red:not(.solid) { background: #fff; color: var(--lt-red); border-color: #F3C9C4; box-shadow: none; }

/* ---------- G4: fields and their labels ---------- */
html.lt-core label.f { font-size: 14px; color: var(--lt-ink); }
html.lt-core .inp, html.lt-core select.inp, html.lt-core textarea.inp { font-size: 15px; min-height: 42px; }
html.lt-core .search input { min-height: 42px; }

/* ---------- tables: readable heads and cells ---------- */
html.lt-core th { font-size: 13px; }
html.lt-core td { font-size: 14.5px; }
html.lt-core .tbl table td, html.lt-core .tbl table th { font-size: 14px; }
html.lt-core .tbl table th { font-size: 13px; }

/* ---------- T1 ⑤: tabs/filters as quiet chips, the active one solid ---------- */
html.lt-core .chips button { font-size: 14px; min-height: 40px; }
html.lt-core .chips button i { font-size: 12px; }

/* ---------- G6: empty state that says what to do ---------- */
html.lt-core .done b, html.lt-core .empty b { font-size: 17px; }
html.lt-core .empty { font-size: 15px; }
.lt-empty-act { margin-top: 12px; }

/* ---------- G7: number cards — zero is quiet, the full-green card is gone ---------- */
html.lt-core .stat b { font-size: 28px; }
html.lt-core .stat span { font-size: 13.5px; }
html.lt-core .stat.hi { background: #fff; border-color: #EEF2ED; box-shadow: var(--lt-shadow); }
html.lt-core .stat.hi b { color: var(--lt-amber); }
html.lt-core .stat.hi span { color: var(--lt-ink2); }
html.lt-core .stat.hi .ic { background: #FFF4D6; color: var(--lt-amber); }
html.lt-v44 .lt-zero b { color: #A3B0A1 !important; }
html.lt-core .stat.lt-zero.hi .ic { background: var(--lt-g100); color: var(--lt-g700); }

/* ---------- G8: phones — every target at least 44px ---------- */
@media (pointer: coarse), (max-width: 640px) {
  html.lt-core .btn, html.lt-core .chips button, html.lt-core .top .nb, html.lt-core .menu div { min-height: 44px; }
  html.lt-core .btn.sm { min-height: 40px; }
  html.lt-core .inp, html.lt-core select.inp, html.lt-core .search input { min-height: 46px; font-size: 16px; }
  /* round 74: a text box too — "textarea.inp" of the G4 rule above is more specific than ".inp" here, so it stayed 15px and
     iPhone zoomed in (desktop sizes unchanged) */
  html.lt-core textarea.inp { font-size: 16px; }
  html.lt-v44 input[type="checkbox"], html.lt-v44 input[type="radio"] { width: 22px; height: 22px; }
}
/* G8: every button on a touch screen is at least 44px tall (icon buttons inside the corner dock keep their own size) */
@media (pointer: coarse) {
  html.lt-v44 body button:not(.lt-nofloor):not(#lt-dock button), html.lt-v44 body select, html.lt-v44 body a.btn { min-height: 44px; }
}

/* round 44 (P01): "nothing waits for you" is one quiet line, not a big empty box */
html.lt-core .card .done { flex-direction: row; justify-content: center; padding: 14px 20px; gap: 12px; }
html.lt-core .card .done i { width: 30px; height: 30px; font-size: 15px; }

/* round 44: a heading for screen readers only (pages whose title is drawn as a picture / app bar) */
.lt-sr { position:absolute !important; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }

/* round 45 (T4): the decision bar — stand-ins for approve / reject / send back while the real buttons are off screen */
#lt-docbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 2147482000; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: #fff; border-top: 2px solid #C79A12; box-shadow: 0 -10px 24px -14px rgba(10, 36, 22, .55);
  padding: 10px 240px calc(10px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); font-family: inherit; }
#lt-docbar[hidden] { display: none; }
#lt-docbar .lt-db-l { font-weight: 800; color: #7A5600; font-size: 14px; margin-right: auto; }
#lt-docbar .lt-db-b { font: inherit; font-size: 14.5px; font-weight: 700; border-radius: 12px; padding: 0 16px; min-height: 44px; cursor: pointer; border: 1px solid #DCE3D8; background: #fff; color: #17321F; }
#lt-docbar .lt-db-b.ok { background: #0E5C33; border-color: #0E5C33; color: #fff; }
#lt-docbar .lt-db-b.no { color: #B42318; border-color: #F2B8B5; }
#lt-docbar .lt-db-b.back { color: #8A6D00; border-color: #E8D49A; }
#lt-docbar .lt-db-b:focus-visible { outline: 3px solid #F3C01F; outline-offset: 2px; }
@media (max-width: 640px) { #lt-docbar { padding-right: 76px; } #lt-docbar .lt-db-l { flex: 1 0 100%; margin: 0 0 2px; font-size: 13px; } #lt-docbar .lt-db-b { flex: 1 1 auto; } }
html[data-lt-modal] #lt-docbar { display: none; }
@media (max-width: 640px) { html.lt-db-on lt-fab, html.lt-db-on #lt-float-x, html.lt-db-on #lt-drop, html.lt-db-on #chat-fab { visibility: hidden !important; } }
