/* Excelloite ERP — extensions to the FleetFlow template (loaded after responsive.css).
   Only adds what the template lacks; every value reuses the --ff-* tokens from style.css. */

/* ==========================================================================
   Sidebar: collapsible module groups
   ========================================================================== */
/* Two levels: module titles (icon + name) and their pages as a compact indented list. */
:root { --sidebar-w: 256px; }
.sidebar { padding: 18px 12px; }
.sb-nav { display: flex; flex-direction: column; gap: 2px; margin-top: 14px; }
.sb-section { margin: 0; }
.sb-group-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 36px;
  margin: 0;
  padding: 0 10px;
  background: none;
  border: 0;
  border-radius: 9px;
  text-align: left;
  cursor: pointer;
  font-size: 13px;
  font-weight: 400;
  text-transform: none;
  color: var(--ff-ink-2);
  transition: background .15s ease, color .15s ease;
}
.sb-group-btn > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.sb-group-btn > .sb-group-ic { font-size: 18px; width: 18px; flex: none; color: var(--ff-ink-3); transition: color .15s ease; }
.sb-group-btn > .sb-caret { font-size: 10px; flex: none; color: var(--ff-ink-3); transition: transform .15s ease; }
.sb-group-btn:hover { background: rgba(255, 255, 255, .6); color: var(--ff-ink); }
.sb-group-btn:hover > .sb-group-ic { color: var(--ff-ink-2); }
.sb-section:not(.is-open) .sb-group-btn > .sb-caret { transform: rotate(-90deg); }
.sb-section:not(.is-open) .sb-items { display: none; }
.sb-section.is-open > .sb-group-btn { color: var(--ff-ink); }
/* The module of the current page */
.sb-section.has-active > .sb-group-btn { color: var(--ff-ink); }
.sb-section.has-active > .sb-group-btn > .sb-group-ic { color: var(--ff-purple); }
.sb-section.has-active:not(.is-open) > .sb-group-btn { background: #fff; box-shadow: var(--sh-xs); }

.sb-items { margin: 2px 0 8px 19px; padding-left: 10px; border-left: 1px solid var(--ff-border); }
.sb-items .sb-link { height: 32px; margin: 0 0 1px; padding: 0 10px; gap: 8px; border-radius: 8px; font-size: 13px; color: var(--ff-ink-2); }
.sb-items .sb-link i { display: none; }
.sb-items .sb-link:hover { background: rgba(255, 255, 255, .6); color: var(--ff-ink); }
.sb-items .sb-link.active { background: #fff; color: var(--ff-ink); box-shadow: var(--sh-xs); }
.sb-items .sb-link.active::before { content: ""; position: absolute; left: -11px; top: 8px; bottom: 8px; width: 2px; border-radius: 2px; background: var(--ff-purple); }
.sb-bottom { padding-top: 12px; border-top: 1px solid var(--ff-border); margin-top: 12px; }
.sb-bottom .sb-link { height: 36px; margin-bottom: 2px; padding: 0 10px; gap: 10px; font-size: 13.5px; }
.sb-bottom .sb-link i { font-size: 18px; width: 18px; }

/* Collapsed sidebar: module icons, and page icons for the open module */
.sidebar-collapsed .sb-group-btn { width: 44px; padding: 0; justify-content: center; color: transparent; }
.sidebar-collapsed .sb-group-btn::before { display: none; }
.sidebar-collapsed .sb-group-btn > span, .sidebar-collapsed .sb-group-btn > .sb-caret { display: none; }
.sidebar-collapsed .sb-items { margin: 2px 0 6px; padding: 0; border: 0; }
.sidebar-collapsed .sb-items .sb-link { width: 44px; height: 36px; padding: 0; justify-content: center; }
.sidebar-collapsed .sb-items .sb-link i { display: inline-block; font-size: 18px; }
.sidebar-collapsed .sb-items .sb-link.active::before { display: none; }
.sidebar-collapsed .sb-bottom .sb-link { width: 44px; padding: 0; justify-content: center; }
@media (max-width: 1199.98px) {
  body:not(.sidebar-expanded) .sb-group-btn { width: 44px; padding: 0; justify-content: center; color: transparent; }
  body:not(.sidebar-expanded) .sb-group-btn::before { display: none; }
  body:not(.sidebar-expanded) .sb-group-btn > span, body:not(.sidebar-expanded) .sb-group-btn > .sb-caret { display: none; }
  body:not(.sidebar-expanded) .sb-items { margin: 2px 0 6px; padding: 0; border: 0; }
  body:not(.sidebar-expanded) .sb-items .sb-link { width: 44px; height: 36px; padding: 0; justify-content: center; }
  body:not(.sidebar-expanded) .sb-items .sb-link i { display: inline-block; font-size: 18px; }
  body:not(.sidebar-expanded) .sb-items .sb-link.active::before { display: none; }
  body:not(.sidebar-expanded) .sb-bottom .sb-link { width: 44px; padding: 0; justify-content: center; }
}
/* Phones: the sidebar is a full-width drawer again */
@media (max-width: 991.98px) {
  body:not(.sidebar-expanded) .sidebar .sb-group-btn { width: 100%; padding: 0 10px; justify-content: flex-start; color: var(--ff-ink-2); }
  body:not(.sidebar-expanded) .sidebar .sb-section.has-active > .sb-group-btn, body:not(.sidebar-expanded) .sidebar .sb-section.is-open > .sb-group-btn { color: var(--ff-ink); }
  body:not(.sidebar-expanded) .sidebar .sb-group-btn > span, body:not(.sidebar-expanded) .sidebar .sb-group-btn > .sb-caret { display: inline-block; }
  body:not(.sidebar-expanded) .sidebar .sb-items { margin: 2px 0 8px 19px; padding-left: 10px; border-left: 1px solid var(--ff-border); }
  body:not(.sidebar-expanded) .sidebar .sb-items .sb-link { width: auto; height: 32px; padding: 0 10px; justify-content: flex-start; }
  body:not(.sidebar-expanded) .sidebar .sb-items .sb-link i { display: none; }
  body:not(.sidebar-expanded) .sidebar .sb-items .sb-link.active::before { display: block; }
  body:not(.sidebar-expanded) .sidebar .sb-bottom .sb-link { width: auto; padding: 0 10px; justify-content: flex-start; }
}

/* ==========================================================================
   Header: context switcher, profile, notifications
   ========================================================================== */
/* ERP header: a top bar (breadcrumb + global tools) and a title row (title + page actions),
   each kept on one line. */
.page-head.erp-head { display: block; margin-bottom: 28px; }
.erp-head .head-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 40px; margin-bottom: 16px; }
.erp-head .crumbs { margin: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 12.5px; text-transform: none; }
.erp-head .crumbs a { color: var(--ff-ink-2); }
.erp-head .page-head-r { flex: none; margin-left: auto; padding-bottom: 0; flex-wrap: nowrap; gap: 10px; }
.erp-head .search-pill { width: 200px; }
.erp-head .ctx-chip { max-width: 220px; }
.erp-head .demo-chip { max-width: 160px; height: 40px; padding: 0 14px 0 12px; }
.erp-head .demo-chip > i:first-child { font-size: 16px; }
@media (min-width: 1500px) { .erp-head .search-pill { width: 260px; } .erp-head .ctx-chip { max-width: 280px; } .erp-head .demo-chip { max-width: 200px; } }
/* Narrower desktops: search becomes an icon button (⌘K still opens it). */
@media (min-width: 992px) and (max-width: 1399.98px) {
  .erp-head .search-pill { width: 40px; padding: 0; justify-content: center; }
  .erp-head .search-pill > span { display: none; }
}
.erp-head .head-title { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.erp-head .page-head-l { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 12px; }
.erp-head .page-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.erp-head .head-actions { display: flex; align-items: center; gap: 10px; flex: none; }
.erp-head .head-actions:empty { display: none; }
.erp-head .head-actions .btn-ff { padding: 0 18px; font-size: 13.5px; }
@media (max-width: 991.98px) {
  .erp-head .head-top { flex-wrap: wrap; row-gap: 10px; }
  .erp-head .page-head-r { flex-wrap: wrap; margin-left: 0; }
  .erp-head .head-title { flex-wrap: wrap; row-gap: 12px; }
  .erp-head .page-title { white-space: normal; }
}
@media (max-width: 767.98px) {
  .page-head.erp-head { margin-bottom: 22px; }
  .erp-head .search-pill { width: 100%; }
}
.ctx-chip { height: 40px; padding: 0 14px 0 12px; max-width: 300px; }
.ctx-chip > i:first-child { font-size: 16px; color: var(--ff-ink-2); margin: 0; }
.ctx-chip .ctx-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ctx-menu { min-width: 300px; max-height: 420px; overflow-y: auto; }
.ctx-menu .dropdown-header { font-size: 11px; font-weight: 500; text-transform: uppercase; color: var(--ff-ink-3); padding: 8px 12px 4px; }
.ctx-menu .dropdown-item .row-sub { margin-left: auto; }
.ctx-menu .dropdown-item.active .row-sub { color: var(--ff-purple-deep); }
.head-avatar { padding: 0; overflow: hidden; }
.head-avatar img, .head-avatar .avatar-initials { width: 100%; height: 100%; }
.profile-menu { min-width: 280px; }
.profile-card { display: flex; align-items: center; gap: 10px; padding: 8px 10px 10px; }
.profile-menu .dropdown-item .ms-auto { color: var(--ff-ink-3); }
.notif-card[data-href] { cursor: pointer; }
.notif-card[data-href]:hover { box-shadow: inset 0 0 0 1px var(--ff-border-strong); }
.notif-card.is-done { opacity: .7; }
.notif-empty { text-align: center; padding: 48px 12px; color: var(--ff-ink-3); }

/* ==========================================================================
   Avatars without photos
   ========================================================================== */
.avatar-initials {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  flex: none;
  background: var(--ff-surface-2);
  color: var(--ff-ink-2);
  font-weight: 500;
  line-height: 1;
}
.avatar-initials.av-22, .avatar-initials.av-24 { font-size: 9.5px; }
.avatar-initials.av-28 { font-size: 11px; }
.avatar-initials.av-32, .avatar-initials.av-36 { font-size: 12px; }
.avatar-initials.av-40, .avatar-initials.av-44, .avatar-initials.av-48 { font-size: 14px; }
.avatar-initials.tone-1 { background: var(--ff-lavender); color: var(--ff-purple-deep); }
.avatar-initials.tone-2 { background: var(--ff-green-soft); color: var(--ff-green-text); }
.avatar-initials.tone-3 { background: var(--ff-amber-soft); color: var(--ff-amber-text); }
.avatar-initials.tone-4 { background: var(--ff-lime-soft); color: var(--ff-lime-text); }

/* ==========================================================================
   Data table toolbar, column filters, sorting, empty state
   ========================================================================== */
.dt-toolbar { margin-bottom: 16px; }
.dt-search { width: 280px; height: 32px; border-radius: 999px; padding: 0 12px; }
.dt-search i { font-size: 14px; color: var(--ff-ink-3); }
.dt-search input { font-size: 12.5px; }
.dt-date { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 30px 0 12px; border-radius: 999px; background: var(--ff-surface); font-size: 12.5px; color: var(--ff-ink-3); white-space: nowrap; position: relative; }
.dt-date .input-ff { height: 30px; width: 118px; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; font-size: 12.5px; font-weight: 500; color: var(--ff-ink); cursor: pointer; }
.dt-date-cal { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 24px; height: 24px; display: grid; place-items: center; margin: 0; padding: 0; border: 0; border-radius: 999px; background: transparent; color: var(--ff-ink-3); cursor: pointer; line-height: 1; }
.dt-date-cal:hover, .dt-date-cal:focus-visible { color: var(--ff-ink); background: rgba(17, 17, 19, 0.06); outline: none; }
.dt-date-cal > i { font-size: 13px; line-height: 1; pointer-events: none; }
.dt-date input[type="date"]::-webkit-calendar-picker-indicator { display: none; }
.dt-date .dt-date-field { border: 0; background: transparent; font: inherit; color: var(--ff-ink); font-weight: 500; padding: 0; cursor: pointer; outline: none; }
.dt-date.is-active { background: var(--ff-lavender); }
.filter-chip.is-active { background: var(--ff-lavender); }
.filter-chip.is-active b { color: var(--ff-purple-deep); }
.btn-ff.is-on { background: var(--ff-lavender); border-color: var(--ff-purple-border); color: var(--ff-purple-deep); }
.dt-menu { max-height: 320px; overflow-y: auto; }
.dt-menu .count-pill { margin-left: auto; }
.table-ff thead th.sortable .sort.on { color: var(--ff-purple); }
.table-ff thead tr.dt-colfilters th { height: auto; padding: 0 6px 8px; text-transform: none; border-bottom: 1px solid var(--ff-border); }
.table-ff thead tr.dt-colfilters th:first-child { padding-left: 14px; }
.table-ff thead tr.dt-colfilters .input-ff, .table-ff thead tr.dt-colfilters .select-ff { min-width: 0; width: 100%; }
.table-ff thead tr.dt-head th { border-bottom: 0; }
.table-ff thead tr.dt-head:last-child th { border-bottom: 1px solid var(--ff-border); }
.input-ff.sm, .select-ff.sm { height: 30px; padding: 0 9px; font-size: 12px; border-radius: 8px; border-color: var(--ff-border); }
.select-ff.sm .caret { font-size: 12px; }
.table-ff td.num, .table-ff th.num { text-align: right; }
.table-ff.tight th, .table-ff.tight td { padding-left: 9px; padding-right: 9px; }
.table-ff.tight th:first-child, .table-ff.tight td:first-child { padding-left: 16px; }
.table-ff td.col-act { white-space: nowrap; }
.table-ff td.col-act .row-acts { display: inline-flex; align-items: center; gap: 2px; }
.table-ff td.col-act .btn-icon { font-size: 15px; }
.table-ff td.col-act .btn-icon.danger:hover { color: var(--ff-red-text); background: var(--ff-red-soft); }
.table-ff tbody tr.dt-empty td { height: auto; padding: 0; cursor: default; }
.table-ff tbody tr.dt-empty:hover { background: transparent; }
.table-foot .pager button:disabled { opacity: .4; cursor: default; }
.empty-state { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 48px 24px; }
.empty-state .icon-tile { margin-bottom: 14px; }
.empty-state .es-title { font-size: 15px; font-weight: 500; }
.empty-state .es-text { font-size: 13px; color: var(--ff-ink-3); margin-top: 4px; max-width: 420px; }
.empty-state .es-actions { display: flex; gap: 8px; margin-top: 16px; }
.cell-progress { min-width: 90px; }
.cell-progress .v { font-size: 12.5px; margin-bottom: 5px; font-variant-numeric: tabular-nums; }

/* ==========================================================================
   Form modals: grouped fields, tabs, validation
   ========================================================================== */
.modal-ff .modal-header .chip { margin-bottom: 8px; }
.modal-ff .form-tabs { margin: 16px -24px 0; padding: 0 24px; gap: 20px; overflow-x: auto; scrollbar-width: none; }
.modal-ff .form-tabs .tab-ff { height: 40px; }
.modal-ff .form-tabs .tab-ff .err-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ff-red); display: none; }
.modal-ff .form-tabs .tab-ff.has-error .err-dot { display: inline-block; }
.modal-ff .modal-body.form-body { max-height: min(62vh, 560px); overflow-y: auto; }
.form-pane + .form-pane { margin-top: 22px; }
.form-pane.is-tab + .form-pane.is-tab { margin-top: 0; }
.form-pane-title { font-size: 13.5px; font-weight: 500; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.form-pane-title i { color: var(--ff-ink-3); font-size: 15px; }
.form-grid .span-2 { grid-column: span 2; }
.form-grid .span-all { grid-column: 1 / -1; }
.form-label-ff { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.form-field .form-label-ff .req { color: var(--ff-red-text); margin-left: 2px; }
.form-field .field-help { font-size: 12px; color: var(--ff-ink-3); margin-top: 5px; }
.form-field .field-error { display: none; font-size: 12px; color: var(--ff-red-text); margin-top: 5px; }
.form-field.is-invalid .field-error { display: block; }
.form-field.is-invalid .input-ff, .form-field.is-invalid .select-ff { border-color: var(--ff-red); background: var(--ff-red-soft); }
.form-field.is-invalid .input-ff:focus, .form-field.is-invalid .input-ff:focus-within { box-shadow: 0 0 0 3px rgba(240, 72, 74, .12); }
.input-ff.prefixed { gap: 8px; }
.input-ff.prefixed .prefix, .input-ff.prefixed .suffix { color: var(--ff-ink-3); font-size: 12.5px; flex: none; }
.input-ff.prefixed input { text-align: inherit; }
.input-ff[readonly], .input-ff.is-readonly { color: var(--ff-ink-2); background: var(--ff-surface-2); }
.form-switch-row { display: flex; align-items: center; gap: 10px; height: 40px; }
.form-alert { display: none; align-items: center; gap: 8px; margin: 0 0 14px; padding: 10px 12px; border-radius: var(--r-inner); background: var(--ff-red-soft); color: var(--ff-red-text); font-size: 13px; }
.form-alert.show { display: flex; }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 767.98px) {
  .form-grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 575.98px) {
  .form-grid.cols-2, .form-grid.cols-3 { grid-template-columns: minmax(0, 1fr); }
  .form-grid .span-2 { grid-column: auto; }
}

/* ==========================================================================
   Date picker (DD MMM YYYY)
   ========================================================================== */
.input-ff.date-input { cursor: pointer; }
.date-wrap { position: relative; }
.date-wrap > i { position: absolute; right: 11px; top: 50%; transform: translateY(-50%); color: var(--ff-ink-3); font-size: 14px; pointer-events: none; }
.date-wrap .input-ff { padding-right: 32px; }
.date-wrap .input-ff.sm { padding-right: 26px; }
.date-wrap .input-ff.sm + i { right: 8px; font-size: 12px; }
.dp-pop { position: fixed; z-index: 2100; width: 268px; padding: 12px; background: #fff; border: 1px solid var(--ff-border); border-radius: 14px; box-shadow: var(--sh-md); font-size: 12.5px; }
.dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.dp-head b { font-weight: 500; font-size: 13.5px; }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dp-grid .dow { text-align: center; font-size: 10.5px; color: var(--ff-ink-3); padding: 4px 0; font-weight: 500; }
.dp-grid button { height: 32px; border: 0; border-radius: 8px; background: transparent; font-size: 12.5px; color: var(--ff-ink); cursor: pointer; font-variant-numeric: tabular-nums; }
.dp-grid button:hover { background: var(--ff-surface); }
.dp-grid button.out { color: #b4b4b8; }
.dp-grid button.today { box-shadow: inset 0 0 0 1px var(--ff-border-strong); }
.dp-grid button.sel { background: var(--ff-purple); color: #fff; }
.dp-foot { display: flex; justify-content: space-between; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--ff-border); }

/* ==========================================================================
   Detail drawer
   ========================================================================== */
.drawer-ff.drawer-detail { --bs-offcanvas-width: 600px; }
.drawer-detail .drawer-head { padding-bottom: 4px; }
.drawer-detail .drawer-title { font-size: 22px; }
.drawer-detail .detail-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.drawer-detail .detail-tabs { padding: 0 20px; gap: 20px; overflow-x: auto; scrollbar-width: none; }
.drawer-detail .detail-tabs .tab-ff { height: 42px; }
.drawer-detail .drawer-body { padding-top: 18px; }
.drawer-detail .drawer-foot { display: flex; justify-content: space-between; gap: 8px; }
.detail-section + .detail-section { margin-top: 18px; }
.detail-section .micro { margin-bottom: 8px; display: block; }
.kv-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; background: var(--ff-surface); border-radius: var(--r-inner); padding: 2px 14px; }
.kv-grid .kv { flex-direction: column; align-items: flex-start; gap: 3px; padding: 10px 0; }
.kv-grid .kv:nth-child(2) { border-top: 0; }
.kv-grid .kv > span:last-child { text-align: left; }
.kv-grid .kv.full { grid-column: 1 / -1; }

/* ==========================================================================
   Pages
   ========================================================================== */
.erp-dash-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: var(--gutter); align-items: start; }
.erp-dash-grid + .erp-dash-grid { margin-top: var(--gutter); }
.erp-dash-grid.even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.portfolio-row { display: grid; grid-template-columns: minmax(0, 1.6fr) 150px 130px 120px; align-items: center; gap: 16px; padding: 12px 0; border-top: 1px solid var(--ff-border); cursor: pointer; }
.portfolio-row:first-child { border-top: 0; }
.portfolio-row:hover .row-title { color: var(--ff-purple-text); }
.bar-row { display: grid; grid-template-columns: minmax(0, 1fr) 120px 64px; align-items: center; gap: 14px; padding: 9px 0; }
.bar-row .v { text-align: right; font-variant-numeric: tabular-nums; font-size: 12.5px; }
.module-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.module-tile { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 14px; background: #fff; border: 1px solid var(--ff-border); cursor: pointer; text-align: left; width: 100%; }
.module-tile:hover { border-color: var(--ff-border-strong); box-shadow: var(--sh-xs); }
.perm-matrix td, .perm-matrix th { text-align: center; }
.perm-matrix td:first-child, .perm-matrix th:first-child { text-align: left; }
.perm-dots { display: inline-flex; gap: 3px; }
.perm-dots span { width: 18px; height: 18px; border-radius: 5px; font-size: 10px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; background: var(--ff-surface-2); color: #b4b4b8; }
.perm-dots span.on { background: var(--ff-lavender); color: var(--ff-purple-deep); }
.table-ff tbody tr.is-current { background: #faf8ff; }
@media (max-width: 1199.98px) {
  .erp-dash-grid, .erp-dash-grid.even { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 767.98px) {
  .portfolio-row { grid-template-columns: minmax(0, 1fr) 110px; }
  .portfolio-row > :nth-child(3), .portfolio-row > :nth-child(4) { display: none; }
  .dt-search { width: 100%; }
  .kv-grid { grid-template-columns: minmax(0, 1fr); }
  .kv-grid .kv:nth-child(2) { border-top: 1px solid var(--ff-border); }
}

/* ==========================================================================
   Project & Construction views
   ========================================================================== */
/* file and photo fields */
.file-drop { position: relative; display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 10px 14px; border-radius: var(--r-input); border: 1px dashed var(--ff-border-strong); background: var(--ff-surface); font-size: 13px; cursor: pointer; }
.file-drop:hover { border-color: var(--ff-purple-soft); background: var(--ff-lavender); }
.file-drop i { font-size: 20px; color: var(--ff-ink-2); }
.file-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-list { display: flex; flex-wrap: wrap; gap: 6px; }
.file-list:not(:empty) { margin-top: 8px; }
.file-chip { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; height: 32px; padding: 0 6px 0 10px; border-radius: 8px; background: #fff; box-shadow: inset 0 0 0 1px var(--ff-border); font-size: 12.5px; }
.file-chip > i { font-size: 16px; color: var(--ff-purple); flex: none; }
.file-chip button { border: 0; background: none; color: var(--ff-ink-3); padding: 0 4px; line-height: 1; }
.file-chip button:hover { color: var(--ff-red-text); }
.file-chip.lg { display: flex; height: 48px; padding: 0 14px; background: var(--ff-surface); box-shadow: none; }
.file-list.photos .photo-chip, .photo-chip { position: relative; width: 72px; height: 72px; border-radius: 10px; overflow: hidden; background: var(--ff-surface-2); display: inline-flex; align-items: center; justify-content: center; color: var(--ff-ink-3); font-size: 22px; }
.photo-chip img { width: 100%; height: 100%; object-fit: cover; }
.photo-chip button { position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: rgba(17, 17, 19, .65); color: #fff; font-size: 10px; display: inline-flex; align-items: center; justify-content: center; }
.photo-strip { display: flex; gap: 6px; flex-wrap: wrap; }
.photo-strip img { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; }

/* units */
.unit-bar { display: flex; height: 10px; border-radius: 6px; overflow: hidden; background: var(--ff-surface-2); }
.unit-bar span { display: block; height: 100%; }
.u-green { background: var(--ff-green); } .u-amber { background: var(--ff-amber); } .u-purple { background: var(--ff-purple); } .u-dark { background: var(--ff-ink); } .u-red { background: var(--ff-red); }
.unit-legend { font-size: 12px; gap: 12px; display: flex; width: 100%; }
.unit-legend i.sq { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.legend i.sq.u-green { background: var(--ff-green); } .legend i.sq.u-amber { background: var(--ff-amber); } .legend i.sq.u-purple { background: var(--ff-purple); } .legend i.sq.u-dark { background: var(--ff-ink); } .legend i.sq.u-red { background: var(--ff-red); }
.unit-legend b { font-weight: 500; color: var(--ff-ink); }
.unit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 6px; }
.unit-chip { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 6px 8px; border: 0; border-radius: 8px; text-align: left; font-size: 11px; line-height: 1.25; cursor: pointer; color: var(--ff-ink); }
.unit-chip b { font-size: 12.5px; font-weight: 500; }
.unit-chip span { color: var(--ff-ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.unit-chip.u-green { background: var(--ff-green-soft); } .unit-chip.u-amber { background: var(--ff-amber-soft); } .unit-chip.u-purple { background: var(--ff-lavender); } .unit-chip.u-red { background: var(--ff-red-soft); }
.unit-chip.u-dark { background: var(--ff-ink); color: #fff; } .unit-chip.u-dark span { color: #b4b4b8; }
.unit-chip:hover { box-shadow: inset 0 0 0 1.5px var(--ff-ink); }

/* comments */
.comment { padding: 10px 12px; border-radius: var(--r-inner); background: var(--ff-surface); margin-bottom: 8px; }
.comment-form { margin-top: 12px; }

/* workflow stepper */
.stepper { display: flex; align-items: center; gap: 6px; padding: 12px 14px; border-radius: var(--r-inner); background: var(--ff-surface); overflow-x: auto; }
.step { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-size: 12px; color: var(--ff-ink-3); }
.step-dot { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 500; background: #fff; box-shadow: inset 0 0 0 1px var(--ff-border-strong); }
.step.done .step-dot { background: var(--ff-green); color: #fff; box-shadow: none; }
.step.current .step-dot { background: var(--ff-purple); color: #fff; box-shadow: none; }
.step.current, .step.done { color: var(--ff-ink); }
.step.current .step-label { font-weight: 500; }
.step.rejected .step-dot { background: var(--ff-red); color: #fff; box-shadow: none; }
.step.rejected { color: var(--ff-red-text); font-weight: 500; }
.step-line { flex: 1 0 14px; height: 1px; background: var(--ff-border-strong); }

/* risk matrix: probability (x) against impact (y) */
.risk-matrix { display: grid; grid-template-columns: 18px minmax(0, 1fr); grid-template-rows: auto auto; gap: 6px 8px; }
.rm-title-y { writing-mode: vertical-rl; transform: rotate(180deg); text-align: center; font-size: 11px; font-weight: 500; text-transform: uppercase; color: var(--ff-ink-3); }
.rm-title-x { grid-column: 2; text-align: center; font-size: 11px; font-weight: 500; text-transform: uppercase; color: var(--ff-ink-3); }
.rm-grid { display: grid; grid-template-columns: 112px repeat(5, minmax(0, 1fr)); gap: 4px; }
.rm-axis-y { display: flex; align-items: center; font-size: 11.5px; color: var(--ff-ink-2); }
.rm-axis-x { text-align: center; font-size: 11.5px; color: var(--ff-ink-2); padding-top: 2px; }
.rm-cell { height: 52px; border: 0; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 12px; color: var(--ff-ink-3); cursor: pointer; }
.rm-cell span { opacity: .55; }
.rm-cell b { width: 28px; height: 28px; border-radius: 50%; background: #fff; color: var(--ff-ink); display: inline-flex; align-items: center; justify-content: center; font-weight: 600; box-shadow: var(--sh-xs); }
.rm-green { background: var(--ff-green-soft); } .rm-amber { background: var(--ff-amber-soft); } .rm-red { background: var(--ff-red-soft); }
.rm-cell.has.rm-red b { background: var(--ff-red); color: #fff; }
.rm-cell.has.rm-amber b { background: var(--ff-amber); color: #fff; }
.rm-cell.has.rm-green b { background: var(--ff-green); color: #fff; }
.rm-cell.sel { box-shadow: inset 0 0 0 2px var(--ff-ink); }
.rm-cell:disabled { cursor: default; }
.risk-matrix.compact .rm-grid { grid-template-columns: 22px repeat(5, minmax(0, 1fr)); }
.risk-matrix.compact .rm-cell { height: 30px; }
.risk-matrix.compact .rm-cell b { width: 20px; height: 20px; font-size: 11px; }

/* Gantt timeline: planned bar with a progress fill */
.pm-gantt { --gantt-pad: 12px; background: #fff; border: 1px solid var(--ff-border); border-radius: var(--r-table); padding-bottom: 6px; overflow: hidden; }
.pm-gantt .gantt-head { height: 38px; background: var(--ff-surface); }
.pm-gantt .gantt-row { height: 44px; }
.pm-gantt .gantt-row.group { background: var(--ff-surface); height: 36px; }
.pm-gantt .gantt-row.group .gantt-name { font-weight: 600; }
.pm-gantt .gantt-who { padding-right: 10px; }
.gbar.plan { background: #fff; box-shadow: inset 0 0 0 1px var(--ff-border-strong); color: var(--ff-ink); padding: 0; height: 22px; }
.gbar.plan .fill { position: absolute; inset: 0 auto 0 0; border-radius: 7px 0 0 7px; }
.gbar.plan .lbl { position: relative; padding: 0 7px; font-size: 11px; font-weight: 500; }
.gbar.tone-purple .fill { background: #d9cdff; } .gbar.tone-purple { box-shadow: inset 0 0 0 1px var(--ff-purple-soft); }
.gbar.tone-green .fill { background: #bfe8cf; } .gbar.tone-green { box-shadow: inset 0 0 0 1px #8fd3ab; }
.gbar.tone-red { background: var(--ff-red-soft); box-shadow: inset 0 0 0 1px #f3a3a4; color: var(--ff-red-text); } .gbar.tone-red .fill { background: #f9c9c9; }
.gbar.tone-amber { box-shadow: inset 0 0 0 1px #f6c779; } .gbar.tone-amber .fill { background: #fde3b5; }
.gantt-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--ff-ink-2); margin-top: 10px; }
.gantt-legend i { display: inline-block; width: 12px; height: 8px; border-radius: 3px; margin-right: 6px; vertical-align: 0; }

/* hierarchy tree */
.tree { border: 1px solid var(--ff-border); border-radius: var(--r-table); background: #fff; padding: 6px; }
.tree-row { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 6px 10px 6px calc(8px + var(--depth) * 22px); border-radius: 10px; cursor: pointer; }
.tree-row:hover { background: var(--ff-surface); }
.tree-row.selected { background: var(--ff-lavender); box-shadow: inset 0 0 0 1px var(--ff-purple-border); }
.tree-row .row-title { display: flex; align-items: center; gap: 8px; }
.tree-level { font-size: 10px; font-weight: 500; text-transform: uppercase; color: var(--ff-ink-3); }
.tree-caret { width: 24px; height: 24px; border: 0; border-radius: 6px; background: transparent; color: var(--ff-ink-2); font-size: 12px; flex: none; display: inline-flex; align-items: center; justify-content: center; }
.tree-caret:hover { background: var(--ff-surface-2); }
.tree-prog { width: 110px; flex: none; }
.tree-units { padding: 4px 10px 10px calc(42px + var(--depth) * 22px); }
.tree-empty { padding: 6px 10px 10px calc(42px + var(--depth) * 22px); font-size: 12px; color: var(--ff-ink-3); }
.hier-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: var(--gutter); align-items: start; }
.hier-detail { position: sticky; top: 16px; }
@media (max-width: 1199.98px) { .hier-layout { grid-template-columns: minmax(0, 1fr); } .hier-detail { position: static; } }

/* kanban */
.kanban { grid-template-columns: repeat(5, minmax(205px, 1fr)); gap: 10px; align-items: start; }
.kanban .board-col { padding: 10px 8px 4px; }
.kanban-card .sev + span { white-space: nowrap; }
.kanban .board-col { min-height: 480px; transition: box-shadow .15s, background .15s; }
.kanban .board-col.drop { box-shadow: inset 0 0 0 2px var(--ff-purple); background: var(--ff-lavender); }
.kanban-card { cursor: grab; }
.kanban-card.dragging { opacity: .45; }
.kanban-card .kc-title { font-size: 13.5px; font-weight: 500; line-height: 1.3; margin: 6px 0 2px; }
.kanban-card.is-late { box-shadow: inset 3px 0 0 var(--ff-red); }
.kanban-card.is-blocked { box-shadow: inset 3px 0 0 var(--ff-amber); }

/* page view switch + filter bar */
.view-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin-bottom: 20px; }
.stat-tile.alert { background: var(--ff-red-soft); margin: 0; border: 0; border-radius: 14px; padding: 12px 14px; } .stat-tile.alert .stat-value { color: var(--ff-red-text); }
.stat-tile.warn { background: var(--ff-amber-soft); } .stat-tile.warn .stat-value { color: var(--ff-amber-text); }
.ms-card { background: #fff; border: 1px solid var(--ff-border); border-radius: 14px; padding: 12px 14px; cursor: pointer; }
.ms-card:hover { border-color: var(--ff-border-strong); }
.ms-card.is-late { border-color: #f3a3a4; background: #fffafa; }
.ms-card.is-done { background: var(--ff-surface); }
.project-tabs { margin-bottom: 20px; }
.proj-hero { display: flex; gap: 20px; align-items: stretch; margin-bottom: 20px; }
.table-ff tbody tr.row-late td:first-child { box-shadow: inset 3px 0 0 var(--ff-red); }
.table-ff tbody tr.row-blocked td:first-child { box-shadow: inset 3px 0 0 var(--ff-amber); }

/* ==========================================================================
   Budget & Finance
   ========================================================================== */
.kpi-strip.fin-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px 0; }
.fin-kpis .kpi-sep { display: none; }
.fin-kpis .kpi { padding: 0 20px; border-left: 1px solid var(--ff-border); }
.fin-kpis .kpi:nth-child(8n + 1) { padding-left: 0; border-left: 0; }
.fin-kpis .kpi-value { font-size: 30px; line-height: 36px; }
@media (max-width: 1199.98px) {
  .kpi-strip.fin-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fin-kpis .kpi:nth-child(4n + 1) { padding-left: 0; border-left: 0; }
}
.table-ff tbody tr.row-group td { background: var(--ff-surface); }
.table-ff tbody tr.row-selected td { background: var(--ff-lavender); }
.table-ff tbody tr.row-changed td { background: #fff7e6; }
.table-ff tr.row-total td { background: var(--ff-surface); border-top: 1px solid var(--ff-border); }
.bd-table th, .bd-table td { padding-left: 8px; padding-right: 8px; font-size: 12.5px; white-space: nowrap; }
.bd-table thead th { white-space: normal; line-height: 1.25; vertical-align: bottom; }
.bd-table th:first-child, .bd-table td:first-child { padding-left: 14px; width: 26%; max-width: 300px; }
.bd-table td:first-child .truncate { max-width: 250px; }
.bd-table tbody tr.lvl-0 td { background: var(--ff-surface); }
.bd-table tbody tr.lvl-0 td .tnum { font-weight: 500; }
.bd-name { display: flex; align-items: center; gap: 6px; padding-left: calc(var(--depth, 0) * 18px); min-width: 0; }
.cc-code { display: flex; align-items: center; gap: 6px; }
.cc-code.child { padding-left: 6px; }
.coa-name { padding-left: calc(var(--depth, 0) * 18px); display: flex; align-items: center; }
.lines-table th, .lines-table td { padding: 6px 8px; vertical-align: middle; }
.lines-table td:first-child, .lines-table th:first-child { padding-left: 12px; }
.lines-table tbody td { height: 44px; }
.lines-table .select-ff, .lines-table .input-ff { width: 100%; min-width: 0; }
.lines-table tfoot td { padding-top: 8px; padding-bottom: 8px; background: var(--ff-surface); }
.lines-field .table-scroll { max-height: 420px; overflow-y: auto; }
.lines-field .table-scroll thead th { position: sticky; top: 0; z-index: 1; background: #fff; }
.lines-field .table-scroll tfoot { position: sticky; bottom: 0; z-index: 1; }
.lines-table input[data-money] { font-variant-numeric: tabular-nums; }
.form-field.is-invalid .lines-field .table-wrap { box-shadow: 0 0 0 1px var(--ff-red); border-radius: var(--r-inner); }
.lines-table .input-ff.sm { padding-left: 8px; padding-right: 8px; }

/* ==========================================================================
   Procurement
   ========================================================================== */
.modal-ff.w-1000 .modal-dialog { max-width: 1080px; }
.flow-trail { display: grid; grid-template-columns: repeat(auto-fit, minmax(122px, 1fr)); gap: 6px; padding: 2px 0 6px; margin-bottom: 4px; }
.flow-trail .flow-sep { display: none; }
.flow-node { min-width: 0; display: flex; flex-direction: column; gap: 1px; padding: 8px 10px; border-radius: 12px; background: var(--ff-surface); color: inherit; text-decoration: none; }
a.flow-node:hover { background: var(--ff-surface-2); }
.flow-node.done { background: var(--ff-lavender); }
.flow-node.current { background: var(--ff-amber-soft); }
.flow-node.skip { opacity: .55; }
.flow-icon { font-size: 15px; color: var(--ff-ink-2); }
.flow-node.done .flow-icon { color: var(--ff-purple); }
.flow-label { font-size: 10.5px; font-weight: 500; text-transform: uppercase; color: var(--ff-ink-3); white-space: nowrap; }
.flow-value { font-size: 12.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.flow-sub { font-size: 11px; color: var(--ff-ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.flow-sep { align-self: center; color: var(--ff-ink-4, #c4c4c8); font-size: 11px; flex: none; }
.score-bar { display: grid; grid-template-columns: minmax(60px, 1fr) 30px; align-items: center; gap: 8px; }
.score-bar b { font-weight: 500; font-size: 12.5px; text-align: right; }
.cmp-table th, .cmp-table td { vertical-align: top; }
.cmp-table thead th { min-width: 190px; }
.cmp-table th:first-child, .cmp-table td:first-child { min-width: 170px; color: var(--ff-ink-2); }
.cmp-table td.best { background: #eefaf2; }
.cmp-table th.sel, .cmp-table td.sel { box-shadow: inset 2px 0 0 var(--ff-purple), inset -2px 0 0 var(--ff-purple); }

/* ==========================================================================
   Inventory
   ========================================================================== */
a.kpi { color: inherit; text-decoration: none; }
a.kpi:hover .kpi-label { color: var(--ff-ink); }
@media (min-width: 1200px) {
  .kpi-strip.inv-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .inv-kpis .kpi:nth-child(8n + 1) { padding-left: 20px; border-left: 1px solid var(--ff-border); }
  .inv-kpis .kpi:nth-child(6n + 1) { padding-left: 0; border-left: 0; }
}
.inv-kpis .kpi-label { overflow: hidden; text-overflow: ellipsis; }
.table-ff tr.row-flag-red td:first-child { box-shadow: inset 3px 0 0 var(--ff-red); }
.table-ff tr.row-flag-amber td:first-child { box-shadow: inset 3px 0 0 var(--ff-amber); }
.table-ff tr.row-flag-purple td:first-child { box-shadow: inset 3px 0 0 var(--ff-purple); }
.table-ff tr.row-muted td { color: var(--ff-ink-3); }

/* ==========================================================================
   CRM & property sales
   ========================================================================== */
.u-grey { background: #c9c9c4; } .u-violet { background: var(--ff-purple-muted, #b69dff); } .u-orange { background: #f08a4b; }
.legend i.sq.u-grey { background: #c9c9c4; } .legend i.sq.u-violet { background: var(--ff-purple-muted, #b69dff); } .legend i.sq.u-orange { background: #f08a4b; }
.unit-chip.u-grey { background: var(--ff-surface-2); } .unit-chip.u-violet { background: #efe9ff; } .unit-chip.u-orange { background: #fdeadf; }
.vt-mark.amber { background: var(--ff-amber); }
.crm-note { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: 12px; background: var(--ff-lavender); font-size: 13px; line-height: 1.45; }
.crm-note i { font-size: 16px; color: var(--ff-purple); margin-top: 1px; }
.crm-note.warn { background: var(--ff-amber-soft); }
.crm-note.warn i { color: #b7791f; }
/* opportunity stage track */
.stage-track { display: flex; flex-wrap: wrap; gap: 4px; }
.stage-step { font-size: 11px; padding: 4px 9px; border-radius: 999px; background: var(--ff-surface); color: var(--ff-ink-3); white-space: nowrap; }
.stage-step.done { background: var(--ff-lavender); color: var(--ff-purple); }
.stage-step.current { background: var(--ff-purple); color: #fff; }
.stage-step.lost { background: var(--ff-red-soft, #fde8e8); color: var(--ff-red); }
/* sales funnel */
.funnel { display: flex; flex-direction: column; gap: 7px; padding-top: 4px; }
.funnel-row { display: grid; grid-template-columns: 150px 1fr 40px; align-items: center; gap: 10px; font-size: 12.5px; }
.funnel-label { color: var(--ff-ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.funnel-bar { height: 14px; border-radius: 7px; background: var(--ff-surface-2); overflow: hidden; }
.funnel-bar span { display: block; height: 100%; border-radius: 7px; background: linear-gradient(90deg, var(--ff-purple), var(--ff-purple-muted, #b69dff)); }
.funnel-row b { text-align: right; font-weight: 500; }
/* kanban pipeline */
.kanban-filters { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.kanban-filter { display: flex; align-items: center; gap: 8px; }
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: 248px; gap: 12px; overflow-x: auto; padding-bottom: 10px; align-items: start; }
.k-col { background: var(--ff-surface); border-radius: 16px; display: flex; flex-direction: column; max-height: calc(100vh - 250px); min-height: 160px; transition: box-shadow .15s; }
.k-col.over { box-shadow: inset 0 0 0 2px var(--ff-purple); }
.k-col.won .k-head { border-top: 3px solid var(--ff-green); } .k-col.lost .k-head { border-top: 3px solid var(--ff-red); }
.k-head { padding: 12px 12px 8px; border-radius: 16px 16px 0 0; }
.k-name { font-weight: 500; font-size: 13.5px; }
.k-meta { font-size: 11.5px; color: var(--ff-ink-3); margin-top: 2px; }
.k-body { padding: 4px 8px 10px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; }
.k-card { background: #fff; border-radius: 12px; padding: 10px 11px; box-shadow: 0 1px 2px rgba(17, 17, 19, .06); cursor: pointer; }
.k-card[draggable="true"] { cursor: grab; }
.k-card:hover { box-shadow: 0 0 0 1.5px var(--ff-ink); }
.k-card.dragging { opacity: .45; }
.k-card-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 4px; }
.k-title { font-weight: 500; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.k-sub { font-size: 12px; color: var(--ff-ink-3); }
.k-foot { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 12.5px; }
.k-foot b { font-weight: 500; }
.k-next { margin-top: 6px; font-size: 11.5px; color: var(--ff-ink-2); display: flex; gap: 4px; align-items: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.k-empty, .k-more { font-size: 12px; color: var(--ff-ink-3); text-align: center; padding: 14px 6px; border: 1.5px dashed var(--ff-border-strong); border-radius: 12px; }
.k-more { border-style: solid; padding: 8px; }
/* project cards (unit inventory) */
.proj-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-bottom: 18px; }
.proj-card { text-align: left; border: 0; background: var(--ff-surface); border-radius: 16px; padding: 14px 16px; color: inherit; }
.proj-card:hover { box-shadow: inset 0 0 0 1.5px var(--ff-ink); }
/* unit availability explorer */
.ua-bar { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.ua-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ua-chip { border: 0; background: var(--ff-surface); border-radius: 12px; padding: 8px 14px; display: flex; flex-direction: column; align-items: flex-start; color: inherit; font-size: 12px; line-height: 1.3; }
.ua-chip b { font-size: 13px; font-weight: 600; }
.ua-chip span { color: var(--ff-ink-3); }
.ua-chip.sm { padding: 6px 12px; font-size: 12.5px; }
.ua-chip.active { background: var(--ff-ink); color: #fff; }
.ua-chip.active span { color: #c9c9ce; }
.ua-layout { display: grid; grid-template-columns: 220px 1fr; gap: 14px; align-items: start; }
.ua-layout.no-floors { grid-template-columns: 1fr; }
.ua-floors { padding: 14px 10px; max-height: calc(100vh - 230px); overflow-y: auto; position: sticky; top: 12px; }
.ua-floor { width: 100%; border: 0; background: transparent; display: grid; grid-template-columns: 34px 1fr 22px; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 8px; font-size: 12px; color: inherit; }
.ua-floor:hover { background: var(--ff-surface); }
.ua-floor.active { background: var(--ff-lavender); }
.ua-fl-name { font-weight: 500; text-align: left; }
.ua-fl-bar { display: flex; gap: 2px; }
.ua-fl-bar i { flex: 1; height: 10px; border-radius: 3px; min-width: 4px; }
.ua-fl-n { text-align: right; color: var(--ff-green); font-weight: 600; }
.ua-main { padding: 18px 20px; min-width: 0; }
.ua-legend { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 14px; }
.ua-key { border: 0; background: var(--ff-surface); border-radius: 999px; padding: 4px 10px; font-size: 12px; display: inline-flex; align-items: center; gap: 6px; color: inherit; }
.ua-key i.sq { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.ua-key b { font-weight: 600; }
.ua-key.active { box-shadow: inset 0 0 0 1.5px var(--ff-ink); }
.ua-key.zero { opacity: .45; }
.ua-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 10px; }
.ua-card { border: 1px solid var(--ff-ink); text-align: left; border-radius: 14px; padding: 11px 12px 10px; display: flex; flex-direction: column; gap: 2px; color: var(--ff-ink); position: relative; transition: transform .12s, box-shadow .12s; }
.ua-card:hover { transform: translateY(-1px); box-shadow: 0 0 0 1px var(--ff-ink); }
.ua-card.dim { opacity: .3; }
.ua-card.u-green { background: var(--ff-green-soft); }
.ua-card.u-amber { background: var(--ff-amber-soft); }
.ua-card.u-violet { background: #efe9ff; }
.ua-card.u-purple { background: var(--ff-lavender); }
.ua-card.u-dark { background: #26262a; color: #fff; }
.ua-card.u-dark .ua-meta, .ua-card.u-dark .ua-price span, .ua-card.u-dark .ua-holder span { color: #a9a9ae; }
.ua-card.u-orange { background: #fdeadf; }
.ua-card.u-red { background: var(--ff-red-soft, #fde8e8); }
.ua-card.u-grey { background: var(--ff-surface-2); }
/* floor / site plan */
.ua-plan { margin: 0 0 16px; padding: 12px 14px 8px; border: 1px solid var(--ff-border); border-radius: 12px; background: #fff; }
.ua-plan-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.ua-plan svg { display: block; width: 100%; height: auto; font-family: inherit; }
.fp-slab { fill: #fafaf8; }
.fp-slab-line { fill: none; stroke: var(--ff-ink); stroke-width: 5; }
.fp-corr { fill: #ecece8; }
.fp-corr-t { font-size: 15px; fill: #a5a5a0; }
.fp-core { fill: #dcdcd7; stroke: var(--ff-ink); stroke-width: 2; }
.fp-lift { fill: #fff; stroke: var(--ff-ink-2); stroke-width: 1.2; }
.fp-core-t { font-size: 18px; font-weight: 600; fill: var(--ff-ink); }
.fp-road { fill: #e4e4df; }
.fp-road-mark { stroke: #fff; stroke-width: 2; stroke-dasharray: 14 10; }
.fp-caption { font-size: 16px; font-weight: 500; fill: var(--ff-ink-2); }
.fp-north path { fill: var(--ff-ink); }
.fp-north text { font-size: 13px; font-weight: 600; fill: var(--ff-ink); }
.fp-unit { cursor: pointer; outline: none; }
.fp-unit rect.u { stroke: var(--ff-ink); stroke-width: 1.5; transition: stroke-width .12s; }
.fp-unit:hover rect.u, .fp-unit:focus-visible rect.u { stroke-width: 3.5; }
.fp-unit.dim { opacity: .25; }
.fp-unit.u-green rect.u { fill: var(--ff-green-soft); }
.fp-unit.u-amber rect.u { fill: var(--ff-amber-soft); }
.fp-unit.u-violet rect.u { fill: #efe9ff; }
.fp-unit.u-purple rect.u { fill: var(--ff-lavender); }
.fp-unit.u-dark rect.u { fill: #26262a; }
.fp-unit.u-orange rect.u { fill: #fdeadf; }
.fp-unit.u-red rect.u { fill: var(--ff-red-soft, #fde8e8); }
.fp-unit.u-grey rect.u { fill: var(--ff-surface-2); }
.fp-door { stroke: #ecece8; stroke-width: 4; }
.fp-balcony { stroke: var(--ff-ink-3); stroke-width: 1; stroke-dasharray: 4 4; }
.fp-no { font-size: 22px; font-weight: 600; fill: var(--ff-ink); }
.fp-sm { font-size: 16px; fill: var(--ff-ink-2); }
.fp-st { font-size: 14px; fill: var(--ff-ink-3); }
.fp-unit.u-dark text { fill: #fff; }
.fp-unit.u-dark .fp-sm, .fp-unit.u-dark .fp-st { fill: #b9b9be; }
.ua-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.ua-top b { font-size: 16px; font-weight: 600; }
.ua-status { font-size: 10.5px; text-transform: uppercase; font-weight: 500; opacity: .75; }
.ua-type { font-size: 12.5px; font-weight: 500; }
.ua-meta { font-size: 11.5px; color: var(--ff-ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ua-price { font-size: 14px; font-weight: 600; margin-top: 4px; display: flex; align-items: baseline; gap: 6px; }
.ua-price span { font-size: 11px; font-weight: 400; color: var(--ff-ink-3); }
.ua-holder { margin-top: 6px; padding-top: 6px; border-top: 1px solid rgba(17, 17, 19, .08); font-size: 11.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; flex-direction: column; }
.ua-holder span { font-weight: 400; color: var(--ff-ink-3); overflow: hidden; text-overflow: ellipsis; }
.ua-stack { display: flex; flex-direction: column; gap: 3px; }
.ua-stack-row { display: flex; align-items: center; gap: 3px; cursor: pointer; padding: 1px 4px; border-radius: 6px; }
.ua-stack-row:hover, .ua-stack-row.active { background: var(--ff-lavender); }
.ua-stack-row span { width: 30px; font-size: 11px; color: var(--ff-ink-3); flex: none; }
.ua-stack-row i { width: 26px; height: 12px; border-radius: 3px; flex: none; }
.ua-stack-row i.dim { opacity: .25; }
/* approval limits strip */
.limits-strip { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 10px 14px; border-radius: 14px; background: var(--ff-surface); }
.limit-chip { font-size: 12px; background: #fff; border-radius: 999px; padding: 4px 10px; }
.limit-chip b { color: var(--ff-purple); font-weight: 600; }
/* printable offer */
.offer-frame { background: var(--ff-surface); border-radius: 16px; padding: 18px; }
.offer-doc { background: #fff; max-width: 760px; margin: 0 auto; padding: 32px 36px; font-size: 13px; line-height: 1.55; color: #111113; border-radius: 6px; box-shadow: 0 1px 3px rgba(17, 17, 19, .08); }
.offer-doc p { margin: 12px 0; }
.od-head { display: flex; justify-content: space-between; gap: 20px; border-bottom: 2px solid #111113; padding-bottom: 14px; margin-bottom: 16px; }
.od-brand { font-size: 18px; font-weight: 600; }
.od-title { font-size: 20px; font-weight: 600; text-align: right; }
.od-right { text-align: right; }
.od-muted { color: #6b6b72; font-size: 12px; }
.od-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 8px; }
.od-label { font-size: 10.5px; text-transform: uppercase; color: #6b6b72; margin: 10px 0 4px; }
.od-table { width: 100%; border-collapse: collapse; margin: 10px 0; }
.od-table td, .od-table th { padding: 6px 8px; border-bottom: 1px solid #ececea; text-align: left; font-size: 12.5px; }
.od-table th { font-weight: 500; color: #6b6b72; font-size: 11px; text-transform: uppercase; }
.od-table .r { text-align: right; font-variant-numeric: tabular-nums; }
.od-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 40px; }
.od-sign div { border-top: 1px solid #111113; padding-top: 6px; font-size: 12px; color: #6b6b72; }
@media print { .offer-doc { box-shadow: none; padding: 0; max-width: none; } }

/* ==========================================================================
   Customer & handover
   ========================================================================== */
.cus-ev-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.cus-ev-chips .chip { border: 0; cursor: pointer; }
.cus-ev-chips .chip b { font-weight: 600; margin-left: 2px; }
.cus-ev-chips .chip.active { background: var(--ff-ink); color: #fff; }
.vt-mark.dark { background: var(--ff-ink); }
/* readiness checklist */
.cus-check-group { background: var(--ff-surface); border-radius: 14px; padding: 10px 12px; margin-bottom: 10px; }
.cus-check-head { display: flex; align-items: center; justify-content: space-between; font-size: 13px; padding: 2px 2px 6px; }
.cus-check-row { display: flex; align-items: flex-start; gap: 10px; background: #fff; border-radius: 10px; padding: 9px 10px; margin-top: 6px; }
.cus-check-row > .pill, .cus-check-row > .btn-ff { flex: none; margin-top: 1px; }
.cus-check-dot { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex: none; font-size: 12px; background: var(--ff-surface); color: var(--ff-ink-3); }
.cus-check-dot.green { background: var(--ff-green-soft); color: var(--ff-green-text); }
.cus-check-dot.violet { background: var(--ff-lavender); color: var(--ff-purple); }
/* collections ageing */
.cus-ageing { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.cus-age { position: relative; border: 0; text-align: left; background: #fff; border-radius: 14px; padding: 12px 14px 16px; display: flex; flex-direction: column; gap: 3px; color: inherit; overflow: hidden; }
.cus-age:hover { box-shadow: inset 0 0 0 1.5px var(--ff-ink); }
.cus-age b { font-size: 18px; font-weight: 600; }
.cus-age i { position: absolute; left: 0; bottom: 0; height: 4px; background: var(--ff-purple); border-radius: 0 4px 0 0; }
.cus-age.warn i { background: var(--ff-amber); }
.cus-age.alert i { background: var(--ff-red); }
.cus-age.alert b { color: var(--ff-red-text); }
/* handover calendar */
.cus-cal-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 14px; align-items: start; }
.cus-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cus-cal-dow { font-size: 11px; text-transform: uppercase; color: var(--ff-ink-3); padding: 0 4px; }
.cus-cal-day { background: #fff; border-radius: 10px; min-height: 96px; padding: 6px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cus-cal-day.out { opacity: .45; }
.cus-cal-day.today { box-shadow: inset 0 0 0 1.5px var(--ff-purple); }
.cus-cal-n { font-size: 12px; font-weight: 600; color: var(--ff-ink-2); }
.cus-cal-ev { border: 0; text-align: left; font-size: 11px; line-height: 1.25; padding: 3px 6px; border-radius: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: var(--ff-lavender); color: var(--ff-purple-text); }
.cus-cal-ev b { font-weight: 600; }
.cus-cal-ev.green { background: var(--ff-green-soft); color: var(--ff-green-text); }
.cus-cal-ev.amber { background: var(--ff-amber-soft); color: var(--ff-amber-text); }
.cus-cal-ev.red { background: var(--ff-red-soft); color: var(--ff-red-text); }
.cus-cal-ev.dark { background: #26262a; color: #fff; }
.cus-cal-wrap .list-row { background: #fff; }
/* customer statement */
.cus-st-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
@media (max-width: 1199.98px) { .cus-cal-wrap, .cus-st-grid { grid-template-columns: 1fr; } .cus-ageing { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 767.98px) { .cus-ageing { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cus-cal-day { min-height: 70px; } }

/* ==========================================================================
   Chunk 8 · access control, approvals, notifications, HR
   ========================================================================== */
.masked { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--ff-ink-3); background: var(--ff-surface); border-radius: 999px; padding: 1px 8px; white-space: nowrap; }
.masked i { font-size: 11px; }
.check-ff:indeterminate { background: var(--ff-purple); border-color: var(--ff-purple); }
.check-ff:indeterminate::after { opacity: 1; width: 8px; height: 0; border-width: 2px 0 0; transform: none; }
.checks-field { display: flex; flex-wrap: wrap; gap: 6px; max-height: 260px; overflow: auto; padding: 2px; }
.check-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--ff-border); background: #fff; font-size: 13px; cursor: pointer; }
.check-chip:hover { border-color: var(--ff-border-strong); }
.check-chip:has(input:checked) { border-color: var(--ff-purple); background: var(--ff-lavender); }
.checks-field .check-chip .ink-3 { margin-left: 2px; }
.demo-chip { max-width: 220px; }
.demo-chip .truncate { max-width: 150px; }
.preview-bar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; margin-bottom: 14px; border-radius: 12px; background: var(--ff-amber-soft); color: var(--ff-amber-text); font-size: 13px; }
.switch-list { max-height: 52vh; overflow: auto; }
.notif-meta { display: flex; gap: 6px; align-items: center; margin-top: 4px; }

/* approval route & workflow flow */
.wf-route { display: flex; flex-direction: column; gap: 0; }
.wf-step { display: flex; gap: 12px; padding: 10px 0; position: relative; }
.wf-step + .wf-step::before { content: ""; position: absolute; left: 13px; top: -10px; height: 20px; border-left: 2px solid var(--ff-border); }
.wf-dot { flex: none; width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; background: var(--ff-surface-2); color: var(--ff-ink-2); }
.wf-step.done .wf-dot { background: var(--ff-green-soft); color: var(--ff-green-text); }
.wf-step.rejected .wf-dot { background: var(--ff-red-soft); color: var(--ff-red-text); }
.wf-step.current .wf-dot { background: var(--ff-amber-soft); color: var(--ff-amber-text); box-shadow: 0 0 0 3px #fff, 0 0 0 4px var(--ff-amber); }
.wf-step.returned .wf-dot { background: var(--ff-lavender); color: var(--ff-purple-deep); }
.wf-comment { font-size: 12.5px; color: var(--ff-ink-2); background: var(--ff-surface); border-radius: 8px; padding: 6px 10px; margin-top: 4px; }
.wf-flow { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.wf-flow.compact { gap: 4px; }
.wf-flow.compact .wf-node { padding: 4px 8px; min-width: 0; max-width: 150px; border-radius: 9px; }
.wf-flow.compact .wf-node-m { display: none; }
.wf-flow.compact .wf-node-t, .wf-flow.compact .wf-node-s { font-size: 11.5px; }
.wf-node { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border-radius: 12px; background: #fff; border: 1px solid var(--ff-border); min-width: 150px; max-width: 230px; }
.wf-node-n { flex: none; font-size: 11px; font-weight: 600; color: var(--ff-purple-deep); background: var(--ff-lavender); border-radius: 6px; padding: 1px 6px; margin-top: 1px; }
.wf-node-t { font-size: 13px; font-weight: 500; }
.wf-node-s { font-size: 12px; color: var(--ff-ink-2); display: flex; gap: 4px; align-items: center; }
.wf-node-m { font-size: 11px; color: var(--ff-ink-3); }
.wf-arrow { color: var(--ff-ink-3); font-size: 12px; }
.wf-cap { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; padding: 4px 10px; border-radius: 999px; background: var(--ff-surface); color: var(--ff-ink-2); }
.wf-cap.end { background: var(--ff-green-soft); color: var(--ff-green-text); }
.wf-parallel { display: flex; flex-direction: column; gap: 6px; padding: 8px; border: 1px dashed var(--ff-purple-border); border-radius: 14px; position: relative; }
.wf-par-label { font-size: 10.5px; text-transform: uppercase; color: var(--ff-purple-deep); }
.wf-flow.compact .wf-parallel { flex-direction: row; padding: 4px; }
.wf-flow.compact .wf-par-label { display: none; }
.wf-canvas { padding: 18px; border-radius: 16px; background: var(--ff-surface); margin-bottom: 16px; overflow-x: auto; }
.wf-cover { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.wf-cover-chip { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 12px; background: #fff; border: 1px solid var(--ff-border); font-size: 13px; text-align: left; }
.wf-cover-chip:hover { border-color: var(--ff-border-strong); }
.wf-cover-chip b { margin-left: auto; font-weight: 600; color: var(--ff-purple-deep); }
.wf-cover-chip.empty { color: var(--ff-ink-3); }
.wf-cover-chip.empty b { color: var(--ff-ink-3); }

/* My Approvals */
.ap-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.ap-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin-bottom: 18px; }
.ap-kpi { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: 16px; background: #fff; border: 1px solid var(--ff-border); text-align: left; }
.ap-kpi:hover { border-color: var(--ff-border-strong); box-shadow: var(--sh-xs); }
.ap-kpi-n { display: block; font-size: 24px; font-weight: 500; line-height: 1.1; }
.ap-kpi-l { display: block; font-size: 13px; font-weight: 500; }
.ap-kpi-s { display: block; font-size: 12px; color: var(--ff-ink-3); }
.ap-kpi.purple .icon-tile { background: var(--ff-lavender); color: var(--ff-purple-deep); }
.ap-kpi.green .icon-tile { background: var(--ff-green-soft); color: var(--ff-green-text); }
.ap-kpi.red .icon-tile { background: var(--ff-red-soft); color: var(--ff-red-text); }
.ap-kpi.amber .icon-tile { background: var(--ff-amber-soft); color: var(--ff-amber-text); }
.ap-kpi.amber .ap-kpi-n { color: var(--ff-amber-text); }
.row-acts .ap-ok { color: var(--ff-green-text); }

/* Notification centre */
.notif-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.notif-cat { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: #fff; border: 1px solid var(--ff-border); }
.notif-cat:hover { border-color: var(--ff-border-strong); }
.notif-cat.empty { opacity: .6; }
.unread-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ff-purple); margin-right: 6px; }
.unread-dot.off { background: var(--ff-border-strong); }
.table-ff tr.is-unread-row td:first-child { box-shadow: inset 3px 0 0 var(--ff-purple); }

/* Roles & permissions */
.roles-layout { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1100px) { .roles-layout { grid-template-columns: 1fr; } }
.roles-list { position: sticky; top: 12px; padding: 14px; }
.roles-items { display: flex; flex-direction: column; gap: 4px; max-height: 70vh; overflow: auto; }
.role-item { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 10px; background: none; border: 0; width: 100%; }
.role-item:hover { background: var(--ff-surface); }
.role-item.active { background: var(--ff-lavender); box-shadow: inset 0 0 0 1px var(--ff-purple-border); }
.role-head { margin-bottom: 14px; }
.pm-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.pm-summary { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 10px; }
.pm-scroll { max-height: 64vh; }
.pm-matrix thead th { position: sticky; top: 0; z-index: 2; background: var(--ff-surface); }
.pm-matrix .pm-col { width: 66px; text-align: center; }
.pm-matrix .pm-split { border-left: 2px solid var(--ff-border) !important; }
.pm-matrix .pm-name { min-width: 300px; }
.pm-matrix tr.pm-module td { background: var(--ff-surface); }
.pm-matrix tr.pm-page.is-off td { color: var(--ff-ink-3); }
.pm-toggle { display: inline-flex; align-items: center; gap: 8px; background: none; border: 0; padding: 0; font-size: 13px; }
.pm-indent { display: inline-flex; align-items: center; gap: 8px; padding-left: 34px; font-size: 13px; min-width: 0; }
.pm-indent > i { color: var(--ff-ink-3); }
.pm-inh { font-size: 10.5px; color: var(--ff-ink-3); border: 1px dashed var(--ff-border-strong); border-radius: 6px; padding: 0 5px; }
.save-bar { position: sticky; bottom: 12px; display: none; align-items: center; gap: 10px; margin-top: 12px; padding: 10px 14px; border-radius: 14px; background: var(--ff-ink); color: #fff; font-size: 13px; box-shadow: var(--sh-md, 0 8px 24px rgba(0,0,0,.18)); z-index: 5; }
.save-bar.show { display: flex; }
.save-bar .btn-light-ff { background: rgba(255,255,255,.12); color: #fff; }
.sens-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--ff-border); }
.sens-row:first-of-type { border-top: 0; }

/* HR */
.att-dot { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 7px; font-size: 11px; }
.att-dot.green { background: var(--ff-green-soft); color: var(--ff-green-text); }
.att-dot.violet { background: var(--ff-lavender); color: var(--ff-purple-deep); }
.att-dot.amber { background: var(--ff-amber-soft); color: var(--ff-amber-text); }
.att-dot.red { background: var(--ff-red-soft); color: var(--ff-red-text); }
.att-dot.grey { background: var(--ff-surface-2); color: var(--ff-ink-2); }
.cert-alerts { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.cert-alert { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--ff-border); background: #fff; }
.cert-alert.red { background: var(--ff-red-soft); border-color: transparent; }
.cert-alert.amber { background: var(--ff-amber-soft); border-color: transparent; }
.org-row { min-height: 56px; cursor: default; }

.form-grid.cols-1 { grid-template-columns: minmax(0, 1fr); }

/* ==========================================================================
   Card rows: cards side by side share one height; two cards split 50/50
   ========================================================================== */
.main-panel .erp-dash-grid, .main-panel .erp-dash-grid.even,
.main-panel .hier-layout, .main-panel .cus-cal-wrap { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.main-panel :is(.erp-dash-grid, .dash-grid-3, .rpt-lib, .cus-st-grid, .hier-layout, .cus-cal-wrap, .roles-layout) { align-items: stretch; }
/* A wrapper around a card lets its (last) card fill the row height. */
.main-panel :is(.erp-dash-grid, .dash-grid-3, .rpt-lib, .cus-st-grid, .cus-cal-wrap) > :not(.card-ff) { display: flex; flex-direction: column; min-width: 0; }
.main-panel :is(.erp-dash-grid, .dash-grid-3, .rpt-lib, .cus-st-grid, .cus-cal-wrap) > :not(.card-ff) > .card-ff:last-child { flex: 1 1 auto; }
/* ==========================================================================
   Form controls: 1px #ccc border and 5px corners everywhere. Capsule controls (table search, date
   range) keep their rounding. :not() pairs raise specificity above the template's variant classes.
   ========================================================================== */
:is(.input-ff, .select-ff, .people-input):not(.ff-x):not(.ff-y) { border: 1px solid #ccc; border-radius: 5px; }
.file-drop:not(.ff-x) { border-color: #ccc; border-radius: 5px; }
.input-ff.dt-search:not(.ff-x):not(.ff-y) { border-radius: 999px; }
.dt-date .input-ff:not(.ff-x):not(.ff-y) { border: 0; border-radius: 0; background: transparent; box-shadow: none; }
/* Capsule pickers (header search, filter dropdowns, date range) get the same border, rounding kept. */
:is(.search-pill, .filter-chip, .dt-date):not(.ff-x) { border: 1px solid #ccc; }
:is(.filter-chip, .dt-date).is-active:not(.ff-x) { border-color: var(--ff-purple-border); }
.filter-chip:not(.ff-x):is(:focus-visible, [aria-expanded="true"]) { border-color: var(--ff-purple); }
:is(.input-ff, .select-ff, .people-input):not(.ff-x):not(.ff-y):is(:focus, :focus-within, .open) { border-color: var(--ff-purple); }
:is(.input-ff, .select-ff):not(.ff-x):not(.ff-y).is-ai { border-color: var(--ff-purple-border); }
:is(.input-ff, .select-ff):not(.ff-x):not(.ff-y).is-warn { border-color: var(--ff-amber); }
.form-field.is-invalid :is(.input-ff, .select-ff):not(.ff-x):not(.ff-y) { border-color: var(--ff-red); }

/* Navigation list beside a workspace (roles, unit availability): same height, list keeps its width. */
.main-panel .ua-layout { align-items: stretch; }
.main-panel .roles-main { display: flex; flex-direction: column; min-width: 0; }
.main-panel .roles-main > .card-ff:last-child { flex: 1 1 auto; }
/* Hierarchy: tree and detail panels fit the screen at one height and scroll on their own. */
.main-panel .hier-layout > .tree, .main-panel .hier-layout > .hier-detail { height: calc(100vh - 230px); min-height: 520px; overflow-y: auto; }
.main-panel .hier-detail { position: static; display: flex; flex-direction: column; }
.main-panel .hier-detail > .card-ff { flex: 1 0 auto; }
@media (max-width: 1199.98px) {
  .main-panel .erp-dash-grid, .main-panel .erp-dash-grid.even, .main-panel .hier-layout, .main-panel .cus-cal-wrap { grid-template-columns: minmax(0, 1fr); }
  .main-panel .hier-layout > .tree, .main-panel .hier-layout > .hier-detail { height: auto; min-height: 0; overflow: visible; }
}

/* ==========================================================================
   Sign-in page (index.html)
   ========================================================================== */
.login-page { --login-gap: 12px; min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
/* Always exactly one viewport tall, so the gap above, beside and below the panel stays equal. */
.login-brand { position: sticky; top: var(--login-gap); height: calc(100vh - 2 * var(--login-gap)); margin: var(--login-gap) 0 var(--login-gap) var(--login-gap); overflow: hidden; padding: 36px 48px 32px; border-radius: 24px; background: #111113; color: #fff; display: flex; flex-direction: column; gap: 32px; }
/* Blueprint grid that fades out towards the edges. */
.login-brand::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255, 255, 255, .055) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .055) 1px, transparent 1px); background-size: 44px 44px; -webkit-mask-image: radial-gradient(ellipse 75% 60% at 50% 42%, #000 30%, transparent 80%); mask-image: radial-gradient(ellipse 75% 60% at 50% 42%, #000 30%, transparent 80%); pointer-events: none; }
.login-brand::after { content: ""; position: absolute; width: 520px; height: 520px; left: 50%; top: 40%; transform: translate(-50%, -50%); border-radius: 50%; background: radial-gradient(circle, rgba(108, 59, 255, .28), rgba(108, 59, 255, 0) 65%); pointer-events: none; }
.login-brand > * { position: relative; z-index: 1; }
.login-logo { display: inline-flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 600; color: inherit; }
.login-logo:hover { color: inherit; }
.login-logo img { width: 36px; height: 36px; }
.login-brand .login-logo { align-self: flex-start; }
.login-brand .login-logo img { box-shadow: 0 0 0 1px rgba(255, 255, 255, .14); border-radius: 14px; }
.login-showcase { flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: center; width: 100%; max-width: 440px; margin: 0 auto; }
.lp-card { background: #fff; color: var(--ff-ink); border-radius: 16px; box-shadow: 0 24px 60px rgba(0, 0, 0, .45); }
.lp-project { padding: 20px; }
.lp-approval { display: flex; align-items: center; gap: 12px; padding: 14px 16px; margin: -18px -28px 0 48px; box-shadow: 0 18px 40px rgba(0, 0, 0, .5); }
.lp-head { display: flex; align-items: center; gap: 12px; }
.lp-icon { flex: none; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--ff-lavender); color: var(--ff-purple); font-size: 18px; }
.lp-icon.amber { background: var(--ff-amber-soft); color: var(--ff-amber-text); }
.lp-title { font-size: 14.5px; font-weight: 600; line-height: 1.3; }
.lp-sub { font-size: 12.5px; color: var(--ff-ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lp-pill { flex: none; margin-left: auto; padding: 3px 10px; border-radius: 999px; background: var(--ff-green-soft); color: var(--ff-green-text); font-size: 11.5px; font-weight: 500; }
.lp-pill.amber { background: var(--ff-amber-soft); color: var(--ff-amber-text); }
.lp-progress { margin-top: 20px; }
.lp-progress-label { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 12.5px; color: var(--ff-ink-2); }
.lp-progress-label b { font-weight: 600; color: var(--ff-ink); }
.lp-bar { height: 8px; border-radius: 999px; background: var(--ff-surface-2); overflow: hidden; }
.lp-bar i { display: block; height: 100%; border-radius: inherit; background: var(--ff-purple); }
.lp-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--ff-border); }
.lp-stats div + div { padding-left: 14px; border-left: 1px solid var(--ff-border); }
.lp-stats span { display: block; font-size: 12px; color: var(--ff-ink-3); }
.lp-stats b { display: block; margin-top: 2px; font-size: 15px; font-weight: 600; }
.login-pitch h2 { margin: 0 0 10px; font-size: 30px; line-height: 1.2; font-weight: 600; }
.login-pitch p { max-width: 460px; margin: 0; font-size: 14.5px; line-height: 1.6; color: rgba(255, 255, 255, .62); }
.login-foot { display: flex; justify-content: space-between; gap: 16px; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, .1); font-size: 12.5px; color: rgba(255, 255, 255, .45); }
.login-main { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 48px 24px; }
.login-card { width: 100%; max-width: 380px; }
.login-logo-sm { display: none; margin-bottom: 28px; }
.login-card h1 { margin: 0 0 6px; font-size: 28px; font-weight: 600; }
.login-lead { margin: 0 0 28px; font-size: 14px; color: var(--ff-ink-2); }
.login-field { margin-bottom: 16px; }
.login-card .input-ff { height: 44px; background: #fff; font-size: 14px; }
.login-card .input-ff:focus-within { border-color: var(--ff-purple); box-shadow: 0 0 0 3px rgba(108, 59, 255, .12); }
.login-card .input-ff > i { font-size: 16px; color: var(--ff-ink-3); }
.login-eye { display: grid; place-items: center; padding: 0; border: 0; background: none; color: var(--ff-ink-3); font-size: 16px; cursor: pointer; }
.login-eye:hover { color: var(--ff-ink); }
.login-submit { width: 100%; height: 44px; margin-top: 8px; font-size: 14px; }
.login-error { display: none; align-items: center; gap: 8px; margin-bottom: 16px; padding: 10px 12px; border-radius: 5px; background: var(--ff-red-soft); color: var(--ff-red-text); font-size: 13px; }
.login-error.show { display: flex; }
.login-error i { font-size: 16px; }
.login-demo { display: flex; gap: 10px; margin-top: 20px; padding: 12px 14px; border-radius: 5px; border: 1px solid var(--ff-ai-border); background: var(--ff-lavender); font-size: 12.5px; line-height: 1.55; color: var(--ff-ink-2); }
.login-demo i { flex: none; margin-top: 2px; font-size: 15px; color: var(--ff-purple); }
.login-demo b { font-weight: 500; color: var(--ff-ink); font-family: var(--mono); font-size: 12px; }
/* Short screens: tighten the panel, then drop the preview cards, rather than overflow it. */
@media (max-height: 760px) {
  .login-brand { padding: 28px 40px 24px; gap: 24px; }
  .login-pitch p { display: none; }
}
@media (max-height: 540px) {
  .login-showcase { display: none; }
  .login-pitch { margin-top: auto; }
}
@media (max-width: 991.98px) {
  .login-page { grid-template-columns: minmax(0, 1fr); }
  .login-brand { display: none; }
  .login-logo-sm { display: inline-flex; }
}
