/* ==========================================================================
   RMG-ERP — design system (no external libraries)
   ========================================================================== */
:root {
  --navy-900: #0d1a33;
  --navy-800: #13223f;
  --navy-700: #1b2e52;
  --navy-600: #25406f;
  --primary: #2563eb;
  --primary-600: #1d4ed8;
  --primary-50: #eff4ff;
  --teal: #0d9488;
  --green: #16a34a;
  --green-50: #ecfdf3;
  --amber: #d97706;
  --amber-50: #fff7e6;
  --red: #dc2626;
  --red-50: #fef2f2;
  --purple: #7c3aed;
  --purple-50: #f3efff;
  --blue-50: #eaf2ff;
  --text: #1c2536;
  --text-2: #4a5568;
  --muted: #7a869a;
  --line: #e3e8f0;
  --line-2: #eef2f7;
  --bg: #f4f6fb;
  --card: #ffffff;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .14);
  --sidebar-w: 262px;
  --font: "Segoe UI", system-ui, -apple-system, "Nirmala UI", "Noto Sans Bengali", "Kalpurush", "SolaimanLipi", Roboto, Arial, sans-serif;
  --font-bn: "Nirmala UI", "Noto Sans Bengali", "Kalpurush", "SolaimanLipi", "Vrinda", "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 14px; }
body { margin: 0; font-family: var(--font); color: var(--text); background: var(--bg); line-height: 1.45; -webkit-font-smoothing: antialiased; }
body.lang-bn, .bn, [lang="bn"] { font-family: var(--font-bn); }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .5rem; line-height: 1.25; color: var(--navy-800); }
h1 { font-size: 1.45rem; font-weight: 650; }
h2 { font-size: 1.15rem; font-weight: 650; }
h3 { font-size: 1rem; font-weight: 650; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1rem 0; }
code, .mono { font-family: Consolas, "Cascadia Mono", monospace; font-size: .92em; }
.ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; vertical-align: middle; }

/* ---------- layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar-w); background: linear-gradient(180deg, var(--navy-800), var(--navy-900)); color: #cfd8ea; position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; z-index: 40; transition: width .2s, transform .2s; }
.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; transition: margin .2s; }
.brand a { display: flex; align-items: center; gap: .7rem; padding: 1rem 1.1rem; color: #fff; text-decoration: none; }
.brand-logo { width: 36px; height: 36px; border-radius: 9px; background: linear-gradient(135deg, #3b82f6, #0d9488); display: grid; place-items: center; font-weight: 800; font-size: 1.1rem; color: #fff; box-shadow: 0 4px 12px rgba(37, 99, 235, .45); flex-shrink: 0; }
.brand-text { display: flex; flex-direction: column; font-weight: 700; letter-spacing: .3px; font-size: 1.05rem; }
.brand-text small { font-weight: 400; font-size: .75rem; color: #8fa2c4; letter-spacing: 0; }
.menu-search { margin: 0 .8rem .6rem; position: relative; }
.menu-search .ico { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: #7d8fb3; width: 15px; height: 15px; }
.menu-search input { width: 100%; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .08); border-radius: 8px; color: #fff; padding: .5rem .6rem .5rem 2rem; font: inherit; outline: none; }
.menu-search input:focus { border-color: #4f7df0; background: rgba(255, 255, 255, .11); }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 0 .5rem 1rem; scrollbar-width: thin; scrollbar-color: #2b4271 transparent; }
.nav-root, .nav-root ul { list-style: none; margin: 0; padding: 0; }
.nav-link, .nav-toggle { display: flex; align-items: center; gap: .65rem; width: 100%; padding: .5rem .7rem; border-radius: 8px; color: #c7d2e8; font: inherit; background: none; border: 0; text-align: left; cursor: pointer; text-decoration: none; }
.nav-link:hover, .nav-toggle:hover { background: rgba(255, 255, 255, .07); color: #fff; text-decoration: none; }
.nav-link.active { background: var(--primary); color: #fff; box-shadow: 0 3px 10px rgba(37, 99, 235, .35); }
.nav-text { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-module { margin-top: 2px; }
.nav-module > .nav-toggle { font-weight: 600; color: #e3e9f6; }
.nav-caret { width: 14px; height: 14px; transition: transform .2s; opacity: .7; }
.nav-module.open > .nav-toggle .nav-caret { transform: rotate(90deg); }
.nav-sub { display: none; padding: 2px 0 6px 1.2rem !important; border-left: 1px solid rgba(255, 255, 255, .08); margin-left: 1.15rem !important; }
.nav-module.open > .nav-sub { display: block; }
.nav-sub .nav-link { padding: .38rem .6rem; font-size: .95rem; }
.nav-group-title { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: #7488ae; padding: .6rem .6rem .25rem; }
.nav-badge { background: var(--red); color: #fff; font-size: .7rem; font-weight: 700; border-radius: 10px; padding: 0 .45rem; line-height: 1.35rem; min-width: 1.35rem; text-align: center; }
.nav-link.active .nav-badge { background: #fff; color: var(--red); }
.sidebar-foot { font-size: .72rem; color: #6d7fa3; padding: .6rem 1rem; border-top: 1px solid rgba(255, 255, 255, .06); }
.nav-hidden { display: none !important; }

body.sb-collapsed { --sidebar-w: 64px; }
body.sb-collapsed .brand-text, body.sb-collapsed .menu-search, body.sb-collapsed .nav-text, body.sb-collapsed .nav-caret,
body.sb-collapsed .nav-badge, body.sb-collapsed .nav-sub, body.sb-collapsed .sidebar-foot { display: none !important; }
body.sb-collapsed .nav-link, body.sb-collapsed .nav-toggle { justify-content: center; }

.topbar { height: 56px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 1rem; padding: 0 1.2rem; position: sticky; top: 0; z-index: 30; }
.topbar-clock { font-variant-numeric: tabular-nums; background: var(--navy-800); color: #fff; padding: .3rem .8rem; border-radius: 7px; font-size: .9rem; font-weight: 600; }
.topbar-company { font-weight: 600; color: var(--navy-700); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-right { display: flex; align-items: center; gap: .5rem; }
.icon-btn { background: none; border: 1px solid transparent; border-radius: 8px; padding: .4rem; color: var(--text-2); cursor: pointer; display: inline-flex; align-items: center; gap: .35rem; font: inherit; position: relative; }
.icon-btn:hover { background: var(--line-2); border-color: var(--line); }
.icon-btn .dot { position: absolute; top: 2px; right: 2px; background: var(--red); color: #fff; font-size: .62rem; border-radius: 8px; padding: 0 4px; font-weight: 700; }
.user-menu { position: relative; }
.user-menu > button { display: flex; align-items: center; gap: .5rem; background: none; border: 0; cursor: pointer; font: inherit; padding: .25rem .4rem; border-radius: 8px; }
.user-menu > button:hover { background: var(--line-2); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, #6366f1, #2563eb); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .85rem; }
.user-name { text-align: left; line-height: 1.15; font-size: .9rem; }
.user-name small { display: block; color: var(--muted); font-size: .75rem; }
.dropdown { position: absolute; right: 0; top: calc(100% + 6px); background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); min-width: 200px; padding: .35rem; display: none; z-index: 50; }
.dropdown.show { display: block; }
.dropdown a, .dropdown button { display: flex; align-items: center; gap: .55rem; width: 100%; padding: .5rem .65rem; border-radius: 7px; color: var(--text); background: none; border: 0; font: inherit; text-align: left; cursor: pointer; }
.dropdown a:hover, .dropdown button:hover { background: var(--line-2); text-decoration: none; }
.lang-switch { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.lang-switch button { border: 0; background: #fff; padding: .3rem .6rem; cursor: pointer; font: inherit; font-size: .85rem; color: var(--text-2); }
.lang-switch button.on { background: var(--navy-800); color: #fff; }
.content { padding: 1.2rem 1.4rem 3rem; flex: 1; }

/* ---------- page head ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.page-head h1 { margin: 0; }
.crumbs { font-size: .82rem; color: var(--muted); margin-bottom: .25rem; display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.crumbs a { color: var(--muted); }
.crumbs .sep { opacity: .5; }
.page-actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.page-note { background: var(--blue-50); border: 1px solid #cddcff; color: #1e3a8a; border-radius: 8px; padding: .6rem .8rem; margin-bottom: 1rem; font-size: .92rem; }

/* ---------- cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 1rem; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: .8rem 1rem; border-bottom: 1px solid var(--line); }
.card-head h2, .card-head h3 { margin: 0; }
.card-body { padding: 1rem; }
.card-foot { padding: .7rem 1rem; border-top: 1px solid var(--line); background: #fbfcfe; border-radius: 0 0 var(--radius) var(--radius); }
.section-title { font-size: .95rem; font-weight: 650; color: var(--navy-700); border-bottom: 2px solid var(--navy-700); padding-bottom: .3rem; margin: 1.1rem 0 .8rem; }
.section-title:first-child { margin-top: 0; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .5rem .95rem; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--text); font: inherit; font-weight: 550; cursor: pointer; line-height: 1.2; white-space: nowrap; text-decoration: none !important; transition: background .15s, border-color .15s, box-shadow .15s; }
.btn:hover { background: var(--line-2); }
.btn:focus-visible, .input:focus-visible { outline: 3px solid rgba(37, 99, 235, .25); outline-offset: 1px; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-600); }
.btn-success { background: var(--green); border-color: var(--green); color: #fff; }
.btn-success:hover { background: #15803d; }
.btn-danger { background: #fff; border-color: #f3b4b4; color: var(--red); }
.btn-danger:hover { background: var(--red-50); }
.btn-warning { background: var(--amber); border-color: var(--amber); color: #fff; }
.btn-dark { background: var(--navy-800); border-color: var(--navy-800); color: #fff; }
.btn-dark:hover { background: var(--navy-700); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-sm { padding: .3rem .6rem; font-size: .86rem; border-radius: 6px; }
.btn-xs { padding: .15rem .45rem; font-size: .8rem; border-radius: 5px; }
.btn .ico { width: 16px; height: 16px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-group { display: inline-flex; gap: .35rem; flex-wrap: wrap; }
.inline-form { display: inline; }

/* ---------- forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .85rem 1rem; }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fg { display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.fg.span-2 { grid-column: span 2; } .fg.span-3 { grid-column: span 3; } .fg.span-4 { grid-column: 1 / -1; }
.fg > label, .label { font-size: .83rem; font-weight: 600; color: var(--text-2); }
.req { color: var(--red); }
.input { width: 100%; padding: .48rem .65rem; border: 1px solid #cfd7e4; border-radius: 7px; background: #fff; font: inherit; color: var(--text); min-height: 36px; transition: border-color .15s, box-shadow .15s; }
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, .15); outline: none; }
.input[disabled], .input[readonly] { background: #f3f5f9; color: var(--text-2); }
select.input { padding-right: 1.8rem; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237a869a' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .6rem center; }
select.input[multiple] { background-image: none; min-height: 90px; padding-right: .65rem; }
textarea.input { min-height: 70px; resize: vertical; }
.input.num { text-align: right; font-variant-numeric: tabular-nums; }
.input.is-invalid { border-color: var(--red); background: #fffafa; }
.field-error { color: var(--red); font-size: .8rem; }
.help { color: var(--muted); font-size: .8rem; }
.fg-bool { justify-content: flex-end; }
.switch { position: relative; display: inline-block; width: 42px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #cbd3df; border-radius: 24px; cursor: pointer; transition: .2s; }
.switch span::before { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::before { transform: translateX(18px); }
.switch input:disabled + span { opacity: .6; cursor: not-allowed; }
.check { display: inline-flex; align-items: center; gap: .4rem; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--primary); }
.form-actions { display: flex; gap: .6rem; justify-content: flex-end; padding: .8rem 1rem; border-top: 1px solid var(--line); background: #fbfcfe; border-radius: 0 0 var(--radius) var(--radius); position: sticky; bottom: 0; z-index: 5; }
.radio-row { display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; min-height: 36px; }

/* searchable select */
.ss-wrap { position: relative; }
.ss-wrap > select { display: none; }
.ss-btn { text-align: left; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 1.8rem; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237a869a' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .6rem center; }
.ss-btn.placeholder { color: var(--muted); }
.ss-pop { position: absolute; left: 0; right: 0; top: calc(100% + 3px); background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-lg); z-index: 60; display: none; min-width: 220px; }
.ss-pop.show { display: block; }
.ss-pop input { width: calc(100% - 12px); margin: 6px; }
.ss-list { max-height: 260px; overflow-y: auto; padding: 0 4px 4px; }
.ss-opt { padding: .38rem .55rem; border-radius: 6px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ss-opt:hover, .ss-opt.hl { background: var(--primary-50); }
.ss-opt.sel { font-weight: 650; color: var(--primary); }
.ss-empty { padding: .5rem; color: var(--muted); }

/* ---------- filter bar ---------- */
.filter-bar { display: flex; flex-wrap: wrap; gap: .6rem; align-items: flex-end; padding: .8rem 1rem; border-bottom: 1px solid var(--line); background: #fbfcfe; border-radius: var(--radius) var(--radius) 0 0; }
.filter-bar .fg { min-width: 150px; flex: 0 1 190px; }
.filter-bar .fg.grow { flex: 1 1 240px; }
.filter-bar .btn { min-height: 36px; }

/* ---------- tables ---------- */
.table-wrap { overflow: auto; max-height: calc(100vh - 260px); }
.table-wrap.no-max { max-height: none; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .92rem; }
.table th { position: sticky; top: 0; background: var(--navy-700); color: #fff; font-weight: 600; text-align: left; padding: .55rem .6rem; white-space: nowrap; z-index: 2; font-size: .84rem; }
.table th a { color: #fff; }
.table th.num, .table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.table th.center, .table td.center { text-align: center; }
.table td { padding: .45rem .6rem; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tbody tr:nth-child(even) td { background: #fafbfd; }
.table tbody tr:hover td { background: #f1f5ff; }
.table tr.hl td { background: #fff8db !important; }
.table tfoot td { position: sticky; bottom: 0; background: #eef2f9; font-weight: 700; border-top: 2px solid var(--navy-700); }
.table .actions { white-space: nowrap; text-align: right; }
.table .wrap { white-space: normal; min-width: 180px; }
.table-compact td, .table-compact th { padding: .3rem .45rem; }
.empty { text-align: center; color: var(--muted); padding: 2rem 1rem !important; }
.table-meta { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .6rem 1rem; font-size: .88rem; color: var(--muted); flex-wrap: wrap; }
.pager { display: flex; gap: .25rem; flex-wrap: wrap; }
.pager a, .pager span { padding: .3rem .6rem; border: 1px solid var(--line); border-radius: 6px; color: var(--text); background: #fff; font-size: .85rem; }
.pager a:hover { background: var(--line-2); text-decoration: none; }
.pager .on { background: var(--primary); border-color: var(--primary); color: #fff; }
.row-link { color: var(--text); font-weight: 600; }

/* ---------- badges & chips ---------- */
.badge { display: inline-block; padding: .12rem .55rem; border-radius: 20px; font-size: .76rem; font-weight: 650; line-height: 1.5; white-space: nowrap; }
.badge-green { background: var(--green-50); color: #067a36; border: 1px solid #b4e6c7; }
.badge-amber { background: var(--amber-50); color: #9a5b00; border: 1px solid #f8d79a; }
.badge-red { background: var(--red-50); color: #b42318; border: 1px solid #f7c2c2; }
.badge-grey { background: #f1f3f7; color: #5b6576; border: 1px solid #dde2ea; }
.badge-blue { background: var(--blue-50); color: #1d4ed8; border: 1px solid #c3d6ff; }
.badge-purple { background: var(--purple-50); color: #5b21b6; border: 1px solid #d9ccff; }
.att { display: inline-block; min-width: 30px; text-align: center; padding: .08rem .35rem; border-radius: 5px; font-weight: 700; font-size: .8rem; }
.att-green { background: #dcfce7; color: #166534; } .att-amber { background: #fef3c7; color: #92400e; } .att-red { background: #fee2e2; color: #991b1b; }
.att-grey { background: #eef1f5; color: #475569; } .att-blue { background: #dbeafe; color: #1e40af; } .att-purple { background: #ede9fe; color: #5b21b6; }
.pill { display: inline-flex; align-items: center; gap: .3rem; background: var(--line-2); border-radius: 20px; padding: .1rem .6rem; font-size: .8rem; }

/* ---------- alerts ---------- */
.alert { display: flex; gap: .6rem; align-items: flex-start; padding: .7rem .9rem; border-radius: 9px; margin-bottom: .8rem; border: 1px solid; font-size: .93rem; }
.alert .ico { margin-top: 1px; }
.alert-success { background: var(--green-50); border-color: #b4e6c7; color: #0b6b33; }
.alert-error { background: var(--red-50); border-color: #f7c2c2; color: #9b1c1c; }
.alert-warning { background: var(--amber-50); border-color: #f8d79a; color: #8a5100; }
.alert-info { background: var(--blue-50); border-color: #c3d6ff; color: #1e3a8a; }
.alert ul { margin: .3rem 0 0 1.1rem; padding: 0; }
.alert .close { margin-left: auto; background: none; border: 0; cursor: pointer; color: inherit; opacity: .6; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: .2rem; border-bottom: 1px solid var(--line); padding: 0 .6rem; overflow-x: auto; background: #fbfcfe; border-radius: var(--radius) var(--radius) 0 0; }
.tab-btn { border: 0; background: none; padding: .7rem .9rem; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-btn .dot-err { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--red); margin-left: .3rem; vertical-align: middle; }
.tab-panel { display: none; padding: 1rem; }
.tab-panel.active { display: block; }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .9rem; margin-bottom: 1rem; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.stat::after { content: ""; position: absolute; right: -18px; top: -18px; width: 70px; height: 70px; border-radius: 50%; background: var(--c, var(--primary)); opacity: .08; }
.stat .k { font-size: .8rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.stat .v { font-size: 1.6rem; font-weight: 750; color: var(--navy-800); font-variant-numeric: tabular-nums; }
.stat .s { font-size: .8rem; color: var(--muted); }
.stat.green { --c: var(--green); } .stat.red { --c: var(--red); } .stat.amber { --c: var(--amber); } .stat.teal { --c: var(--teal); } .stat.purple { --c: var(--purple); }
.bar-chart { display: flex; flex-direction: column; gap: .45rem; }
.bar-row { display: grid; grid-template-columns: 150px 1fr 70px; gap: .6rem; align-items: center; font-size: .88rem; }
.bar-track { background: var(--line-2); border-radius: 5px; height: 14px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, #3b82f6, #2563eb); border-radius: 5px; }
.bar-fill.green { background: linear-gradient(90deg, #22c55e, #16a34a); }
.bar-fill.red { background: linear-gradient(90deg, #f87171, #dc2626); }
.bar-fill.amber { background: linear-gradient(90deg, #fbbf24, #d97706); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }

/* ---------- permission matrix ---------- */
.perm-toolbar { display: flex; gap: .6rem; flex-wrap: wrap; align-items: flex-end; padding: .8rem 1rem; border-bottom: 1px solid var(--line); background: #fbfcfe; }
.perm-table td.lvl-0 { font-weight: 750; background: #e8eefb !important; color: var(--navy-800); }
.perm-table td.lvl-1 { font-weight: 650; padding-left: 1.6rem; background: #f4f7fd !important; }
.perm-table td.lvl-2 { padding-left: 2.8rem; }
.perm-table td.lvl-3 { padding-left: 4rem; }
.perm-table td.center input { width: 17px; height: 17px; accent-color: var(--green); cursor: pointer; }
.perm-table .na { color: #c3cad6; }
.perm-table .row-all { font-size: .75rem; }
.perm-table tr.feature td:first-child { font-style: italic; color: var(--purple); }
.perm-table th.col-head { cursor: pointer; }
.perm-table th.col-head:hover { background: var(--navy-600); }
.perm-legend { font-size: .82rem; color: var(--muted); }

/* ---------- entry grid (Excel-like) ---------- */
.grid-entry { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; }
.grid-entry th { position: sticky; top: 0; background: var(--navy-700); color: #fff; font-size: .8rem; padding: .45rem .4rem; white-space: nowrap; z-index: 2; }
.grid-entry td { padding: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #fff; }
.grid-entry td.rn { background: #f3f5f9; color: var(--muted); text-align: center; font-size: .8rem; min-width: 36px; padding: 0 .3rem; }
.grid-entry .input { border: 0; border-radius: 0; min-height: 32px; padding: .3rem .4rem; min-width: 90px; }
.grid-entry select.input { min-width: 130px; }
.grid-entry .input:focus { box-shadow: inset 0 0 0 2px var(--primary); }
.grid-entry tr.err td { background: #fff1f1; }
.grid-entry tr.err .input { background: #fff1f1; }
.grid-entry .row-errors { font-size: .78rem; color: var(--red); padding: .2rem .4rem; background: #fff1f1; }
.grid-entry td.calc { background: #f6f8fc; text-align: right; padding: 0 .45rem; font-variant-numeric: tabular-nums; color: var(--text-2); min-width: 80px; }
.grid-help { font-size: .85rem; color: var(--muted); }

/* ---------- misc ---------- */
.muted { color: var(--muted); } .small { font-size: .85rem; } .xsmall { font-size: .78rem; }
.text-right { text-align: right; } .text-center { text-align: center; } .nowrap { white-space: nowrap; }
.flex { display: flex; } .items-center { align-items: center; } .justify-between { justify-content: space-between; } .wrap-gap { flex-wrap: wrap; gap: .6rem; }
.gap { gap: .6rem; } .mt-0 { margin-top: 0; } .mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; }
.w-100 { width: 100%; } .hidden { display: none !important; }
.kv { display: grid; grid-template-columns: 170px 1fr; gap: .35rem .8rem; font-size: .93rem; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; font-weight: 550; }
.photo-box { width: 130px; height: 155px; border: 1px dashed #b8c3d6; border-radius: 8px; background: #f6f8fc center/cover no-repeat; display: grid; place-items: center; color: var(--muted); font-size: .8rem; text-align: center; overflow: hidden; }
.photo-box img { width: 100%; height: 100%; object-fit: cover; }
.sig-box { width: 220px; height: 80px; }
.progress { height: 10px; background: var(--line-2); border-radius: 6px; overflow: hidden; }
.progress > div { height: 100%; background: var(--green); }
.status-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: .35rem; background: var(--muted); }
.status-dot.on { background: var(--green); box-shadow: 0 0 0 3px rgba(22, 163, 74, .2); }
.status-dot.off { background: var(--red); box-shadow: 0 0 0 3px rgba(220, 38, 38, .15); }
.timeline { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 .9rem 1rem; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--primary); }
.phase-card { border-left: 4px solid var(--line); }
.phase-card.done { border-left-color: var(--green); } .phase-card.build { border-left-color: var(--amber); } .phase-card.plan { border-left-color: #b8c3d6; }
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { padding: .25rem 0 .25rem 1.6rem; position: relative; }
.checklist li::before { content: "○"; position: absolute; left: .2rem; color: var(--muted); }
.checklist li.done::before { content: "✔"; color: var(--green); }
.checklist li.build::before { content: "◐"; color: var(--amber); }
dialog.modal { border: 0; border-radius: 12px; padding: 0; box-shadow: var(--shadow-lg); width: min(560px, 94vw); }
dialog.modal::backdrop { background: rgba(13, 26, 51, .45); }
dialog.modal .card-head { border-radius: 12px 12px 0 0; }

/* ---------- auth pages ---------- */
.auth-page { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: #fff; }
.auth-hero { background: radial-gradient(circle at 20% 20%, #274b8f 0, transparent 45%), linear-gradient(160deg, var(--navy-800), var(--navy-900)); color: #dbe5f7; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-hero h1 { color: #fff; font-size: 2rem; margin-top: 2rem; }
.auth-hero ul { padding-left: 1.1rem; line-height: 2; color: #b9c7e2; }
.auth-hero .brand-logo { width: 46px; height: 46px; font-size: 1.4rem; }
.auth-form { display: grid; place-items: center; padding: 2rem; }
.auth-box { width: min(380px, 100%); }
.auth-box h2 { font-size: 1.5rem; margin-bottom: .3rem; }
.auth-box .fg { margin-bottom: .9rem; }
.auth-box .btn { width: 100%; padding: .7rem; }

/* ---------- install ---------- */
.install-wrap { max-width: 860px; margin: 2rem auto; padding: 0 1rem; }

/* ---------- print documents ---------- */
.print-sheet { background: #fff; margin: 0 auto 1rem; box-shadow: var(--shadow); }
.a4 { width: 210mm; min-height: 297mm; padding: 18mm 18mm 16mm; }
.letter { font-family: var(--font-bn); font-size: 13.5px; line-height: 1.75; color: #111; }
.letter h2 { text-align: center; font-size: 1.25rem; margin: .5rem 0 1rem; color: #111; text-decoration: underline; }
.letter .lh { text-align: center; border-bottom: 2px solid #111; padding-bottom: .5rem; margin-bottom: 1rem; }
.letter .lh h1 { font-size: 1.5rem; color: #111; margin: 0; }
.letter ol { padding-left: 1.3rem; }
.letter .sign { display: flex; justify-content: space-between; margin-top: 3.5rem; }
.letter .sign div { border-top: 1px solid #111; padding-top: .3rem; min-width: 180px; text-align: center; }
.cards-sheet { display: flex; flex-wrap: wrap; gap: 6mm; padding: 6mm; background: #fff; }
.idcard { width: 54mm; height: 86mm; border: 1px solid #333; border-radius: 3mm; padding: 2.5mm 3mm; font-family: var(--font-bn); font-size: 7.6pt; line-height: 1.35; color: #111; position: relative; overflow: hidden; background: #fff; page-break-inside: avoid; }
.idcard .ic-logo { display: flex; align-items: center; gap: 1.5mm; font-weight: 700; font-size: 9.5pt; color: #1b2e7a; font-family: var(--font); justify-content: center; }
.idcard .ic-logo .mark { width: 6mm; height: 5mm; background: linear-gradient(120deg, #d62828 0 33%, #f4b400 33% 66%, #1b2e7a 66%); transform: skewX(-18deg); }
.idcard .ic-title { text-align: center; font-weight: 700; font-size: 9pt; margin: 1mm 0; }
.idcard .ic-photo { width: 20mm; height: 23mm; margin: 0 auto; border: 1px solid #999; background: #f1f1f1 center/cover no-repeat; display: block; object-fit: cover; }
.idcard .ic-name { background: #1f4e9c; color: #fff; text-align: center; font-weight: 700; font-size: 9pt; margin: 1mm -3mm; padding: .6mm 1mm; }
.idcard .barcode { width: 100%; height: 8mm; display: block; margin: .6mm 0; }
.idcard table { width: 100%; border-collapse: collapse; }
.idcard td { padding: 0 .5mm; vertical-align: top; }
.idcard td:first-child { white-space: nowrap; width: 18mm; }
.idcard .ic-sign { position: absolute; bottom: 2mm; left: 3mm; right: 3mm; display: flex; justify-content: space-between; font-size: 6.4pt; }
.idcard .ic-sign span { border-top: 1px solid #444; padding-top: .3mm; }
.idcard .ic-sign img { position: absolute; bottom: 3mm; right: 3mm; height: 7mm; }
.idcard.back { font-size: 7.4pt; }
.idcard.back .ic-row { margin-bottom: 1.1mm; }
.payslip { width: 100%; border: 1px solid #333; padding: 4mm; font-size: 10pt; margin-bottom: 5mm; page-break-inside: avoid; }
.payslip table { width: 100%; border-collapse: collapse; }
.payslip td, .payslip th { border: 1px solid #aaa; padding: 1mm 1.5mm; }
.payslip th { background: #eee; }
.report-head { text-align: center; margin-bottom: .6rem; }
.report-head h2 { margin: 0; }
.form-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.gap-2 { gap: 1.4rem; } .flex.wrap { flex-wrap: wrap; }
.row-hl td { background: var(--green-50, #eefaf2); }
.sheet-wide { font-size: 9.5px; }
.sheet-wide th, .sheet-wide td { padding: .2rem .3rem !important; }
.payslip-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5mm; }
.payslip h4 { margin: 0 0 1mm; text-align: center; font-size: 11pt; }
.payslip .ps-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 0 4mm; font-size: 9pt; margin-bottom: 1.5mm; }
.payslip .ps-net { font-weight: 700; font-size: 11pt; text-align: right; margin-top: 1mm; }
.payslip .ps-sign { display: flex; justify-content: space-between; margin-top: 7mm; font-size: 8.5pt; }
.payslip .ps-sign span { border-top: 1px solid #333; padding-top: .5mm; min-width: 30mm; text-align: center; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fg.span-3, .fg.span-4 { grid-column: 1 / -1; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); }
  body.sb-open .sidebar { transform: none; }
  .main { margin-left: 0 !important; }
  .form-grid, .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .fg.span-2 { grid-column: auto; }
  .auth-page { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
  .topbar-clock, .user-name { display: none; }
  .kv { grid-template-columns: 1fr; }
}

/* ---------- print ---------- */
@media print {
  @page { margin: 8mm; }
  body { background: #fff; }
  .sidebar, .topbar, .page-actions, .filter-bar, .no-print, .form-actions, .alert, .pager, .crumbs, .table-meta .pager { display: none !important; }
  .main { margin: 0 !important; }
  .content { padding: 0; }
  .card { border: 0; box-shadow: none; }
  .table-wrap { max-height: none; overflow: visible; }
  .table th { position: static; background: #ddd !important; color: #000; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .print-sheet { box-shadow: none; margin: 0; }
  .a4 { padding: 0; min-height: auto; }
  .idcard, .idcard .ic-name, .idcard .ic-logo .mark { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .page-break { page-break-after: always; }
  .landscape-print { zoom: .8; }
  .payslip-grid { grid-template-columns: 1fr 1fr; }
}

/* ---------- production ---------- */
.progress-stack { display: grid; gap: 3px; }
.pbar { height: 6px; background: var(--line-2, #eef1f6); border-radius: 4px; overflow: hidden; }
.pbar span { display: block; height: 100%; background: var(--primary); border-radius: 4px; }
.pbar.teal span { background: var(--teal, #0d9488); } .pbar.green span { background: var(--green); }
.matrix td { padding: .2rem .25rem !important; } .matrix .input { min-width: 56px; padding: .3rem .4rem; }
.tracker th, .tracker td { white-space: nowrap; font-size: .8rem; padding: .25rem .4rem !important; }
.tracker tr.sub td { background: var(--blue-50, #eef4ff); font-weight: 600; }
.tracker .neg { color: var(--red); }
.bar-row { display: grid; grid-template-columns: 180px 1fr 90px; gap: .6rem; align-items: center; margin-bottom: .35rem; font-size: .85rem; }
.bar-row .bar { height: 14px; background: var(--primary); border-radius: 3px; min-width: 2px; }

/* multi-column form grids collapse on smaller screens */
@media (max-width: 1100px) { .form-grid.cols-4, .form-grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) { .form-grid.cols-4, .form-grid.cols-3, .form-grid.cols-2 { grid-template-columns: 1fr; } .bar-row { grid-template-columns: 1fr 1fr; } .bar-row > :last-child { grid-column: 1 / -1; } }

/* ---------- Excel-style sheet tabs (daily data entry) ---------- */
.sheet-tabs { display: flex; flex-wrap: nowrap; gap: 3px; overflow-x: auto; padding: 0 0 2px; margin: -.25rem 0 .9rem; border-bottom: 2px solid var(--line); scrollbar-width: thin; }
.sheet-tab { flex: 0 0 auto; padding: .38rem .8rem; border: 1px solid var(--line); border-bottom: 0; border-radius: 6px 6px 0 0; background: #fff; color: var(--text); font-size: .86rem; font-weight: 600; text-decoration: none; white-space: nowrap; }
.sheet-tab:hover { background: var(--blue-50, #eef4ff); text-decoration: none; }
.sheet-tab.g-fabric { border-top: 3px solid #2f80ed; }
.sheet-tab.g-floor { background: #d6249f; border-color: #d6249f; color: #fff; }
.sheet-tab.g-floor:hover { background: #b81d88; }
.sheet-tab.g-line { border-top: 3px solid #0d9488; }
.sheet-tab.g-more { font-weight: 500; color: var(--muted); }
.sheet-tab.active { background: #1da1f2; border-color: #1da1f2; color: #fff; box-shadow: 0 -2px 0 #1da1f2 inset; }
.sheet-sep { flex: 0 0 1px; background: var(--line); margin: .3rem .4rem; }

/* ---------- TNA board & case study (P2b) ---------- */
.tna-board th.task { text-align: center; white-space: normal; min-width: 74px; max-width: 92px; font-size: .74rem; line-height: 1.15; }
.tna-board td.tna { text-align: center; font-size: .72rem; line-height: 1.2; padding: .2rem .3rem !important; border-left: 1px solid var(--line); }
.tna .p { color: var(--muted); }
.tna .a { font-weight: 650; }
.tna .d { font-size: .68rem; font-weight: 700; }
.tna-green { background: #e7f6ed; } .tna-green .d { color: #067a36; }
.tna-red { background: #fdeaea; } .tna-red .d { color: #b42318; }
.tna-amber { background: #fff3dc; } .tna-amber .d { color: #9a5b00; }
.tna-blue { background: #eaf1ff; } .tna-blue .d { color: #1d4ed8; }
.tna-grey { background: transparent; }
.rag { display: inline-block; width: .7rem; height: .7rem; border-radius: 50%; vertical-align: middle; margin-right: .25rem; background: #c7ced9; }
.rag.red { background: var(--red); } .rag.amber { background: var(--amber); } .rag.green { background: var(--green); } .rag.done { background: var(--teal, #0d9488); }
.tna-legend { display: flex; flex-wrap: wrap; gap: .8rem; font-size: .78rem; color: var(--muted); }
.tna-legend span { display: inline-flex; align-items: center; gap: .3rem; }
.tna-legend i { width: .9rem; height: .9rem; border-radius: 3px; display: inline-block; border: 1px solid var(--line); }
.plan-table .input { padding: .25rem .35rem; min-width: 118px; }
.plan-table td { vertical-align: middle; }
.case-head { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; margin-bottom: 1rem; }
.case-head div { padding: .5rem .7rem; border-right: 1px solid var(--line); }
.case-head div:last-child { border-right: 0; }
.case-head .k { font-size: .72rem; color: var(--muted); text-transform: uppercase; font-weight: 650; }
.case-head .v { font-size: 1rem; font-weight: 700; color: var(--navy-800); }
.case-section { font-size: .8rem; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; color: #fff; background: var(--navy-800, #1f3a68); padding: .3rem .6rem; border-radius: 4px 4px 0 0; margin: 0; }
@media (max-width: 860px) { .case-head { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media print { .tna-green, .tna-red, .tna-amber, .tna-blue, .case-section, .rag { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }

/* ---------- floor: bundle cards, scanning, hourly tablet, board (P2c) ---------- */
.input-lg { font-size: 1.15rem; padding: .55rem .7rem; min-height: 2.9rem; }
.btn-lg { font-size: 1.05rem; padding: .6rem 1.4rem; }
.big-num { font-size: 1.7rem; font-weight: 750; color: var(--navy-800); font-variant-numeric: tabular-nums; line-height: 1.2; }
.scan-card .form-actions { justify-content: flex-start; }
.scan-msg { font-size: 1.15rem; font-weight: 650; }
.scan-modes { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.scan-mode { display: flex; align-items: center; justify-content: center; gap: .5rem; padding: 1rem .6rem; border: 2px solid var(--line); border-radius: var(--radius); cursor: pointer; font-weight: 650; background: #fff; }
.scan-mode.on { border-color: var(--primary); background: var(--primary-50, #eef4ff); color: var(--primary-600, #1d4ed8); }
.scan-mode input { accent-color: var(--primary); width: 18px; height: 18px; }
.hourly-grid td, .hourly-grid th { padding: .35rem .5rem !important; font-size: .9rem; }
.hourly-grid .input-lg { font-size: 1.25rem; font-weight: 650; text-align: right; width: 100%; min-width: 96px; }
.bundle-sheet { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4mm; }
.bundle-card { border: 1px dashed #777; border-radius: 2mm; padding: 3mm; font-size: 9pt; page-break-inside: avoid; background: #fff; }
.bundle-card .bc-head { display: flex; justify-content: space-between; font-size: 7.5pt; color: #555; }
.bundle-card .bc-no { font-size: 13pt; font-weight: 800; letter-spacing: .04em; text-align: center; }
.bundle-card .barcode { width: 100%; height: 12mm; display: block; }
.bundle-card .bc-tab { width: 100%; border-collapse: collapse; margin-top: 1mm; }
.bundle-card .bc-tab td { padding: .3mm 0; vertical-align: top; }
.bundle-card .bc-tab td:first-child { color: #666; width: 22mm; }
.bundle-card .bc-boxes { display: flex; justify-content: space-between; gap: 2mm; margin-top: 1.5mm; padding-top: 1.5mm; border-top: 1px solid #ccc; font-size: 7.5pt; color: #555; }
.board td.hour-ok { background: #e7f6ed; } .board td.hour-low { background: #fff3dc; }
.board-tv { font-size: 1.35rem; }
.board-tv .table th, .board-tv .table td { font-size: 1.15rem !important; padding: .5rem .6rem !important; }
.board-tv .report-head h3 { font-size: 1.6rem; }
@media (max-width: 860px) { .scan-modes { grid-template-columns: 1fr; } .hourly-grid .input-lg { min-width: 72px; } }
@media print { .bundle-sheet { gap: 3mm; } .bundle-card { border-style: solid; border-color: #999; } .board td.hour-ok, .board td.hour-low { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }

/* ---------- P2d: offline banner, carton labels (floor tablets) ---------- */
.offline-bar { position: sticky; top: 0; z-index: 30; padding: .5rem .9rem; font-size: .88rem; font-weight: 650; border-radius: 6px; margin-bottom: .8rem; }
.offline-bar.off { background: #fdeaea; color: #b42318; border: 1px solid #f7c2c2; }
.offline-bar.sync { background: #fff3dc; color: #9a5b00; border: 1px solid #f8d79a; }
.offline-bar.done { background: #e7f6ed; color: #067a36; border: 1px solid #b4e6c7; }
.carton-label-sheet { display: grid; grid-template-columns: repeat(2, 1fr); gap: 5mm; }
.carton-label { border: 1px solid #333; border-radius: 2mm; padding: 4mm; page-break-inside: avoid; }
.carton-label .cl-co { font-weight: 800; font-size: 12pt; }
.carton-label .cl-mark { font-size: 10pt; color: #333; margin-bottom: 1mm; }
.carton-label .cl-tab { width: 100%; border-collapse: collapse; font-size: 9.5pt; }
.carton-label .cl-tab td { padding: .4mm 0; vertical-align: top; }
.carton-label .cl-tab td:first-child { color: #666; width: 26mm; }
.carton-label .barcode { width: 100%; height: 14mm; display: block; margin-top: 1.5mm; }
@media print { .carton-label { border-color: #000; } }

/* ---------------- Accounts (Phase 3a) ---------------- */
.between { justify-content: space-between; }
.items-end { align-items: flex-end; }
td.right, th.right, .right { text-align: right; }
.card-title { font-size: .95rem; font-weight: 700; margin: 0 0 .6rem; }
.vbal { display: inline-block; font-weight: 700; font-size: .8rem; padding: .1rem .5rem; border-radius: 6px; }
.vbal.ok { background: var(--green-50); color: var(--green); }
.vbal.bad { background: var(--red-50); color: var(--red); }
.voucher-grid td { vertical-align: top; }
.voucher-grid .num { max-width: 120px; }
.table .group-row td { background: var(--line-2); font-weight: 600; }
.table tr.subtotal td, .table tr.subtotal th { border-top: 1px solid var(--line); background: #fbfcfe; }
.tb-table thead tr.sub th { font-weight: 600; color: var(--muted); font-size: .74rem; }
/* Print documents (vouchers, reports) */
.print-only { display: none; }
.print-doc { max-width: 780px; margin: 0 auto; }
.print-doc.wide { max-width: none; }
.print-doc .print-head { margin-bottom: .8rem; }
.doc-meta { width: 100%; margin: .4rem 0 .8rem; font-size: .9rem; }
.table.bordered th, .table.bordered td { border: 1px solid #333; padding: .35rem .5rem; }
.amount-words { margin-top: .5rem; font-size: .9rem; }
.sign-row { display: flex; justify-content: space-between; gap: 1rem; margin-top: 3rem; }
.sign-row .sign { flex: 1; text-align: center; border-top: 1px solid #333; padding-top: .3rem; font-size: .82rem; }
@media print {
  .print-only { display: block; }
}

/* ---------- Field & travel staff (Phase 1c): map, my field day, live map, live board ---------- */
.erp-map { position: relative; overflow: hidden; background: #e8eaed; touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; border-radius: 0 0 var(--radius) var(--radius); }
.erp-map.em-grab { cursor: grabbing; }
.em-tiles, .em-marks, .em-svg { position: absolute; inset: 0; }
.em-tile { position: absolute; left: 0; top: 0; width: 256px; height: 256px; opacity: 0; transition: opacity .2s; pointer-events: none; max-width: none; }
.em-tile.ok { opacity: 1; }
.em-svg { pointer-events: none; overflow: visible; }
.em-c { fill: rgba(37, 99, 235, .08); stroke: rgba(37, 99, 235, .55); stroke-width: 1.5; }
.em-site { fill: rgba(13, 148, 136, .10); stroke: rgba(13, 148, 136, .7); stroke-dasharray: 4 3; }
.em-site-clock { fill: rgba(22, 163, 74, .12); stroke: #16a34a; stroke-dasharray: none; }
.em-acc { fill: rgba(37, 99, 235, .12); stroke: rgba(37, 99, 235, .35); }
.em-ping { fill: #2563eb; stroke: #fff; stroke-width: 1; }
.em-l { fill: none; stroke-linejoin: round; stroke-linecap: round; }
.em-trail { stroke: #2563eb; stroke-width: 3.5; opacity: .85; }
.em-mk { position: absolute; transform: translate(-50%, -50%); cursor: pointer; }
.em-mk span { pointer-events: none; }
.em-me { width: 16px; height: 16px; border-radius: 50%; background: #2563eb; border: 3px solid #fff; box-shadow: 0 0 0 2px rgba(37, 99, 235, .35), 0 1px 4px rgba(0, 0, 0, .35); }
.em-pin-site { width: 20px; height: 20px; border-radius: 6px; background: #0d9488; color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); }
.em-pin-visit { width: 22px; height: 22px; border-radius: 50% 50% 50% 0; transform: translate(-50%, -100%) rotate(-45deg); background: #7c3aed; border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .35); display: grid; place-items: center; }
.em-pin-visit span { transform: rotate(45deg); color: #fff; font-size: 10px; font-weight: 700; }
.em-pin-visit.em-v-done { background: #16a34a; } .em-pin-visit.em-v-in_progress { background: #d97706; } .em-pin-visit.em-v-cancelled { background: #9ca3af; }
.em-user { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 11px; font-weight: 700; border: 2.5px solid #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .35); background: var(--st, #64748b); }
.em-user.is-sel { box-shadow: 0 0 0 4px rgba(37, 99, 235, .45), 0 2px 6px rgba(0, 0, 0, .35); z-index: 2; }
.em-ev { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: #fff; border: 2px solid #2563eb; color: #1d4ed8; font-size: 8.5px; font-weight: 800; }
.em-ev-clock_in { border-color: #16a34a; color: #067a36; } .em-ev-clock_out { border-color: #dc2626; color: #b91c1c; } .em-ev-break_start, .em-ev-break_end { border-color: #d97706; color: #9a5b00; } .em-ev-visit_in, .em-ev-visit_out { border-color: #7c3aed; color: #5b21b6; }
.st-in { --st: #16a34a; } .st-break { --st: #d97706; } .st-no_signal { --st: #dc2626; } .st-out { --st: #2563eb; } .st-absent { --st: #94a3b8; } .st-leave { --st: #7c3aed; }
.em-pop { position: absolute; z-index: 5; transform: translate(-50%, calc(-100% - 20px)); background: #fff; border-radius: 8px; box-shadow: var(--shadow-lg); padding: .55rem .7rem .6rem; min-width: 190px; max-width: 270px; font-size: .86rem; cursor: default; }
.em-pop::after { content: ""; position: absolute; left: 50%; bottom: -6px; width: 12px; height: 12px; background: #fff; transform: translateX(-50%) rotate(45deg); }
.em-pop-x { position: absolute; top: 2px; right: 4px; border: 0; background: none; font-size: 1.1rem; line-height: 1; color: var(--muted); cursor: pointer; }
.em-pop-body > b:first-child { padding-right: 1rem; }
.em-pop-acts { margin-top: .4rem; display: flex; gap: .3rem; }
.em-zoom { position: absolute; right: 10px; top: 10px; display: flex; flex-direction: column; border-radius: 6px; overflow: hidden; box-shadow: 0 1px 4px rgba(0, 0, 0, .3); z-index: 4; }
.em-zoom button { width: 30px; height: 30px; border: 0; border-bottom: 1px solid var(--line); background: #fff; font-size: 1.1rem; font-weight: 700; cursor: pointer; color: var(--text); }
.em-zoom button:last-child { border-bottom: 0; }
.em-zoom button:hover { background: var(--primary-50); }
.em-note { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: rgba(255, 255, 255, .92); padding: .5rem .9rem; border-radius: 8px; color: var(--text-2); box-shadow: var(--shadow); z-index: 3; }
.map-attrib { font-size: .7rem; color: var(--muted); text-align: right; padding: .15rem .6rem .3rem; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--st, #94a3b8); flex-shrink: 0; }
.dot-in { --st: #16a34a; } .dot-break { --st: #d97706; } .dot-no_signal { --st: #dc2626; } .dot-out { --st: #2563eb; } .dot-absent { --st: #94a3b8; } .dot-leave { --st: #7c3aed; }
.ring { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 2px dashed #0d9488; vertical-align: middle; }
.trv-legend { display: flex; flex-wrap: wrap; gap: .4rem 1rem; align-items: center; font-size: .82rem; color: var(--text-2); margin-left: auto; }
.trv-legend span { display: inline-flex; align-items: center; gap: .35rem; }
.trv-pill { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .75rem; font-weight: 650; color: #fff; background: var(--st, #64748b); white-space: nowrap; }

/* my field day */
.trv-field { max-width: 1200px; }
.trv-hero .card-body { padding: 1.1rem 1.2rem; }
.trv-hero-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.trv-clock { font-size: 2.6rem; font-weight: 750; letter-spacing: .02em; color: var(--navy-800); font-variant-numeric: tabular-nums; line-height: 1.1; }
.trv-state { padding: .35rem .9rem; border-radius: 999px; font-weight: 700; font-size: .85rem; white-space: nowrap; }
.trv-state-out { background: #f1f3f7; color: #5b6576; } .trv-state-in { background: var(--green-50); color: #067a36; } .trv-state-break { background: var(--amber-50); color: #9a5b00; }
.trv-loc { margin-top: .8rem; display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; padding: .55rem .75rem; border-radius: 8px; background: var(--line-2); color: var(--text-2); font-size: .9rem; }
.trv-loc.is-ok { background: var(--blue-50); color: #1d4ed8; } .trv-loc.is-bad { background: var(--red-50); color: #b91c1c; }
.trv-near.is-in { color: #067a36; font-weight: 650; } .trv-near.is-out { color: #9a5b00; font-weight: 600; }
.trv-seg { display: inline-flex; margin-top: .8rem; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: #fff; }
.trv-seg button { border: 0; background: none; padding: .55rem .9rem; display: inline-flex; gap: .4rem; align-items: center; font: inherit; color: var(--text-2); cursor: pointer; }
.trv-seg button + button { border-left: 1px solid var(--line); }
.trv-seg button.active { background: var(--primary); color: #fff; }
.trv-reason { margin-top: .6rem; }
.trv-selfie { margin-top: .8rem; display: flex; flex-direction: column; gap: .5rem; align-items: flex-start; }
.trv-selfie video, .trv-selfie img { width: 100%; max-width: 320px; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; background: #111827; }
.trv-selfie video { transform: scaleX(-1); }
.trv-field [hidden], .trv-monitor [hidden], .trv-board [hidden], .em [hidden] { display: none !important; }
.trv-selfie-bar { display: flex; gap: .4rem; }
.trv-actions { display: flex; gap: .7rem; margin-top: 1rem; flex-wrap: wrap; }
.trv-btn { flex: 1 1 180px; justify-content: center; padding: .95rem 1.2rem; font-size: 1.1rem; font-weight: 700; border-radius: 12px; color: #fff; border: 0; box-shadow: 0 4px 12px rgba(16, 24, 40, .15); }
.trv-btn .ico { width: 22px; height: 22px; }
.trv-btn-in { background: linear-gradient(135deg, #16a34a, #0d9488); } .trv-btn-in:hover { filter: brightness(1.05); }
.trv-btn-out { background: linear-gradient(135deg, #dc2626, #b91c1c); }
.trv-btn-break { background: linear-gradient(135deg, #f59e0b, #d97706); }
.trv-btn:disabled { opacity: .6; cursor: progress; }
.trv-msg { margin-top: .7rem; min-height: 1.2em; font-weight: 600; }
.trv-msg.is-error { color: var(--red); } .trv-msg.is-success { color: #067a36; } .trv-msg.is-warning { color: #9a5b00; }
.trv-stats { margin-top: 1rem; }
.trv-mini-map { height: 320px; }
.trv-visits { display: flex; flex-direction: column; gap: .5rem; }
.trv-visit { display: flex; justify-content: space-between; gap: .6rem; padding: .55rem .7rem; border: 1px solid var(--line); border-left: 4px solid #2563eb; border-radius: 8px; }
.trv-visit-en_route { border-left-color: #d97706; } .trv-visit-in_progress { border-left-color: #16a34a; background: var(--green-50); } .trv-visit-done { border-left-color: #16a34a; opacity: .85; } .trv-visit-cancelled { border-left-color: #9ca3af; opacity: .6; }
.trv-visit-acts { display: flex; gap: .25rem; align-items: flex-start; flex-shrink: 0; }
.trv-selfie-thumb { width: 44px; height: 33px; object-fit: cover; border-radius: 4px; border: 1px solid var(--line); }

/* live map */
.trv-split { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 1rem; align-items: start; }
.trv-big-map { height: calc(100vh - 330px); min-height: 420px; }
.trv-map-card { position: relative; }
.trv-trail { padding: .5rem .8rem; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.trv-list-card .card-head .input { max-width: 150px; }
.trv-list { max-height: calc(100vh - 300px); min-height: 420px; overflow: auto; }
.trv-row { display: flex; width: 100%; gap: .6rem; align-items: center; padding: .55rem .8rem; border: 0; border-bottom: 1px solid var(--line-2); background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.trv-row:hover { background: var(--primary-50); } .trv-row.is-sel { background: var(--blue-50); }
.trv-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.trv-row-main b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trv-row-side { text-align: right; white-space: nowrap; color: var(--text-2); }
.trv-kpis { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }
.trv-kpis .stat { padding: .65rem .8rem; } .trv-kpis .stat .v { font-size: 1.4rem; }

/* live status board (internal / TV / external) */
.trv-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .9rem; margin-bottom: 1rem; }
.trv-card { background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--st, #94a3b8); border-radius: var(--radius); box-shadow: var(--shadow); padding: .8rem .9rem; display: flex; flex-direction: column; gap: .5rem; }
.trv-card-head { display: flex; gap: .6rem; align-items: center; }
.trv-av { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 750; color: #fff; background: var(--st, #94a3b8); flex-shrink: 0; }
.trv-card-name { flex: 1; min-width: 0; } .trv-card-name b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trv-card-place { font-size: .86rem; color: var(--text-2); background: var(--line-2); border-radius: 6px; padding: .3rem .5rem; }
.trv-card-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .4rem; }
.trv-card-grid > div { display: flex; flex-direction: column; }
.trv-card-grid span { font-size: .7rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 600; }
.trv-card-grid b { font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.trv-card-grid em { font-style: normal; font-size: .72rem; color: var(--muted); }
.trv-card-grid em.is-late { color: var(--red); font-weight: 650; } .trv-card-grid em.is-ok { color: #067a36; }
.trv-card-foot { font-size: .78rem; color: var(--muted); border-top: 1px dashed var(--line); padding-top: .35rem; }
.trv-board-map { height: 360px; }
.board-body { background: #0f172a; min-height: 100vh; }
.trv-board.is-tv { padding: 1.2rem 1.5rem; }
.trv-board.is-tv .trv-cards { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.trv-board.is-tv .stat { background: #111c33; border-color: #1f2d4d; } .trv-board.is-tv .stat .k { color: #93a4c3; } .trv-board.is-tv .stat .v { color: #fff; }
.trv-board.is-tv .board-foot { color: #93a4c3; }
.board-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; color: #fff; margin-bottom: 1rem; }
.board-head h1 { color: #fff; margin: 0; font-size: 1.6rem; }
.board-title { display: flex; align-items: center; gap: .8rem; }
.board-co { color: #93a4c3; font-size: .9rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.board-meta { text-align: right; color: #cbd5e1; }
.board-clock { font-size: 2.2rem; font-weight: 750; font-variant-numeric: tabular-nums; color: #fff; line-height: 1; }
.live-dot { width: 14px; height: 14px; border-radius: 50%; background: #22c55e; animation: live-pulse 1.8s infinite; }
@keyframes live-pulse { 0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, .55); } 70% { box-shadow: 0 0 0 12px rgba(34, 197, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); } }
.board-gone { grid-column: 1 / -1; text-align: center; padding: 3rem 1rem; font-size: 1.3rem; color: #fff; background: #1f2d4d; border-radius: var(--radius); }
.board-gone-page { min-height: 100vh; display: grid; place-items: center; color: #e2e8f0; text-align: center; padding: 2rem; }
.board-gone-page h1 { color: #fff; }
.is-copied { background: var(--green) !important; color: #fff !important; border-color: var(--green) !important; }
@media (max-width: 1100px) { .trv-split { grid-template-columns: 1fr; } .trv-big-map { height: 60vh; } .trv-list { max-height: none; min-height: 0; } }
@media (max-width: 860px) {
  .trv-clock { font-size: 2.1rem; } .trv-mini-map { height: 260px; } .trv-btn { padding: .9rem; }
  .trv-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .board-head { flex-direction: column; align-items: flex-start; } .board-meta { text-align: left; }
  .trv-legend { margin-left: 0; }
}
@media print { .erp-map, .map-attrib { display: none; } }

/* ---------- conveyance claims (Phase 1d) ---------- */
.input-sm { padding: .3rem .5rem; font-size: .85rem; min-height: 0; }
.row-warn > td { background: var(--amber-50); }
.row-sel > td { background: var(--blue-50, rgba(37,99,235,.08)); }
.claim-grid td { vertical-align: top; }
.claim-grid input.input-sm { min-width: 6.5rem; }
.claim-grid input.num { width: 5.5rem; min-width: 0; text-align: right; }
.claim-grid select.input-sm { min-width: 11rem; }
.claim-grid .is-off { opacity: .35; }
.input-file { font-size: .75rem; max-width: 12rem; }

/* Phase 4e — planning: line plan board (Gantt), readiness chips */
.text-red { color: #b42318; } .text-green { color: #067a36; } .text-amber { color: #9a5b00; } .nowrap { white-space: nowrap; }
.gantt-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; margin-bottom: 1rem; }
.gantt { --day: 30px; min-width: calc(170px + var(--days) * var(--day)); font-size: .74rem; }
.g-row { display: grid; grid-template-columns: 170px 1fr; border-bottom: 1px solid var(--line-2); }
.g-row:last-child { border-bottom: 0; }
.g-label { padding: .35rem .5rem; position: sticky; left: 0; background: #fff; z-index: 2; border-right: 1px solid var(--line); }
.g-label b { display: block; font-size: .82rem; }
.g-head .g-label { background: #f6f8fb; font-weight: 700; }
.g-days, .g-track { display: grid; grid-template-columns: repeat(var(--days), minmax(var(--day), 1fr)); }
.g-days > div { text-align: center; padding: .2rem 0; border-left: 1px solid var(--line-2); line-height: 1.15; color: var(--muted); background: #f6f8fb; }
.g-days > div.off, .g-track > i.off { background: repeating-linear-gradient(135deg, #f3f4f6 0 4px, #e6e9ef 4px 8px); }
.g-days > div.today { background: #dbeafe; color: #1d4ed8; font-weight: 700; }
.g-track { padding: 3px 0; row-gap: 3px; }
.g-track > i { grid-row: 1 / -1; border-left: 1px solid var(--line-2); }
.g-track > i.today { background: rgba(37, 99, 235, .08); }
.g-bar { z-index: 1; margin: 0 1px; border-radius: 5px; padding: .15rem .4rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: #fff; text-decoration: none; font-weight: 600; line-height: 1.25; background: #3b82f6; border: 1px solid rgba(0, 0, 0, .08); }
.g-bar:hover { filter: brightness(1.08); color: #fff; }
.g-bar small { font-weight: 500; opacity: .92; }
.g-bar.st-running { background: #16a34a; } .g-bar.st-behind { background: #d97706; } .g-bar.st-done { background: #94a3b8; } .g-bar.st-planned { background: #3b82f6; }
.g-bar.late { box-shadow: inset 0 -4px 0 #dc2626; }
.g-bar.overlap { outline: 2px dashed #dc2626; outline-offset: -2px; }
.g-bar.cut-l { border-top-left-radius: 0; border-bottom-left-radius: 0; } .g-bar.cut-r { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.rdy { display: inline-flex; gap: 2px; }
.rdy i { font-style: normal; font-size: .66rem; font-weight: 700; border-radius: 3px; padding: 0 3px; border: 1px solid var(--line); color: #5b6576; background: #f1f3f7; }
.rdy i.ready { background: #e7f6ed; color: #067a36; border-color: #b4e6c7; }
.rdy i.partial, .rdy i.pending { background: #fff3dc; color: #9a5b00; border-color: #f8d79a; }
.rdy i.none { background: #fdeaea; color: #b42318; border-color: #f7c2c2; }
.cap-bars { display: flex; gap: 1.2rem; align-items: flex-end; height: 170px; padding: .5rem 0; }
.cap-bars .m { flex: 1; display: flex; flex-direction: column; align-items: center; gap: .3rem; height: 100%; justify-content: flex-end; font-size: .78rem; }
.cap-bars .pair { display: flex; gap: 4px; align-items: flex-end; height: 100%; width: 100%; justify-content: center; }
.cap-bars .pair span { width: 34%; border-radius: 4px 4px 0 0; min-height: 2px; }
.cap-bars .cap { background: #93c5fd; } .cap-bars .need { background: #16a34a; } .cap-bars .need.over { background: #dc2626; }
@media print { .g-bar, .g-days > div, .g-track > i, .rdy i, .cap-bars span { -webkit-print-color-adjust: exact; print-color-adjust: exact; } .gantt-wrap { overflow: visible; } }

/* ---------------- quality (P5a): traffic light, stepper ---------------- */
.tl { display: inline-block; width: 1.25rem; height: 1.25rem; border-radius: 50%; vertical-align: middle; border: 2px solid rgba(0,0,0,.08); }
.tl-green { background: #16a34a; } .tl-yellow { background: #facc15; } .tl-red { background: #dc2626; } .tl-none { background: #e5e7eb; }
.tl-cell { text-align: center; }
.tl-cell .n { font-size: .72rem; color: var(--muted, #64748b); display: block; }
.tl-board td, .tl-board th { text-align: center; }
.tl-board td:first-child, .tl-board th:first-child { text-align: left; }
.muted-row > td { opacity: .85; }
[data-stepper] .btn { min-width: 2.2rem; justify-content: center; }
.bar-h { height: .55rem; border-radius: 3px; background: var(--teal, #0d9488); min-width: 2px; }
.bar-h.red { background: var(--red, #dc2626); }

/* Phase 5d — gate pass and visitor badge barcodes */
.gp-barcode .barcode { width: 62mm; height: 12mm; display: block; }
.visitor-badge .barcode { width: 100%; height: 9mm; display: block; }

/* Phase 5e — phones: two KPI tiles per row on every dashboard (MD dashboard / approvals on the go) */
@media (max-width: 600px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
  .stats .stat { padding: .6rem .7rem; }
  .stats .stat .v { font-size: 1.25rem; }
  .stats .stat .s { font-size: .72rem; }
}

/* Phase 5g — comparative statement: the lowest price of a line */
.cs-matrix td.cs-l1 { background: #e7f6ec; }
.cs-matrix td.cs-l1 > :first-child, .cs-matrix td.cs-l1 { font-weight: 600; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .cs-matrix td.cs-l1 { background: rgba(34, 197, 94, .16); } }
:root[data-theme="dark"] .cs-matrix td.cs-l1 { background: rgba(34, 197, 94, .16); }

/* Phase 5i: negative / positive money in cost sheets */
.cost-neg { color: var(--red); } .cost-pos { color: var(--green); }

/* Phase 5j: employee self-service (portal) */
.ess-hero { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.ess-name { font-size: 1.35rem; font-weight: 750; color: var(--navy-800); }
.ess-today { background: var(--line-2); border-radius: var(--radius-sm); padding: .6rem .9rem; min-width: 220px; }
.ess-today .k { font-size: .78rem; color: var(--muted); font-weight: 600; text-transform: uppercase; }
a.stat { color: inherit; text-decoration: none; } a.stat:hover { border-color: var(--primary); }
.ess-list { display: flex; flex-direction: column; }
.ess-row { display: flex; justify-content: space-between; align-items: center; gap: .8rem; padding: .65rem 1rem; border-bottom: 1px solid var(--line-2); color: inherit; text-decoration: none; }
.ess-row:hover { background: var(--primary-50); } .ess-row:last-child { border-bottom: 0; }
.ess-notice.is-new { background: var(--blue-50); }
.ess-notice-body { white-space: normal; line-height: 1.6; font-size: 1rem; margin: .6rem 0; }
.ess-code { font-family: Consolas, "Courier New", monospace; font-size: 1.5rem; font-weight: 800; letter-spacing: .12em; background: #fff; border: 2px dashed var(--navy-700); border-radius: 8px; padding: .4rem .8rem; display: inline-block; margin: .4rem 0; color: var(--navy-800); }
.ess-legend { display: inline-flex; align-items: center; gap: .25rem; margin-right: .8rem; }
.ess-stats .stat .v { font-size: 1.4rem; }

/* Phase 5j: kiosk (touch screen at the gate) */
.kiosk-body { background: #0f1d38; color: #0f172a; min-height: 100vh; margin: 0; font-size: 18px; user-select: none; -webkit-user-select: none; }
.kiosk-body input, .kiosk-body textarea { user-select: text; -webkit-user-select: text; }
.kiosk-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem 1.2rem; background: var(--navy-900); color: #fff; }
.kiosk-brand { display: flex; align-items: center; gap: .7rem; } .kiosk-brand small { display: block; color: #9fb2d6; font-size: .8rem; }
.kiosk-clock { font-size: 1.3rem; font-weight: 700; font-variant-numeric: tabular-nums; color: #dbe6ff; }
.kiosk-top-r { display: flex; align-items: center; gap: .8rem; }
.kiosk-top-r form { margin: 0; }
.kiosk-lang, .kiosk-done { border: 1px solid #3c5488; background: #1b2e52; color: #fff; border-radius: 10px; padding: .55rem 1rem; font-size: 1rem; cursor: pointer; display: inline-flex; gap: .4rem; align-items: center; }
.kiosk-done { background: #b42318; border-color: #b42318; font-weight: 700; }
.kiosk-who { text-align: right; line-height: 1.2; } .kiosk-who small { display: block; color: #9fb2d6; }
.kiosk-main { padding: 1.2rem; max-width: 1280px; margin: 0 auto; }
.kiosk-alert { font-size: 1.1rem; }
.kiosk-center { display: flex; justify-content: center; align-items: flex-start; min-height: 70vh; }
.kiosk-center .kiosk-panel { max-width: 560px; width: 100%; }
.kiosk-center-text { text-align: center; }
.kiosk-panel { background: #fff; border-radius: 16px; padding: 1.3rem 1.5rem; box-shadow: var(--shadow-lg); margin-bottom: 1rem; }
.kiosk-panel h1 { font-size: 1.6rem; margin: 0 0 .8rem; display: flex; align-items: center; gap: .5rem; } .kiosk-panel h2 { margin: 0 0 .8rem; font-size: 1.35rem; }
.kiosk-start { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 1.2rem; align-items: start; }
.kiosk-side { display: flex; flex-direction: column; gap: 1rem; }
.kiosk-help { display: flex; gap: .6rem; color: #c9d6f2; font-size: 1rem; padding: .4rem .2rem; }
.kiosk-label { display: block; font-weight: 650; margin: .7rem 0 .3rem; color: var(--navy-700); }
.kiosk-input { width: 100%; box-sizing: border-box; font-size: 1.5rem; padding: .6rem .8rem; border: 2px solid #c7d2e5; border-radius: 12px; background: #f8fafd; color: var(--text); }
.kiosk-input:focus { outline: none; border-color: var(--primary); background: #fff; box-shadow: 0 0 0 4px rgba(37, 99, 235, .15); }
textarea.kiosk-input { font-size: 1.15rem; }
.kiosk-pin { letter-spacing: .5em; text-align: center; font-size: 2rem; }
.pinpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; margin: 1rem 0; }
.pinpad button { font-size: 1.9rem; font-weight: 700; padding: .7rem 0; border-radius: 14px; border: 1px solid #c7d2e5; background: #eef3fb; color: var(--navy-800); cursor: pointer; touch-action: manipulation; }
.pinpad button:active { background: var(--primary); color: #fff; }
.pinpad .pk-muted { font-size: 1.1rem; background: #f5f6f8; color: var(--text-2); }
.kiosk-btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; font-size: 1.15rem; font-weight: 650; padding: .75rem 1.3rem; border-radius: 12px; border: 1px solid #c7d2e5; background: #fff; color: var(--navy-800); text-decoration: none; cursor: pointer; touch-action: manipulation; }
.kiosk-go { width: 100%; background: var(--green); border-color: var(--green); color: #fff; font-size: 1.35rem; padding: .9rem 1rem; margin-top: .8rem; }
.kiosk-back { background: #1b2e52; border-color: #3c5488; color: #fff; }
.kiosk-small { font-size: 1rem; padding: .5rem .9rem; }
.kiosk-bar { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.kiosk-bar h1 { color: #fff; margin: 0; font-size: 1.6rem; text-align: center; }
.kiosk-seg { display: inline-flex; background: #1b2e52; border-radius: 12px; padding: .25rem; gap: .25rem; }
.kiosk-seg a { color: #c9d6f2; padding: .55rem .9rem; border-radius: 10px; text-decoration: none; font-weight: 600; }
.kiosk-seg a.on { background: #fff; color: var(--navy-800); }
.kiosk-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; }
.kiosk-tile { display: flex; flex-direction: column; gap: .3rem; background: #fff; border-radius: 18px; padding: 1.3rem 1.2rem; text-decoration: none; color: var(--navy-800); box-shadow: var(--shadow-lg); border-top: 6px solid var(--navy-600); min-height: 130px; touch-action: manipulation; }
.kiosk-tile .ico { width: 34px; height: 34px; color: var(--navy-600); }
.kiosk-tile b { font-size: 1.35rem; } .kiosk-tile small { color: var(--text-2); font-size: .95rem; }
.kiosk-tile:active { transform: scale(.98); }
.kiosk-tile.tile-green { border-top-color: var(--green); } .kiosk-tile.tile-green .ico { color: var(--green); }
.kiosk-tile.tile-blue { border-top-color: var(--primary); } .kiosk-tile.tile-blue .ico { color: var(--primary); }
.kiosk-tile.tile-purple { border-top-color: var(--purple); } .kiosk-tile.tile-purple .ico { color: var(--purple); }
.kiosk-tile.tile-amber { border-top-color: var(--amber); } .kiosk-tile.tile-amber .ico { color: var(--amber); }
.kiosk-tile.tile-red { border-top-color: var(--red); } .kiosk-tile.tile-red .ico { color: var(--red); }
.kiosk-hello { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; color: #fff; margin-bottom: 1rem; }
.kiosk-hello h1 { margin: 0; font-size: 1.8rem; color: #fff; } .kiosk-hello .muted { color: #9fb2d6; }
.kiosk-today { background: #1b2e52; border-radius: 14px; padding: .7rem 1.1rem; display: flex; flex-direction: column; gap: .15rem; min-width: 240px; }
.kiosk-today small { color: #9fb2d6; text-transform: uppercase; font-size: .78rem; font-weight: 700; } .kiosk-today span { color: #c9d6f2; }
.kiosk-ack { display: flex; align-items: center; gap: .8rem; background: #fff7e6; border: 2px solid var(--amber); border-radius: 14px; padding: .8rem 1rem; margin-bottom: .8rem; color: #8a5100; text-decoration: none; }
.kiosk-ack span { display: flex; flex-direction: column; } .kiosk-ack .ico { width: 28px; height: 28px; }
.kiosk-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; align-items: start; }
.kiosk-list { display: flex; flex-direction: column; gap: .6rem; }
.kiosk-item { display: flex; justify-content: space-between; align-items: center; gap: 1rem; background: #fff; border-radius: 14px; padding: .9rem 1.1rem; border: 1px solid var(--line); }
.kiosk-panel .kiosk-item { border-radius: 10px; padding: .7rem .2rem; border: 0; border-bottom: 1px solid var(--line-2); }
.kiosk-link { color: inherit; text-decoration: none; box-shadow: var(--shadow); } .kiosk-link.is-new { border-left: 6px solid var(--primary); }
.kiosk-amount { text-align: right; font-size: 1.5rem; font-weight: 800; color: var(--navy-800); } .kiosk-amount small { display: block; font-size: .8rem; color: var(--muted); font-weight: 600; }
.kiosk-choices { display: flex; flex-wrap: wrap; gap: .5rem; }
.kiosk-choice input { position: absolute; opacity: 0; pointer-events: none; }
.kiosk-choice span { display: inline-flex; flex-direction: column; padding: .6rem 1rem; border: 2px solid #c7d2e5; border-radius: 12px; font-weight: 700; cursor: pointer; background: #f8fafd; }
.kiosk-choice span small { font-weight: 500; color: var(--text-2); font-size: .85rem; }
.kiosk-choice input:checked + span { border-color: var(--primary); background: var(--primary-50); color: var(--primary-600); }
.kiosk-dates { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.kiosk-scroll .card { border-radius: 14px; overflow: hidden; }
.kiosk-scroll .table { font-size: 1.05rem; } .kiosk-scroll .table td, .kiosk-scroll .table th { padding: .55rem .7rem; }
.kiosk-body .stats .stat { border-radius: 14px; }
.kiosk-notice .ess-notice-body { font-size: 1.2rem; }
.kiosk-acked { display: inline-flex; gap: .4rem; font-size: 1rem; padding: .5rem .8rem; }
.kiosk-code { font-size: 2.1rem; line-height: 1.4; }
.kiosk-kv { grid-template-columns: 150px 1fr; font-size: 1.1rem; }
.kiosk-payslip { background: #fff; border-radius: 14px; padding: 1rem; max-width: 760px; margin: 0 auto; font-size: 1.05rem; }
.kiosk-payslip .payslip { font-size: 12pt; border: 0; }
.kiosk-payslip .payslip .ps-meta { font-size: 11pt; }
@media (max-width: 860px) { .kiosk-start, .kiosk-two { grid-template-columns: 1fr; } .kiosk-bar { grid-template-columns: auto 1fr; } .kiosk-bar > :last-child { grid-column: 1 / -1; } .kiosk-clock { display: none; } }
@media print { .kiosk-body { background: #fff; } .kiosk-top, .kiosk-bar { display: none; } .kiosk-payslip { box-shadow: none; padding: 0; } }
:root[data-theme="dark"] .ess-today { background: rgba(255, 255, 255, .06); }
:root[data-theme="dark"] .ess-notice.is-new { background: rgba(37, 99, 235, .14); }
:root[data-theme="dark"] .ess-code { background: transparent; color: inherit; border-color: currentColor; }
.pin-slips { display: grid; grid-template-columns: 1fr 1fr; gap: 4mm; }
.pin-slip { border: 1px dashed #555; padding: 3mm 4mm; page-break-inside: avoid; display: flex; flex-direction: column; gap: 1mm; font-size: 10pt; }
.pin-value { font-family: Consolas, "Courier New", monospace; font-size: 22pt; font-weight: 800; letter-spacing: .25em; text-align: center; border: 1px solid #333; border-radius: 2mm; margin: 1.5mm 0; padding: 1mm; }
