:root {
  --bg: #f4f7fb;
  --surface: #fff;
  --border: #d9e4f4;
  --primary: #162f5b;
  --text: #162f5b;
  --muted: #64748b;
}

* { box-sizing: border-box; }
.hidden { display: none !important; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Be Vietnam Pro", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

body.encity-booting .app-layout {
  visibility: hidden;
}

.encity-splashscreen {
  position: fixed;
  inset: 0;
  z-index: 5000;
  background: #fff;
  display: grid;
  place-items: center;
  opacity: 1;
  visibility: visible;
  transition: opacity .22s ease, visibility 0s linear .22s;
}

.encity-splashscreen.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.encity-splashscreen-inner {
  width: min(240px, 70vw);
  display: grid;
  gap: 12px;
  justify-items: center;
}

.encity-splashscreen-logo {
  width: min(180px, 55vw);
  height: auto;
  display: block;
}

.encity-splashscreen-bar {
  width: 100%;
  height: 4px;
  border-radius: 999px;
  overflow: hidden;
  background: #dbeafe;
}

.encity-splashscreen-bar span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #162f5b 0%, #162f5b 100%);
  animation: encitySplashFill .55s linear forwards;
}

.encity-splashscreen-text {
  font-size: 14px;
  font-weight: 700;
  color: #475569;
  text-align: center;
}

@keyframes encitySplashFill {
  0% { width: 0; }
  100% { width: 100%; }
}

.encity-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 4900;
  background: rgba(255, 255, 255, .28);
  backdrop-filter: blur(.6px);
  display: grid;
  place-items: center;
  opacity: 1;
  visibility: visible;
  transition: opacity .18s ease, visibility 0s linear .18s;
}

.encity-loading-overlay.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.encity-loading-spinner {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 4px solid rgba(37, 99, 235, .16);
  border-top-color: #162f5b;
  border-right-color: #38bdf8;
  animation: encitySpinnerRotate .72s linear infinite;
}

@keyframes encitySpinnerRotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.encity-dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 4950;
  background: rgba(15, 23, 42, .34);
  display: grid;
  place-items: center;
  padding: 18px;
  opacity: 1;
  visibility: visible;
  transition: opacity .18s ease, visibility 0s linear .18s;
}

.encity-dialog-overlay.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.encity-dialog {
  width: min(420px, 100%);
  background: #fff;
  border: 1px solid #dbe7f7;
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, .22);
  padding: 18px;
  display: grid;
  gap: 14px;
}

.encity-dialog-title {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
}

.encity-dialog-message {
  color: #334155;
  line-height: 1.55;
  white-space: pre-wrap;
}

.encity-dialog-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.app-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 268px 1fr;
  transition: grid-template-columns .2s ease;
}

.app-sidebar {
  background: #f1f5fb;
  border-right: 1px solid var(--border);
  padding: 8px 12px 12px 0;
  transition: padding .2s ease;
}

.brand {
  min-height: 86px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 8px 10px;
  margin-bottom: 8px;
  border-bottom: 1px solid #dbe7f7;
}

.brand-logo {
  width: 86px;
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

.menu { display: grid; gap: 4px; }
.menu-group {
  display: grid;
  gap: 6px;
}
.menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 10px 9px 12px;
  border-radius: 0 999px 999px 0;
  color: #334155;
  text-decoration: none;
  border-top: 1px solid transparent;
  border-right: 1px solid transparent;
  border-bottom: 1px solid transparent;
  border-left: 0;
  font-weight: 600;
  font-size: 13px;
  line-height: 1.25;
}
.menu-item i { font-size: 13px; width: 16px; text-align: center; }
.menu-item:hover {
  background: #162f5b;
  border-top-color: #162f5b;
  border-right-color: #162f5b;
  border-bottom-color: #162f5b;
  color: #fff;
  box-shadow: 0 8px 20px rgba(37, 99, 235, .22);
}
.menu-item.active {
  background: #162f5b;
  border-top-color: #162f5b;
  border-right-color: #162f5b;
  border-bottom-color: #162f5b;
  color: #fff;
  box-shadow: 0 8px 20px rgba(37, 99, 235, .22);
}
.menu-submenu {
  display: grid;
  gap: 4px;
  padding-left: 18px;
}
.menu-subitem {
  display: block;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  color: #4a5f84;
  text-decoration: none;
}
.menu-subitem:hover {
  color: #17356a;
  background: #eaf2ff;
}
.menu-subitem.active {
  color: #17356a;
  background: #dfeaff;
}

.topbar {
  height: 62px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  background: #fff;
}
.topbar-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.topbar-sidebar-toggle {
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
  border-radius: 10px;
  border: 1px solid #cfe0f8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #1f3b66;
}
.topbar-sidebar-toggle i {
  font-size: 14px;
  transition: transform .2s ease;
}
.topbar-sidebar-toggle:hover {
  background: #edf4ff;
}
.topbar-title { font-size: 18px; font-weight: 700; }
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.topbar-profile-wrap {
  position: relative;
}
.topbar-profile-trigger {
  width: 42px;
  min-width: 42px;
  height: 42px;
  min-height: 42px;
  border-radius: 999px;
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.topbar-profile-trigger:hover,
.topbar-profile-trigger:focus {
  border: 0;
  background: transparent;
  box-shadow: none;
}
.topbar-avatar {
  width: 30px;
  height: 30px;
  min-width: 30px;
  min-height: 30px;
  aspect-ratio: 1 / 1;
  flex: 0 0 30px;
  border-radius: 999px;
  background: #162f5b;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
}
.topbar-avatar.lg {
  width: 36px;
  height: 36px;
  font-size: 14px;
}
.topbar-user {
  display: grid;
  justify-items: end;
  gap: 2px;
}
.topbar-user-name {
  font-size: 14px;
  font-weight: 700;
}
.topbar-user-role {
  color: var(--muted);
  font-size: 12px;
}
.btn-icon.topbar-bell {
  position: relative;
  width: 42px;
  min-width: 42px;
  height: 42px;
  min-height: 42px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.topbar-profile-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(320px, calc(100vw - 24px));
  border: 1px solid #d8e4f7;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 12px 26px rgba(15, 23, 42, .16);
  padding: 10px;
  z-index: 1210;
  display: grid;
  gap: 10px;
}
.topbar-profile-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.topbar-profile-meta {
  min-width: 0;
}
.topbar-profile-email {
  color: #64748b;
  font-size: 12px;
  line-height: 1.35;
  word-break: break-word;
  border-top: 1px dashed #dbe7f7;
  padding-top: 8px;
}
.topbar-profile-logout {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  line-height: 1;
  text-decoration: none;
}
.topbar-profile-logout i {
  font-size: 20px;
  line-height: 1;
}

@media (min-width: 981px) {
  body.sidebar-collapsed .app-layout {
    grid-template-columns: 84px 1fr;
  }
  body.sidebar-collapsed .app-sidebar {
    padding-right: 8px;
  }
  body.sidebar-collapsed .brand {
    min-height: 72px;
    padding: 8px 6px 8px;
  }
  body.sidebar-collapsed .brand-logo {
    width: 42px;
  }
  body.sidebar-collapsed .menu {
    gap: 6px;
    padding-right: 0;
  }
  body.sidebar-collapsed .menu-item {
    border-radius: 12px;
    margin: 0 8px;
    padding: 10px 0;
    justify-content: center;
    gap: 0;
  }
  body.sidebar-collapsed .menu-item span {
    display: none;
  }
  body.sidebar-collapsed .menu-item i {
    width: auto;
    font-size: 15px;
  }
  body.sidebar-collapsed .topbar-sidebar-toggle i {
    transform: rotate(180deg);
  }
}
.notification-badge {
  position: absolute;
  top: -6px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  display: grid;
  place-items: center;
  border: 2px solid #fff;
}

.page-content {
  padding: 14px;
  display: grid;
  gap: 12px;
  min-width: 0;
}

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  min-width: 0;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.kpi {
  border: 1px solid #cfe0f8;
  border-radius: 14px;
  padding: 10px 12px;
  background: linear-gradient(180deg, #f8fbff 0%, #f2f8ff 100%);
}
.kpi-label { color: #475569; font-size: 13px; }
.kpi-value { font-size: 28px; font-weight: 800; margin-top: 3px; }

.toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.page-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid #d9e4f4;
  margin-bottom: 12px;
}

.page-tab {
  height: 38px;
  border: 1px solid #bfd2ef;
  border-bottom-color: transparent;
  border-radius: 12px 12px 0 0;
  padding: 0 14px;
  background: #f8fbff;
  color: #475569;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.page-tab.active {
  background: #162f5b;
  border-color: #162f5b;
  color: #fff;
}

#encity-live-tabs.page-tabs {
  flex-wrap: wrap;
  row-gap: 8px;
}

.live-blocklist-lead {
  margin: 0 0 12px;
  color: #475569;
  font-size: 14px;
  line-height: 1.45;
}

.encity-live-blocklist-page .live-toolbar-blocklist {
  margin-bottom: 12px;
}

.catalog-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1.1fr) 180px repeat(3, auto);
  gap: 10px;
  align-items: center;
}

.catalog-toolbar .btn {
  white-space: nowrap;
}

.projects-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1.1fr) repeat(4, 160px) repeat(3, auto);
  gap: 10px;
  align-items: center;
}
.projects-toolbar .btn { white-space: nowrap; }

.payments-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1.1fr) 180px 150px 140px repeat(3, auto);
  gap: 10px;
  align-items: center;
}

.payments-toolbar .btn {
  white-space: nowrap;
}

.payment-table-panel {
  display: none;
}

.payment-table-panel.active {
  display: block;
}

.payments-pager {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
  margin-top: 10px;
  margin-bottom: 0;
}

.payments-pager .select,
.payments-pager .search-select,
.payments-pager .search-select-trigger {
  width: 90px;
  min-width: 90px;
  flex: 0 0 90px;
}

.payments-pager .muted {
  white-space: nowrap;
}

.timesheet-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1.1fr) 180px 180px 140px 150px repeat(3, auto);
  gap: 10px;
  align-items: center;
}

.timesheet-toolbar .btn {
  white-space: nowrap;
}

.kqxs-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 10px;
  padding-bottom: 2px;
}

.kqxs-toolbar .btn {
  white-space: nowrap;
  flex: 0 0 auto;
}

.filters-inline {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 10px;
  padding-bottom: 2px;
}

.filters-inline > * {
  flex: 0 0 auto;
}

.filters-inline .input,
.filters-inline .select {
  min-width: 190px;
}

.content-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1.2fr) minmax(170px, 0.75fr) minmax(190px, 1fr) minmax(190px, 0.8fr) auto auto;
  align-items: center;
  gap: 10px;
}

#encity-content-module,
#encity-content-module .table-wrap {
  min-width: 0;
  max-width: 100%;
}

#encity-content-module {
  overflow-x: hidden;
}

#encity-content-module .table-wrap {
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}

.content-toolbar #encity-content-search {
  min-width: 0;
}

.content-toolbar #encity-content-status-filter {
  min-width: 0;
}

.content-toolbar #encity-content-type-filter {
  min-width: 0;
}

.content-toolbar #encity-content-category-filter {
  min-width: 0;
}

.content-toolbar .btn {
  white-space: nowrap;
}

.content-category-tabs-wrap {
  margin: -4px 0 12px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 6px;
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.content-category-tabs-scroll {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  white-space: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0 0 7px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scrollbar-color: #90b4ea #edf4ff;
  scrollbar-width: auto;
}

.content-category-scroll-btn {
  width: 34px;
  height: 34px;
  border: 1px solid #bfd2ef;
  border-radius: 999px;
  background: #fff;
  color: #162f5b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.content-category-scroll-btn:hover {
  background: #f3f8ff;
  border-color: #90b4ea;
}

.content-category-tabs {
  display: inline-flex;
  width: max-content;
  min-width: max-content;
  margin: 0;
  border-bottom: 0;
  flex-wrap: nowrap;
  padding-right: 8px;
}

.content-category-tabs .page-tab {
  height: 34px;
  border-radius: 999px;
  border: 1px solid #bfd2ef;
  background: #f8fbff;
  border-bottom-color: #bfd2ef;
  flex: 0 0 auto;
  min-width: max-content;
  white-space: nowrap;
  font-size: 14px;
}

.content-category-tabs .page-tab.active {
  background: #162f5b;
  border-color: #162f5b;
  color: #fff;
}

.content-category-tabs-scroll::-webkit-scrollbar {
  height: 10px;
}

.content-category-tabs-scroll::-webkit-scrollbar-track {
  background: #edf4ff;
  border-radius: 999px;
}

.content-category-tabs-scroll::-webkit-scrollbar-thumb {
  background: #90b4ea;
  border-radius: 999px;
  border: 2px solid #edf4ff;
}

.content-item-drawer-tabs {
  margin-bottom: 14px;
  overflow-x: auto;
  flex-wrap: nowrap;
  padding-bottom: 2px;
}

.content-item-drawer-tabs .page-tab {
  white-space: nowrap;
  flex: 0 0 auto;
}

.content-item-tab-panel {
  padding-top: 4px;
}

.stats-list-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1.2fr) repeat(3, minmax(170px, 0.8fr)) auto auto;
  gap: 10px;
  align-items: center;
}

.stats-list-toolbar .input,
.stats-list-toolbar .select {
  width: 100%;
  min-width: 0;
}

.stats-list-toolbar .btn {
  white-space: nowrap;
}

.stats-quick-toolbar {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 10px;
  align-items: center;
}

.stats-quick-toolbar .input,
.stats-quick-toolbar .select,
.stats-quick-toolbar .btn {
  width: 100%;
}

.date-range-input {
  min-width: 260px;
}

.kqxs-quick-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.kqxs-quick-card {
  border: 1px solid #c4d6f0;
  border-radius: 12px;
  background: #f8fbff;
  padding: 12px;
}

.kqxs-quick-card h4 {
  margin: 0 0 10px;
  font-size: 16px;
}

.kqxs-headtail-table {
  display: grid;
  border: 1px solid #cddcf2;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

.kqxs-headtail-row {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 0;
  align-items: stretch;
  font-size: 16px;
  border-bottom: 1px solid #d9e5f6;
}

.kqxs-headtail-row:last-child {
  border-bottom: 0;
}

.kqxs-headtail-key {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 8px;
  font-weight: 700;
  color: #1e3a66;
  background: #eff5ff;
  border-right: 1px solid #d9e5f6;
}

.kqxs-headtail-values {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 12px;
  font-weight: 600;
  color: #4b607f;
  word-break: break-word;
}

.kqxs-subcard {
  margin-top: 14px;
}

.users-table {
  min-width: 1180px;
}

.users-table th:nth-child(1),
.users-table td:nth-child(1) {
  width: 80px;
}

.users-table th:nth-child(2),
.users-table td:nth-child(2) {
  width: 180px;
}

.users-table th:nth-child(3),
.users-table td:nth-child(3) {
  width: 180px;
}

.users-table th:nth-child(4),
.users-table td:nth-child(4) {
  width: 260px;
}

.users-permissions-card {
  margin-top: 14px;
}

.users-permissions-table {
  min-width: 980px;
}

.users-permissions-table th:first-child,
.users-permissions-table td:first-child {
  min-width: 260px;
}

.users-permissions-table .report-permission-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #1f4f9f;
}

.kqxs-table {
  min-width: 1040px;
}

.crawl-table {
  min-width: 1240px;
}

.stats-table {
  min-width: 1260px;
}

.live-table {
  min-width: 1200px;
}

.live-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 2fr) minmax(200px, 1fr) minmax(180px, 1fr) auto auto auto;
  gap: 10px;
  align-items: center;
  overflow: visible;
  padding-bottom: 0;
}

.live-toolbar > .input,
.live-toolbar > .select,
.live-toolbar > .btn {
  width: 100% !important;
  min-width: 0;
}

.live-toolbar .btn {
  white-space: nowrap;
}

#encity-live-search {
  min-width: 260px;
}

#encity-live-status-filter {
  min-width: 180px;
}

#encity-live-bulk-action {
  min-width: 160px;
}

#encity-live-apply-bulk-action,
#encity-live-refresh,
#encity-live-create {
  width: auto !important;
}

#encity-live-create {
  justify-self: end;
}

.live-quick-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: center;
}

.live-quick-grid .btn {
  white-space: nowrap;
}

.live-quick-span-2 {
  grid-column: span 2;
}

.live-quick-output {
  margin-top: 10px;
  min-height: 180px;
  white-space: pre-wrap;
  overflow: auto;
}

.live-quick-fab {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 1180;
  min-height: 44px;
  border-radius: 999px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, .22);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.live-quick-drawer {
  width: min(560px, 96vw);
}

.live-quick-drawer .drawer-body {
  padding-bottom: 12px;
}

.live-comment-chat {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 12px;
  border: 1px solid #c9d8f0;
  border-radius: 14px;
  background:
    radial-gradient(circle at 20% 20%, rgba(37, 99, 235, .06) 0, transparent 35%),
    radial-gradient(circle at 80% 0%, rgba(22, 47, 91, .05) 0, transparent 36%),
  #f8fbff;
  padding: 12px;
}

.live-comment-threads,
.live-comment-messages {
  border: 1px solid #dbe7f8;
  border-radius: 12px;
  background: #fff;
  min-height: 62vh;
}

.live-comment-thread-list {
  max-height: 62vh;
  overflow: auto;
  padding: 8px;
  display: grid;
  gap: 8px;
}

.live-thread-item {
  width: 100%;
  border: 1px solid #dbe7f8;
  border-radius: 12px;
  padding: 8px;
  background: #fff;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 8px;
  text-align: left;
  cursor: pointer;
}

.live-thread-item.active {
  border-color: #16325c;
  background: #eef4ff;
}

.live-thread-avatar {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: #16325c;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 12px;
}

.live-thread-main {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.live-thread-name {
  font-weight: 700;
  color: #16325c;
}

.live-thread-preview {
  font-size: 12px;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.live-thread-meta {
  display: grid;
  justify-items: end;
  align-content: start;
  gap: 4px;
  font-size: 11px;
  color: #7b8aa3;
}

.live-thread-count {
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #dbe7f8;
  color: #16325c;
  font-weight: 700;
}

.live-comment-chat-list {
  display: grid;
  gap: 10px;
  max-height: 62vh;
  overflow: auto;
  padding: 10px;
  padding-right: 2px;
}

.live-chat-msg {
  display: grid;
  gap: 4px;
  max-width: 76%;
  cursor: pointer;
}

.live-chat-msg.incoming {
  justify-self: start;
}

.live-chat-msg.outgoing {
  justify-self: end;
}

.live-chat-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #64748b;
}

.live-chat-bubble {
  border: 1px solid #d7e3f5;
  border-radius: 14px;
  padding: 10px 12px;
  line-height: 1.45;
  color: #0f2852;
  background: #fff;
  word-break: break-word;
}

.live-chat-msg.outgoing .live-chat-bubble {
  border-color: #18407b;
  background: linear-gradient(180deg, #234b88 0%, #16325c 100%);
  color: #f8fbff;
}

.live-chat-sub {
  font-size: 11px;
  color: #7b8aa3;
}

.live-chat-empty {
  text-align: center;
  color: #64748b;
  padding: 18px 8px;
}

.content-table {
  table-layout: fixed;
  min-width: 0;
}

.content-table th,
.content-table td {
  vertical-align: middle;
}

.content-table td {
  overflow-wrap: anywhere;
  word-break: normal;
}

.content-table--categories th:nth-child(1),
.content-table--categories td:nth-child(1) {
  width: 72px;
}

.content-table--categories th:nth-child(4),
.content-table--categories td:nth-child(4),
.content-table--categories th:nth-child(5),
.content-table--categories td:nth-child(5),
.content-table--categories th:nth-child(6),
.content-table--categories td:nth-child(6) {
  width: 130px;
}

.content-table--items {
  min-width: 1120px;
}

.content-table--items th:nth-child(1),
.content-table--items td:nth-child(1) {
  width: 62px;
}

.content-table--items th:nth-child(2),
.content-table--items td:nth-child(2) {
  width: 210px;
}

.content-table--items th:nth-child(3),
.content-table--items td:nth-child(3) {
  width: 220px;
}

.content-table--items th:nth-child(4),
.content-table--items td:nth-child(4) {
  width: 150px;
}

.content-table--items th:nth-child(5),
.content-table--items td:nth-child(5) {
  width: 120px;
}

.content-table--items th:nth-child(6),
.content-table--items td:nth-child(6) {
  width: 82px;
}

.content-table--items th:nth-child(7),
.content-table--items td:nth-child(7) {
  width: 82px;
}

.content-table--items th:nth-child(8),
.content-table--items td:nth-child(8) {
  width: 130px;
}

.faq-table {
  min-width: 1100px;
}

.page-settings-table {
  min-width: 1320px;
}

.card-head-inline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.card-head-inline .card-title {
  margin: 0;
}

.quick-hours {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.table-sort-btn {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}

.table-sort-btn:hover {
  color: #1d4ed8;
}

.timesheet-time-block-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.timesheet-pager {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
  margin-top: 10px;
  margin-bottom: 0;
}

.timesheet-pager .select {
  width: 90px;
  min-width: 90px;
  flex: 0 0 90px;
}

.timesheet-pager .search-select {
  width: 90px;
  min-width: 90px;
  flex: 0 0 90px;
}

.timesheet-pager .search-select-trigger {
  width: 90px;
  min-width: 90px;
}

.timesheet-pager .muted {
  white-space: nowrap;
}

.project-drawer-tabs {
  margin-bottom: 0;
  flex: 1 1 auto;
}

.project-drawer-top {
  margin: -4px 0 12px;
  padding: 10px 0 0;
  border-bottom: 1px solid #dbe7f8;
}

.project-drawer-tabs-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 0;
}

.project-drawer-tabs-head .btn {
  white-space: nowrap;
  min-width: 148px;
}

.project-status-stepper {
  min-height: 44px;
  margin-bottom: 0;
}

.project-status-stepper .status-step {
  min-width: 132px;
  max-width: none;
}

.project-tab-panel .form-grid {
  gap: 8px 10px;
}

.project-tab-panel .label {
  margin-bottom: 4px;
}

.project-tab-panel textarea.input {
  min-height: 92px;
}

.project-tab-panel textarea#encity-project-dependencies {
  min-height: 78px;
}

.status-stepper {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  background: #fff;
}

.status-step {
  position: relative;
  flex: 1 1 0;
  border: 0;
  background: #fff;
  color: #64748b;
  height: 42px;
  min-width: 120px;
  padding: 0 20px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 50%, calc(100% - 18px) 100%, 0 100%, 18px 50%);
  z-index: 1;
  margin-left: -16px;
  transition: all .16s ease;
}

.status-step:first-child {
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 50%, calc(100% - 18px) 100%, 0 100%);
  margin-left: 0;
  padding-left: 16px;
}

.status-step:last-child {
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 18px 50%);
  padding-left: 26px;
  padding-right: 14px;
}

.status-step:hover {
  background: #eff6ff;
  color: #162f5b;
}

.status-step.active {
  z-index: 2;
  background: linear-gradient(135deg, #162f5b 0%, #162f5b 100%);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .28), 0 6px 14px rgba(37, 99, 235, .2);
}

.status-step.past {
  background: #f3f7ff;
  color: #162f5b;
}

.project-tab-panel {
  display: none;
}
.project-tab-panel.active {
  display: block;
}

.project-task-toolbar {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 10px;
  align-items: center;
  padding-bottom: 2px;
}

.project-task-toolbar .input {
  flex: 1 1 340px;
  min-width: 260px;
}

.project-task-toolbar .select,
.project-task-toolbar .search-select,
.project-task-toolbar .search-select-trigger {
  flex: 0 0 220px;
  min-width: 220px;
}

.project-task-toolbar .btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

.project-task-table-wrap {
  max-height: 58vh;
  overflow: auto;
}

.project-task-table-wrap thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f4f8ff;
}

.assignee-list {
  margin-top: 8px;
  border: 1px solid #d9e4f4;
  border-radius: 12px;
  max-height: 220px;
  overflow: auto;
  padding: 8px;
  display: grid;
  gap: 6px;
  background: #fff;
}

.assignee-picked {
  margin-top: 8px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.assignee-picker-wrap {
  position: relative;
}

.assignee-avatar {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid #bfd2ef;
  background: #eff6ff;
  color: #162f5b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  padding: 0;
}

.assignee-avatar span {
  font-size: 11px;
  font-weight: 800;
}

.assignee-avatar i {
  position: absolute;
  right: -3px;
  top: -3px;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: #1e293b;
  color: #fff;
  font-size: 9px;
  display: grid;
  place-items: center;
}

.assignee-item {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #e2eaf7;
  border-radius: 10px;
  padding: 7px 10px;
  font-size: 13px;
  color: #334155;
}

.assignee-item:hover {
  background: #f8fbff;
  border-color: #bfd2ef;
}

.assignee-item i {
  margin-left: auto;
  color: #64748b;
}

.assignee-list-float {
  display: none;
  position: relative;
  left: auto;
  right: auto;
  z-index: 10;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .12);
}

.assignee-list-float.open {
  display: grid;
}

.assignee-suggest {
  width: 100%;
  background: #fff;
  cursor: pointer;
  justify-content: space-between;
  font: inherit;
}

.table-assignees {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.table-assignee-avatar {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: 1px solid #bfd2ef;
  background: #eff6ff;
  color: #162f5b;
  font-size: 10px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.table-assignee-more {
  min-width: 26px;
  height: 26px;
  border-radius: 999px;
  border: 1px solid #c7d2fe;
  background: #eef2ff;
  color: #4f46e5;
  padding: 0 7px;
  font-size: 11px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.history-change {
  margin-top: 4px;
  font-size: 12px;
  color: #475569;
}

.history-timeline {
  position: relative;
  padding-left: 22px;
  display: grid;
  gap: 12px;
}

.history-timeline::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #d8e6fb;
}

.history-node {
  position: relative;
}

.history-dot {
  position: absolute;
  left: -18px;
  top: 14px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #162f5b;
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px #c7dcfb;
}

.history-card {
  border: 1px solid #d9e4f4;
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
}

.history-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: #64748b;
}

.history-action {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid #bfd2ef;
  background: #eff6ff;
  color: #162f5b;
  font-weight: 700;
}

.history-title {
  margin-top: 6px;
  font-weight: 700;
  color: #0f172a;
}

.history-changes {
  margin-top: 8px;
  display: grid;
  gap: 6px;
}

.history-change-row {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr) 14px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.history-field {
  color: #475569;
  font-weight: 700;
}

.history-before {
  color: #475569;
  background: #f8fafc;
  border: 1px solid #edf2f7;
  border-radius: 8px;
  padding: 4px 8px;
}

.history-after {
  color: #14532d;
  background: #f0fdf4;
  border: 1px solid #dcfce7;
  border-radius: 8px;
  padding: 4px 8px;
}

.encity-inline-toast {
  position: fixed;
  right: 14px;
  bottom: 14px;
  background: #0f172a;
  color: #fff;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .24);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .18s ease, transform .18s ease;
  z-index: 2000;
}

.encity-inline-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.input, .select, .btn {
  height: 42px;
  border: 1px solid #bcd0ee;
  border-radius: 12px;
  font: inherit;
}
.input { width: 100%; padding: 0 12px; background: #fff; }
.select {
  width: 100%;
  padding: 0 36px 0 12px;
  background: #fff;
  color: #0f172a;
  color-scheme: light;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2364758b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

.select option {
  background: #fff;
  color: #0f172a;
}

.project-role-picker .input {
  margin-bottom: 0;
}

.project-role-search-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.project-role-search-row .input {
  flex: 1 1 auto;
}

.project-role-search-row .btn {
  width: 42px;
  min-width: 42px;
  padding: 0;
}

.project-role-picker .assignee-picked:empty {
  display: none;
}

.project-role-picker .assignee-picked {
  display: block;
}

.project-role-rate-table-wrap {
  margin-top: 8px;
  max-height: none;
  overflow: visible;
}

.assignee-picked .project-role-rate-table-wrap {
  max-height: 220px;
  overflow: auto;
}

#encity-project-role-list-content .project-role-rate-table-wrap {
  max-height: none;
  overflow: visible;
}

.project-role-rate-table th,
.project-role-rate-table td {
  vertical-align: middle;
}

.project-role-rate-table th:not(:last-child),
.project-role-rate-table td:not(:last-child) {
  border-right: 1px solid #d9e4f4;
}

.project-role-rate-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f4f8ff;
}

#encity-project-role-list-drawer {
  width: min(1120px, 99vw);
}

.project-role-list-content {
  min-height: 0;
}

.project-role-rate-table td .project-role-rate-input.input {
  min-width: 170px;
  height: 36px;
}

.project-role-rate-actions {
  text-align: center;
}

.project-role-rate-chip {
  min-width: 220px;
  flex: 1 1 220px;
  border: 1px solid #d9e4f4;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  padding: 10px;
  display: grid;
  gap: 10px;
}

.project-role-rate-chip__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.project-role-rate-chip__identity {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.project-role-rate-chip__text {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.project-role-rate-chip__text strong {
  font-size: 13px;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-role-rate-chip__text span {
  font-size: 12px;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-role-rate-chip__remove {
  width: 28px;
  height: 28px;
  border: 1px solid #d9e4f4;
  border-radius: 999px;
  background: #fff;
  color: #64748b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.project-role-rate-chip__remove:hover {
  color: #b91c1c;
  border-color: #fecaca;
  background: #fff5f5;
}

.project-role-rate-chip__field {
  display: grid;
  gap: 6px;
}

.project-role-rate-chip__field > span {
  font-size: 12px;
  font-weight: 700;
  color: #475569;
}

.project-role-rate-input.input {
  height: 38px;
}

.search-select {
  position: relative;
  width: 100%;
  min-width: 120px;
}
.search-select-native {
  position: absolute !important;
  opacity: 0 !important;
  pointer-events: none !important;
  width: 1px !important;
  height: 1px !important;
}
.search-select-trigger {
  height: 42px;
  border: 1px solid #bcd0ee;
  border-radius: 12px;
  padding: 0 34px 0 12px;
  background: #fff;
  color: #0f172a;
  width: 100%;
  display: flex;
  align-items: center;
  font-size: 14px;
  cursor: pointer;
  position: relative;
}
.search-select-trigger:hover { border-color: #90b4ea; }
.search-select.open .search-select-trigger {
  border-color: #7ea9e8;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
.search-select-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.search-select-arrow {
  position: absolute;
  right: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: #64748b;
  font-size: 12px;
  transition: transform .15s ease;
}
.search-select.open .search-select-arrow { transform: translateY(-50%) rotate(180deg); }
.search-select-dropdown {
  position: fixed;
  left: 0;
  top: 0;
  background: #fff;
  border: 1px solid #bcd0ee;
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .12);
  padding: 8px;
  z-index: 1600;
  display: none;
  max-height: 320px;
}
.search-select.open .search-select-dropdown { display: block; }
.search-select-input {
  height: 36px;
  width: 100%;
  border: 1px solid #bcd0ee;
  border-radius: 10px;
  padding: 0 10px;
  margin-bottom: 8px;
  font-size: 14px;
}
.search-select-options {
  max-height: 240px;
  overflow: auto;
  display: grid;
  gap: 4px;
}
.search-select-option {
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 7px 10px;
  text-align: left;
  background: #fff;
  color: #0f172a;
  cursor: pointer;
  font: inherit;
}
.search-select-option:hover,
.search-select-option.highlighted { background: #eff6ff; border-color: #bfdbfe; }
.search-select-option.active { background: #162f5b; border-color: #162f5b; color: #fff; }
.search-select-empty {
  color: #64748b;
  font-size: 13px;
  padding: 8px 10px;
}
.input:focus, .select:focus, textarea.input:focus {
  outline: 0;
  border-color: #7ea9e8;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
.input[readonly],
textarea.input[readonly] {
  background: #f3f6fb;
  color: #64748b;
  border-color: #d4e0f2;
  cursor: not-allowed;
}
.input[readonly]:focus,
textarea.input[readonly]:focus {
  border-color: #d4e0f2;
  box-shadow: none;
}
textarea.input {
  min-height: 110px;
  height: auto;
  line-height: 1.45;
  padding: 10px 12px;
  resize: vertical;
}
input[type="date"].input {
  padding-right: 36px;
}
.btn {
  background: #fff;
  color: #334155;
  padding: 0 12px;
  cursor: pointer;
}
.btn:disabled {
  opacity: .45;
  cursor: not-allowed;
  pointer-events: none;
}
.btn:hover { border-color: #90b4ea; }
.btn.btn-primary { background: #162f5b; color: #fff; border-color: #162f5b; }
.btn.btn-danger { background: #fee2e2; color: #b91c1c; border-color: #fecaca; }
.btn.btn-warning { background: #f59e0b; color: #111827; border-color: #d97706; font-weight: 800; }
.btn.btn-success { background: #22c55e; color: #052e16; border-color: #16a34a; font-weight: 800; }
.btn.btn-warning:disabled,
.btn.btn-success:disabled { opacity: .85; }

.table-wrap {
  border: 1px solid #c9d8f0;
  border-radius: 14px;
  overflow: auto;
}
.table-pager {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.table-pager .pager-info {
  color: #64748b;
  font-size: 13px;
}
.table-pager .btn {
  min-height: 34px;
  padding: 0 12px;
}
.table-pager .select {
  width: 86px;
  min-width: 86px;
}

@media (max-width: 980px) {
  .table-pager {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}
.table-ui {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}
.table-ui th {
  text-align: left;
  font-size: 13px;
  color: #64748b;
  background: #f8fbff;
  border-bottom: 1px solid #dbe7f8;
  padding: 10px 12px;
}
.table-ui td {
  border-bottom: 1px solid #e6edf8;
  padding: 10px 12px;
}
.project-progress-cell {
  width: 88px;
}
.project-progress-ring {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  padding: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.project-progress-ring-inner {
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #e3ebf8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
}
.table-clickable tbody tr { cursor: pointer; }
.table-clickable tbody tr:hover { background: #f9fbff; }
.table-clickable tbody tr.row-selected { background: #eef6ff; }
.task-row-check {
  width: 18px;
  height: 18px;
  accent-color: #162f5b;
  vertical-align: middle;
}
.empty { text-align: center; color: var(--muted); padding: 22px !important; }

.table-ui td.empty {
  text-align: center;
}

.table-ui td.empty::before {
  content: "\f059";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  display: inline-block;
  margin-right: 8px;
  color: #94a3b8;
}

.pill {
  display: inline-block;
  border-radius: 999px;
  padding: 3px 10px;
  border: 1px solid;
  font-size: 12px;
  font-weight: 700;
}
.pill.ok { color: #15803d; border-color: #86efac; background: #dcfce7; }
.pill.warn { color: #b45309; border-color: #fcd34d; background: #fef3c7; }
.pill.info { color: #162f5b; border-color: #93c5fd; background: #dbeafe; }
.pill.danger { color: #b91c1c; border-color: #fca5a5; background: #fee2e2; }

.muted { color: var(--muted); }
.section-title { margin: 0 0 10px; }
.report-top-actions {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-start;
  gap: 8px;
  align-items: center;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 2px;
}
.report-top-actions .select,
.report-top-actions .input {
  width: 150px;
  flex: 0 0 150px;
}
.report-top-actions #encity-report-date-range {
  width: 210px;
  flex-basis: 210px;
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2364758b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 2v4'/%3E%3Cpath d='M16 2v4'/%3E%3Crect width='18' height='18' x='3' y='4' rx='2'/%3E%3Cpath d='M3 10h18'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
.report-top-actions .btn {
  white-space: nowrap;
  flex: 0 0 auto;
}
.report-permission-toolbar {
  margin-top: 10px;
  border: 1px solid #d7e2f2;
  border-radius: 16px;
  background: linear-gradient(180deg, #fbfdff 0%, #f6f9ff 100%);
  padding: 12px;
}
.report-permission-list-toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto auto;
  gap: 10px;
  align-items: center;
}
.report-permission-list-toolbar .btn {
  white-space: nowrap;
}
.report-permission-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.report-permission-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.report-permission-title {
  color: #16325c;
  font-size: 19px;
  font-weight: 800;
  line-height: 1.2;
}
.report-permission-role-tabs {
  margin-top: 10px;
  margin-bottom: 10px;
  overflow-x: auto;
  flex-wrap: nowrap;
}
.report-permission-meta-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 10px;
  margin-bottom: 10px;
}
.report-role-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}
#encity-report-role-drawer {
  width: min(1220px, 99vw);
}
.report-tree-layout {
  margin-top: 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 12px;
}
.report-tree-transfer {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.report-tree-transfer .btn {
  width: 40px;
  min-width: 40px;
  height: 40px;
  min-height: 40px;
  border-radius: 12px;
  padding: 0;
}
.report-tree-transfer .btn i {
  font-size: 14px;
}
.report-tree-transfer .btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}
.report-tree-transfer .btn.is-active {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #1d4ed8;
}
.report-tree-panel {
  border: 1px solid #dbe7f7;
  border-radius: 12px;
  padding: 10px;
  background: #fff;
}
.report-tree-title {
  font-size: 16px;
  font-weight: 800;
  color: #16325c;
  margin-bottom: 8px;
}
.report-tree-box {
  margin-top: 8px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px;
  max-height: 58vh;
  overflow: auto;
}
.report-tree-group {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  margin-bottom: 8px;
  padding: 8px;
}
.report-tree-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.report-tree-group-head .btn {
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  border-radius: 10px;
  padding: 0;
}
.report-tree-group-head .btn i {
  font-size: 12px;
}
.report-tree-actions {
  margin-top: 8px;
  margin-left: 26px;
  border-left: 2px dashed #dbe7f7;
  padding-left: 10px;
  display: grid;
  gap: 8px;
}
.report-tree-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: #1e293b;
}
.report-tree-check-action {
  font-weight: 600;
}
.report-tree-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #1f4f9f;
}
.report-permission-table-wrap {
  border: 1px solid #dbe7f7;
  background: #fff;
  border-radius: 12px;
  overflow: auto;
}
.report-permission-table-wrap table {
  min-width: 820px;
}
.report-permission-table-wrap th,
.report-permission-table-wrap td {
  white-space: nowrap;
}
.report-permission-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}
.report-permission-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #1f4f9f;
}
.report-permission-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.report-permission-box {
  border: 1px solid #dbe7f7;
  background: #fff;
  border-radius: 12px;
  padding: 10px;
}
.report-permission-box-title {
  color: #1e3a63;
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 8px;
}
.report-role-checkboxes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
}
.report-role-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #1e2d40;
  font-size: 13px;
  font-weight: 700;
  border: 1px solid #d7e3f5;
  border-radius: 10px;
  padding: 7px 9px;
  background: #fbfdff;
}
.report-role-item input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: #1f4f9f;
}
.report-filter-summary {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.report-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid #bfd2ef;
  background: #eff6ff;
  color: #162f5b;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease, background .14s ease;
}

.report-filter-chip:hover {
  border-color: #93c5fd;
  background: #dbeafe;
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(37, 99, 235, .12);
}

.report-filter-chip.is-static,
.report-filter-chip:disabled {
  background: #f8fbff;
  color: #64748b;
  border-color: #d9e4f4;
  cursor: default;
}

.report-filter-chip.is-static:hover,
.report-filter-chip:disabled:hover {
  transform: none;
  box-shadow: none;
}

.report-filter-chip i {
  font-size: 11px;
}

.report-filter-chip > .fa-calendar,
.report-filter-chip > .fa-diagram-project,
.report-filter-chip > .fa-user {
  width: 16px;
  text-align: center;
  font-size: 12px;
}

.report-filter-chip-date {
  color: #162f5b;
  background: #eff6ff;
}

.report-filter-chip-project {
  color: #166534;
  background: #ecfdf5;
  border-color: #bbf7d0;
}

.report-filter-chip-project:hover {
  background: #dcfce7;
  border-color: #86efac;
  box-shadow: 0 6px 14px rgba(22, 101, 52, .12);
}

.report-filter-chip-user {
  color: #7c2d12;
  background: #fff7ed;
  border-color: #fed7aa;
}

.report-filter-chip-user:hover {
  background: #ffedd5;
  border-color: #fdba74;
  box-shadow: 0 6px 14px rgba(194, 65, 12, .12);
}
.users-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1.1fr) 170px 170px repeat(3, auto);
  gap: 10px;
  align-items: center;
}
.spec-grid { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.spec-item {
  border: 1px dashed #c4d6f2;
  border-radius: 12px;
  padding: 10px 12px;
  display: grid;
  gap: 4px;
}

.encity-kpi-hero-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.encity-kpi-hero {
  min-height: 102px;
  border-radius: 16px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(255, 255, 255, .35);
  box-shadow: 0 6px 14px rgba(30, 58, 107, .14), inset 0 1px 0 rgba(255, 255, 255, .24);
  background: linear-gradient(135deg, #2e4f9f 0%, #3f80d6 100%);
}

.encity-kpi-hero.tone-blue {
  background: linear-gradient(135deg, #2e4f9f 0%, #3f80d6 100%);
}

.encity-kpi-hero.tone-teal {
  background: linear-gradient(135deg, #1485a3 0%, #1daea0 100%);
}

.encity-kpi-hero.tone-purple {
  background: linear-gradient(135deg, #5656bd 0%, #7448c9 100%);
}

.encity-kpi-hero.tone-amber {
  background: linear-gradient(135deg, #b97316 0%, #d7962a 100%);
}

.encity-kpi-icon {
  width: 50px;
  height: 50px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(255, 255, 255, .18);
  border: 1px solid rgba(255, 255, 255, .34);
  font-size: 19px;
}

.encity-kpi-content {
  color: #fff;
  min-width: 0;
}

.encity-kpi-label {
  font-size: 14px;
  line-height: 1.2;
  opacity: .94;
  font-weight: 700;
}

.encity-kpi-value {
  margin-top: 4px;
  font-size: clamp(20px, 1.75vw, 32px);
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: .15px;
  word-break: break-word;
}

.encity-report-charts {
  margin-top: 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}

.report-chart-card {
  border: 1px solid #c9d8f0;
  border-radius: 16px;
  padding: 12px;
  background: #fff;
}

.report-chart-title {
  margin-bottom: 8px;
  font-weight: 700;
  color: #475569;
  font-size: 14px;
}

.report-chart-canvas-wrap {
  position: relative;
  height: 340px;
  max-height: 340px;
  overflow: hidden;
}

.report-chart-canvas-wrap canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .36);
  display: none;
  z-index: 1200;
}
.drawer-overlay.open { display: block; }

.drawer {
  position: fixed;
  top: 0;
  right: -102vw;
  width: min(980px, 96vw);
  height: 100vh;
  background: #fff;
  border-left: 1px solid var(--border);
  box-shadow: -12px 0 30px rgba(15, 23, 42, .16);
  z-index: 1210;
  transition: right .22s ease;
  display: flex;
  flex-direction: column;
  overflow: visible;
}
.drawer.open { right: 0; }
.drawer.drawer-sm {
  width: min(440px, 96vw);
}
#encity-project-drawer {
  width: min(1240px, 98vw);
}
.drawer-head {
  min-height: 74px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 14px 12px;
}
.drawer-title {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
}
.drawer-subtitle {
  margin-top: 4px;
  color: #64748b;
  font-size: 13px;
}
.drawer-close-side {
  position: absolute;
  left: -52px;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  border-radius: 10px 0 0 10px;
  border: 0;
  background: #162f5b;
  color: #fff;
  box-shadow: 0 8px 20px rgba(37, 99, 235, .34);
  z-index: 1220;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .16s ease, visibility 0s linear .16s;
}
.drawer.open .drawer-close-side {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition-delay: 0s;
}
.drawer-close-side:hover {
  background: #162f5b;
  color: #fff;
}
.drawer-close-side i {
  font-size: 18px;
  opacity: 1 !important;
}
.drawer-body {
  padding: 12px;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  padding-bottom: 0;
}

.drawer-body > form,
form.drawer-body {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding-bottom: 96px;
}
.notification-drawer-body {
  display: grid;
  gap: 12px;
}
.notification-drawer-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.notification-push-status {
  min-height: 18px;
  font-size: 13px;
}
.notification-push-status.ok {
  color: #15803d;
}
.notification-push-status.danger {
  color: #b91c1c;
}
.notification-list {
  display: grid;
  gap: 10px;
}
.notification-item {
  display: grid;
  gap: 6px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid #dbe7f7;
  background: #fff;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.notification-item:hover {
  transform: translateY(-1px);
  border-color: #bfd2ef;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .08);
}
.notification-item.unread {
  background: linear-gradient(180deg, #f8fbff 0%, #f1f7ff 100%);
  border-color: #bfdbfe;
}
.notification-item-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 8px;
}
.notification-item-title {
  font-size: 14px;
  font-weight: 800;
  line-height: 1.35;
}
.notification-item-time {
  color: #64748b;
  font-size: 12px;
  white-space: nowrap;
}
.notification-item-message {
  color: #334155;
  font-size: 13px;
  line-height: 1.45;
}
.notification-item-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.notification-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: #eef4ff;
  color: #31528c;
  font-size: 12px;
  font-weight: 700;
}
.notification-chip.unread {
  background: #dbeafe;
  color: #162f5b;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.span-2 { grid-column: 1 / -1; }

.span-3 { grid-column: 1 / -1; }
.label { display: block; margin-bottom: 6px; color: #475569; }
.checkbox-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  color: #334155;
  font-weight: 600;
}
.checkbox-inline input {
  width: 16px;
  height: 16px;
}

.toggle-chip {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px 0 44px;
  border: 1px solid #bfd2ef;
  border-radius: 999px;
  color: #334155;
  font-weight: 700;
  overflow: hidden;
  cursor: pointer;
  transition: border-color .2s ease, box-shadow .2s ease;
}

.toggle-chip input[type="checkbox"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 4;
}

.toggle-chip__bg {
  position: absolute;
  inset: 0;
  background: #f8fbff;
  transition: background-color .2s ease;
  z-index: 1;
}

.toggle-chip__dot {
  position: absolute;
  left: 14px;
  top: 50%;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 2px solid #9bb6df;
  background: #fff;
  transform: translateY(-50%);
  transition: all .2s ease;
  z-index: 2;
}

.toggle-chip input[type="checkbox"]:checked ~ .toggle-chip__bg {
  background: #163e78;
}

.toggle-chip input[type="checkbox"]:checked ~ .toggle-chip__dot {
  border-color: #163e78;
  box-shadow: inset 0 0 0 5px #163e78;
}

.toggle-chip input[type="checkbox"]:checked ~ .toggle-chip__text {
  color: #fff;
}

.toggle-chip input[type="checkbox"]:checked {
  outline: none;
}

.toggle-chip:focus-within {
  border-color: #163e78;
  box-shadow: 0 0 0 3px rgba(22, 62, 120, .2);
}

.toggle-chip__text {
  line-height: 1.2;
  position: relative;
  z-index: 2;
  transition: color .2s ease;
}
.is-hidden {
  display: none !important;
}
.rich-editor {
  border: 1px solid #bfd2ef;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}
.rich-editor-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px;
  border-bottom: 1px solid #dbe7f7;
  background: #f8fbff;
}
.rich-editor-toolbar .btn {
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
}
.rich-editor-content {
  min-height: 180px;
  padding: 10px 12px;
  font-size: 15px;
  line-height: 1.55;
  color: #0f172a;
  outline: none;
}
.rich-editor-content:empty:before {
  content: attr(data-placeholder);
  color: #94a3b8;
}

/* CKEditor 5 - align with existing form fields */
#encity-page-settings-drawer .ck.ck-editor {
  width: 100%;
  border-radius: 14px !important;
  overflow: hidden !important;
}
#encity-page-settings-drawer .ck.ck-editor__main > .ck-editor__editable,
#encity-page-settings-drawer .ck.ck-editor__main > .ck-source-editing-area textarea {
  min-height: 220px;
  border: 0 !important;
  border-top: 1px solid #bfd2ef !important;
  border-radius: 0 0 14px 14px !important;
  box-shadow: none !important;
  background: #fff;
  font-size: 15px;
  line-height: 1.55;
  color: #0f172a;
}
#encity-page-settings-drawer .ck.ck-toolbar {
  border: 0 !important;
  border-bottom: 1px solid #dbe7f7 !important;
  border-radius: 14px 14px 0 0 !important;
  background: #f8fbff;
}
#encity-page-settings-drawer .ck.ck-toolbar .ck-button {
  border-radius: 8px !important;
}
#encity-page-settings-drawer .ck.ck-editor__top {
  border: 1px solid #bfd2ef !important;
  border-bottom: 0 !important;
  border-radius: 14px 14px 0 0 !important;
  overflow: hidden !important;
}
#encity-page-settings-drawer .ck.ck-editor__main {
  border: 1px solid #bfd2ef !important;
  border-top: 0 !important;
  border-radius: 0 0 14px 14px !important;
  overflow: hidden !important;
}
#encity-page-settings-drawer .ck.ck-editor__main > .ck-editor__editable.ck-focused,
#encity-page-settings-drawer .ck.ck-editor__main > .ck-source-editing-area textarea:focus {
  border-color: transparent !important;
  box-shadow: none !important;
}
#encity-page-settings-drawer .ck.ck-editor.ck-focused {
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15) !important;
  border-radius: 14px !important;
}

#encity-content-drawer .ck.ck-editor {
  width: 100%;
  border-radius: 14px !important;
  overflow: hidden !important;
}
#encity-content-drawer .ck.ck-editor__main > .ck-editor__editable,
#encity-content-drawer .ck.ck-editor__main > .ck-source-editing-area textarea {
  min-height: 220px;
  border: 0 !important;
  border-top: 1px solid #bfd2ef !important;
  border-radius: 0 0 14px 14px !important;
  box-shadow: none !important;
  background: #fff;
  font-size: 15px;
  line-height: 1.55;
  color: #0f172a;
}
#encity-content-drawer .ck.ck-toolbar {
  border: 0 !important;
  border-bottom: 1px solid #dbe7f7 !important;
  border-radius: 14px 14px 0 0 !important;
  background: #f8fbff;
}
#encity-content-drawer .ck.ck-toolbar .ck-button {
  border-radius: 8px !important;
}
#encity-content-drawer .ck.ck-editor__top {
  border: 1px solid #bfd2ef !important;
  border-bottom: 0 !important;
  border-radius: 14px 14px 0 0 !important;
  overflow: hidden !important;
}
#encity-content-drawer .ck.ck-editor__main {
  border: 1px solid #bfd2ef !important;
  border-top: 0 !important;
  border-radius: 0 0 14px 14px !important;
  overflow: hidden !important;
}
#encity-content-drawer .ck.ck-editor__main > .ck-editor__editable.ck-focused,
#encity-content-drawer .ck.ck-editor__main > .ck-source-editing-area textarea:focus {
  border-color: transparent !important;
  box-shadow: none !important;
}
#encity-content-drawer .ck.ck-editor.ck-focused {
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15) !important;
  border-radius: 14px !important;
}

.content-cover-preview {
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  border: 1px solid #d7e4f6;
  border-radius: 12px;
  background: #f8fbff;
}

.content-cover-upload {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.content-cover-upload-input {
  display: none;
}

.content-cover-upload-name {
  min-height: 42px;
  border: 1px solid #bfd2ef;
  border-radius: 12px;
  background: #f8fbff;
  color: #475569;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.content-cover-remove {
  min-width: 42px;
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 12px;
}

.page-banner-upload-box {
  margin-bottom: 10px;
}

.page-banner-upload-box .btn {
  min-height: 42px;
}


.page-banner-preview-wrap {
  position: relative;
}

.page-banner-preview-wrap .content-cover-preview {
  display: block;
}

.page-banner-remove-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: rgba(15, 23, 42, .72);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(15, 23, 42, .28);
}

.page-banner-remove-btn:hover {
  background: #b91c1c;
}

.drawer-form-actions {
  position: sticky;
  bottom: 0;
  z-index: 30;
  justify-content: flex-end;
  background: #fff;
  border-top: 1px solid #e6edf8;
  margin: 12px -12px -12px;
  padding: 10px 12px;
  box-shadow: 0 -8px 20px rgba(15, 23, 42, .06);
}

.project-drawer-actions {
  position: static;
  margin: 12px 0 0;
  border-top: 1px solid #e6edf8;
  padding: 10px 0 0;
}

.task-drawer-actions {
  position: static;
  margin: 12px 0 0;
  border-top: 1px solid #e6edf8;
  padding: 10px 0 0;
}

@media (max-width: 980px) {
  .topbar {
    height: auto;
    min-height: 62px;
    padding: 10px 14px;
    gap: 10px;
    align-items: start;
  }
  .topbar-actions {
    margin-left: auto;
  }
  .topbar-user {
    display: none;
  }
  .topbar-profile-popover {
    right: -8px;
  }
  .app-layout { grid-template-columns: 1fr; }
  .app-sidebar { border-right: 0; border-bottom: 1px solid var(--border); }
  .kpi-grid, .spec-grid, .form-grid, .encity-report-charts { grid-template-columns: 1fr; }
  .encity-kpi-hero-grid { grid-template-columns: 1fr 1fr; }
  .catalog-toolbar { grid-template-columns: minmax(220px, 1fr) 180px auto auto auto; }
  .projects-toolbar { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .projects-toolbar > :first-child { grid-column: 1 / -1; }
  .payments-toolbar { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .payments-toolbar > :first-child { grid-column: 1 / -1; }
  .timesheet-toolbar { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .timesheet-toolbar > :first-child { grid-column: 1 / -1; }
  .users-toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .users-toolbar > :first-child { grid-column: 1 / -1; }
  .stats-list-toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats-quick-toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .content-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .content-toolbar #encity-content-search,
  .content-toolbar #encity-content-status-filter,
  .content-toolbar #encity-content-type-filter,
  .content-toolbar #encity-content-category-filter {
    min-width: 0;
  }

  .content-toolbar #encity-content-search {
    grid-column: 1 / -1;
  }
  .project-task-toolbar {
    flex-wrap: wrap;
    overflow-x: visible;
  }
  .project-task-toolbar .input,
  .project-task-toolbar .select,
  .project-task-toolbar .search-select,
  .project-task-toolbar .search-select-trigger {
    flex: 1 1 100%;
    min-width: 0;
  }
  .report-top-actions {
    flex-wrap: wrap;
    overflow-x: visible;
  }
  .report-top-actions .select,
  .report-top-actions .input,
  .report-top-actions .btn {
    flex: 1 1 calc(33.333% - 10px);
    width: auto;
  }
  .report-permission-head {
    flex-direction: column;
    align-items: stretch;
  }
  .report-permission-grid {
    grid-template-columns: 1fr;
  }
  .report-permission-meta-row {
    grid-template-columns: 1fr;
  }
  .report-permission-list-toolbar {
    grid-template-columns: 1fr;
  }
  .report-permission-list-toolbar .btn {
    width: 100%;
  }
  .report-role-count {
    justify-content: flex-start;
  }
  .report-tree-layout {
    grid-template-columns: 1fr;
  }
  .report-tree-transfer {
    flex-direction: row;
    justify-content: flex-start;
  }
  .payments-pager {
    flex-wrap: wrap;
    justify-content: center;
  }
  .timesheet-pager {
    flex-wrap: wrap;
    justify-content: center;
  }
  .project-drawer-tabs-head { flex-direction: column; align-items: stretch; }
  .project-drawer-tabs-head .btn { margin-bottom: 0; width: fit-content; min-width: 0; }
  .project-status-stepper { overflow-x: auto; }
  .project-status-stepper .status-step { min-width: 140px; flex: 0 0 auto; }
  .drawer-close-side {
    left: -44px;
    width: 36px;
    min-width: 36px;
    height: 36px;
    min-height: 36px;
    border-radius: 8px 0 0 8px;
  }
  .drawer-close-side i { font-size: 15px; }
  .encity-kpi-value { font-size: 28px; }
  .report-chart-canvas-wrap { height: 300px; max-height: 300px; }
}

@media (max-width: 820px) {
  .catalog-toolbar,
  .projects-toolbar,
  .payments-toolbar,
  .timesheet-toolbar,
  .users-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .timesheet-time-block-grid {
    grid-template-columns: 1fr;
  }

  .catalog-toolbar > :first-child,
  .projects-toolbar > :first-child,
  .payments-toolbar > :first-child,
  .timesheet-toolbar > :first-child,
  .users-toolbar > :first-child {
    grid-column: 1 / -1;
  }

  .catalog-toolbar .btn,
  .projects-toolbar .btn,
  .payments-toolbar .btn,
  .timesheet-toolbar .btn,
  .users-toolbar .btn {
    width: 100%;
  }

  .report-top-actions .select,
  .report-top-actions .input,
  .report-top-actions .btn {
    flex: 1 1 calc(50% - 10px);
    width: auto;
  }
}

@media (max-width: 640px) {
  .catalog-toolbar,
  .projects-toolbar,
  .payments-toolbar,
  .timesheet-toolbar,
  .users-toolbar,
  .content-toolbar {
    grid-template-columns: 1fr;
  }
  .content-toolbar .btn {
    width: 100%;
  }
  .encity-kpi-hero-grid { grid-template-columns: 1fr; }
  .report-chart-canvas-wrap { height: 260px; max-height: 260px; }
  .report-top-actions .select,
  .report-top-actions .input,
  .report-top-actions .btn {
    flex-basis: 100%;
    width: 100%;
  }
  .encity-splashscreen-inner {
    width: min(220px, 82vw);
  }
  .encity-loading-spinner {
    width: 40px;
    height: 40px;
  }
}

@media (max-width: 820px) {
  .topbar-sidebar-toggle {
    display: none;
  }
  body {
    padding-bottom: 92px;
  }

  .app-main {
    min-width: 0;
  }

  .app-sidebar {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: 10px;
    top: auto;
    z-index: 1450;
    border: 1px solid #cfe0f8;
    border-radius: 18px;
    background: rgba(255, 255, 255, .98);
    box-shadow: 0 14px 38px rgba(15, 23, 42, .2);
    padding: 8px;
    backdrop-filter: blur(8px);
  }

  .brand {
    display: none;
  }

  .menu {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
  }

  .menu-item {
    border-radius: 12px;
    border: 1px solid #dbe7f8;
    padding: 7px 4px;
    min-height: 56px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    text-align: center;
    font-size: 10px;
    line-height: 1.2;
    color: #475569;
  }

  .menu-item i {
    width: auto;
    font-size: 14px;
  }

  .menu-item span {
    font-size: 10px;
    font-weight: 700;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .menu-item:hover,
  .menu-item.active {
    background: #162f5b;
    border-color: #162f5b;
    color: #fff;
    box-shadow: 0 10px 20px rgba(22, 47, 91, .28);
  }

  .table-wrap {
    border: 0;
    border-radius: 0;
    overflow: visible;
    background: transparent;
  }

  .table-ui {
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0 10px;
  }

  .table-ui thead {
    display: none;
  }

  .table-ui tbody,
  .table-ui tr,
  .table-ui td {
    display: block;
    width: 100%;
  }

  .table-ui tr {
    background: #fff;
    border: 1px solid #dbe7f7;
    border-radius: 14px;
    padding: 6px 10px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, .06);
    margin-bottom: 10px;
  }

  .table-ui td {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    border-bottom: 1px dashed #e5edf8;
    padding: 8px 0;
    white-space: normal;
  }

  .table-ui td:last-child {
    border-bottom: 0;
  }

  .table-ui td::before {
    content: attr(data-label);
    flex: 0 0 42%;
    max-width: 42%;
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
    line-height: 1.35;
  }

  .table-ui td[data-label=""]::before {
    content: "";
    flex-basis: 0;
    max-width: 0;
  }

  .table-ui td > * {
    margin-left: auto;
    max-width: 58%;
  }

  .table-ui td > .table-assignees,
  .table-ui td > .pill,
  .table-ui td > .btn,
  .table-ui td > .muted,
  .table-ui td > .project-progress-cell-wrap {
    margin-left: auto;
  }

  .table-ui td.empty {
    display: block;
    text-align: center;
    border-bottom: 0;
    padding: 14px 4px !important;
  }

  .table-ui td.empty::before {
    display: inline-block;
    margin-right: 6px;
  }

  .table-ui td.empty > * {
    max-width: none;
    margin-left: 0;
  }
}

@media (max-width: 820px) {
  .topbar {
    position: sticky;
    top: 0;
    z-index: 1100;
    background: rgba(255, 255, 255, .95);
    backdrop-filter: blur(6px);
  }

  .page-content {
    padding: 10px;
    gap: 10px;
  }

  .card {
    border-radius: 16px;
    padding: 10px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .06);
  }

  .app-sidebar {
    left: 8px;
    right: 8px;
    bottom: 8px;
    padding: 8px 8px 6px;
  }

  .menu {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 2px;
    scroll-snap-type: x mandatory;
  }

  .menu::-webkit-scrollbar {
    height: 0;
  }

  .menu-item {
    min-width: 68px;
    flex: 0 0 68px;
    scroll-snap-align: start;
  }

  .drawer,
  .drawer.drawer-sm,
  #encity-project-drawer,
  #encity-project-role-list-drawer,
  #encity-report-role-drawer {
    width: 100vw;
    max-width: 100vw;
    right: -100vw;
    border-left: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .drawer-close-side {
    left: auto;
    right: 10px;
    top: 12px;
    transform: none;
    border-radius: 10px;
    width: 36px;
    min-width: 36px;
    height: 36px;
    min-height: 36px;
    box-shadow: 0 6px 14px rgba(15, 23, 42, .22);
  }

  .drawer-head {
    padding-right: 56px;
  }

  .projects-toolbar,
  .timesheet-toolbar,
  .payments-toolbar,
  .users-toolbar,
  .catalog-toolbar,
  .stats-list-toolbar,
  .stats-quick-toolbar,
  .kqxs-toolbar,
  .report-top-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .projects-toolbar .btn,
  .timesheet-toolbar .btn,
  .payments-toolbar .btn,
  .users-toolbar .btn,
  .catalog-toolbar .btn,
  .stats-list-toolbar .btn,
  .stats-quick-toolbar .btn,
  .kqxs-toolbar .btn,
  .report-top-actions .btn {
    width: 100%;
  }

  .kqxs-quick-grid {
    grid-template-columns: 1fr;
  }

  .live-quick-grid {
    grid-template-columns: 1fr;
  }

  .live-quick-span-2 {
    grid-column: span 1;
  }

  .live-toolbar {
    grid-template-columns: minmax(220px, 1fr) minmax(180px, 1fr) minmax(160px, 1fr) auto auto auto;
    overflow: visible;
  }
  .live-toolbar > .input,
  .live-toolbar > .select,
  .live-toolbar > .btn {
    width: 100% !important;
  }
}

@media (max-width: 1180px) {
  .live-toolbar {
    grid-template-columns: 1fr 1fr 1fr;
  }
  #encity-live-search {
    grid-column: 1 / -1;
  }
  #encity-live-create {
    justify-self: end;
  }
}

@media (max-width: 820px) {
  .live-toolbar {
    grid-template-columns: 1fr;
  }
  #encity-live-create {
    justify-self: stretch;
  }

  .live-quick-fab {
    right: 12px;
    bottom: 82px;
  }

  .live-chat-msg {
    max-width: 100%;
  }

  .live-comment-chat {
    grid-template-columns: 1fr;
  }

  .live-comment-threads,
  .live-comment-messages {
    min-height: 0;
  }

  .live-comment-thread-list {
    max-height: 38vh;
  }

  .live-comment-chat-list {
    max-height: 48vh;
  }

  .timesheet-pager,
  .payments-pager {
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .timesheet-pager .muted,
  .payments-pager .muted {
    flex: 0 0 auto;
  }

  .table-ui tr {
    border-radius: 16px;
  }

  .table-ui td {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 8px 0;
  }

  .table-ui td::before {
    flex: 0 0 auto;
    max-width: 100%;
    font-size: 11px;
    letter-spacing: .1px;
  }

  .table-ui td > * {
    margin-left: 0;
    max-width: 100%;
  }
}
