/* ══════════════════════════════════════════
   RISE CONTRACTING PORTAL v5
   style.css
══════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@500;600;700&family=Inter:wght@400;500;600&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; font-family: 'Inter', sans-serif; font-size: 14px; background: #0d1117; color: #e8edf2; -webkit-font-smoothing: antialiased; overflow-x: hidden; }

:root {
  --bg: #0d1117; --bg-card: #161d2b; --bg-raised: #1a2340;
  --border: #1e2d4a; --border-mid: #2a3a5a;
  --blue: #2B3990; --blue-light: #7b8fe8;
  --text: #e8edf2; --text-mid: #a0aec0; --text-dim: #6b7594; --text-faint: #4a5270;
  --red: #f87171; --orange: #f97316; --green: #22c55e;
  --header-h: 58px;
}

/* ══════════════════════════════════════════
   LOGIN SCREEN
   Fixed overlay — sits on top of everything.
   When hidden it is completely gone and the
   home screen is fully visible in its place.
══════════════════════════════════════════ */
#screen-login {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: #0d1117;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}
#screen-login.active { display: flex; }

.login-wrap { width: 100%; max-width: 360px; }

.login-logo { text-align: center; margin-bottom: 24px; }
.login-logo-text { font-family: 'Rajdhani', sans-serif; font-size: 42px; font-weight: 700; color: #fff; letter-spacing: 8px; line-height: 1; }
.login-logo-sub { font-family: 'Rajdhani', sans-serif; font-size: 13px; font-weight: 600; color: var(--blue-light); letter-spacing: 6px; margin-top: 2px; }

.login-title { font-family: 'Rajdhani', sans-serif; font-size: 22px; font-weight: 700; color: #fff; text-align: center; margin-bottom: 4px; }
.login-sub { font-size: 13px; color: var(--text-dim); text-align: center; margin-bottom: 24px; }

/* Recent accounts */
.recent-accounts { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.recent-account-btn {
  background: var(--bg-card); border: 1.5px solid var(--border); border-radius: 10px;
  padding: 12px 14px; display: flex; align-items: center; gap: 12px; cursor: pointer;
  transition: all .15s; width: 100%;
}
.recent-account-btn:hover { border-color: var(--blue-light); background: var(--bg-raised); }
.ra-avatar { width: 36px; height: 36px; background: var(--blue); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: 'Rajdhani', sans-serif; font-size: 15px; font-weight: 700; color: #fff; flex-shrink: 0; }
.ra-info { flex: 1; text-align: left; }
.ra-name { font-size: 13px; font-weight: 600; color: var(--text); }
.ra-email { font-size: 11px; color: var(--text-dim); margin-top: 1px; }
.ra-arrow { color: var(--blue-light); font-size: 18px; }

.recent-divider { display: flex; align-items: center; gap: 10px; margin: 4px 0 12px; }
.recent-divider::before, .recent-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.recent-divider span { font-size: 11px; color: var(--text-faint); white-space: nowrap; }

/* Login fields */
.login-field-wrap { margin-bottom: 16px; }
.login-label { display: block; font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase; color: #8a94a8; font-weight: 600; margin-bottom: 6px; }
.login-input { width: 100%; background: var(--bg-card); border: 1.5px solid var(--border); border-radius: 9px; height: 48px; padding: 0 14px; font-size: 15px; color: var(--text); outline: none; font-family: 'Inter', sans-serif; transition: border-color .15s; -webkit-appearance: none; }
.login-input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(43,57,144,0.2); }
.login-input::placeholder { color: #3a4560; }

/* PIN dots */
.login-pin-display { display: flex; justify-content: center; gap: 16px; margin: 16px 0; }
.pin-dot { width: 18px; height: 18px; border-radius: 50%; background: #1e2d4a; border: 2px solid #2a3a5a; transition: background .15s; }
.pin-dot.filled { background: var(--blue); border-color: var(--blue-light); }

/* PIN keypad */
.login-keypad { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-top: 8px; }
.login-keypad button { background: var(--bg-card); border: 1.5px solid var(--border); border-radius: 10px; color: var(--text); font-size: 20px; font-weight: 600; padding: 16px; cursor: pointer; font-family: 'Inter', sans-serif; transition: background .15s; }
.login-keypad button:hover { background: var(--blue); border-color: var(--blue); }
.login-keypad button:active { background: var(--blue); transform: scale(0.96); }

.login-error { min-height: 20px; font-size: 12px; color: var(--red); text-align: center; margin-bottom: 8px; font-weight: 600; }
.login-btn { width: 100%; background: var(--blue); color: #fff; border: none; border-radius: 9px; padding: 15px; font-family: 'Rajdhani', sans-serif; font-size: 15px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; cursor: pointer; transition: background .15s; margin-bottom: 10px; }
.login-btn:hover { background: #364ab5; }
.login-change-btn { width: 100%; background: transparent; border: none; color: var(--text-dim); font-size: 13px; cursor: pointer; padding: 8px; transition: color .15s; }
.login-change-btn:hover { color: var(--text); }

/* ══════════════════════════════════════════
   HEADER
══════════════════════════════════════════ */
.hdr { background: #111827; border-bottom: 3px solid var(--blue); padding: 10px 14px; display: flex; align-items: center; gap: 10px; position: fixed; top: 0; left: 0; right: 0; z-index: 100; height: var(--header-h); box-shadow: 0 2px 12px rgba(0,0,0,0.4); }
.hdr-text { flex: 1; }
.hdr-co { font-family: 'Rajdhani', sans-serif; font-size: 16px; font-weight: 700; color: #fff; letter-spacing: 2px; text-transform: uppercase; line-height: 1.1; }
.hdr-user { font-size: 11px; color: var(--blue-light); margin-top: 1px; font-weight: 500; }
.hdr-logout-btn { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.15); border-radius: 7px; width: 34px; height: 34px; color: #a0aec0; cursor: pointer; font-size: 16px; display: flex; align-items: center; justify-content: center; transition: all .15s; }
.hdr-logout-btn:hover { background: rgba(248,113,113,0.15); border-color: var(--red); color: var(--red); }

/* ══════════════════════════════════════════
   SCREENS
══════════════════════════════════════════ */
.screen { display: none; padding-top: var(--header-h); min-height: 100vh; }
.screen.active { display: block; }
.screen-inner { padding: 16px; max-width: 480px; margin: 0 auto; }

.mod-banner { background: #111827; border-bottom: 2px solid var(--blue); padding: 10px 14px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: var(--header-h); z-index: 50; }
.banner-title { font-family: 'Rajdhani', sans-serif; font-size: 16px; font-weight: 700; color: #fff; flex: 1; text-align: center; }
.btn-back-icon { background: var(--bg-raised); border: 1.5px solid var(--blue); color: #fff; border-radius: 8px; width: 36px; height: 36px; font-size: 16px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background .15s; flex-shrink: 0; }
.btn-back-icon:hover { background: var(--blue); }

/* ══════════════════════════════════════════
   HOME — MODULE TILES
══════════════════════════════════════════ */
.home-greeting { font-family: 'Rajdhani', sans-serif; font-size: 22px; font-weight: 700; color: #fff; margin-bottom: 2px; letter-spacing: 0.5px; }
.home-sub { font-size: 12px; color: var(--text-dim); margin-bottom: 20px; }

.module-tiles { display: flex; flex-direction: column; gap: 10px; }

.module-tile {
  background: var(--bg-card); border: 1.5px solid var(--border); border-radius: 14px;
  padding: 18px 16px; cursor: pointer; display: flex; align-items: center; gap: 14px;
  transition: all .2s;
}
.module-tile:hover { border-color: var(--blue-light); background: var(--bg-raised); box-shadow: 0 4px 16px rgba(43,57,144,0.2); }
.module-tile.admin-tile { border-color: var(--border-mid); }
.module-tile.admin-tile:hover { border-color: #f97316; box-shadow: 0 4px 16px rgba(249,115,22,0.15); }

.tile-icon { width: 52px; height: 52px; background: var(--bg-raised); border: 1.5px solid var(--blue); border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 26px; flex-shrink: 0; }
.admin-tile .tile-icon { border-color: var(--orange); }
.tile-info { flex: 1; }
.tile-name { font-family: 'Rajdhani', sans-serif; font-size: 17px; font-weight: 700; color: #fff; letter-spacing: 0.5px; }
.tile-sub { font-size: 11px; color: var(--text-dim); margin-top: 2px; }
.tile-arrow { color: var(--blue); font-size: 22px; }

/* ══════════════════════════════════════════
   PROJECTS
══════════════════════════════════════════ */
.section-label { font-size: 10px; letter-spacing: 2px; text-transform: uppercase; color: var(--text-dim); font-weight: 600; margin-bottom: 10px; }

.project-card { background: var(--bg-card); border: 1.5px solid var(--border); border-radius: 10px; padding: 14px 16px; margin-bottom: 8px; cursor: pointer; display: flex; align-items: center; justify-content: space-between; transition: all .15s; }
.project-card:hover { border-color: var(--blue-light); background: var(--bg-raised); }
.project-name { font-family: 'Rajdhani', sans-serif; font-size: 15px; font-weight: 700; color: #fff; }
.project-meta { font-size: 11px; color: var(--text-dim); margin-top: 2px; }
.project-arrow { color: var(--blue); font-size: 18px; }

.project-module-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.project-mod-card { background: var(--bg-card); border: 1.5px solid var(--border); border-radius: 12px; padding: 18px 12px; cursor: pointer; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; transition: all .15s; min-height: 110px; justify-content: center; }
.project-mod-card:hover { border-color: var(--blue-light); background: var(--bg-raised); box-shadow: 0 4px 14px rgba(43,57,144,0.2); }
.pm-icon { font-size: 28px; }
.pm-name { font-family: 'Rajdhani', sans-serif; font-size: 13px; font-weight: 700; color: #fff; line-height: 1.3; }
.pm-soon { font-size: 9px; color: var(--text-faint); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }

/* Odd card centering */
.project-module-grid .project-mod-card:last-child:nth-child(odd) { grid-column: 1 / -1; max-width: calc(50% - 5px); margin: 0 auto; }

/* ══════════════════════════════════════════
   MODULE GRIDS (Workshop, Employee, Site Manager)
══════════════════════════════════════════ */
.module-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.module-card { background: var(--bg-card); border: 1.5px solid var(--border); border-radius: 12px; padding: 16px 12px; cursor: pointer; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; transition: all .15s; min-height: 120px; justify-content: center; width: 100%; }
.module-card:hover { border-color: var(--blue-light); background: var(--bg-raised); box-shadow: 0 4px 14px rgba(43,57,144,0.2); }
.mod-icon { font-size: 30px; }
.mod-name { font-family: 'Rajdhani', sans-serif; font-size: 13px; font-weight: 700; color: #fff; line-height: 1.3; }
.mod-soon { font-size: 9px; color: var(--text-faint); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.module-grid .module-card:last-child:nth-child(odd) { grid-column: 1 / -1; max-width: calc(50% - 5px); margin: 0 auto; }

.empty-state { text-align: center; color: var(--text-faint); padding: 24px; font-size: 13px; background: var(--bg-card); border-radius: 10px; border: 1.5px dashed var(--border); line-height: 1.6; }

/* ══════════════════════════════════════════
   ADMIN MODULE
══════════════════════════════════════════ */
.admin-tabs { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.admin-tab { background: none; border: none; border-bottom: 2px solid transparent; padding: 8px 12px; font-size: 12px; font-weight: 600; color: var(--text-dim); cursor: pointer; transition: all .15s; margin-bottom: -1px; white-space: nowrap; }
.admin-tab:hover { color: var(--text); }
.admin-tab.active { color: var(--blue-light); border-bottom-color: var(--blue-light); }
.admin-tab-content { display: none; padding-bottom: 20px; }
.admin-tab-content.active { display: block; }
.admin-sec-label { font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase; color: #8a94a8; font-weight: 700; margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.admin-hint { font-size: 9px; letter-spacing: 0; text-transform: none; color: var(--text-faint); margin-left: 6px; }

/* User cards */
.user-card { background: var(--bg-card); border: 1.5px solid var(--border); border-radius: 10px; padding: 12px 14px; margin-bottom: 8px; display: flex; align-items: center; gap: 12px; }
.user-avatar { width: 38px; height: 38px; background: var(--blue); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: 'Rajdhani', sans-serif; font-size: 14px; font-weight: 700; color: #fff; flex-shrink: 0; }
.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 13px; font-weight: 600; color: var(--text); }
.user-email { font-size: 11px; color: var(--text-dim); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.user-role-badge { font-size: 9px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; padding: 2px 7px; border-radius: 4px; }
.role-admin { background: rgba(249,115,22,0.15); color: var(--orange); border: 1px solid rgba(249,115,22,0.3); }
.role-user { background: rgba(43,57,144,0.15); color: var(--blue-light); border: 1px solid rgba(43,57,144,0.3); }
/* Icon buttons (edit / delete / permissions on the Users, Projects and
   Document Library lists).
   These declared no colour, so they inherited the browser default black,
   which is invisible on the dark card background. Combined with the icon
   glyphs having been stripped from portal.js, the buttons showed up only
   on hover, when the :hover background painted a visible rectangle behind
   them. Both halves are fixed: glyphs restored in portal.js, colour set
   here. Keep an explicit colour on any new icon button. */
.icon-btn { background: none; border: none; cursor: pointer; padding: 4px 6px; font-size: 16px; line-height: 1; color: var(--text-mid); transition: color .15s, background .15s; border-radius: 6px; }
.icon-btn:hover { color: var(--text); background: var(--bg-raised); }
.icon-btn.del:hover { color: var(--red); background: var(--bg-raised); }
.icon-btn:focus-visible { outline: 2px solid var(--blue-light); outline-offset: 1px; }

/* Module access checkboxes */
.module-access-grid { display: flex; flex-direction: column; gap: 8px; margin-bottom: 6px; }
.mac-row { background: var(--bg-card); border: 1.5px solid var(--border); border-radius: 8px; padding: 10px 12px; display: flex; align-items: center; justify-content: space-between; }
.mac-row.locked { opacity: .6; }
.mac-name { font-size: 13px; font-weight: 600; color: var(--text); }
.mac-lock { font-size: 10px; color: var(--text-faint); margin-top: 1px; }

.toggle-pill { width: 40px; height: 22px; background: var(--border); border-radius: 11px; cursor: pointer; position: relative; transition: background .2s; flex-shrink: 0; }
.toggle-pill.on { background: var(--blue); }
.toggle-pill.locked-on { background: var(--orange); }
.toggle-pill::after { content: ''; position: absolute; width: 17px; height: 17px; background: #fff; border-radius: 50%; top: 2.5px; left: 2.5px; transition: left .2s; box-shadow: 0 1px 3px rgba(0,0,0,0.4); }
.toggle-pill.on::after, .toggle-pill.locked-on::after { left: 20.5px; }

/* Project checkboxes */
.project-access-list { display: flex; flex-direction: column; gap: 6px; }
.pac-row { background: var(--bg-card); border: 1.5px solid var(--border); border-radius: 8px; padding: 9px 12px; display: flex; align-items: center; justify-content: space-between; }
.pac-name { font-size: 13px; color: var(--text); font-weight: 500; }

/* Project list in admin */
.project-admin-card { background: var(--bg-card); border: 1.5px solid var(--border); border-radius: 10px; padding: 12px 14px; margin-bottom: 8px; display: flex; align-items: center; justify-content: space-between; }
.pa-info { flex: 1; }
.pa-name { font-size: 13px; font-weight: 600; color: var(--text); }
.pa-meta { font-size: 11px; color: var(--text-dim); margin-top: 1px; }
.pa-actions { display: flex; gap: 8px; align-items: center; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.status-dot.active { background: var(--green); }
.status-dot.inactive { background: var(--text-faint); }

/* Admin link cards */
.admin-link-card { background: var(--bg-card); border: 1.5px solid var(--border); border-radius: 10px; padding: 14px 16px; margin-bottom: 10px; cursor: pointer; display: flex; align-items: center; gap: 12px; transition: all .15s; }
.admin-link-card:hover { border-color: var(--blue-light); background: var(--bg-raised); }
.alc-icon { font-size: 24px; flex-shrink: 0; }
.alc-info { flex: 1; }
.alc-title { font-size: 13px; font-weight: 600; color: var(--text); }
.alc-sub { font-size: 11px; color: var(--text-dim); margin-top: 2px; }
.alc-arrow { color: var(--blue); font-size: 18px; }

/* ══════════════════════════════════════════
   PANELS / OVERLAYS
══════════════════════════════════════════ */
.overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.75); z-index: 200; align-items: flex-end; justify-content: center; }
.overlay.open { display: flex; }
.panel { background: #111827; border-radius: 16px 16px 0 0; border-top: 2px solid var(--blue); width: 100%; max-width: 480px; margin: 0 auto; max-height: 88vh; overflow-y: auto; padding: 18px 16px 32px; }
.panel-handle { width: 40px; height: 4px; background: var(--border); border-radius: 2px; margin: 0 auto 16px; }
.panel-title { font-family: 'Rajdhani', sans-serif; font-size: 18px; font-weight: 700; letter-spacing: 1px; color: #fff; margin-bottom: 2px; }
.panel-sub { font-size: 12px; color: var(--text-dim); margin-bottom: 16px; }

/* ══════════════════════════════════════════
   SHARED FORM ELEMENTS
══════════════════════════════════════════ */
.fg { display: flex; flex-direction: column; gap: 3px; }
.flabel { font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase; color: #8a94a8; font-weight: 600; }
.req { color: var(--red); margin-left: 2px; }
.field-hint { font-size: 11px; color: var(--text-faint); margin-top: 3px; }
.finput { background: var(--bg-card); border: 1.5px solid var(--border); border-radius: 7px; color: var(--text); font-size: 13px; height: 40px; padding: 0 11px; width: 100%; outline: none; font-family: 'Inter', sans-serif; font-weight: 500; transition: border-color .15s; -webkit-appearance: none; appearance: none; }
.finput:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(43,57,144,0.2); }
.finput::placeholder { color: #3a4560; }
select.finput { cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237b8fe8' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-color: var(--bg-card); padding-right: 28px; }
select.finput option { background: var(--bg-card); color: var(--text); }

.btn-add { width: 100%; background: transparent; border: 1.5px dashed var(--border-mid); color: var(--blue-light); border-radius: 8px; padding: 11px; font-size: 13px; font-weight: 600; cursor: pointer; margin-top: 8px; transition: all .15s; }
.btn-add:hover { border-color: var(--blue-light); background: var(--bg-raised); }
.btn-save { flex: 1; background: var(--blue); color: #fff; border: none; border-radius: 9px; padding: 13px; font-family: 'Rajdhani', sans-serif; font-size: 14px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; cursor: pointer; transition: background .15s; }
.btn-save:hover { background: #364ab5; }
.btn-cancel { flex: 0 0 auto; background: transparent; border: 1.5px solid var(--border); color: var(--text-dim); border-radius: 9px; padding: 13px 18px; font-size: 13px; cursor: pointer; font-weight: 600; transition: all .15s; }
.btn-cancel:hover { border-color: var(--red); color: var(--red); }

/* Coming soon */
.coming-soon-title { font-family: 'Rajdhani', sans-serif; font-size: 22px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: #fff; margin-bottom: 8px; }
.coming-soon-sub { font-size: 13px; color: var(--text-dim); }

/* Activity log badge */
.activity-badge { display: inline-flex; align-items: center; gap: 5px; background: rgba(34,197,94,0.1); border: 1px solid rgba(34,197,94,0.2); border-radius: 20px; padding: 3px 10px; font-size: 10px; color: var(--green); font-weight: 600; }

@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .hdr { padding-top: max(10px, env(safe-area-inset-top)); }
}
@media (max-width: 360px) {
  .project-module-grid, .module-grid { grid-template-columns: 1fr; }
  .project-module-grid .project-mod-card:last-child:nth-child(odd),
  .module-grid .module-card:last-child:nth-child(odd) { grid-column: auto; max-width: 100%; }
}

/* ══════════════════════════════════════════
   T&C HEADER BUTTON
══════════════════════════════════════════ */
.hdr-tc-btn {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 7px;
  padding: 6px 9px;
  font-size: 10px;
  font-weight: 700;
  color: #a0aec0;
  cursor: pointer;
  letter-spacing: 0.5px;
  transition: all .15s;
  white-space: nowrap;
}
.hdr-tc-btn:hover { background: rgba(43,57,144,0.3); border-color: var(--blue-light); color: var(--blue-light); }

/* ══════════════════════════════════════════
   TERMS & CONDITIONS OVERLAY
══════════════════════════════════════════ */
.tc-overlay {
  display: none; position: fixed; inset: 0; z-index: 600;
  background: rgba(0,0,0,0.88);
  align-items: flex-end; justify-content: center;
}
.tc-overlay.open { display: flex; }
.tc-panel {
  background: #111827; border-radius: 16px 16px 0 0;
  border-top: 3px solid var(--blue);
  width: 100%; max-width: 480px; max-height: 92vh;
  display: flex; flex-direction: column;
}
.tc-header {
  padding: 16px 18px 12px; border-bottom: 1px solid var(--border);
  flex-shrink: 0; position: relative;
}
.tc-title {
  font-family: 'Rajdhani', sans-serif; font-size: 18px; font-weight: 700;
  letter-spacing: 1px; color: #fff; margin-bottom: 2px; padding-right: 32px;
}
.tc-sub { font-size: 11px; color: var(--text-dim); }
.tc-close-btn {
  position: absolute; top: 14px; right: 14px;
  background: var(--bg-raised); border: 1.5px solid var(--border);
  color: var(--text-dim); border-radius: 6px; width: 28px; height: 28px;
  font-size: 13px; cursor: pointer; display: flex; align-items: center;
  justify-content: center; transition: all .15s;
}
.tc-close-btn:hover { border-color: var(--red); color: var(--red); }
.tc-body {
  flex: 1; overflow-y: auto; padding: 16px 18px;
  -webkit-overflow-scrolling: touch;
}
.tc-intro {
  font-size: 12px; color: var(--blue-light);
  background: rgba(43,57,144,0.15); border: 1px solid rgba(43,57,144,0.3);
  border-radius: 8px; padding: 10px 12px; line-height: 1.6;
  margin-bottom: 16px; font-weight: 500;
}
.tc-section { margin-bottom: 16px; }
.tc-heading {
  font-family: 'Rajdhani', sans-serif; font-size: 13px; font-weight: 700;
  letter-spacing: 1px; color: #fff; text-transform: uppercase;
  background: var(--bg-raised); border-left: 3px solid var(--blue);
  padding: 6px 10px; margin-bottom: 8px; border-radius: 0 6px 6px 0;
}
.tc-section p {
  font-size: 12px; color: var(--text-mid); line-height: 1.7;
  margin-bottom: 6px; padding-left: 4px;
}
.tc-actions {
  padding: 14px 18px 28px; display: flex; gap: 10px;
  flex-shrink: 0; border-top: 1px solid var(--border); background: #111827;
}
.tc-accept-btn {
  flex: 1; background: var(--blue); color: #fff; border: none;
  border-radius: 9px; padding: 14px;
  font-family: 'Rajdhani', sans-serif; font-size: 15px; font-weight: 700;
  letter-spacing: 1.5px; text-transform: uppercase; cursor: pointer;
  transition: background .15s;
}
.tc-accept-btn:hover { background: #364ab5; }
.tc-decline-btn {
  flex: 0 0 auto; background: transparent; border: 1.5px solid var(--border);
  color: var(--text-dim); border-radius: 9px; padding: 14px 18px;
  font-size: 13px; cursor: pointer; font-weight: 600; transition: all .15s;
}
.tc-decline-btn:hover { border-color: var(--red); color: var(--red); }

/* ACCESS DENIED */
.tc-denied-overlay {
  position: fixed; inset: 0; z-index: 700; background: #0d1117;
  align-items: center; justify-content: center;
  text-align: center; padding: 32px 24px;
}
.tc-denied-overlay[style*="flex"] { display: flex !important; }
.tc-denied-panel { max-width: 320px; }
.tc-denied-title {
  font-family: 'Rajdhani', sans-serif; font-size: 26px; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase; color: var(--red); margin-bottom: 12px;
}
.tc-denied-sub { font-size: 13px; color: var(--text-dim); line-height: 1.6; }
.tc-denied-btn {
  display: block; width: 100%; background: var(--bg-raised);
  border: 1.5px solid var(--border); color: var(--text-mid);
  border-radius: 9px; padding: 13px; font-size: 13px; cursor: pointer;
  font-weight: 600; margin-top: 24px; transition: all .15s;
}
.tc-denied-btn:hover { border-color: var(--blue); color: var(--text); }

@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .tc-actions { padding-bottom: calc(28px + env(safe-area-inset-bottom)); }
}

/* T&C status badges on user cards */
.tc-accepted-badge {
  font-size: 9px; font-weight: 700; padding: 2px 6px; border-radius: 4px;
  background: rgba(34,197,94,0.12); color: var(--green);
  border: 1px solid rgba(34,197,94,0.3); white-space: nowrap;
}
.tc-pending-badge {
  font-size: 9px; font-weight: 700; padding: 2px 6px; border-radius: 4px;
  background: rgba(107,117,148,0.15); color: var(--text-faint);
  border: 1px solid var(--border); white-space: nowrap;
}
.tc-declined-badge {
  font-size: 9px; font-weight: 700; padding: 2px 6px; border-radius: 4px;
  background: rgba(248,113,113,0.12); color: var(--red);
  border: 1px solid rgba(248,113,113,0.3); white-space: nowrap; cursor: default;
}

/* ══════════════════════════════════════════
   PROJECT PANEL — 3-section form
══════════════════════════════════════════ */
.project-panel { max-height: 92vh; }
.proj-panel-hdr { padding: 0 0 12px; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.proj-section-tabs { display: flex; gap: 4px; margin-top: 10px; }
.pst { flex:1; text-align:center; padding:6px 4px; font-size:11px; font-weight:600; color:var(--text-faint); border-bottom:2px solid transparent; transition:all .2s; cursor:pointer; letter-spacing:0.3px; }
.pst:hover { color: var(--text-mid); }
.pst.active { color:var(--blue-light); border-bottom-color:var(--blue-light); }
.pst.done   { color:var(--green);      border-bottom-color:var(--green); }
.proj-section { display:none; }
.proj-section.active { display:block; }
.proj-nav-row { display:flex; justify-content:space-between; align-items:center; margin-top:18px; gap:10px; }
.btn-next { background:var(--blue); color:#fff; border:none; border-radius:9px; padding:12px 20px; font-family:'Rajdhani',sans-serif; font-size:14px; font-weight:700; letter-spacing:1px; cursor:pointer; transition:background .15s; }
.btn-next:hover { background:#364ab5; }

/* File upload zones */
.file-upload-zone { background:var(--bg-card); border:2px dashed var(--border-mid); border-radius:10px; padding:14px; text-align:center; cursor:pointer; transition:all .15s; margin-bottom:6px; }
.file-upload-zone:hover { border-color:var(--blue-light); background:var(--bg-raised); }
.file-upload-zone.has-file { border-color:var(--green); border-style:solid; }
.fuz-icon { font-size:22px; margin-bottom:4px; }
.fuz-text { font-size:13px; font-weight:600; color:var(--text-mid); }
.fuz-hint { font-size:11px; color:var(--text-faint); margin-top:2px; }

/* SDS items in form */
.sds-item { background:var(--bg-raised); border:1.5px solid var(--border); border-radius:8px; padding:8px 10px; margin-bottom:5px; display:flex; align-items:center; gap:8px; }
.sds-item-icon { font-size:16px; flex-shrink:0; }
.sds-item-name { flex:1; font-size:12px; color:var(--text); font-weight:500; }
.sds-item-size { font-size:10px; color:var(--text-faint); }

/* Coating subsections */
.coating-subsec { background:var(--bg-card); border:1.5px solid var(--border); border-radius:10px; padding:10px 12px; margin-bottom:8px; }
.coating-subsec-title { font-family:'Rajdhani',sans-serif; font-size:12px; font-weight:700; letter-spacing:1px; text-transform:uppercase; color:var(--blue-light); margin-bottom:7px; display:flex; align-items:center; justify-content:space-between; }
.btn-add-inline { background:transparent; border:1px solid var(--blue-light); color:var(--blue-light); border-radius:5px; padding:2px 9px; font-size:11px; font-weight:600; cursor:pointer; transition:all .15s; }
.btn-add-inline:hover { background:var(--blue); border-color:var(--blue); color:#fff; }

/* Tag chips */
.tag-list { display:flex; flex-wrap:wrap; gap:5px; margin-bottom:5px; min-height:8px; }
.tag-chip { background:var(--bg-raised); border:1.5px solid var(--border-mid); border-radius:20px; padding:3px 9px 3px 11px; font-size:12px; color:var(--text-mid); display:flex; align-items:center; gap:5px; }
.tag-chip-del { background:none; border:none; color:var(--text-faint); cursor:pointer; font-size:14px; padding:0; line-height:1; transition:color .15s; }
.tag-chip-del:hover { color:var(--red); }

/* Zone items */
.zone-item { background:var(--bg-raised); border:1.5px solid var(--border); border-radius:8px; padding:9px 11px; margin-bottom:5px; }
.zone-item-top { display:flex; align-items:center; justify-content:space-between; }
.zone-item-name { font-size:13px; font-weight:600; color:var(--text); }
.zone-item-sub { margin-top:4px; }
.zone-l2-chip { display:inline-block; background:var(--bg-card); border:1px solid var(--border); border-radius:4px; padding:1px 6px; font-size:10px; color:var(--text-dim); margin:2px 2px 0 0; }

/* Product items */
.product-item { background:var(--bg-raised); border:1.5px solid var(--border); border-radius:8px; padding:8px 11px; margin-bottom:5px; display:flex; align-items:center; justify-content:space-between; }
.product-item-info { flex:1; }
.product-item-name { font-size:13px; font-weight:600; color:var(--text); }
.product-item-type { font-size:10px; color:var(--blue-light); font-weight:700; text-transform:uppercase; letter-spacing:0.5px; margin-top:1px; }

/* Project detail meta bar */
.project-detail-meta { background:var(--bg-card); border:1.5px solid var(--border); border-radius:10px; padding:9px 13px; margin-bottom:12px; }
.pdm-number { font-family:'Rajdhani',sans-serif; font-size:14px; font-weight:700; color:var(--blue-light); margin-bottom:1px; }

/* SDS view list */
.sds-view-item { background:var(--bg-card); border:1.5px solid var(--border); border-radius:10px; padding:13px 15px; margin-bottom:7px; display:flex; align-items:center; gap:11px; cursor:pointer; transition:all .15s; }
.sds-view-item:hover { border-color:var(--blue-light); background:var(--bg-raised); }
.sds-view-icon { font-size:22px; flex-shrink:0; }
.sds-view-info { flex:1; }
.sds-view-name { font-size:13px; font-weight:600; color:var(--text); }
.sds-view-size { font-size:11px; color:var(--text-dim); margin-top:1px; }

/* ══════════════════════════════════════════
   DOCUMENT LIBRARY
══════════════════════════════════════════ */
.dl-intro {
  font-size: 12px; color: var(--text-dim); margin-bottom: 16px;
  background: rgba(43,57,144,0.1); border: 1px solid rgba(43,57,144,0.2);
  border-radius: 8px; padding: 10px 12px; line-height: 1.6;
}

/* Tier cards on home screen */
.dl-tier-list { display: flex; flex-direction: column; gap: 10px; }
.dl-tier-card {
  background: var(--bg-card); border: 1.5px solid var(--border);
  border-radius: 12px; padding: 16px; cursor: pointer;
  display: flex; align-items: center; gap: 14px; transition: all .15s;
}
.dl-tier-card:hover { border-color: var(--blue-light); background: var(--bg-raised); box-shadow: 0 4px 14px rgba(43,57,144,0.2); }
.dl-tier-icon { font-size: 28px; flex-shrink: 0; }
.dl-tier-info { flex: 1; }
.dl-tier-label { font-family: 'Rajdhani', sans-serif; font-size: 16px; font-weight: 700; color: #fff; }
.dl-tier-sub { font-size: 11px; color: var(--text-dim); margin-top: 2px; }
.dl-arrow { color: var(--blue-light); font-size: 20px; }

/* Group blocks within a tier */
.dl-group-block { margin-bottom: 20px; }
.dl-group-header {
  font-family: 'Rajdhani', sans-serif; font-size: 12px; font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase; color: var(--blue-light);
  padding: 6px 0; margin-bottom: 6px;
  border-bottom: 1.5px solid var(--border);
}

/* Document rows */
.dl-doc-row {
  background: var(--bg-card); border: 1.5px solid var(--border);
  border-radius: 9px; padding: 11px 13px; margin-bottom: 6px;
  display: flex; align-items: center; gap: 10px;
  cursor: pointer; transition: all .15s;
}
.dl-doc-row:hover { border-color: var(--blue-light); background: var(--bg-raised); }
.dl-doc-row.has-link { border-left: 3px solid var(--blue); }
.dl-doc-icon { font-size: 18px; flex-shrink: 0; }
.dl-doc-info { flex: 1; min-width: 0; }
.dl-doc-id { font-size: 9px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--blue-light); margin-bottom: 2px; }
.dl-doc-name { font-size: 13px; font-weight: 600; color: var(--text); }
.dl-doc-meta { font-size: 10px; color: var(--text-dim); margin-top: 2px; }
.dl-doc-status { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.dl-doc-arrow { color: var(--blue-light); font-size: 16px; }

/* Link status dots */
.dl-status-dot { font-size: 10px; }
.dl-status-dot.linked   { color: var(--green); }
.dl-status-dot.unlinked { color: var(--text-faint); }

/* SOP + FC grid */
.dl-sop-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.dl-sop-card {
  background: var(--bg-card); border: 1.5px solid var(--border);
  border-radius: 12px; padding: 20px 14px; text-align: center;
  cursor: default; transition: all .15s;
}
.dl-sop-card.linked { border-color: var(--blue); cursor: pointer; }
.dl-sop-card.linked:hover { background: var(--bg-raised); box-shadow: 0 4px 14px rgba(43,57,144,0.2); }
.dl-sop-icon { font-size: 32px; margin-bottom: 8px; }
.dl-sop-label { font-family: 'Rajdhani', sans-serif; font-size: 13px; font-weight: 700; color: #fff; margin-bottom: 8px; }
.dl-sop-status { font-size: 11px; }
.dl-badge-linked   { background: rgba(34,197,94,0.15);  color: var(--green);      border: 1px solid rgba(34,197,94,0.3);  border-radius: 4px; padding: 2px 8px; font-weight: 600; font-size: 11px; }
.dl-badge-unlinked { background: rgba(107,117,148,0.1); color: var(--text-faint); border: 1px solid var(--border);         border-radius: 4px; padding: 2px 8px; font-weight: 600; font-size: 11px; }

/* No link placeholder */
.dl-no-link { text-align: center; padding: 40px 20px; }
.dl-no-link-icon { font-size: 48px; margin-bottom: 12px; opacity: .4; }
.dl-no-link-title { font-family: 'Rajdhani', sans-serif; font-size: 18px; font-weight: 700; color: #fff; margin-bottom: 8px; }
.dl-no-link-sub { font-size: 13px; color: var(--text-dim); line-height: 1.6; margin-bottom: 20px; }

/* Admin set link button shown to admins */
.btn-dl-admin {
  width: 100%; background: transparent; border: 1.5px dashed var(--border-mid);
  color: var(--blue-light); border-radius: 8px; padding: 11px;
  font-size: 13px; font-weight: 600; cursor: pointer; margin-top: 8px;
  transition: all .15s;
}
.btn-dl-admin:hover { border-color: var(--blue-light); background: var(--bg-raised); }

/* Admin doc library list */
.dl-admin-row {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 7px; padding: 8px 10px; margin-bottom: 4px;
}
.dl-admin-row.child { margin-left: 14px; background: var(--bg); }
.dl-doc-id-sm { font-size: 9px; font-weight: 700; color: var(--blue-light); letter-spacing: 0.5px; margin-right: 6px; }
.dl-admin-name { font-size: 12px; color: var(--text); }
.dl-admin-row-right { display: flex; align-items: center; gap: 6px; }
.dl-link-status { min-height: 18px; margin-top: 6px; }

/* ══════════════════════════════════════════
   FEEDBACK BUTTON IN HEADER
══════════════════════════════════════════ */
.hdr-fb-btn {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 7px; padding: 6px 9px;
  font-size: 15px; cursor: pointer;
  transition: all .15s; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.hdr-fb-btn:hover { background: rgba(43,57,144,0.3); border-color: var(--blue-light); }

/* ══════════════════════════════════════════
   APP FEEDBACK OVERLAY
══════════════════════════════════════════ */
.fb-user-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-raised); border: 1.5px solid var(--border);
  border-radius: 10px; padding: 11px 14px; margin-bottom: 14px;
}
.fb-user-avatar {
  width: 36px; height: 36px; background: var(--blue);
  border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-family: 'Rajdhani', sans-serif;
  font-size: 14px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.fb-user-name  { font-size: 13px; font-weight: 600; color: var(--text); }
.fb-user-email { font-size: 11px; color: var(--text-dim); margin-top: 1px; }

.fb-textarea {
  height: auto !important; min-height: 120px !important;
  padding: 10px 12px !important; resize: none; line-height: 1.6;
}
.fb-error {
  min-height: 18px; font-size: 12px; color: var(--red);
  font-weight: 600; margin-top: 4px;
}

/* ══════════════════════════════════════════
   WHAT'S NEW OVERLAY
══════════════════════════════════════════ */
.wn-header { margin-bottom: 14px; }
.wn-badge {
  display: inline-block; background: rgba(43,57,144,0.2);
  border: 1px solid rgba(43,57,144,0.4); border-radius: 20px;
  padding: 3px 10px; font-size: 11px; font-weight: 700;
  color: var(--blue-light); letter-spacing: 0.5px;
  margin-bottom: 8px;
}
.wn-list {
  list-style: none; padding: 0; margin: 0 0 12px;
  background: var(--bg-card); border: 1.5px solid var(--border);
  border-radius: 10px; overflow: hidden;
}
.wn-item {
  padding: 10px 14px; font-size: 13px; color: var(--text-mid);
  line-height: 1.5; border-bottom: 1px solid var(--border);
  display: flex; align-items: flex-start; gap: 8px;
}
.wn-item::before { content: '✓'; color: var(--green); font-weight: 700; flex-shrink: 0; margin-top: 1px; }
.wn-item:last-child { border-bottom: none; }
.wn-version {
  font-size: 11px; color: var(--text-faint);
  text-align: right; letter-spacing: 0.5px;
}

/* ══════════════════════════════════════════
   ZONE DRAWING INDICATORS
══════════════════════════════════════════ */
.zone-drw-ok      { font-size: 12px; color: var(--green); }
.zone-drw-missing { font-size: 12px; color: var(--orange); }

/* ══════════════════════════════════════════
   ADMIN ADD ROW (input + button inline)
══════════════════════════════════════════ */
.admin-add-row {
  display: flex; gap: 6px; margin-top: 6px;
}
.admin-input {
  flex: 1; background: var(--bg-card); border: 1.5px solid var(--border);
  border-radius: 7px; color: var(--text); font-size: 13px; height: 38px;
  padding: 0 10px; outline: none; font-family: 'Inter', sans-serif;
  transition: border-color .15s;
}
.admin-input:focus { border-color: var(--blue); }
.admin-input::placeholder { color: #3a4560; }
.admin-add-btn {
  background: var(--blue); color: #fff; border: none;
  border-radius: 7px; padding: 0 14px; font-size: 13px;
  font-weight: 600; cursor: pointer; height: 38px;
  white-space: nowrap; transition: background .15s;
}
.admin-add-btn:hover { background: #364ab5; }

/* Admin hint box */
.admin-hint-box {
  background: rgba(43,57,144,0.1); border: 1px solid rgba(43,57,144,0.2);
  border-radius: 8px; padding: 9px 12px; font-size: 12px;
  color: var(--text-dim); line-height: 1.6;
}

/* del-btn and edit-btn inline icon buttons */
.del-btn  { background:none; border:none; cursor:pointer; font-size:16px; opacity:.55; transition:opacity .15s; padding:2px 4px; border-radius:4px; }
.del-btn:hover  { opacity:1; color:var(--red); }
.edit-btn { background:none; border:none; cursor:pointer; font-size:15px; opacity:.55; transition:opacity .15s; padding:2px 4px; border-radius:4px; }
.edit-btn:hover { opacity:1; }

/* ══════════════════════════════════════════
   DRAWING MARK UPS VIEW
══════════════════════════════════════════ */
.dm-zone-block { margin-bottom: 16px; }
.dm-zone-header {
  font-family: 'Rajdhani', sans-serif; font-size: 13px; font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase; color: var(--blue-light);
  border-bottom: 1.5px solid var(--border); padding-bottom: 6px; margin-bottom: 6px;
}
.dm-subzone-row {
  background: var(--bg-card); border: 1.5px solid var(--border);
  border-radius: 9px; padding: 12px 14px; margin-bottom: 6px;
  display: flex; align-items: center; gap: 12px; transition: all .15s;
}
.dm-subzone-row.has-drw { cursor: pointer; border-left: 3px solid var(--blue); }
.dm-subzone-row.has-drw:hover { border-color: var(--blue-light); background: var(--bg-raised); }
.dm-row-icon { font-size: 20px; flex-shrink: 0; }
.dm-row-info { flex: 1; }
.dm-row-name { font-size: 13px; font-weight: 600; color: var(--text); }
.dm-row-sub  { font-size: 11px; color: var(--text-dim); margin-top: 2px; }
.dm-row-arrow { color: var(--blue-light); font-size: 18px; }

/* ══════════════════════════════════════════
   ADMIN ITEM (surfaces/products library list)
══════════════════════════════════════════ */
.admin-item {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg-card); border: 1.5px solid var(--border);
  border-radius: 8px; padding: 9px 12px; margin-bottom: 5px;
}
.admin-item-name { font-size: 13px; font-weight: 600; color: var(--text); }
.admin-item-sub  { font-size: 11px; color: var(--text-dim); margin-top: 1px; }

/* ══════════════════════════════════════════
   DOCUMENT VIEWER OVERLAY
══════════════════════════════════════════ */
#doc-viewer-overlay {
  /* Override generic overlay — full screen, no bottom-sheet */
  align-items: stretch !important;
  padding: 0 !important;
}
#doc-viewer-overlay .doc-viewer-sheet {
  display: flex;
  flex-direction: column;
  background: #0d1117;
  width: 100%;
  max-width: 100%;
  height: 100%;
  border-radius: 0;
  border-top: none;
  padding: 0;
  max-height: 100%;
  overflow: hidden;
}

.doc-viewer-hdr {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: #111827;
  border-bottom: 2px solid var(--blue);
  flex-shrink: 0;
  padding-top: max(12px, env(safe-area-inset-top));
}
.doc-viewer-title {
  flex: 1;
  font-family: 'Rajdhani', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.doc-viewer-close {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 7px;
  color: #fff;
  font-size: 16px;
  width: 34px;
  height: 34px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .15s;
}
.doc-viewer-close:hover { background: rgba(248,113,113,0.3); border-color: var(--red); color: var(--red); }

.doc-viewer-body {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: #1a1a2e;
}

.doc-viewer-iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* Loading state */
.doc-viewer-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: #0d1117;
  z-index: 2;
}
.doc-viewer-spinner {
  width: 38px;
  height: 38px;
  border: 3px solid var(--border);
  border-top-color: var(--blue-light);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.doc-viewer-loading-text {
  font-size: 13px;
  color: var(--text-dim);
  letter-spacing: 0.5px;
  text-align: center;
  padding: 0 24px;
  line-height: 1.45;
}

/* Delayed state -- past Busy.DELAY_MS with no iframe onload. Same orange
   "still working" language as .busy-indicator.is-delayed. */
.doc-viewer-loading.is-delayed .doc-viewer-spinner { border-top-color: var(--orange); }
.doc-viewer-loading.is-delayed .doc-viewer-loading-text { color: var(--orange); }

.doc-viewer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  padding-bottom: max(8px, env(safe-area-inset-bottom));
  background: #111827;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.doc-viewer-hint {
  font-size: 11px;
  color: var(--text-faint);
}
.doc-viewer-open-ext {
  background: transparent;
  border: 1px solid var(--border-mid);
  color: var(--text-dim);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.doc-viewer-open-ext:hover {
  border-color: var(--blue-light);
  color: var(--blue-light);
}

/* ══════════════════════════════════════════
   ADMIN OPS — SHARED
══════════════════════════════════════════ */
.ao-date-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-card); border: 1.5px solid var(--border);
  border-radius: 10px; padding: 12px 14px; margin-bottom: 14px;
}
.ao-section-hdr {
  font-family: 'Rajdhani', sans-serif; font-size: 12px; font-weight: 700;
  letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-dim);
  padding: 6px 0 8px; border-bottom: 1px solid var(--border);
  margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center;
}
.ao-card {
  background: var(--bg-card); border: 1.5px solid var(--border);
  border-radius: 12px; padding: 14px;
}
.ao-card-title {
  font-family: 'Rajdhani', sans-serif; font-size: 14px; font-weight: 700;
  color: #fff; margin-bottom: 12px; padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.ao-hint {
  font-size: 11px; color: var(--text-faint); margin-top: 10px; line-height: 1.5;
}
.ao-select-all-btn {
  background: transparent; border: 1px solid var(--blue); color: var(--blue-light);
  border-radius: 6px; padding: 3px 10px; font-size: 11px; font-weight: 700; cursor: pointer;
}

/* ── Team Allocation ── */
.alloc-member-row {
  background: var(--bg-card); border: 1.5px solid var(--border);
  border-radius: 10px; padding: 10px 12px; margin-bottom: 8px;
  transition: border-color .15s;
}
.alloc-check-label {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
}
.alloc-chk { width: 18px; height: 18px; accent-color: var(--blue); flex-shrink: 0; }
.alloc-name { font-size: 14px; font-weight: 600; color: #fff; }
.alloc-location-wrap { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.alloc-loc-btns { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.alloc-loc-btn {
  background: var(--bg-raised); border: 1.5px solid var(--border);
  border-radius: 7px; padding: 6px 10px; font-size: 12px; font-weight: 600;
  color: var(--text-dim); cursor: pointer; transition: all .15s;
}
.alloc-loc-btn:hover { border-color: var(--blue-light); color: var(--text); }
.alloc-loc-btn.active { background: var(--blue); border-color: var(--blue); color: #fff; }
.alloc-other-input { margin-top: 6px; }
.alloc-shift-row { margin-top: 10px; }
.alloc-shift-btns { display: flex; gap: 7px; margin-top: 4px; }
.alloc-shift-btn {
  flex: 1; background: var(--bg-raised); border: 1.5px solid var(--border);
  border-radius: 7px; padding: 7px 10px; font-size: 12px; font-weight: 600;
  color: var(--text-dim); cursor: pointer; transition: all .15s;
}
.alloc-shift-btn.active { border-color: var(--blue-light); color: #fff; background: var(--bg-raised); }
.alloc-split-detail { margin-top: 10px; }
.alloc-split-block {
  background: var(--bg-raised); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px;
}
.alloc-hist-row {
  background: var(--bg-card); border: 1.5px solid var(--border); border-radius: 9px;
  padding: 10px 12px; margin-bottom: 7px; cursor: pointer; display: flex;
  align-items: center; gap: 10px; transition: border-color .15s;
}
.alloc-hist-row:hover { border-color: var(--blue-light); }
.ahr-date { font-family: 'Rajdhani', sans-serif; font-size: 14px; font-weight: 700;
  color: #fff; flex-shrink: 0; min-width: 80px; }
.ahr-names { flex: 1; font-size: 12px; color: var(--text-dim);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ahr-count { font-size: 11px; color: var(--blue-light); font-weight: 700; flex-shrink: 0; }
.alloc-hist-empty, .alloc-empty { font-size: 13px; color: var(--text-faint);
  text-align: center; padding: 16px 0; }

/* ── Financials ── */
.inv-row {
  background: var(--bg-card); border: 1.5px solid var(--border);
  border-radius: 9px; padding: 10px 12px; margin-bottom: 7px;
}
.inv-top { display: flex; justify-content: space-between; margin-bottom: 5px; }
.inv-no  { font-size: 14px; font-weight: 700; color: #fff; }
.inv-date { font-size: 12px; color: var(--text-dim); }
.inv-bottom { display: flex; gap: 10px; flex-wrap: wrap; }
.inv-po, .inv-excl, .inv-incl { font-size: 11px; font-weight: 600; }
.inv-po   { color: var(--text-dim); }
.inv-excl { color: var(--text-mid); }
.inv-incl { color: var(--blue-light); }

/* ── Reminders ── */
.reminder-card {
  border-radius: 10px; padding: 12px 14px; margin-bottom: 8px;
  cursor: pointer; border: 1.5px solid var(--border);
  background: var(--bg-card); transition: all .15s;
}
.reminder-card:hover { border-color: var(--blue-light); }
.reminder-card.overdue  { border-color: rgba(248,113,113,0.5); background: rgba(248,113,113,0.06); }
.reminder-card.due-soon { border-color: rgba(249,115,22,0.5); background: rgba(249,115,22,0.06); }
.reminder-card.ok       { border-color: rgba(34,197,94,0.25); }
.rem-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.rem-name { font-size: 14px; font-weight: 700; color: #fff; }
.rem-cat  { font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  color: var(--text-dim); text-align: right; flex-shrink: 0; }
.rem-status { font-size: 12px; font-weight: 600; margin-top: 5px; color: var(--text-mid); }
.reminder-card.overdue  .rem-status { color: #f87171; }
.reminder-card.due-soon .rem-status { color: #f97316; }
.reminder-card.ok       .rem-status { color: #86efac; }
.rem-notes { font-size: 11px; color: var(--text-faint); margin-top: 4px; }

/* Reminder update overlay */
.overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.75);
  z-index: 200; align-items: flex-end; justify-content: center; }
.overlay.open { display: flex; }
.overlay-sheet {
  background: #111827; border-radius: 16px 16px 0 0; border-top: 2px solid var(--blue);
  width: 100%; max-width: 480px; padding: 18px 16px 32px; max-height: 88vh; overflow-y: auto;
}
.overlay-handle { width: 40px; height: 4px; background: var(--border);
  border-radius: 2px; margin: 0 auto 16px; }
.overlay-title { font-family: 'Rajdhani', sans-serif; font-size: 18px; font-weight: 700;
  color: #fff; margin-bottom: 14px; }

/* ══════════════════════════════════════════
   EMPLOYEE FORMS
══════════════════════════════════════════ */
.ef-section {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  margin: 12px 14px 0;
}
.ef-section-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--blue-light);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}
.ef-checkbox-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.ef-checkbox-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ef-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  font-weight: 500;
}
.ef-check input[type="checkbox"],
.ef-check input[type="radio"] {
  width: 17px;
  height: 17px;
  accent-color: var(--blue);
  flex-shrink: 0;
}
.ef-note {
  margin: 12px 14px 0;
  font-size: 11px;
  color: var(--text-faint);
  background: rgba(43,57,144,0.07);
  border: 1px solid rgba(43,57,144,0.2);
  border-radius: 8px;
  padding: 10px 12px;
  line-height: 1.6;
}

/* Rating buttons */
.ef-rating-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  gap: 10px;
}
.ef-rating-row:last-child { border-bottom: none; }
.ef-rating-row .flabel { flex: 1; margin-bottom: 0; font-size: 12px; }
.ef-rating-btns { display: flex; gap: 5px; flex-shrink: 0; }
.ef-rating-btn {
  width: 34px; height: 34px;
  background: var(--bg-raised);
  border: 1.5px solid var(--border);
  border-radius: 7px;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all .15s;
}
.ef-rating-btn:hover { border-color: var(--blue-light); }
.ef-rating-btn.active { background: var(--blue); border-color: var(--blue); color: #fff; }

/* Success screen */
.ef-success {
  position: absolute;
  inset: var(--header-h) 0 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px 24px;
  background: var(--bg);
}
.ef-success-icon {
  width: 64px; height: 64px;
  background: rgba(43,57,144,0.15);
  border: 2px solid var(--blue);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: var(--blue-light);
  margin-bottom: 18px;
}
.ef-success-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 1px;
  margin-bottom: 10px;
}
.ef-success-sub {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.6;
  max-width: 320px;
  margin-bottom: 24px;
}

/* ══════════════════════════════════════════
   ZONE — MULTIPLE DRAWINGS + UNLIMITED NESTING
══════════════════════════════════════════ */
.zone-drawings-section { margin-bottom:12px; }
.zone-drawings-header {
  display:flex; justify-content:space-between; align-items:center;
  margin-bottom:6px;
}
.zone-add-drw-btn {
  background:var(--blue); border:none; color:#fff;
  border-radius:6px; padding:4px 10px; font-size:12px;
  font-weight:700; cursor:pointer;
}
.zone-drawings-list {
  background:var(--bg-raised); border:1.5px solid var(--border);
  border-radius:8px; overflow:hidden;
}
.zone-no-drw {
  padding:10px 12px; font-size:12px; color:var(--text-faint); text-align:center;
}
.zone-drw-row {
  display:flex; align-items:center; gap:8px; padding:8px 12px;
  border-bottom:1px solid var(--border); font-size:12px;
}
.zone-drw-row:last-child { border-bottom:none; }
.zone-drw-icon { font-size:16px; flex-shrink:0; }
.zone-drw-name { flex:1; color:var(--text); font-weight:500;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.zone-drw-size { color:var(--text-dim); flex-shrink:0; font-size:11px; }
.zone-drw-del  {
  background:none; border:none; color:var(--text-dim); font-size:16px;
  cursor:pointer; padding:0 4px; line-height:1;
}
.zone-drw-del:hover { color:var(--red); }
.zone-drw-badge {
  font-size:11px; font-weight:600; color:var(--blue-light);
  background:rgba(43,57,144,0.12); border-radius:4px; padding:1px 6px;
  margin-left:6px; vertical-align:middle;
}

/* Sub-zone tree */
.zone-sub-section { margin-top:4px; }
.zone-add-sub-btn {
  background:transparent; border:1.5px dashed var(--border); color:var(--text-dim);
  border-radius:7px; padding:6px 12px; font-size:12px; font-weight:600;
  cursor:pointer; width:100%; margin-top:6px; transition:all .15s;
}
.zone-add-sub-btn:hover { border-color:var(--blue-light); color:var(--blue-light); }
.sz-node { margin-top:4px; }
.sz-node-row {
  display:flex; align-items:center; gap:6px; background:var(--bg-raised);
  border:1.5px solid var(--border); border-radius:7px; padding:7px 10px; font-size:12px;
}
.sz-node-name  { flex:1; font-weight:600; color:var(--text); }
.sz-node-drw-count { font-size:11px; color:var(--text-dim); flex-shrink:0; }
.sz-edit-btn, .sz-del-btn {
  background:none; border:none; cursor:pointer; font-size:13px; padding:0 2px;
}
.sz-children { margin-left:14px; margin-top:3px; }
.sz-add-btn {
  background:none; border:1px dashed var(--border); color:var(--text-faint);
  border-radius:6px; padding:4px 10px; font-size:11px; cursor:pointer;
  margin-top:4px; transition:all .15s;
}
.sz-add-btn:hover { border-color:var(--blue-light); color:var(--blue-light); }

/* Zone list item drawing badge */
.zone-item-name { display:flex; align-items:center; flex-wrap:wrap; gap:4px; }

/* ══════════════════════════════════════════
   APPLICATOR CHIPS (from registered users)
══════════════════════════════════════════ */
.applicator-chip-grid {
  display:flex; flex-wrap:wrap; gap:7px; margin-top:4px;
}
.applicator-chip {
  background:var(--bg-raised); border:1.5px solid var(--border);
  border-radius:20px; padding:6px 14px; font-size:13px; font-weight:600;
  color:var(--text-dim); cursor:pointer; transition:all .15s;
}
.applicator-chip:hover { border-color:var(--blue-light); color:var(--text); }
.applicator-chip.active {
  background:var(--blue); border-color:var(--blue); color:#fff;
}
.applicator-hint {
  font-size:11px; color:var(--text-faint); margin-top:5px;
}

/* ══════════════════════════════════════════
   DRAWING MARKUPS — updated for drawings[] model
══════════════════════════════════════════ */
.dm-zone-block    { margin-bottom:10px; }
.dm-zone-header   {
  display:flex; align-items:center; justify-content:space-between;
  font-family:'Rajdhani',sans-serif; font-size:13px; font-weight:700;
  letter-spacing:0.5px; color:var(--text); padding:6px 0 5px;
  border-bottom:1px solid var(--border); margin-bottom:4px;
}
.dm-drw-count {
  font-size:11px; font-weight:600; color:var(--blue-light);
  background:rgba(43,57,144,0.12); border-radius:4px; padding:1px 7px;
}
.dm-drawing-row {
  display:flex; align-items:center; gap:10px;
  background:var(--bg-card); border:1.5px solid var(--border);
  border-radius:8px; padding:10px 12px; margin-bottom:5px;
  transition:border-color .15s;
}
.dm-drawing-row.has-drw { cursor:pointer; }
.dm-drawing-row.has-drw:hover { border-color:var(--blue-light); }
.dm-drawing-row.no-drw  { opacity:0.6; }
.dm-row-icon { font-size:20px; flex-shrink:0; }
.dm-row-info { flex:1; min-width:0; }
.dm-row-name { font-size:13px; font-weight:600; color:var(--text);
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.dm-row-sub  { font-size:11px; color:var(--text-dim); margin-top:1px; }
.dm-row-arrow{ font-size:18px; color:var(--text-dim); flex-shrink:0; }

/* ══════════════════════════════════════════
   HAZARDOUS SUBSTANCES ADMIN TAB
══════════════════════════════════════════ */
.haz-sync-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 12px;
  gap: 10px;
}
.haz-sync-status {
  font-size: 11px;
  color: var(--text-dim);
  flex: 1;
}
.haz-sync-btn {
  background: var(--blue);
  border: none;
  color: #fff;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity .15s;
}
.haz-sync-btn:hover { opacity: 0.85; }

.haz-group { margin-bottom: 14px; }
.haz-group-header {
  font-family: 'Rajdhani', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 4px 0 7px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.haz-count {
  background: rgba(43,57,144,0.15);
  color: var(--blue-light);
  border-radius: 10px;
  font-size: 11px;
  padding: 1px 7px;
  font-weight: 700;
}
.haz-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 9px;
  padding: 10px 12px;
  margin-bottom: 6px;
}
.haz-item-main { flex: 1; min-width: 0; }
.haz-item-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.haz-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.haz-item-meta span {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
}
.haz-item-notes {
  font-size: 11px;
  color: var(--text-faint);
  margin-top: 5px;
  font-style: italic;
}

/* ══════════════════════════════════════════
   SUB-ZONE INLINE EDITOR
══════════════════════════════════════════ */
.zone-sz-editor-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.zone-sz-back-btn {
  background: var(--bg-raised);
  border: 1.5px solid var(--border);
  color: var(--text-dim);
  border-radius: 7px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s;
}
.zone-sz-back-btn:hover { border-color: var(--blue-light); color: var(--text); }
.zone-sz-editor-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

/* ══════════════════════════════════════════
   SITE INSPECTION CHECKLIST
══════════════════════════════════════════ */
.si-checklist { display:flex; flex-direction:column; gap:0; }
.si-chk-row {
  display:flex; align-items:center; justify-content:space-between;
  padding:9px 0; border-bottom:1px solid var(--border); gap:8px;
}
.si-chk-row:last-child { border-bottom:none; }
.si-chk-label {
  font-size:13px; font-weight:500; color:var(--text); flex:1;
}
.si-chk-opts {
  display:flex; gap:12px; flex-shrink:0;
}
.si-chk-opts label {
  display:flex; align-items:center; gap:5px;
  font-size:12px; font-weight:600; color:var(--text-dim); cursor:pointer;
}
.si-chk-opts input[type="radio"] {
  accent-color:var(--blue); width:15px; height:15px;
}


/* ══════════════════════════════════════════
   COATING LOG CSS (merged)
══════════════════════════════════════════ */
/* ══════════════════════════════════════════
   RISE CONTRACTING — COATING APPLICATION LOG v2
   style.css
══════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@500;600;700&family=Inter:wght@400;500;600&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; font-family: 'Inter', sans-serif; font-size: 14px; background: #0d1117; color: #e8edf2; -webkit-font-smoothing: antialiased; overflow-x: hidden; }

:root {
  --bg:         #0d1117;
  --bg-card:    #161d2b;
  --bg-raised:  #1a2340;
  --border:     #1e2d4a;
  --border-mid: #2a3a5a;
  --blue:       #2B3990;
  --blue-light: #7b8fe8;
  --text:       #e8edf2;
  --text-mid:   #a0aec0;
  --text-dim:   #6b7594;
  --text-faint: #4a5270;
  --red:        #f87171;
  --orange:     #f97316;
  --green:      #22c55e;
  --header-h:   58px;
}

/* ── Header ── */
.hdr { background: #111827; border-bottom: 3px solid var(--blue); padding: 10px 14px; display: flex; align-items: center; gap: 10px; position: fixed; top: 0; left: 0; right: 0; z-index: 100; height: var(--header-h); box-shadow: 0 2px 12px rgba(0,0,0,0.4); }
.hdr-text { flex: 1; min-width: 0; }
.hdr-co { font-family: 'Rajdhani', sans-serif; font-size: 15px; font-weight: 700; color: #fff; letter-spacing: 1.5px; text-transform: uppercase; line-height: 1.1; }
.hdr-sub { font-size: 10px; color: var(--text-dim); letter-spacing: 1px; text-transform: uppercase; margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hdr-admin-btn { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.15); border-radius: 7px; padding: 6px 10px; font-size: 11px; color: #a0aec0; cursor: pointer; font-weight: 600; white-space: nowrap; transition: background .15s; flex-shrink: 0; }
.hdr-admin-btn:hover { background: rgba(255,255,255,0.12); }
.btn-back-icon { background: var(--bg-raised); border: 1.5px solid var(--blue); color: #fff; border-radius: 8px; width: 36px; height: 36px; font-size: 16px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background .15s; flex-shrink: 0; }
.btn-back-icon:hover { background: var(--blue); }

/* ── Screens ── */
.screen { display: none; padding-top: var(--header-h); min-height: 100vh; }
.screen.active { display: block; }
.screen-inner { padding: 16px; max-width: 480px; margin: 0 auto; }
.job-banner { background: #111827; border-bottom: 2px solid var(--blue); padding: 10px 14px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: var(--header-h); z-index: 50; }
.banner-job { font-family: 'Rajdhani', sans-serif; font-size: 16px; font-weight: 700; color: #fff; flex: 1; text-align: center; }

/* ── Mode Select ── */
.mode-title { font-family: 'Rajdhani', sans-serif; font-size: 22px; font-weight: 700; color: #fff; margin-bottom: 4px; }
.mode-sub { font-size: 13px; color: var(--text-dim); margin-bottom: 20px; line-height: 1.5; }
.mode-grid { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.mode-card { background: var(--bg-card); border: 1.5px solid var(--border); border-radius: 14px; padding: 20px 16px; cursor: pointer; transition: all .2s; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.mode-card:hover { border-color: var(--blue-light); background: var(--bg-raised); box-shadow: 0 4px 20px rgba(43,57,144,0.2); }
.mode-icon { font-size: 32px; margin-bottom: 4px; }
.mode-name { font-family: 'Rajdhani', sans-serif; font-size: 16px; font-weight: 700; color: #fff; }
.mode-desc { font-size: 12px; color: var(--text-dim); line-height: 1.5; }
.mode-hint { font-size: 11px; color: var(--text-faint); background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; line-height: 1.5; }

/* ── Zone Confirm ── */
.zc-heading { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.zc-icon { font-size: 28px; flex-shrink: 0; margin-top: 2px; }
.zc-title { font-family: 'Rajdhani', sans-serif; font-size: 18px; font-weight: 700; color: #fff; }
.zc-sub { font-size: 12px; color: var(--text-dim); margin-top: 3px; line-height: 1.5; }
.zc-drawing-wrap { background: var(--bg-card); border: 1.5px solid var(--border); border-radius: 10px; padding: 12px; margin-bottom: 14px; min-height: 80px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.zc-drawing-placeholder { font-size: 13px; color: var(--text-faint); padding: 16px; text-align: center; }
.zc-drawing-name { font-size: 11px; color: var(--text-dim); margin-top: 8px; }
.zc-confirm-hint { font-size: 12px; color: var(--blue-light); background: rgba(43,57,144,0.1); border: 1px solid rgba(43,57,144,0.2); border-radius: 8px; padding: 9px 12px; line-height: 1.5; margin-bottom: 14px; }
.btn-confirm-zone { flex: 1; background: var(--blue); color: #fff; border: none; border-radius: 8px; padding: 13px; font-family: 'Rajdhani', sans-serif; font-size: 14px; font-weight: 700; cursor: pointer; transition: background .15s; }
.btn-confirm-zone:hover { background: #364ab5; }
.btn-cancel-zone { background: var(--bg-raised); border: 1.5px solid var(--border); color: var(--text-mid); border-radius: 8px; padding: 13px 16px; cursor: pointer; font-size: 13px; transition: all .15s; }
.btn-cancel-zone:hover { border-color: var(--blue); }

/* Zone confirmed badge */
.zone-confirmed-badge { display: flex; align-items: center; gap: 8px; background: rgba(34,197,94,0.1); border: 1.5px solid rgba(34,197,94,0.3); border-radius: 8px; padding: 8px 12px; margin-bottom: 8px; }
.zcb-icon { font-size: 16px; }
.zcb-text { flex: 1; font-size: 12px; color: var(--green); font-weight: 600; }
.zcb-view { background: none; border: 1px solid var(--green); color: var(--green); border-radius: 5px; padding: 3px 9px; font-size: 11px; cursor: pointer; }

/* ── Form body ── */
.form-body { padding-bottom: 90px; max-width: 480px; margin: 0 auto; }
.fsec { padding: 14px 14px 0; }
.fsec-hdr { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1.5px solid var(--border); }
.fsec-icon { width: 28px; height: 28px; background: var(--bg-raised); border: 1.5px solid var(--blue); border-radius: 7px; display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; }
.fsec-title { font-family: 'Rajdhani', sans-serif; font-size: 12px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: #c5cfe8; flex: 1; }
.fsec-req { font-size: 9px; color: var(--red); font-weight: 600; letter-spacing: 1px; text-transform: uppercase; }
.frow { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-bottom: 9px; }
.frow.full { grid-template-columns: 1fr; }
.fg { display: flex; flex-direction: column; gap: 3px; }
.flabel { font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase; color: #8a94a8; font-weight: 600; }
.req { color: var(--red); margin-left: 2px; }
.divider-line { height: 1px; background: var(--border); margin: 10px 14px 0; }

.finput { background: var(--bg-card); border: 1.5px solid var(--border); border-radius: 7px; color: var(--text); font-size: 13px; height: 40px; padding: 0 11px; width: 100%; outline: none; font-family: 'Inter', sans-serif; font-weight: 500; transition: border-color .15s; -webkit-appearance: none; appearance: none; }
.finput:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(43,57,144,0.2); }
.finput::placeholder { color: #3a4560; }
select.finput { cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237b8fe8' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-color: var(--bg-card); padding-right: 28px; }
select.finput option, select.finput optgroup { background: var(--bg-card); color: var(--text); }
textarea.finput { height: auto; min-height: 80px; padding: 9px 11px; resize: none; line-height: 1.5; }
input[type="date"].finput { cursor: pointer; color-scheme: dark; }

/* ── Photo upload ── */
.photo-upload-zone { background: var(--bg-card); border: 2px dashed var(--border-mid); border-radius: 10px; padding: 20px; text-align: center; cursor: pointer; transition: all .15s; margin-bottom: 10px; }
.photo-upload-zone:hover { border-color: var(--blue-light); background: var(--bg-raised); }
.puz-icon { font-size: 28px; margin-bottom: 6px; }
.puz-text { font-size: 13px; color: var(--text-mid); font-weight: 600; }
.puz-hint { font-size: 11px; color: var(--text-faint); margin-top: 3px; }
input[type="file"] { display: none; }

.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 8px; }
.photo-thumb { position: relative; border-radius: 8px; overflow: hidden; border: 1.5px solid var(--border); background: var(--bg-card); }
.photo-thumb img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.photo-del { position: absolute; top: 4px; right: 4px; background: rgba(0,0,0,0.7); color: var(--red); border: none; border-radius: 50%; width: 22px; height: 22px; font-size: 14px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.photo-name { font-size: 9px; color: var(--text-faint); padding: 2px 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Submit bar ── */
.submit-bar { position: sticky; bottom: 0; background: #111827; border-top: 1.5px solid var(--border); padding: 10px 14px; display: flex; gap: 8px; z-index: 50; box-shadow: 0 -4px 20px rgba(0,0,0,0.4); }
.screen:not(.active) .submit-bar { display: none !important; }
.btn-sub { flex: 1; background: var(--bg-raised); color: #fff; border: 1.5px solid var(--blue); border-radius: 8px; padding: 13px; font-family: 'Rajdhani', sans-serif; font-size: 14px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px; transition: background .15s; }
.btn-sub:hover { background: var(--blue); }
.btn-back-sm { background: var(--bg-raised); border: 1.5px solid var(--blue); color: #fff; border-radius: 8px; padding: 13px 16px; cursor: pointer; font-size: 16px; font-weight: 700; transition: all .15s; }
.btn-back-sm:hover { background: var(--blue); }

/* ── Buttons ── */
.btn-primary { width: 100%; background: var(--bg-raised); color: #fff; border: 1.5px solid var(--blue); border-radius: 9px; padding: 14px; font-family: 'Rajdhani', sans-serif; font-size: 15px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; cursor: pointer; margin-top: 14px; transition: background .15s; }
.btn-primary:hover { background: var(--blue); }
.btn-ghost { width: 100%; background: transparent; border: 1.5px solid var(--border); color: var(--text-mid); border-radius: 9px; padding: 12px; font-size: 13px; cursor: pointer; font-weight: 600; margin-top: 8px; transition: all .15s; }
.btn-ghost:hover { border-color: var(--blue); color: var(--text); background: var(--bg-raised); }

/* ── Success ── */
.suc-icon { width: 64px; height: 64px; background: var(--bg-raised); border: 2px solid var(--blue); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 18px; font-size: 28px; color: var(--blue-light); }
.suc-title { font-family: 'Rajdhani', sans-serif; font-size: 24px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: #fff; margin-bottom: 6px; }
.suc-sub { font-size: 13px; color: var(--text-dim); line-height: 1.6; margin-bottom: 18px; }
.suc-meta { background: var(--bg-card); border: 1.5px solid var(--border); border-radius: 9px; padding: 12px 14px; margin-bottom: 16px; text-align: left; }
.suc-row { display: flex; justify-content: space-between; font-size: 12px; padding: 5px 0; border-bottom: 1px solid var(--border); }
.suc-row:last-child { border-bottom: none; }
.suc-k { color: var(--text-dim); font-weight: 500; }
.suc-v { color: var(--text); font-weight: 700; text-align: right; max-width: 60%; }

/* ── Admin ── */
.admin-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.75); z-index: 200; align-items: flex-end; justify-content: center; }
.admin-overlay.open { display: flex; }
.admin-sheet { background: #111827; border-radius: 16px 16px 0 0; border-top: 2px solid var(--blue); width: 100%; max-width: 480px; margin: 0 auto; max-height: 88vh; overflow-y: auto; padding: 18px 16px 32px; }
.admin-handle { width: 40px; height: 4px; background: var(--border); border-radius: 2px; margin: 0 auto 16px; }
.admin-title { font-family: 'Rajdhani', sans-serif; font-size: 18px; font-weight: 700; color: #fff; margin-bottom: 2px; }
.admin-sub { font-size: 12px; color: var(--text-dim); margin-bottom: 16px; }
.admin-tabs { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid var(--border); }
.admin-tab { background: none; border: none; border-bottom: 2px solid transparent; padding: 8px 12px; font-size: 12px; font-weight: 600; color: var(--text-dim); cursor: pointer; transition: all .15s; margin-bottom: -1px; }
.admin-tab:hover { color: var(--text); }
.admin-tab.active { color: var(--blue-light); border-bottom-color: var(--blue-light); }
.admin-tab-content { display: none; }
.admin-tab-content.active { display: block; }
.admin-sec-label { font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase; color: #8a94a8; font-weight: 700; margin-bottom: 8px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.admin-input { width: 100%; background: var(--bg-card); border: 1.5px solid var(--border); border-radius: 7px; padding: 0 11px; height: 40px; font-size: 12px; color: var(--text); outline: none; font-weight: 500; }
.admin-input:focus { border-color: var(--blue); }
.admin-close-btn { width: 100%; background: var(--bg-raised); color: #fff; border: 1.5px solid var(--blue); border-radius: 9px; padding: 13px; font-size: 14px; font-weight: 700; cursor: pointer; margin-top: 16px; font-family: 'Rajdhani', sans-serif; letter-spacing: 1.5px; text-transform: uppercase; transition: background .15s; }
.admin-close-btn:hover { background: var(--blue); }

/* Admin history */
.admin-history-row { background: var(--bg-card); border: 1.5px solid var(--border); border-radius: 8px; padding: 9px 12px; margin-bottom: 6px; }
.ahr-title { font-size: 13px; font-weight: 600; color: var(--text); }
.ahr-meta { font-size: 11px; color: var(--text-dim); margin-top: 2px; }

/* PIN */
.pin-dot { width: 14px; height: 14px; border-radius: 50%; background: #1e2d4a; border: 2px solid #2a3a5a; transition: background .15s; display: inline-block; }
.pin-dot.filled { background: var(--blue); border-color: var(--blue-light); }
.pin-keypad { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin-bottom: 8px; }
.pin-keypad button { background: var(--bg-raised); border: 1.5px solid var(--border); border-radius: 8px; color: var(--text); font-size: 18px; font-weight: 600; padding: 14px; cursor: pointer; font-family: 'Inter', sans-serif; transition: background .15s; }
.pin-keypad button:hover { background: var(--blue); }
.pin-keypad button:empty { background: transparent; border: none; cursor: default; }

@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .submit-bar { padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
  .hdr { padding-top: max(10px, env(safe-area-inset-top)); }
}

/* ── Applicator person-select buttons ── */
.btn-toggle-group {
  display: flex; flex-wrap: wrap; gap: 7px; margin-top: 4px;
}
.toggle-person-btn {
  background: var(--bg-card); border: 1.5px solid var(--border);
  border-radius: 8px; padding: 9px 14px; font-size: 13px; font-weight: 600;
  color: var(--text-mid); cursor: pointer; transition: all .15s;
  font-family: 'Inter', sans-serif;
}
.toggle-person-btn:hover { border-color: var(--blue-light); background: var(--bg-raised); color: var(--text); }
.toggle-person-btn.active { background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: 0 0 10px rgba(43,57,144,0.3); }

/* ── Application method buttons ── */
.app-method-btns {
  display: flex; gap: 9px; margin-top: 4px;
}
.app-method-btn {
  flex: 1; background: var(--bg-card); border: 1.5px solid var(--border);
  border-radius: 8px; padding: 11px 10px; font-size: 13px; font-weight: 600;
  color: var(--text-mid); cursor: pointer; transition: all .15s;
  font-family: 'Inter', sans-serif; display: flex; align-items: center;
  justify-content: center; gap: 6px;
}
.app-method-btn:hover { border-color: var(--blue-light); background: var(--bg-raised); color: var(--text); }
.app-method-btn.active { background: var(--bg-raised); border-color: var(--blue-light); color: #fff; box-shadow: 0 0 12px rgba(43,57,144,0.25); }

/* ══════════════════════════════════════════
   BATCH NO. SCAN + HELP
══════════════════════════════════════════ */
.batch-input-row {
  display: flex;
  gap: 6px;
  align-items: center;
}
.batch-scan-btn {
  background: var(--blue);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 18px;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity .15s;
}
.batch-scan-btn:hover { opacity: 0.85; }

.batch-help-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  margin-left: 6px;
  vertical-align: middle;
  flex-shrink: 0;
}

/* Scanner viewfinder */
.batch-scan-viewfinder {
  position: relative;
  width: 100%;
  border-radius: 10px;
  overflow: hidden;
  background: #000;
  max-height: 55vh;
}
.batch-scan-guide {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.batch-scan-corner {
  position: absolute;
  width: 24px;
  height: 24px;
  border-color: #fff;
  border-style: solid;
  opacity: 0.9;
}
.batch-scan-corner.tl { top:16px;  left:16px;  border-width:3px 0 0 3px; }
.batch-scan-corner.tr { top:16px;  right:16px; border-width:3px 3px 0 0; }
.batch-scan-corner.bl { bottom:16px; left:16px;  border-width:0 0 3px 3px; }
.batch-scan-corner.br { bottom:16px; right:16px; border-width:0 3px 3px 0; }

.batch-scan-line {
  position: absolute;
  left: 10%;
  right: 10%;
  top: 50%;
  height: 2px;
  background: rgba(43,57,144,0.8);
  animation: scanline 1.8s ease-in-out infinite;
}
@keyframes scanline {
  0%   { top: 20%; opacity:1; }
  50%  { top: 80%; opacity:0.6; }
  100% { top: 20%; opacity:1; }
}

/* Batch help */
.batch-help-body {
  background: var(--bg-raised);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  text-align: center;
  margin-top: 12px;
}
.batch-help-icon { font-size: 40px; margin-bottom: 10px; }
.batch-help-hint {
  font-size: 14px;
  color: var(--text);
  line-height: 1.6;
  margin: 0;
}

/* ══════════════════════════════════════════
   INLINE ZONE DRAWING PREVIEW CARD
══════════════════════════════════════════ */
.zone-preview-card {
  background: var(--bg-card);
  border: 1.5px solid var(--blue);
  border-radius: 10px;
  padding: 12px;
  margin: 8px 0 12px;
}
.zpv-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.zpv-icon { font-size: 22px; flex-shrink: 0; }
.zpv-info { flex: 1; min-width: 0; }
.zpv-zone-name {
  font-family: 'Rajdhani', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.zpv-file-name {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 1px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Drawing thumbnail */
.zpv-thumb {
  width: 100%;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  cursor: zoom-in;
  display: block;
  max-height: 260px;
  object-fit: contain;
  background: #fff;
}
.zpv-enlarge-hint {
  text-align: center;
  font-size: 11px;
  color: var(--text-faint);
  margin-top: 4px;
  margin-bottom: 6px;
}
.zpv-name-only {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  background: var(--bg-raised);
  border-radius: 7px;
  padding: 10px 12px;
  margin-bottom: 8px;
}
.zpv-no-drawing {
  font-size: 12px;
  color: var(--text-faint);
  text-align: center;
  padding: 10px;
  margin-bottom: 6px;
}
/* Confirmation checkbox row */
.zpv-confirm-row {
  border-top: 1px solid var(--border);
  padding-top: 10px;
  margin-top: 8px;
}
.zpv-check-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  line-height: 1.4;
}
.zpv-check-label input[type="checkbox"] {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  accent-color: var(--blue);
  cursor: pointer;
}
.zpv-confirmed-badge {
  margin-top: 8px;
  background: rgba(34,197,94,0.12);
  color: #22c55e;
  border: 1.5px solid rgba(34,197,94,0.3);
  border-radius: 7px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

/* ══════════════════════════════════════════
   DRAWING LIGHTBOX
══════════════════════════════════════════ */
.drawing-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.lightbox-inner {
  position: relative;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.lightbox-img {
  max-width: 100%;
  max-height: 80vh;
  border-radius: 8px;
  object-fit: contain;
}
.lightbox-close {
  position: absolute;
  top: -12px;
  right: -12px;
  background: #fff;
  color: #111;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}
.lightbox-hint {
  color: rgba(255,255,255,0.5);
  font-size: 11px;
  text-align: center;
}

/* ══════════════════════════════════════════
   ZONE DRAWING CARD — VIEW BUTTONS
══════════════════════════════════════════ */
.zpv-hint {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 2px;
}
.zpv-drawings-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}
.zpv-view-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-raised);
  border: 1.5px solid var(--blue);
  border-radius: 9px;
  padding: 11px 13px;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: background .15s;
}
.zpv-view-btn:hover { background: rgba(43,57,144,0.12); }
.zpv-view-btn-icon  { font-size: 22px; flex-shrink: 0; }
.zpv-view-btn-info  { flex: 1; min-width: 0; }
.zpv-view-btn-name  { font-size: 13px; font-weight: 700; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zpv-view-btn-meta  { font-size: 11px; color: var(--blue-light); margin-top: 2px; }
.zpv-view-btn-arrow { font-size: 22px; color: var(--blue-light); flex-shrink: 0; }

/* Form locked state */
.form-body-lockable { transition: opacity .2s; }
.form-body-locked   { opacity: 0.35; pointer-events: none; user-select: none; }

.form-locked-overlay {
  background: rgba(43,57,144,0.07);
  border: 1.5px dashed var(--blue);
  border-radius: 8px;
  padding: 10px 14px;
  margin: 8px 0;
}
.form-locked-msg {
  font-size: 12px;
  font-weight: 600;
  color: var(--blue-light);
  text-align: center;
}

/* ══════════════════════════════════════════
   DRAWING VIEWER — FULL SCREEN OVERLAY
══════════════════════════════════════════ */
.drawing-viewer {
  position: fixed;
  inset: 0;
  background: #111;
  z-index: 900;
  display: flex;
  flex-direction: column;
}
.dv-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: #1a1a2e;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.dv-close {
  background: rgba(255,255,255,0.1);
  border: none;
  color: #fff;
  border-radius: 8px;
  width: 36px;
  height: 36px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dv-close:hover { background: rgba(255,255,255,0.2); }
.dv-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dv-body {
  flex: 1;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.dv-loading {
  color: rgba(255,255,255,0.6);
  font-size: 14px;
  text-align: center;
  padding: 24px;
  max-width: 280px;
}
.dv-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.dv-iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: #fff;
}
.dv-footer {
  background: #1a1a2e;
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 12px 14px;
  flex-shrink: 0;
}
.dv-footer-hint {
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  text-align: center;
  margin-bottom: 8px;
}
.dv-footer-btns {
  display: flex;
  gap: 8px;
}
.dv-btn-confirm {
  flex: 1;
  background: #22c55e;
  border: none;
  color: #fff;
  border-radius: 9px;
  padding: 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.dv-btn-back {
  background: rgba(255,255,255,0.1);
  border: none;
  color: #fff;
  border-radius: 9px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

/* ══════════════════════════════════════════
   INLINE DRAWING CONFIRM PROMPT
══════════════════════════════════════════ */
.zpv-confirm-prompt {
  margin-top: 10px;
  background: rgba(34,197,94,0.08);
  border: 1.5px solid rgba(34,197,94,0.4);
  border-radius: 9px;
  padding: 12px 14px;
}
.zpv-confirm-prompt-text {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 10px;
  line-height: 1.4;
}
.zpv-confirm-prompt-btn {
  width: 100%;
  background: #22c55e;
  border: none;
  color: #fff;
  border-radius: 8px;
  padding: 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.3px;
}
.zpv-confirm-prompt-btn:active {
  opacity: 0.85;
}

/* ══════════════════════════════════════════
   DRAWING THUMBNAIL CARDS
══════════════════════════════════════════ */
.zpv-drw-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 8px;
}
.zpv-drw-card-thumb {
  width: 100%;
  height: 260px;
  background: #fff;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.zpv-drw-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-dim);
}
.zpv-drw-spinner {
  width: 28px; height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

/* Delayed state -- past Busy.DELAY_MS with no preview resolved. Same
   orange "still working" language as .busy-indicator.is-delayed, but
   card-scoped: the rest of the form is never blocked by it. */
.zpv-drw-loading.is-delayed { color: var(--orange); padding: 0 14px; }
.zpv-drw-loading.is-delayed .zpv-drw-spinner { border-top-color: var(--orange); }
.zpv-drw-delayed-text { text-align: center; line-height: 1.45; }
.zpv-drw-retry { padding: 5px 12px; font-size: 11px; }
@keyframes spin { to { transform: rotate(360deg); } }

.zpv-thumb-iframe {
  width: 100%; height: 100%;
  border: none;
  pointer-events: none; /* prevent scroll capture */
}
.zpv-thumb-img {
  width: 100%; height: 100%;
  object-fit: contain;
}
/* Static "document attached" card for PDF thumbnails -- replaces trying to
   live-render the PDF via a data: URI iframe, which is unreliable across
   browsers and fails silently (blank, no error). Same icon+filename
   pattern as .dm-drawing-row (Drawing Mark Ups list). */
.zpv-thumb-doc {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%; height: 100%;
  padding: 16px;
  text-align: center;
  cursor: pointer;
}
.zpv-thumb-doc-icon { font-size: 40px; line-height: 1; }
.zpv-thumb-doc-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.zpv-thumb-doc-tap { font-size: 11px; color: var(--blue-light); font-weight: 600; }
.zpv-thumb-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.03);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 10px;
  cursor: pointer;
}
.zpv-thumb-tap {
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 20px;
}
.zpv-drw-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-top: 1px solid var(--border);
  gap: 8px;
}
.zpv-drw-card-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.zpv-drw-open-btn {
  background: var(--blue);
  border: none;
  color: #fff;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  opacity: 1;
  transition: opacity .15s;
}
.zpv-drw-open-btn:disabled { opacity: 0.4; cursor: default; }

/* Portal fallback */
.zpv-portal-fallback {
  background: var(--bg-raised);
  border: 1.5px dashed var(--border);
  border-radius: 9px;
  padding: 14px;
  text-align: center;
  margin-bottom: 6px;
}
.zpv-fallback-icon { font-size: 32px; margin-bottom: 6px; }
.zpv-fallback-text {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 8px;
  line-height: 1.5;
}


/* ══════════════════════════════════════════
   WORKSHOP CSS (merged)
══════════════════════════════════════════ */
/* ══════════════════════════════════════════
   RISE CONTRACTING — CONTAINER REGISTER v2
   style.css
══════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@500;600;700&family=Inter:wght@400;500;600&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; font-family: 'Inter', sans-serif; font-size: 14px; background: #0d1117; color: #e8edf2; -webkit-font-smoothing: antialiased; overflow-x: hidden; }

:root {
  --bg: #0d1117; --bg-card: #161d2b; --bg-raised: #1a2340;
  --border: #1e2d4a; --border-mid: #2a3a5a;
  --blue: #2B3990; --blue-light: #7b8fe8;
  --text: #e8edf2; --text-mid: #a0aec0; --text-dim: #6b7594; --text-faint: #4a5270;
  --red: #f87171; --orange: #f97316; --green: #22c55e;
  --header-h: 58px;
}

/* ── Header ── */
.hdr { background: #111827; border-bottom: 3px solid var(--blue); padding: 10px 14px; display: flex; align-items: center; gap: 10px; position: fixed; top: 0; left: 0; right: 0; z-index: 100; height: var(--header-h); box-shadow: 0 2px 12px rgba(0,0,0,0.4); }
.hdr-text { flex: 1; }
.hdr-co { font-family: 'Rajdhani', sans-serif; font-size: 15px; font-weight: 700; color: #fff; letter-spacing: 1.5px; text-transform: uppercase; line-height: 1.1; }
.hdr-sub { font-size: 10px; color: var(--text-dim); letter-spacing: 1px; text-transform: uppercase; margin-top: 1px; }
.hdr-admin-btn { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.15); border-radius: 7px; padding: 6px 10px; font-size: 11px; color: #a0aec0; cursor: pointer; font-weight: 600; white-space: nowrap; transition: background .15s; }
.hdr-admin-btn:hover { background: rgba(255,255,255,0.12); }
.btn-back-icon { background: var(--bg-raised); border: 1.5px solid var(--blue); color: #fff; border-radius: 8px; width: 36px; height: 36px; font-size: 16px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background .15s; flex-shrink: 0; }
.btn-back-icon:hover { background: var(--blue); }

/* ── Screens ── */
.screen { display: none; padding-top: var(--header-h); min-height: 100vh; }
.screen.active { display: block; }
.screen-inner { padding: 16px; max-width: 480px; margin: 0 auto; }
.job-banner { background: #111827; border-bottom: 2px solid var(--blue); padding: 10px 14px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: var(--header-h); z-index: 50; }
.banner-job { font-family: 'Rajdhani', sans-serif; font-size: 16px; font-weight: 700; color: #fff; flex: 1; text-align: center; }

/* ── Action buttons ── */
.action-row { display: flex; gap: 10px; margin-bottom: 22px; }
.action-btn { flex: 1; background: var(--bg-card); border: 2px solid var(--border); border-radius: 12px; padding: 16px 10px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 6px; transition: all .2s; }
.action-btn:hover { border-color: var(--blue-light); background: var(--bg-raised); }
.action-btn.take:hover { border-color: var(--orange); box-shadow: 0 0 14px rgba(249,115,22,0.25); }
.action-btn.return:hover { border-color: var(--green); box-shadow: 0 0 14px rgba(34,197,94,0.25); }
.action-icon { font-size: 28px; }
.action-label { font-family: 'Rajdhani', sans-serif; font-size: 14px; font-weight: 700; color: #fff; letter-spacing: 0.5px; }
.action-sub { font-size: 10px; color: var(--text-dim); }

/* ── Search ── */
.section-label-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; gap: 10px; }
.section-label { font-size: 10px; letter-spacing: 2px; text-transform: uppercase; color: var(--text-dim); font-weight: 600; white-space: nowrap; }
.search-box { flex: 1; max-width: 160px; }
.search-box input { width: 100%; background: var(--bg-card); border: 1.5px solid var(--border); border-radius: 7px; height: 34px; padding: 0 10px; font-size: 12px; color: var(--text); outline: none; }
.search-box input:focus { border-color: var(--blue); }
.search-box input::placeholder { color: var(--text-faint); }

/* ── Stock list ── */
.stock-type-block { margin-bottom: 20px; }
.stock-type-header { font-family: 'Rajdhani', sans-serif; font-size: 13px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--blue-light); margin-bottom: 8px; padding-bottom: 6px; border-bottom: 1.5px solid var(--border); }
.stock-product-block { margin-bottom: 12px; }
.stock-product-name { font-size: 13px; font-weight: 600; color: var(--text-mid); margin-bottom: 6px; padding-left: 4px; }

.batch-entry-card { background: var(--bg-card); border: 1.5px solid var(--border); border-radius: 10px; padding: 11px 13px; margin-bottom: 6px; }
.batch-entry-card.expired-card { border-color: rgba(248,113,113,0.4); background: rgba(248,113,113,0.05); }
.batch-entry-card.warning-card { border-color: rgba(249,115,22,0.4); background: rgba(249,115,22,0.05); }
.batch-entry-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.batch-entry-brand { font-size: 10px; color: var(--blue-light); font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; }
.batch-entry-qty { font-family: 'Rajdhani', sans-serif; font-size: 20px; font-weight: 700; color: #fff; line-height: 1; text-align: right; }
.batch-entry-qty-label { font-size: 9px; color: var(--text-dim); text-align: right; }

.batch-entry-pills { display: flex; flex-wrap: wrap; gap: 5px; }
.pill { font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 4px; background: var(--bg-raised); color: var(--text-mid); border: 1px solid var(--border); }
.pill.level-full { background: rgba(34,197,94,0.1);   color: var(--green);  border-color: rgba(34,197,94,0.3); }
.pill.level-75   { background: rgba(234,179,8,0.1);   color: #eab308;       border-color: rgba(234,179,8,0.3); }
.pill.level-50   { background: rgba(249,115,22,0.1);  color: var(--orange); border-color: rgba(249,115,22,0.3); }
.pill.level-25   { background: rgba(248,113,113,0.1); color: var(--red);    border-color: rgba(248,113,113,0.3); }
.pill.expired    { background: rgba(248,113,113,0.15);color: var(--red);    border-color: rgba(248,113,113,0.4); font-weight: 700; }
.pill.expiring   { background: rgba(249,115,22,0.15); color: var(--orange); border-color: rgba(249,115,22,0.4); }

.empty-state { text-align: center; color: var(--text-faint); padding: 24px; font-size: 13px; background: var(--bg-card); border-radius: 10px; border: 1.5px dashed var(--border); line-height: 1.6; }

/* ── Form body ── */
.form-body { padding-bottom: 90px; max-width: 480px; margin: 0 auto; }
.fsec { padding: 14px 14px 0; }
.fsec-hdr { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1.5px solid var(--border); }
.fsec-icon { width: 28px; height: 28px; background: var(--bg-raised); border: 1.5px solid var(--blue); border-radius: 7px; display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; }
.fsec-title { font-family: 'Rajdhani', sans-serif; font-size: 12px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: #c5cfe8; flex: 1; }
.fsec-req { font-size: 9px; color: var(--red); font-weight: 600; letter-spacing: 1px; text-transform: uppercase; }
.frow { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-bottom: 9px; }
.frow.full { grid-template-columns: 1fr; }
.fg { display: flex; flex-direction: column; gap: 3px; }
.flabel { font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase; color: #8a94a8; font-weight: 600; }
.req { color: var(--red); margin-left: 2px; }
.divider-line { height: 1px; background: var(--border); margin: 10px 14px 0; }
.field-hint { font-size: 11px; color: var(--text-faint); margin-top: 3px; }

.finput { background: var(--bg-card); border: 1.5px solid var(--border); border-radius: 7px; color: var(--text); font-size: 13px; height: 40px; padding: 0 11px; width: 100%; outline: none; font-family: 'Inter', sans-serif; font-weight: 500; transition: border-color .15s; -webkit-appearance: none; appearance: none; }
.finput:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(43,57,144,0.2); }
.finput::placeholder { color: #3a4560; }
input[type="date"].finput { cursor: pointer; color-scheme: dark; }
select.finput { cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237b8fe8' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-color: var(--bg-card); padding-right: 28px; }
select.finput option { background: var(--bg-card); color: var(--text); }
textarea.finput { height: auto; min-height: 70px; padding: 9px 11px; resize: none; line-height: 1.5; }

/* ── Expiry display ── */
.expiry-display { font-size: 11px; margin-top: 5px; padding: 5px 9px; border-radius: 5px; font-weight: 600; }
.expiry-display:empty { display: none; }
.expiry-display.ok      { background: rgba(34,197,94,0.1);  color: var(--green);  border: 1px solid rgba(34,197,94,0.2); }
.expiry-display.warning { background: rgba(249,115,22,0.1); color: var(--orange); border: 1px solid rgba(249,115,22,0.2); }
.expiry-display.expired { background: rgba(248,113,113,0.1);color: var(--red);    border: 1px solid rgba(248,113,113,0.2); }

/* ── Level selector ── */
.level-selector { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.level-btn { background: var(--bg-card); border: 2px solid var(--border); border-radius: 10px; padding: 12px 6px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; transition: all .2s; }
.level-btn:hover { border-color: var(--blue-light); background: var(--bg-raised); }
.level-btn.active { border: 2.5px solid var(--blue-light); background: var(--bg-raised); box-shadow: 0 0 10px rgba(123,143,232,0.3); }
.level-icon { font-size: 20px; }
.level-label { font-family: 'Rajdhani', sans-serif; font-size: 12px; font-weight: 700; color: #fff; }
.level-val { font-size: 9px; color: var(--text-dim); }

/* ── Batch detail card (take-out) ── */
.batch-detail-card { background: var(--bg-raised); border: 1.5px solid var(--blue); border-radius: 8px; padding: 10px 12px; margin-top: 8px; font-size: 12px; }
.batch-detail-row { display: flex; justify-content: space-between; padding: 3px 0; }
.batch-detail-row:not(:last-child) { border-bottom: 1px solid var(--border); }
.batch-dk { color: var(--text-dim); }
.batch-dv { color: var(--text); font-weight: 600; text-align: right; }
.batch-dv.expired-flag { color: var(--red); }
.batch-dv.warn-flag    { color: var(--orange); }

/* ── Submit bar ── */
.submit-bar { position: sticky; bottom: 0; background: #111827; border-top: 1.5px solid var(--border); padding: 10px 14px; display: flex; gap: 8px; z-index: 50; box-shadow: 0 -4px 20px rgba(0,0,0,0.4); }
.screen:not(.active) .submit-bar { display: none !important; }
.btn-sub { flex: 1; background: var(--bg-raised); color: #fff; border: 1.5px solid var(--blue); border-radius: 8px; padding: 13px; font-family: 'Rajdhani', sans-serif; font-size: 14px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px; transition: background .15s; }
.btn-sub:hover { background: var(--blue); }
.btn-back-sm { background: var(--bg-raised); border: 1.5px solid var(--blue); color: #fff; border-radius: 8px; padding: 13px 16px; cursor: pointer; font-size: 16px; font-weight: 700; transition: all .15s; }
.btn-back-sm:hover { background: var(--blue); }

/* ── Primary / Ghost buttons ── */
.btn-primary { width: 100%; background: var(--bg-raised); color: #fff; border: 1.5px solid var(--blue); border-radius: 9px; padding: 14px; font-family: 'Rajdhani', sans-serif; font-size: 15px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; cursor: pointer; margin-top: 14px; transition: background .15s; }
.btn-primary:hover { background: var(--blue); }
.btn-ghost { width: 100%; background: transparent; border: 1.5px solid var(--border); color: var(--text-mid); border-radius: 9px; padding: 12px; font-size: 13px; cursor: pointer; font-weight: 600; margin-top: 8px; transition: all .15s; }
.btn-ghost:hover { border-color: var(--blue); color: var(--text); background: var(--bg-raised); }
.btn-add-project { width: 100%; background: transparent; border: 1.5px dashed var(--border-mid); color: var(--blue-light); border-radius: 8px; padding: 11px; font-size: 13px; font-weight: 600; cursor: pointer; margin-top: 8px; transition: all .15s; }
.btn-add-project:hover { border-color: var(--blue-light); background: var(--bg-raised); }

/* ── Success ── */
.suc-icon { width: 64px; height: 64px; background: var(--bg-raised); border: 2px solid var(--blue); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 18px; font-size: 28px; color: var(--blue-light); }
.suc-title { font-family: 'Rajdhani', sans-serif; font-size: 24px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: #fff; margin-bottom: 6px; }
.suc-sub { font-size: 13px; color: var(--text-dim); line-height: 1.6; margin-bottom: 18px; }
.suc-meta { background: var(--bg-card); border: 1.5px solid var(--border); border-radius: 9px; padding: 12px 14px; margin-bottom: 16px; text-align: left; }
.suc-row { display: flex; justify-content: space-between; font-size: 12px; padding: 5px 0; border-bottom: 1px solid var(--border); }
.suc-row:last-child { border-bottom: none; }
.suc-k { color: var(--text-dim); font-weight: 500; }
.suc-v { color: var(--text); font-weight: 700; text-align: right; max-width: 58%; }

/* ── Admin overlays ── */
.admin-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.75); z-index: 200; align-items: flex-end; justify-content: center; }
.admin-overlay.open { display: flex; }
.admin-sheet { background: #111827; border-radius: 16px 16px 0 0; border-top: 2px solid var(--blue); width: 100%; max-width: 480px; margin: 0 auto; max-height: 88vh; overflow-y: auto; padding: 18px 16px 32px; }
.admin-handle { width: 40px; height: 4px; background: var(--border); border-radius: 2px; margin: 0 auto 16px; }
.admin-title { font-family: 'Rajdhani', sans-serif; font-size: 18px; font-weight: 700; letter-spacing: 1px; color: #fff; margin-bottom: 2px; }
.admin-sub { font-size: 12px; color: var(--text-dim); margin-bottom: 16px; }
.admin-tabs { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.admin-tab { background: none; border: none; border-bottom: 2px solid transparent; padding: 8px 10px; font-size: 12px; font-weight: 600; color: var(--text-dim); cursor: pointer; transition: all .15s; margin-bottom: -1px; white-space: nowrap; }
.admin-tab:hover { color: var(--text); }
.admin-tab.active { color: var(--blue-light); border-bottom-color: var(--blue-light); }
.admin-tab-content { display: none; }
.admin-tab-content.active { display: block; }
.admin-sec-label { font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase; color: #8a94a8; font-weight: 700; margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.admin-hint-box { background: rgba(43,57,144,0.15); border: 1px solid rgba(43,57,144,0.3); border-radius: 6px; padding: 8px 10px; font-size: 11px; color: var(--text-mid); line-height: 1.5; margin: 8px 0; }
.admin-item { background: var(--bg-card); border: 1.5px solid var(--border); border-radius: 8px; padding: 10px 12px; margin-bottom: 6px; display: flex; align-items: center; justify-content: space-between; }
.admin-item-name { font-size: 13px; font-weight: 600; color: var(--text); }
.admin-item-sub { font-size: 10px; color: var(--text-dim); margin-top: 1px; }
.admin-item-actions { display: flex; gap: 8px; align-items: center; }

/* Admin batch entries */
.admin-batch-entry { background: var(--bg-card); border: 1.5px solid var(--border); border-radius: 8px; padding: 10px 12px; margin-bottom: 6px; }
.admin-batch-entry.expired-card { border-color: rgba(248,113,113,0.4); }
.admin-batch-top { display: flex; justify-content: space-between; align-items: flex-start; }
.admin-batch-name { font-size: 13px; font-weight: 600; color: var(--text); }
.admin-batch-sub { font-size: 10px; color: var(--text-dim); margin-top: 2px; line-height: 1.6; }

/* Admin brand blocks */
.admin-brand-block { margin-bottom: 14px; }
.admin-brand-header { display: flex; align-items: center; justify-content: space-between; background: var(--bg-raised); border: 1.5px solid var(--blue); border-radius: 8px; padding: 10px 12px; margin-bottom: 6px; }
.admin-brand-name { font-family: 'Rajdhani', sans-serif; font-size: 14px; font-weight: 700; color: #fff; }
.admin-brand-products { padding-left: 10px; }

.del-btn { background: none; border: none; color: var(--red); font-size: 16px; cursor: pointer; padding: 2px 4px; opacity: .6; transition: opacity .15s; line-height: 1; }
.del-btn:hover { opacity: 1; }
.edit-btn { background: none; border: none; color: var(--blue-light); font-size: 14px; cursor: pointer; padding: 2px 4px; opacity: .7; transition: opacity .15s; }
.edit-btn:hover { opacity: 1; }
.admin-add-row { display: flex; gap: 8px; margin-top: 10px; }
.admin-input { flex: 1; background: var(--bg-card); border: 1.5px solid var(--border); border-radius: 7px; padding: 0 11px; height: 38px; font-size: 13px; color: var(--text); outline: none; font-weight: 500; -webkit-appearance: none; }
.admin-input:focus { border-color: var(--blue); }
.admin-input::placeholder { color: #3a4560; }
.admin-add-btn { background: var(--blue); color: #fff; border: none; border-radius: 7px; padding: 0 14px; height: 38px; font-size: 13px; font-weight: 700; cursor: pointer; transition: background .15s; white-space: nowrap; }
.admin-add-btn:hover { background: #364ab5; }
.admin-close-btn { width: 100%; background: var(--bg-raised); color: #fff; border: 1.5px solid var(--blue); border-radius: 9px; padding: 13px; font-size: 14px; font-weight: 700; cursor: pointer; margin-top: 16px; font-family: 'Rajdhani', sans-serif; letter-spacing: 1.5px; text-transform: uppercase; transition: background .15s; }
.admin-close-btn:hover { background: var(--blue); }

/* ── PIN ── */
.pin-dot { width: 14px; height: 14px; border-radius: 50%; background: #1e2d4a; border: 2px solid #2a3a5a; transition: background .15s; display: inline-block; }
.pin-dot.filled { background: var(--blue); border-color: var(--blue-light); }
.pin-keypad { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin-bottom: 8px; }
.pin-keypad button { background: var(--bg-raised); border: 1.5px solid var(--border); border-radius: 8px; color: var(--text); font-size: 18px; font-weight: 600; padding: 14px; cursor: pointer; font-family: 'Inter', sans-serif; transition: background .15s; }
.pin-keypad button:hover { background: var(--blue); }
.pin-keypad button:empty { background: transparent; border: none; cursor: default; }

/* ── History ── */
.history-row { background: var(--bg-card); border: 1.5px solid var(--border); border-radius: 8px; padding: 10px 12px; margin-bottom: 6px; }
.history-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.history-item { font-size: 13px; font-weight: 600; color: var(--text); }
.history-badge { font-size: 9px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; padding: 2px 7px; border-radius: 4px; }
.history-badge.in  { background: rgba(34,197,94,0.15);  color: var(--green); }
.history-badge.out { background: rgba(249,115,22,0.15); color: var(--orange); }
.history-meta { font-size: 11px; color: var(--text-dim); }

@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .submit-bar { padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
  .hdr { padding-top: max(10px, env(safe-area-inset-top)); }
}

/* ══════════════════════════════════════════
   INLINE ADD — BRAND / PRODUCT
══════════════════════════════════════════ */
.field-with-add {
  display: flex;
  gap: 7px;
  align-items: center;
}
.field-with-add-select {
  flex: 1;
}
.field-add-btn {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  background: var(--bg-raised);
  border: 1.5px solid var(--blue);
  border-radius: 7px;
  color: var(--blue-light);
  font-size: 22px;
  font-weight: 300;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
  line-height: 1;
}
.field-add-btn:hover {
  background: var(--blue);
  color: #fff;
}

.inline-add-wrap {
  margin-top: 8px;
  background: var(--bg-raised);
  border: 1.5px solid var(--blue);
  border-radius: 10px;
  padding: 12px;
}
.inline-add-input {
  width: 100%;
  margin-bottom: 8px;
}
.inline-add-actions {
  display: flex;
  gap: 7px;
}
.inline-save-btn {
  flex: 1;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 7px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: background .15s;
}
.inline-save-btn:hover { background: #364ab5; }
.inline-cancel-btn {
  background: transparent;
  border: 1.5px solid var(--border-mid);
  color: var(--text-dim);
  border-radius: 7px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: all .15s;
}
.inline-cancel-btn:hover { border-color: var(--red); color: var(--red); }
.inline-add-error {
  min-height: 16px;
  margin-top: 6px;
  font-size: 12px;
  color: var(--red);
  font-weight: 600;
}

/* ── Sync indicator pill ── */
.sync-pill {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--blue-light);
  background: rgba(43,57,144,0.2);
  border: 1px solid rgba(123,143,232,0.3);
  border-radius: 20px;
  padding: 4px 9px;
  white-space: nowrap;
  animation: pulse-sync 1.2s ease-in-out infinite;
}
@keyframes pulse-sync {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.45; }
}

/* ══════════════════════════════════════════
   OCR SCAN — FULL SCREEN CROP UI
══════════════════════════════════════════ */

/* Full-screen container — sits over everything */
.scan-fullscreen {
  position: fixed;
  inset: 0;
  background: #0d1117;
  z-index: 300;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Step wrapper */
.scan-step {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding-top: max(0px, env(safe-area-inset-top));
}

/* Top bar */
.scan-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: #111827;
  border-bottom: 2px solid var(--blue);
  flex-shrink: 0;
}
.scan-topbar-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.5px;
}
.scan-topbar-btn {
  background: transparent;
  border: 1px solid var(--border-mid);
  color: var(--text-mid);
  border-radius: 7px;
  padding: 6px 11px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: all .15s;
  min-width: 70px;
  text-align: center;
}
.scan-topbar-btn:hover { border-color: var(--blue-light); color: var(--text); }
.scan-topbar-btn-primary {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}
.scan-topbar-btn-primary:hover { background: #364ab5; }

/* Step body — scrollable content area */
.scan-step-body {
  flex: 1;
  padding: 20px 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.scan-subtitle {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.5;
  text-align: center;
  margin-bottom: 6px;
}

/* Upload zone */
.scan-upload-zone {
  background: var(--bg-card);
  border: 2px dashed var(--border-mid);
  border-radius: 14px;
  padding: 36px 20px;
  text-align: center;
  cursor: pointer;
  transition: all .15s;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.scan-upload-zone:hover, .scan-upload-zone:active { border-color: var(--blue-light); background: var(--bg-raised); }
.scan-uz-icon  { font-size: 48px; }
.scan-uz-text  { font-size: 15px; font-weight: 600; color: var(--text-mid); }
.scan-uz-hint  { font-size: 12px; color: var(--text-faint); }

/* Crop canvas wrap */
.scan-crop-hint {
  font-size: 11px;
  color: var(--blue-light);
  background: rgba(43,57,144,0.12);
  border-bottom: 1px solid rgba(43,57,144,0.2);
  padding: 8px 14px;
  text-align: center;
  flex-shrink: 0;
}
.scan-canvas-wrap {
  flex: 1;
  position: relative;
  background: #000;
  overflow: hidden;
  touch-action: none;
}
.scan-canvas-wrap canvas {
  display: block;
}
#scan-sel-canvas {
  cursor: crosshair;
}
.scan-crop-footer {
  padding: 10px 14px;
  padding-bottom: max(10px, env(safe-area-inset-bottom));
  background: #111827;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: center;
  flex-shrink: 0;
}
.scan-crop-action-btn {
  background: transparent;
  border: 1.5px solid var(--border-mid);
  color: var(--text-dim);
  border-radius: 8px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: all .15s;
}
.scan-crop-action-btn:hover { border-color: var(--blue-light); color: var(--text); }

/* Processing */
.scan-spinner {
  width: 48px; height: 48px;
  border: 4px solid var(--border);
  border-top-color: var(--blue-light);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}
.scan-processing-text {
  font-family: 'Rajdhani', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  text-align: center;
  margin-top: 16px;
}
.scan-processing-sub {
  font-size: 12px;
  color: var(--text-faint);
  text-align: center;
}

/* Result */
.scan-result-label {
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 600;
}
.scan-confidence { font-size: 12px; font-weight: 600; margin-top: 4px; }
.scan-confidence.high { color: var(--green); }
.scan-confidence.mid  { color: var(--orange); }
.scan-confidence.low  { color: var(--red); }
.scan-use-btn {
  width: 100%;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 9px;
  padding: 15px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .15s;
  margin-top: 4px;
}
.scan-use-btn:hover { background: #364ab5; }
.scan-retry-btn {
  width: 100%;
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-dim);
  border-radius: 9px;
  padding: 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: all .15s;
}
.scan-retry-btn:hover { border-color: var(--blue-light); color: var(--text); }

/* Scan input row (📷 button next to field) */
.scan-input-row {
  display: flex;
  gap: 7px;
  align-items: center;
}
.scan-input-row .finput { flex: 1; }
.scan-btn {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  background: var(--bg-raised);
  border: 1.5px solid var(--blue);
  border-radius: 7px;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}
.scan-btn:hover { background: var(--blue); }

/* ══════════════════════════════════════════
   QUICK-SCAN CHIPS PANEL
══════════════════════════════════════════ */
.qs-panel {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(13, 17, 23, 0.96);
  border-top: 2px solid var(--blue);
  padding: 12px 12px 16px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10;
  max-height: 55%;
  overflow-y: auto;
}
.qs-panel-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 10px;
}
.qs-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.qs-chip {
  background: var(--bg-raised);
  border: 1.5px solid var(--blue);
  border-radius: 8px;
  padding: 9px 14px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  transition: all .15s;
  letter-spacing: 0.5px;
}
.qs-chip:hover, .qs-chip:active {
  background: var(--blue);
  transform: scale(1.03);
}
.qs-no-results {
  font-size: 12px;
  color: var(--text-dim);
  padding: 6px 0;
  line-height: 1.5;
}
.qs-panel-actions {
  border-top: 1px solid var(--border);
  padding-top: 10px;
  margin-top: 4px;
}
.qs-refine-btn {
  background: transparent;
  border: none;
  color: var(--blue-light);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 0;
  font-family: 'Inter', sans-serif;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Scanning spinner overlay on canvas */
.qs-scanning {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  z-index: 5;
}

/* ══════════════════════════════════════════
   CONTAINER v4 — NEW COMPONENTS
══════════════════════════════════════════ */

/* Home grid */
.home-grid { display:flex; flex-direction:column; gap:14px; padding:16px; }
.home-tile { background:var(--bg-card); border:1.5px solid var(--border); border-radius:14px; padding:20px 16px; cursor:pointer; transition:all .2s; }
.home-tile:hover { border-color:var(--blue-light); background:var(--bg-raised); }
.home-tile-icon { font-size:32px; margin-bottom:8px; }
.home-tile-name { font-family:'Rajdhani',sans-serif; font-size:17px; font-weight:700; color:#fff; }
.home-tile-sub  { font-size:12px; color:var(--text-dim); margin-top:3px; }

/* FABs */
.fab-row { position:fixed; bottom:0; left:0; right:0; display:flex; gap:8px; padding:10px 14px;
  padding-bottom:max(10px,env(safe-area-inset-bottom)); background:#111827; border-top:1.5px solid var(--border);
  z-index:50; max-width:480px; margin:0 auto; }
.fab { flex:1; border-radius:8px; padding:13px; font-family:'Rajdhani',sans-serif; font-size:14px;
  font-weight:700; letter-spacing:1.5px; text-transform:uppercase; cursor:pointer; transition:background .15s; border:1.5px solid var(--blue); }
.fab-primary   { background:var(--blue); color:#fff; }
.fab-primary:hover { background:#364ab5; }
.fab-secondary { background:var(--bg-raised); color:#fff; }
.fab-secondary:hover { background:var(--blue); }

/* Mode cards */
.mode-card-grid { display:flex; flex-direction:column; gap:12px; padding:16px; }
.mode-card { background:var(--bg-card); border:1.5px solid var(--border); border-radius:14px;
  padding:20px 16px; cursor:pointer; transition:all .2s; }
.mode-card:hover { border-color:var(--blue-light); background:var(--bg-raised); }
.mode-card-icon { font-size:28px; margin-bottom:8px; }
.mode-card-name { font-family:'Rajdhani',sans-serif; font-size:16px; font-weight:700; color:#fff; }
.mode-card-desc { font-size:12px; color:var(--text-dim); margin-top:4px; line-height:1.5; }

/* Toggle row */
.toggle-row { display:flex; gap:7px; flex-wrap:wrap; }
.toggle-opt-btn { flex:1; min-width:0; background:var(--bg-card); border:1.5px solid var(--border);
  border-radius:8px; padding:9px 10px; font-size:13px; font-weight:600; color:var(--text-mid);
  cursor:pointer; transition:all .15s; font-family:'Inter',sans-serif; text-align:center; }
.toggle-opt-btn:hover { border-color:var(--blue-light); }
.toggle-opt-btn.active { background:var(--bg-raised); border-color:var(--blue-light); color:#fff; }

/* Batch assigned */
.batch-assigned { opacity:0.7; }
.assigned-pill  { background:rgba(43,57,144,0.2); border:1px solid var(--blue); color:var(--blue-light); }
.assigned-badge { background:rgba(43,57,144,0.15); border:1.5px solid var(--blue); border-radius:8px;
  padding:8px 12px; font-size:12px; color:var(--blue-light); margin-top:6px; font-weight:600; }
.txt-red { color:var(--red); }

/* Stock container adjustments for v4 */
#stock-list { padding:12px 14px 100px; }
.search-bar-wrap { padding:10px 14px 0; }
.search-bar { width:100%; background:var(--bg-card); border:1.5px solid var(--border);
  border-radius:8px; padding:9px 12px; color:var(--text); font-size:13px; outline:none; }
.search-bar:focus { border-color:var(--blue); }

/* IP product card */
.ip-product-card { background:var(--bg-card); border:1.5px solid var(--border); border-radius:12px;
  padding:14px; margin-bottom:12px; }
.ip-product-hdr { display:flex; justify-content:space-between; align-items:center; margin-bottom:12px;
  padding-bottom:8px; border-bottom:1px solid var(--border); }
.ip-product-num { font-family:'Rajdhani',sans-serif; font-size:13px; font-weight:700; color:var(--blue-light);
  text-transform:uppercase; letter-spacing:1px; }
.ip-remove-btn  { background:transparent; border:1px solid var(--red); color:var(--red); border-radius:6px;
  padding:3px 8px; font-size:11px; font-weight:700; cursor:pointer; }
.ip-entry-block { background:var(--bg-raised); border:1px solid var(--border); border-radius:8px;
  padding:10px; margin-top:8px; }
.ip-entry-hdr   { display:flex; justify-content:space-between; align-items:center; margin-bottom:8px; }
.ip-entry-label { font-size:11px; font-weight:700; color:var(--blue-light); text-transform:uppercase; letter-spacing:1px; }
.btn-add-product { width:100%; background:transparent; border:1.5px dashed var(--border-mid);
  border-radius:8px; padding:12px; font-size:13px; font-weight:600; color:var(--text-dim);
  cursor:pointer; transition:all .15s; margin-top:4px; }
.btn-add-product:hover { border-color:var(--blue-light); color:var(--text); }
.btn-add-batch { width:100%; background:transparent; border:1px dashed var(--blue); color:var(--blue-light);
  border-radius:7px; padding:8px; font-size:12px; font-weight:600; cursor:pointer; margin-top:8px; }

/* Multi-log toggle */
.multi-log-toggle { background:rgba(43,57,144,0.08); border:1px solid rgba(43,57,144,0.2);
  border-radius:8px; padding:10px 12px; margin:10px 0 4px; }
.multi-log-toggle .flabel { color:var(--blue-light); }

/* Month/year selects */
.month-year-wrap, .month-year-wrap-sm {
  display:flex; gap:5px; align-items:center; flex:1;
}
.month-sel { flex:1; min-width:60px; }
.year-sel  { flex:1.3; min-width:75px; }
.na-btn { flex-shrink:0; background:var(--bg-raised); border:1.5px solid var(--border);
  border-radius:6px; padding:0 10px; height:40px; font-size:11px; font-weight:700; color:var(--text-dim);
  cursor:pointer; transition:all .15s; white-space:nowrap; }
.na-btn.active { background:var(--blue); border-color:var(--blue); color:#fff; }

/* Summary screen */
.summary-intro { font-size:13px; color:var(--text-dim); background:var(--bg-card); border:1.5px solid var(--border);
  border-radius:9px; padding:12px 14px; margin-bottom:14px; line-height:1.6; }
.summary-project-badge { background:rgba(43,57,144,0.15); border:1.5px solid var(--blue);
  border-radius:9px; padding:10px 14px; margin-bottom:12px; font-size:14px; font-weight:700; color:#fff;
  display:flex; justify-content:space-between; align-items:center; }
.spb-label { color:var(--text-dim); font-weight:500; font-size:12px; margin-right:6px; }
.spb-loc { font-size:11px; color:var(--blue-light); font-weight:600; }
.summary-product-card { background:var(--bg-card); border:1.5px solid var(--border); border-radius:10px;
  padding:12px 14px; margin-bottom:10px; }
.spc-hdr { font-family:'Rajdhani',sans-serif; font-size:14px; font-weight:700; color:#fff;
  margin-bottom:8px; padding-bottom:6px; border-bottom:1px solid var(--border); }
.spc-row { display:flex; justify-content:space-between; font-size:12px; padding:3px 0; }
.spc-row span:first-child { color:var(--text-dim); }
.spc-row span:last-child  { color:var(--text); font-weight:600; }

/* Existing return */
.ex-return-row { display:flex; justify-content:space-between; align-items:center;
  background:var(--bg-card); border:1.5px solid var(--border); border-radius:8px;
  padding:10px 12px; margin-bottom:8px; }
.ex-return-name { font-size:13px; font-weight:600; color:var(--text); }
.ex-return-sub  { font-size:11px; color:var(--text-dim); margin-top:2px; }
.level-selector-mini { display:flex; gap:4px; }
.level-btn-sm { background:var(--bg-raised); border:1.5px solid var(--border); border-radius:5px;
  padding:4px 8px; font-size:11px; font-weight:700; color:var(--text-dim); cursor:pointer; transition:all .15s; }
.level-btn-sm.active { background:var(--blue); border-color:var(--blue); color:#fff; }
.form-hint { font-size:11px; color:var(--text-faint); line-height:1.5; padding:6px 0; }

/* Hire equipment sides grid */
.hire-sides-grid { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-bottom:12px; }
.hire-side-card { background:var(--bg-card); border:1.5px dashed var(--border-mid); border-radius:10px;
  padding:10px; cursor:pointer; transition:all .15s; min-height:90px;
  display:flex; flex-direction:column; align-items:center; justify-content:center; }
.hire-side-card:hover { border-color:var(--blue-light); }
.hire-side-label { font-size:10px; font-weight:700; letter-spacing:1px; text-transform:uppercase;
  color:var(--text-dim); margin-bottom:6px; }
.hire-side-thumb { width:100%; height:60px; border-radius:6px; font-size:11px; color:var(--text-faint);
  display:flex; align-items:center; justify-content:center; background-size:cover; background-position:center; }

/* Machinery out list */
.machinery-out-row { background:var(--bg-card); border:1.5px solid var(--border); border-radius:8px;
  padding:10px 12px; margin-bottom:8px; }
.mor-name { font-size:14px; font-weight:600; color:#fff; }
.mor-meta { font-size:11px; color:var(--text-dim); margin-top:2px; }
.empty-state-sm { font-size:13px; color:var(--text-faint); padding:12px 0; text-align:center; }

/* Guide overlay */
.guide-btn { background:transparent; border:1px solid var(--blue); color:var(--blue-light);
  border-radius:4px; padding:1px 6px; font-size:10px; font-weight:700; cursor:pointer; margin-left:4px; }
.guide-brand-list { margin:12px 0; }
.guide-brand-row  { display:flex; gap:10px; padding:8px 0; border-bottom:1px solid var(--border); }
.guide-brand-name { font-size:12px; font-weight:700; color:var(--text); min-width:120px; flex-shrink:0; }
.guide-brand-loc  { font-size:12px; color:var(--text-dim); line-height:1.5; }

/* Out-assigned-badge */
#out-reassign-wrap { display:none; }

/* ══════════════════════════════════════════
   QR / BARCODE SCANNER
══════════════════════════════════════════ */

/* Camera viewfinder */
.qr-viewfinder-wrap {
  flex: 1;
  position: relative;
  background: #000;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.qr-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.qr-hint {
  text-align: center;
  font-size: 12px;
  color: var(--blue-light);
  background: rgba(43,57,144,0.15);
  border-bottom: 1px solid rgba(43,57,144,0.2);
  padding: 8px 14px;
  flex-shrink: 0;
}

/* Targeting frame corners */
.qr-frame {
  position: absolute;
  width: 220px;
  height: 220px;
  pointer-events: none;
}
.qr-corner {
  position: absolute;
  width: 28px;
  height: 28px;
  border-color: var(--blue-light);
  border-style: solid;
}
.qr-corner.tl { top:0; left:0; border-width:3px 0 0 3px; }
.qr-corner.tr { top:0; right:0; border-width:3px 3px 0 0; }
.qr-corner.bl { bottom:0; left:0; border-width:0 0 3px 3px; }
.qr-corner.br { bottom:0; right:0; border-width:0 3px 3px 0; }

/* Scanning line animation */
.qr-scanning-line {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 2px;
  background: var(--blue-light);
  box-shadow: 0 0 8px var(--blue-light);
  animation: qr-scan 2s ease-in-out infinite;
}
@keyframes qr-scan {
  0%   { top: calc(50% - 110px); }
  50%  { top: calc(50% + 108px); }
  100% { top: calc(50% - 110px); }
}

/* Result / not found panels */
.qr-result-panel, .qr-notfound-panel {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(13,17,23,0.97);
  border-top: 2px solid var(--blue);
  padding: 18px 16px 20px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  animation: slide-up 0.25s ease;
}
@keyframes slide-up { from { transform:translateY(100%); } to { transform:translateY(0); } }

.qr-result-icon {
  font-size: 36px;
  width: 64px; height: 64px;
  background: rgba(43,57,144,0.2);
  border: 2px solid var(--blue);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.qr-result-name {
  font-family: 'Rajdhani', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  text-align: center;
}
.qr-result-meta {
  font-size: 12px;
  color: var(--text-dim);
}
.qr-use-btn {
  width: 100%;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 9px;
  padding: 14px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  cursor: pointer;
  margin-top: 4px;
}
.qr-retry-btn {
  width: 100%;
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-dim);
  border-radius: 9px;
  padding: 11px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
}

.qr-notfound-icon { font-size: 36px; }
.qr-notfound-text { font-size: 14px; font-weight: 600; color: var(--text); text-align: center; }
.qr-notfound-code { font-size: 11px; color: var(--text-faint); }

/* Footer */
.qr-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  padding-bottom: max(10px, env(safe-area-inset-bottom));
  background: #111827;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.qr-torch-btn {
  background: var(--bg-raised);
  border: 1.5px solid var(--border);
  color: var(--text-mid);
  border-radius: 7px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all .15s;
}
.qr-torch-btn:hover { border-color: var(--blue-light); }
.qr-footer-hint {
  font-size: 10px;
  color: var(--text-faint);
  max-width: 180px;
  text-align: right;
  line-height: 1.4;
}

/* QR scan button (▦ symbol) */
.qr-scan-btn {
  background: rgba(43,57,144,0.15);
  border-color: var(--blue);
  color: var(--blue-light);
  font-size: 16px;
}
.qr-scan-btn:hover { background: var(--blue); color: #fff; }

/* Quick scan bar (tap to open scanner) */
.qr-quick-scan-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(43,57,144,0.1);
  border: 1.5px solid rgba(43,57,144,0.3);
  border-radius: 10px;
  padding: 11px 14px;
  cursor: pointer;
  transition: all .15s;
  margin-bottom: 4px;
}
.qr-quick-scan-bar:hover, .qr-quick-scan-bar:active {
  background: rgba(43,57,144,0.2);
  border-color: var(--blue-light);
}
.qr-qs-icon { font-size: 22px; flex-shrink: 0; color: var(--blue-light); }
.qr-qs-text { flex: 1; font-size: 13px; font-weight: 600; color: var(--text-mid); }
.qr-qs-arrow { color: var(--blue-light); font-size: 16px; font-weight: 700; }
.qr-qs-divider {
  text-align: center;
  font-size: 11px;
  color: var(--text-faint);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin: 6px 0 10px;
  position: relative;
}
.qr-qs-divider::before, .qr-qs-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 35%;
  height: 1px;
  background: var(--border);
}
.qr-qs-divider::before { left: 0; }
.qr-qs-divider::after  { right: 0; }

/* ══════════════════════════════════════════
   CONSUMABLES MODULE
══════════════════════════════════════════ */
.screen-inner-pad { padding: 12px 14px 100px; }
.action-row { display:flex; gap:10px; margin-bottom:16px; }
.action-btn { flex:1; background:var(--bg-card); border:1.5px solid var(--border); border-radius:12px;
  padding:16px 10px; cursor:pointer; transition:all .2s; display:flex; flex-direction:column;
  align-items:center; gap:6px; }
.action-btn:hover { border-color:var(--blue-light); background:var(--bg-raised); }
.action-btn.take   { border-color:rgba(248,113,113,0.3); }
.action-btn.take:hover { border-color:var(--red); background:rgba(248,113,113,0.08); }
.action-btn.return { border-color:rgba(34,197,94,0.3); }
.action-btn.return:hover { border-color:var(--green); background:rgba(34,197,94,0.08); }
.action-icon { font-size:28px; }
.action-label { font-family:'Rajdhani',sans-serif; font-size:14px; font-weight:700;
  color:#fff; letter-spacing:0.5px; }
.section-label-row { display:flex; justify-content:space-between; align-items:center; margin-bottom:10px; }
.section-label { font-family:'Rajdhani',sans-serif; font-size:13px; font-weight:700;
  letter-spacing:1.5px; text-transform:uppercase; color:var(--text-dim); }
.search-sm { flex:1; max-width:160px; background:var(--bg-card); border:1.5px solid var(--border);
  border-radius:7px; padding:6px 10px; font-size:12px; color:var(--text); outline:none; }
.cat-block  { margin-bottom:14px; }
.cat-header { font-family:'Rajdhani',sans-serif; font-size:12px; font-weight:700; letter-spacing:1.5px;
  text-transform:uppercase; color:var(--text-dim); padding:4px 0 6px;
  border-bottom:1px solid var(--border); margin-bottom:6px; }
.stock-item-row { background:var(--bg-card); border:1.5px solid var(--border); border-radius:8px;
  padding:9px 12px; margin-bottom:6px; }
.sir-info { display:flex; justify-content:space-between; align-items:baseline; margin-bottom:5px; }
.sir-name { font-size:13px; font-weight:600; color:var(--text); }
.sir-stock { font-size:12px; font-weight:700; }
.sir-stock.stock-ok   { color:var(--green); }
.sir-stock.stock-low  { color:var(--orange); }
.sir-stock.stock-zero { color:var(--red); }
.sir-bar-wrap { background:var(--border); border-radius:4px; height:5px; overflow:hidden; }
.sir-bar { height:100%; border-radius:4px; transition:width .3s; }
.sir-bar.stock-ok   { background:var(--green); }
.sir-bar.stock-low  { background:var(--orange); }
.sir-bar.stock-zero { background:var(--red); width:0!important; }
.stock-hint { font-size:11px; margin-top:4px; font-weight:600; }
.hint-low   { color:var(--orange); }
.hint-zero  { color:var(--red); }
.auto-field { background:var(--bg-raised); border:1.5px solid var(--border); border-radius:7px;
  height:40px; display:flex; align-items:center; padding:0 11px; font-size:13px; color:var(--text-mid); }

/* QR item badge (shown after scan) */
.qr-item-badge { background:rgba(43,57,144,0.15); border:1.5px solid var(--blue); border-radius:8px;
  padding:8px 12px; font-size:13px; font-weight:600; color:var(--blue-light); margin-top:6px; }

/* QR on success screen */
.suc-qr-label { font-size:12px; color:var(--text-dim); margin-bottom:6px; }
#suc-qr-canvas { border-radius:8px; }

/* ══════════════════════════════════════════
   LOGO HOME BUTTON
══════════════════════════════════════════ */
.hdr-logo-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1;
  flex-shrink: 0;
}
.hdr-logo-btn .hdr-co {
  font-family: 'Rajdhani', sans-serif;
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 3px;
  text-transform: uppercase;
  line-height: 1;
}
.hdr-logo-btn .hdr-co-sub {
  font-family: 'Rajdhani', sans-serif;
  font-size: 9px;
  font-weight: 600;
  color: var(--blue-light);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-top: 1px;
}
.hdr-logo-btn:active { opacity: 0.75; }

/* ══════════════════════════════════════════
   COATING LOG DRAWING LIGHTBOX — FULLSCREEN
══════════════════════════════════════════ */
.cal-lightbox-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 9999;
  flex-direction: column;
}
.cal-lightbox-overlay.open {
  display: flex;
}
.cal-lightbox-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: #111827;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  flex-shrink: 0;
}
.cal-lb-close-btn {
  background: rgba(255,255,255,0.1);
  border: none;
  color: #fff;
  border-radius: 8px;
  width: 36px;
  height: 36px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cal-lb-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cal-lightbox-body {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cal-lb-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: none;
}
.cal-lb-iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  display: none;
}
.cal-lightbox-footer {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  background: #111827;
  border-top: 1px solid rgba(255,255,255,0.1);
  flex-shrink: 0;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
}
.cal-lb-confirm-btn {
  flex: 1;
  background: #22c55e;
  border: none;
  color: #fff;
  border-radius: 9px;
  padding: 13px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.cal-lb-back-btn {
  background: rgba(255,255,255,0.1);
  border: none;
  color: #fff;
  border-radius: 9px;
  padding: 13px 16px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

/* ══════════════════════════════════════════
   NOTIFICATION BADGE + BELL
══════════════════════════════════════════ */
.hdr-notif-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  position: relative;
  padding: 4px 6px;
  display: flex;
  align-items: center;
}
.notif-badge {
  position: absolute;
  top: 0;
  right: 0;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 10px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ══════════════════════════════════════════
   NOTIFICATION CARDS
══════════════════════════════════════════ */
.notif-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: border-color .15s;
}
.notif-card:active { border-color: var(--blue); }
.notif-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.notif-type {
  font-family: 'Rajdhani', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.notif-status {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.notif-project {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 2px;
}
.notif-meta {
  font-size: 11px;
  color: var(--text-faint);
}
.notif-action {
  font-size: 12px;
  color: var(--blue-light);
  margin-top: 6px;
  font-weight: 600;
}

/* ══════════════════════════════════════════
   APPROVAL REVIEW
══════════════════════════════════════════ */
.review-header {
  background: var(--bg-raised);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 14px;
  border: 1.5px solid var(--border);
}
.review-type {
  font-family: 'Rajdhani', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}
.review-project { font-size: 14px; color: var(--blue-light); margin: 2px 0; }
.review-meta    { font-size: 12px; color: var(--text-dim); }
.review-body    { margin-bottom: 80px; }
.review-row {
  display: flex;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.review-k { color: var(--text-dim); flex: 0 0 140px; }
.review-v { color: var(--text); flex: 1; }
.approval-action-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  display: flex;
  /* The busy indicator is injected here as a full-width row when an
     approve/decline is in flight; without wrapping it would squash the
     two buttons instead of sitting above them. */
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 16px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  z-index: 50;
}
.screen:not(.active) .approval-action-bar { display: none !important; }
.btn-approve {
  flex: 1;
  background: #22c55e;
  border: none;
  color: #fff;
  border-radius: 9px;
  padding: 13px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.btn-decline {
  flex: 1;
  background: #ef4444;
  border: none;
  color: #fff;
  border-radius: 9px;
  padding: 13px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

/* ══════════════════════════════════════════
   BUSY / PROCESSING INDICATOR
   Shared 3-state feedback (idle / busy / delayed)
   driven by Busy.begin() in portal.js.
   Injected as the first row of a .submit-bar,
   so it stays visible on the sticky bar.
══════════════════════════════════════════ */
.submit-bar-busy { flex-wrap: wrap; }

.busy-indicator {
  flex: 0 0 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(43,57,144,0.12);
  border: 1.5px solid var(--border-mid);
  border-radius: 9px;
  padding: 9px 12px;
}

.busy-spinner {
  width: 18px; height: 18px;
  border: 2.5px solid var(--border);
  border-top-color: var(--blue-light);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

.busy-text {
  flex: 1;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-mid);
  line-height: 1.4;
}

.busy-retry {
  flex-shrink: 0;
  background: transparent;
  border: 1.5px solid var(--orange);
  color: var(--orange);
  border-radius: 8px;
  padding: 6px 14px;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all .15s;
}
.busy-retry:hover { background: var(--orange); color: #fff; }

/* Delayed state -- still running, but past the wait threshold. */
.busy-indicator.is-delayed {
  background: rgba(249,115,22,0.10);
  border-color: rgba(249,115,22,0.45);
}
.busy-indicator.is-delayed .busy-spinner { border-top-color: var(--orange); }
.busy-indicator.is-delayed .busy-text    { color: var(--orange); }

/* Safety Archives injects the indicator straight into a screen/list
   container rather than a .submit-bar (there is no submit bar on those
   screens -- the user taps a card or a row). It needs the same gap the
   cards and rows around it already use. */
.screen-inner > .busy-indicator,
#sds-file-list > .busy-indicator { margin-bottom: 8px; }

/* Frozen while an action is in flight. Kept distinct from
   .form-body-locked (the zone-confirmation lock) so the two never
   fight over the same class. */
.busy-locked {
  opacity: 0.5;
  pointer-events: none;
  user-select: none;
  transition: opacity .2s;
}

@media (prefers-reduced-motion: reduce) {
  .busy-spinner { animation-duration: 2.4s; }
}
