:root {
  --bg: #f3f7fc;
  --surface: #ffffff;
  --surface-2: #edf4fc;
  --surface-3: #e3edf9;
  --ink: #132a44;
  --muted: #60758d;
  --line: #d7e3f1;
  --brand: #1468d4;
  --brand-strong: #0b4697;
  --brand-soft: #e1efff;
  --accent: #5b5ce2;
  --accent-soft: #ececff;
  --danger: #b84242;
  --danger-soft: #fde9e9;
  --success: #257a4a;
  --success-soft: #e2f4e9;
  --warning: #9b6519;
  --warning-soft: #fff1d7;
  --info: #315f9e;
  --info-soft: #e8f0fc;
  --shadow: 0 16px 38px rgba(20, 74, 140, .10);
  --shadow-soft: 0 6px 18px rgba(20, 74, 140, .07);
  --radius: 18px;
  --radius-sm: 12px;
  --sidebar: 270px;
  --header: 76px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

[data-theme="dark"] {
  --bg: #081426;
  --surface: #0e2038;
  --surface-2: #142a47;
  --surface-3: #1a3557;
  --ink: #edf5ff;
  --muted: #9eb2ca;
  --line: #294465;
  --brand: #65a7ff;
  --brand-strong: #a7ccff;
  --brand-soft: #17375f;
  --accent: #9899ff;
  --accent-soft: #292b5d;
  --danger: #ef7d7d;
  --danger-soft: #3b2121;
  --success: #6fd293;
  --success-soft: #1d3928;
  --warning: #f0bc61;
  --warning-soft: #392e1b;
  --info: #86b3ef;
  --info-soft: #1f3048;
  --shadow: 0 16px 40px rgba(0, 0, 0, .30);
  --shadow-soft: 0 5px 18px rgba(0, 0, 0, .20);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

.boot-screen {
  min-height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  color: var(--muted);
}
.boot-screen strong { color: var(--ink); font-size: 25px; }
.boot-screen p { margin: 0; }

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px 12px 12px 4px;
  background: linear-gradient(145deg, var(--brand), var(--brand-strong));
  color: white;
  font-weight: 850;
  box-shadow: 0 8px 20px rgba(20, 104, 212, .24);
}
.brand-mark.large { width: 58px; height: 58px; font-size: 24px; border-radius: 17px 17px 17px 6px; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar) 1fr; }
.sidebar {
  position: fixed;
  z-index: 50;
  inset: 0 auto 0 0;
  width: var(--sidebar);
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  transition: transform .25s ease;
}
.sidebar-head {
  min-height: var(--header);
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
}
.brand-copy { min-width: 0; }
.brand-copy strong { display: block; font-size: 18px; letter-spacing: -.03em; }
.brand-copy small { display: block; color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.condo-switcher { margin: 14px 14px 8px; padding: 11px 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; }
.condo-switcher label { display: block; color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 4px; }
.condo-switcher select { width: 100%; border: 0; outline: 0; color: var(--ink); background: transparent; font-weight: 700; cursor: pointer; }

.nav-scroll { flex: 1; overflow: auto; padding: 6px 10px 16px; }
.nav-group { margin-top: 15px; }
.nav-label { padding: 0 10px 6px; color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; }
.nav-item {
  width: 100%; border: 0; background: transparent; display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: 11px; color: var(--muted); cursor: pointer; text-align: left; transition: .16s ease;
}
.nav-item:hover { background: var(--surface-2); color: var(--ink); }
.nav-item.active { background: var(--brand-soft); color: var(--brand-strong); font-weight: 750; }
.nav-icon { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 8px; background: color-mix(in srgb, currentColor 10%, transparent); font-size: 12px; font-weight: 850; }
.nav-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; display: grid; place-items: center; background: var(--danger-soft); color: var(--danger); border-radius: 999px; font-size: 10px; font-weight: 800; }

.sidebar-foot { padding: 12px; border-top: 1px solid var(--line); }
.mode-switch { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--surface-2); padding: 4px; border-radius: 12px; gap: 3px; }
.mode-btn { border: 0; background: transparent; border-radius: 9px; padding: 7px 4px; font-size: 10px; color: var(--muted); cursor: pointer; }
.mode-btn.active { background: var(--surface); box-shadow: var(--shadow-soft); color: var(--ink); font-weight: 750; }

.main-shell { grid-column: 2; min-width: 0; }
.topbar {
  height: var(--header); position: sticky; z-index: 30; top: 0; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px); border-bottom: 1px solid color-mix(in srgb, var(--line) 75%, transparent);
  display: flex; align-items: center; gap: 14px; padding: 0 26px;
}
.mobile-menu { display: none; }
.search-box { flex: 1; max-width: 480px; position: relative; }
.search-box input { width: 100%; height: 42px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); color: var(--ink); padding: 0 42px 0 15px; outline: none; }
.search-box input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.search-hint { position: absolute; right: 10px; top: 9px; border: 1px solid var(--line); color: var(--muted); background: var(--surface-2); border-radius: 6px; padding: 2px 6px; font-size: 10px; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; transition: .16s; }
.icon-btn:hover { transform: translateY(-1px); border-color: var(--brand); }
.avatar { width: 38px; height: 38px; display: grid; place-items: center; overflow: hidden; background: var(--brand-soft); color: var(--brand-strong); font-weight: 850; border-radius: 12px; border: 1px solid var(--line); }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.user-chip { display: flex; align-items: center; gap: 9px; padding-left: 5px; }
.user-copy strong { display: block; font-size: 12px; }
.user-copy small { color: var(--muted); font-size: 10px; }

.page { padding: 26px; max-width: 1560px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.page-title { margin: 0; font-size: clamp(24px, 3vw, 32px); line-height: 1.15; letter-spacing: -.04em; }
.page-subtitle { margin: 7px 0 0; color: var(--muted); max-width: 720px; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.btn { min-height: 40px; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 0 14px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; font-weight: 720; transition: .16s ease; }
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-soft); }
.btn.primary { background: var(--brand); color: white; border-color: var(--brand); }
.btn.secondary { background: var(--brand-soft); color: var(--brand-strong); border-color: transparent; }
.btn.danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.small { min-height: 32px; padding: 0 10px; border-radius: 9px; font-size: 12px; }
.btn.block { width: 100%; }

.grid { display: grid; gap: 16px; }
.grid.kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.auto { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-soft); min-width: 0; }
.card.pad { padding: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 17px 18px 12px; }
.card-head h2, .card-head h3 { margin: 0; font-size: 15px; letter-spacing: -.02em; }
.card-body { padding: 0 18px 18px; }
.card-link { color: var(--brand); font-weight: 750; font-size: 12px; cursor: pointer; border: 0; background: transparent; }

.kpi { padding: 17px; display: grid; grid-template-columns: 1fr auto; gap: 12px; }
.kpi-label { color: var(--muted); font-size: 12px; }
.kpi-value { font-size: 28px; line-height: 1.1; letter-spacing: -.04em; font-weight: 850; margin-top: 7px; }
.kpi-meta { margin-top: 8px; font-size: 11px; color: var(--muted); }
.kpi-meta.positive { color: var(--success); }
.kpi-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; background: var(--brand-soft); color: var(--brand-strong); font-weight: 850; }

.hero-card { overflow: hidden; position: relative; padding: 24px; min-height: 190px; background: linear-gradient(135deg, var(--brand-strong), var(--brand)); color: white; border: 0; }
.hero-card::after { content: ''; position: absolute; width: 230px; height: 230px; border: 45px solid rgba(255,255,255,.07); border-radius: 50%; right: -75px; top: -92px; }
.hero-card > * { position: relative; z-index: 1; }
.hero-card .eyebrow { color: rgba(255,255,255,.72); }
.hero-card h2 { font-size: 26px; max-width: 580px; margin: 8px 0 9px; letter-spacing: -.04em; }
.hero-card p { max-width: 610px; color: rgba(255,255,255,.78); margin: 0 0 18px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.hero-actions .btn { border-color: rgba(255,255,255,.2); background: rgba(255,255,255,.12); color: white; backdrop-filter: blur(5px); }
.hero-actions .btn.primary { background: white; color: var(--brand-strong); }

.eyebrow { color: var(--brand); text-transform: uppercase; font-size: 10px; font-weight: 850; letter-spacing: .12em; }
.muted { color: var(--muted); }
.tiny { font-size: 11px; }

.progress { height: 8px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), #5b8def); border-radius: inherit; }
.progress-row { display: grid; gap: 8px; margin-top: 14px; }
.progress-meta { display: flex; justify-content: space-between; gap: 12px; font-size: 11px; color: var(--muted); }

.list { display: grid; gap: 10px; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.list-icon { flex: 0 0 38px; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: var(--surface-2); font-weight: 850; color: var(--brand-strong); }
.list-copy { min-width: 0; flex: 1; }
.list-copy strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-copy small { color: var(--muted); }
.list-actions { display: flex; gap: 6px; align-items: center; }

.badge { display: inline-flex; align-items: center; gap: 5px; min-height: 24px; padding: 0 8px; border-radius: 999px; font-size: 10px; font-weight: 800; white-space: nowrap; background: var(--surface-2); color: var(--muted); }
.badge.success { background: var(--success-soft); color: var(--success); }
.badge.warning { background: var(--warning-soft); color: var(--warning); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.brand { background: var(--brand-soft); color: var(--brand-strong); }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .75; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.toolbar-left, .toolbar-right { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.input, .select, .textarea { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 11px; outline: none; width: 100%; }
.input, .select { min-height: 40px; padding: 0 12px; }
.textarea { min-height: 105px; resize: vertical; padding: 10px 12px; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.toolbar .input { width: min(320px, 100%); }

.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 14px; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th { background: var(--surface-2); color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; text-align: left; padding: 11px 13px; }
td { padding: 13px; border-top: 1px solid var(--line); vertical-align: middle; }
tr:hover td { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.person { display: flex; align-items: center; gap: 10px; }
.person-avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: var(--brand-soft); color: var(--brand-strong); font-weight: 850; font-size: 11px; }
.person strong { display: block; }
.person small { color: var(--muted); }

.module-card { padding: 17px; display: flex; flex-direction: column; gap: 12px; }
.module-card .module-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.module-card h3 { margin: 0; font-size: 15px; }
.module-card p { color: var(--muted); margin: 0; font-size: 12px; }
.module-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; background: var(--brand-soft); color: var(--brand-strong); font-weight: 850; }
.module-footer { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.check-list { display: grid; gap: 8px; }
.check-row { display: flex; align-items: center; gap: 11px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.check-row.done { opacity: .7; background: var(--success-soft); }
.check-toggle { width: 24px; height: 24px; border: 2px solid var(--line); border-radius: 8px; background: var(--surface); cursor: pointer; display: grid; place-items: center; color: white; }
.check-row.done .check-toggle { background: var(--success); border-color: var(--success); }
.check-copy { flex: 1; }
.check-copy strong { display: block; }
.check-copy small { color: var(--muted); }

.timeline { position: relative; display: grid; gap: 14px; }
.timeline::before { content: ''; position: absolute; top: 10px; bottom: 10px; left: 11px; width: 1px; background: var(--line); }
.timeline-item { display: grid; grid-template-columns: 24px 1fr; gap: 10px; position: relative; }
.timeline-dot { width: 23px; height: 23px; border: 5px solid var(--surface); background: var(--brand); border-radius: 50%; box-shadow: 0 0 0 1px var(--line); }
.timeline-copy { padding-bottom: 4px; }
.timeline-copy strong { display: block; font-size: 12px; }
.timeline-copy small { color: var(--muted); }

.chart { display: flex; align-items: end; gap: 9px; min-height: 170px; padding-top: 18px; }
.chart-col { flex: 1; display: grid; grid-template-rows: 1fr auto; gap: 8px; height: 155px; text-align: center; color: var(--muted); font-size: 10px; }
.chart-bar-wrap { display: flex; align-items: end; height: 100%; background: linear-gradient(to top, var(--line) 1px, transparent 1px); background-size: 100% 25%; border-radius: 9px 9px 0 0; }
.chart-bar { width: 100%; min-height: 5px; border-radius: 8px 8px 3px 3px; background: linear-gradient(to top, var(--brand), #7caeff); position: relative; }
.chart-bar span { position: absolute; top: -20px; left: 50%; transform: translateX(-50%); color: var(--ink); font-weight: 800; }

.empty { padding: 42px 20px; text-align: center; color: var(--muted); }
.empty-icon { width: 52px; height: 52px; display: grid; place-items: center; margin: 0 auto 12px; background: var(--surface-2); color: var(--brand); border-radius: 17px; font-size: 19px; font-weight: 850; }
.empty h3 { color: var(--ink); margin: 0 0 5px; }
.empty p { margin: 0 auto 15px; max-width: 420px; }

.tabs { display: flex; gap: 5px; background: var(--surface-2); padding: 4px; border-radius: 12px; width: max-content; max-width: 100%; overflow: auto; }
.tab { border: 0; background: transparent; color: var(--muted); border-radius: 9px; padding: 8px 12px; white-space: nowrap; cursor: pointer; }
.tab.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-soft); font-weight: 750; }

.alert { padding: 13px 14px; border-radius: 13px; border: 1px solid var(--line); display: flex; gap: 11px; align-items: flex-start; }
.alert.warning { background: var(--warning-soft); color: var(--warning); border-color: transparent; }
.alert.info { background: var(--info-soft); color: var(--info); border-color: transparent; }
.alert.success { background: var(--success-soft); color: var(--success); border-color: transparent; }
.alert strong { display: block; }
.alert p { margin: 2px 0 0; color: inherit; opacity: .82; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.field { display: grid; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 11px; font-weight: 800; color: var(--muted); }
.field-help { color: var(--muted); font-size: 10px; }

.modal-backdrop { position: fixed; z-index: 100; inset: 0; background: rgba(5, 20, 17, .55); backdrop-filter: blur(5px); display: grid; place-items: center; padding: 18px; animation: fadeIn .15s ease; }
.modal { width: min(620px, 100%); max-height: min(88vh, 820px); overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 30px 80px rgba(0,0,0,.28); animation: rise .2s ease; }
.modal-head { position: sticky; top: 0; z-index: 2; background: var(--surface); display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 19px; }
.modal-head p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.modal-body { padding: 18px; }
.modal-foot { position: sticky; bottom: 0; background: var(--surface); display: flex; justify-content: flex-end; gap: 8px; padding: 14px 18px; border-top: 1px solid var(--line); }

.toast-root, #toast-root { position: fixed; z-index: 200; right: 18px; bottom: 18px; display: grid; gap: 8px; }
.toast { min-width: min(360px, calc(100vw - 36px)); max-width: 420px; background: var(--ink); color: var(--surface); padding: 12px 14px; border-radius: 12px; box-shadow: var(--shadow); animation: toastIn .2s ease; }
.toast.success { background: var(--success); color: white; }
.toast.warning { background: var(--warning); color: white; }
.toast.danger { background: var(--danger); color: white; }

.public-shell { min-height: 100vh; background: linear-gradient(180deg, #e6f0ff 0, var(--bg) 42%); padding: 22px; }
.public-top { max-width: 920px; margin: 0 auto 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.public-brand { display: flex; align-items: center; gap: 10px; }
.public-card { max-width: 920px; margin: 0 auto; overflow: hidden; }
.public-cover { padding: 44px clamp(22px, 7vw, 64px); background: linear-gradient(135deg, var(--brand-strong), var(--brand)); color: white; }
.public-cover h1 { font-size: clamp(30px, 7vw, 54px); letter-spacing: -.055em; line-height: 1.05; max-width: 720px; margin: 12px 0; }
.public-cover p { font-size: 16px; max-width: 680px; color: rgba(255,255,255,.8); }
.public-content { padding: clamp(22px, 6vw, 54px); }
.public-content .lead { font-size: 17px; line-height: 1.75; white-space: pre-line; }
.public-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 24px; }

.portal-shell { min-height: 100vh; background: var(--bg); }
.portal-header { padding: 22px max(18px, calc((100vw - 1160px)/2)); background: linear-gradient(135deg, var(--brand-strong), var(--brand)); color: white; }
.portal-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.portal-welcome { margin-top: 34px; }
.portal-welcome h1 { margin: 5px 0; font-size: clamp(27px, 5vw, 42px); letter-spacing: -.045em; }
.portal-welcome p { margin: 0; color: rgba(255,255,255,.75); }
.portal-main { max-width: 1160px; margin: -20px auto 0; padding: 0 18px 90px; position: relative; }
.quick-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; }
.quick-card { border: 1px solid var(--line); background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-soft); padding: 15px; cursor: pointer; text-align: left; }
.quick-card strong { display: block; margin-top: 11px; }
.quick-card small { color: var(--muted); }
.quick-card .module-icon { width: 36px; height: 36px; }
.portal-bottom-nav { display: none; }

.operation-shell { min-height: 100vh; background: #eaf1fb; }
.operation-head { position: sticky; top: 0; z-index: 30; padding: 14px 18px; background: var(--brand-strong); color: white; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.operation-main { max-width: 860px; margin: 0 auto; padding: 18px 16px 80px; }
.shift-card { background: linear-gradient(135deg, var(--brand-strong), var(--brand)); color: white; border: 0; }
.shift-card .muted { color: rgba(255,255,255,.72); }
.task-stack { display: grid; gap: 11px; }
.task-card { background: var(--surface); border: 1px solid var(--line); border-radius: 15px; padding: 14px; display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; }
.task-priority { width: 7px; align-self: stretch; border-radius: 999px; background: var(--brand); }
.task-priority.high { background: var(--danger); }
.task-priority.medium { background: var(--warning); }

.lucide-icon { display: block; flex: 0 0 auto; }
.nav-icon .lucide-icon, .kpi-icon .lucide-icon, .module-icon .lucide-icon, .list-icon .lucide-icon { width: 100%; max-width: 21px; height: auto; }
.btn .lucide-icon, .tab .lucide-icon, .badge .lucide-icon { margin-right: 1px; }
.search-leading { position: absolute; z-index: 1; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-box input { padding-left: 40px; }
.employee-avatar, .vendor-avatar, .table-avatar { object-fit: cover; background: var(--brand-soft); border: 1px solid var(--line); box-shadow: 0 4px 12px rgba(20, 74, 140, .08); }
.employee-avatar { width: 38px; height: 38px; border-radius: 12px; flex: 0 0 38px; }
.task-avatar { width: 42px; height: 42px; border-radius: 13px; }
.vendor-identity { min-width: 0; display: flex; align-items: center; gap: 12px; }
.vendor-identity > div { min-width: 0; }
.vendor-avatar { width: 52px; height: 52px; border-radius: 16px; flex: 0 0 52px; }
.table-avatar { width: 36px; height: 36px; border-radius: 11px; flex: 0 0 36px; }
.compact-person { min-width: 190px; }
.compact-person strong, .compact-person small { display: block; }
.compact-person small { color: var(--muted); font-size: 10px; }
.compact-owner { min-width: 0; }
.compact-owner strong, .compact-owner small { display: block; }
.compact-owner small { color: var(--muted); font-size: 10px; }
.contact-inline { display: inline-flex; align-items: center; gap: 5px; }
.tab { display: inline-flex; align-items: center; gap: 6px; }
.eyebrow .lucide-icon { display: inline-block; vertical-align: -2px; margin-right: 4px; }
.task-card { grid-template-columns: auto auto minmax(0, 1fr) auto; }
.task-title-row { display: flex; align-items: center; gap: 7px; }
.task-title-row span { color: var(--brand); }

.mobile-backdrop { display: none; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (max-width: 1180px) {
  .grid.kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  :root { --sidebar: 280px; }
  .app-shell { display: block; }
  .sidebar { transform: translateX(-103%); box-shadow: var(--shadow); }
  .sidebar.open { transform: translateX(0); }
  .main-shell { grid-column: auto; }
  .mobile-menu { display: grid; }
  .mobile-backdrop { position: fixed; z-index: 45; inset: 0; background: rgba(5,20,17,.4); backdrop-filter: blur(2px); }
  .mobile-backdrop.show { display: block; }
  .topbar { padding: 0 16px; }
  .user-copy { display: none; }
  .page { padding: 20px 16px; }
  .grid.two { grid-template-columns: 1fr; }
  .quick-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 640px) {
  .topbar { height: 66px; }
  .search-box { display: none; }
  .page { padding-top: 17px; }
  .page-head { display: grid; }
  .page-actions .btn { flex: 1; }
  .grid.kpis, .grid.three { grid-template-columns: 1fr; }
  .kpi { grid-template-columns: 1fr auto; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .toolbar-left, .toolbar-right { width: 100%; }
  .toolbar .input, .toolbar .select { width: 100%; }
  .form-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .modal-backdrop { padding: 0; place-items: end center; }
  .modal { width: 100%; max-height: 92vh; border-radius: 20px 20px 0 0; }
  .public-shell { padding: 0; }
  .public-top { padding: 14px 16px; margin: 0; }
  .public-card { border-radius: 0; border-left: 0; border-right: 0; }
  .portal-main { padding-bottom: 100px; }
  .portal-bottom-nav { position: fixed; z-index: 40; left: 10px; right: 10px; bottom: 10px; display: grid; grid-template-columns: repeat(4,1fr); padding: 5px; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(12px); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
  .portal-bottom-nav button { border: 0; background: transparent; color: var(--muted); padding: 7px 3px; font-size: 10px; border-radius: 10px; }
  .portal-bottom-nav button.active { background: var(--brand-soft); color: var(--brand-strong); font-weight: 750; }
  .operation-main { padding-left: 12px; padding-right: 12px; }
  .task-card { grid-template-columns: auto auto minmax(0, 1fr); }
  .task-card > .btn { grid-column: 2 / 4; justify-self: start; }
  .task-priority { grid-row: 1 / 3; }
  .task-avatar { width: 38px; height: 38px; }
}

.product-tabs { width: 100%; }
.showcase-intro h2, .investor-hero h2, .pitch-card h2 { margin: 7px 0 8px; letter-spacing: -.035em; }
.showcase-highlights, .source-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.showcase-browser { overflow: hidden; }
.showcase-toolbar { min-height: 54px; display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.browser-dots { display: flex; gap: 6px; }
.browser-dots span { width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
.browser-dots span:first-child { background: #ef6a6a; }
.browser-dots span:nth-child(2) { background: #e9b949; }
.browser-dots span:last-child { background: #55b985; }
.showcase-address { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--muted); font-size: 11px; }
.showcase-frame { display: block; width: 100%; min-height: 760px; border: 0; background: var(--bg); }
.showcase-frame.mobile-product { width: min(430px, 100%); min-height: 820px; margin: 24px auto; border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); }

.investor-hero { overflow: hidden; position: relative; padding: clamp(24px, 5vw, 48px); background: radial-gradient(circle at 88% 12%, rgba(255,255,255,.18), transparent 28%), linear-gradient(135deg, #083f8f, var(--brand) 58%, #4d72e8); color: white; border: 0; }
.investor-hero .eyebrow, .investor-hero p { color: rgba(255,255,255,.78); }
.investor-hero h2 { max-width: 780px; font-size: clamp(30px, 5vw, 54px); line-height: 1.03; }
.investor-hero p { max-width: 800px; font-size: 16px; }
.automation-hero h2 { max-width: 900px; }
.automation-card { min-height: 230px; }
.automation-flow { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin: 20px 0; }
.automation-flow span { padding: 11px 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); font-weight: 750; }
.automation-flow b { color: var(--brand); }
.pitch-card blockquote { margin: 16px 0 0; padding: 0 0 0 20px; border-left: 4px solid var(--brand); font-size: clamp(17px, 2.5vw, 23px); line-height: 1.65; letter-spacing: -.018em; }
.sources-card a { color: var(--brand); font-weight: 750; padding: 8px 10px; border-radius: 9px; background: var(--brand-soft); }
.sources-card a:hover { color: var(--brand-strong); }
code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .9em; padding: 2px 5px; border-radius: 6px; background: var(--surface-2); }

@media (max-width: 900px) {
  .showcase-frame { min-height: 680px; }
}

@media (max-width: 640px) {
  .showcase-toolbar { grid-template-columns: auto minmax(0,1fr); }
  .showcase-toolbar .btn { grid-column: 1 / -1; width: 100%; }
  .showcase-frame { min-height: 620px; }
  .showcase-frame.mobile-product { width: 100%; min-height: 760px; margin: 0; border: 0; border-radius: 0; box-shadow: none; }
  .investor-hero { border-radius: 16px; }
  .automation-flow { display: grid; }
  .automation-flow b { transform: rotate(90deg); justify-self: center; }
}

.resident-grid { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.resident-card { padding: 18px; display: grid; gap: 16px; }
.resident-card-top { display: grid; grid-template-columns: 68px 1fr; gap: 14px; align-items: center; }
.resident-card-top img { width: 68px; height: 68px; object-fit: cover; border-radius: 20px; border: 1px solid var(--line); background: var(--brand-soft); }
.resident-card-top h3 { margin: 3px 0 2px; font-size: 17px; }
.resident-card-top p { margin: 0; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.resident-tags { display: flex; flex-wrap: wrap; gap: 7px; }
.resident-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.resident-stats span { padding: 9px; border-radius: 11px; background: var(--surface-2); color: var(--muted); font-size: 10px; display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.resident-stats span .lucide-icon { color: var(--brand); }
.resident-stats strong { display: inline; color: var(--ink); font-size: 13px; }
.resident-hero { display: flex; align-items: center; gap: 18px; }
.resident-hero > img { width: 88px; height: 88px; flex: 0 0 88px; object-fit: cover; border-radius: 26px; border: 2px solid rgba(255,255,255,.45); background: rgba(255,255,255,.16); box-shadow: 0 14px 34px rgba(0,0,0,.18); }
.resident-hero-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.resident-hero-tags .badge { background: rgba(255,255,255,.16); color: white; backdrop-filter: blur(8px); }
.resident-profile-person { align-items: center; }
.profile-avatar { width: 64px; height: 64px; object-fit: cover; border-radius: 19px; border: 1px solid var(--line); background: var(--brand-soft); }

.identity-grid { display: grid; gap: 10px; }
.identity-card { display: grid; grid-template-columns: 48px minmax(0,1fr) auto; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.identity-symbol { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px; background: var(--brand-soft); font-size: 24px; }
.identity-copy { min-width: 0; }
.identity-copy strong, .identity-copy small, .identity-copy span { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.identity-copy small, .identity-copy span { color: var(--muted); font-size: 11px; }
.identity-actions { display: grid; justify-items: end; gap: 6px; }

.visual-card { overflow: hidden; display: flex; flex-direction: column; }
.visual-thumb { min-height: 190px; position: relative; overflow: hidden; background: var(--surface-2); }
.visual-thumb img { width: 100%; height: 100%; min-height: 190px; max-height: 250px; display: block; object-fit: cover; transition: transform .28s ease; }
.visual-card:hover .visual-thumb img { transform: scale(1.025); }
.visual-overlay { position: absolute; inset: auto 12px 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.visual-content { padding: 17px; display: grid; gap: 10px; flex: 1; }
.visual-content h3 { margin: 0; font-size: 18px; }
.visual-content p { margin: 0; color: var(--muted); }
.visual-meta { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; }
.visual-meta span { padding: 10px; border: 1px solid var(--line); border-radius: 11px; color: var(--muted); font-size: 10px; overflow: hidden; }
.visual-meta strong { display: block; color: var(--ink); font-size: 11px; margin-bottom: 2px; }
.integration-card { min-height: 100%; }
.accounting-cycle { padding: 14px 0; border-bottom: 1px solid var(--line); }
.accounting-cycle:last-child { border-bottom: 0; }
.accounting-cycle h3 { margin: 4px 0; }

@media (max-width: 640px) {
  .resident-card-top { grid-template-columns: 56px 1fr; }
  .resident-card-top img { width: 56px; height: 56px; border-radius: 16px; }
  .resident-stats, .visual-meta { grid-template-columns: 1fr; }
  .identity-card { grid-template-columns: 42px minmax(0,1fr); }
  .identity-symbol { width: 42px; height: 42px; font-size: 21px; }
  .identity-actions { grid-column: 2; display: flex; justify-items: start; justify-content: flex-start; }
  .visual-thumb, .visual-thumb img { min-height: 175px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

/* Mobile navigation and list containment hardening */
@media (max-width: 640px) {
  html, body, .app-shell, .main-shell, .page, .card { max-width: 100%; }
  body { overflow-x: hidden; }
  .card-head { align-items: flex-start; flex-wrap: wrap; }
  .card-head > * { min-width: 0; }
  .card-link { margin-left: 0; }
  .list-item { align-items: flex-start; flex-wrap: wrap; }
  .list-copy { flex: 1 1 calc(100% - 50px); }
  .list-copy strong { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }
  .list-copy small { display: block; overflow-wrap: anywhere; }
  .list-actions { flex: 1 0 100%; width: 100%; padding-left: 50px; flex-wrap: wrap; justify-content: flex-start; }
  .list-actions .badge { max-width: 100%; white-space: normal; text-align: left; }
  .list-actions .btn { max-width: 100%; }
  .table-wrap { max-width: 100%; -webkit-overflow-scrolling: touch; }
  .module-footer { align-items: flex-start; flex-wrap: wrap; }
  .identity-actions { max-width: 100%; flex-wrap: wrap; }
}
@media (max-width: 390px) {
  .page { padding-left: 12px; padding-right: 12px; }
  .card-head, .card-body, .card.pad { padding-left: 14px; padding-right: 14px; }
  .list-actions { padding-left: 0; }
  .list-actions .btn { flex: 1 1 auto; }
}

/* QA Lab 2026-08-07: WCAG-friendly touch targets for touch layouts */
@media (max-width: 900px) {
  .mode-btn,
  .btn,
  .btn.small,
  .card-link,
  .portal-bottom-nav button {
    min-height: 44px;
  }
  .icon-btn {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
  }
  .card-link {
    display: inline-flex;
    align-items: center;
    padding-top: 6px;
    padding-bottom: 6px;
  }
}
