@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@400;500;600;700&display=swap');

:root {
  --bg: #f3f5f8;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --text: #001837;
  --muted: #5f728f;
  --primary: #006c76;
  --primary-dark: #00505a;
  --border: #d9e2ec;
  --danger: #b42318;
  --success: #0f9d58;
  --brand-dark: #041c35;
  --heading-font: 'IBM Plex Sans Arabic', IMBPlexSansArabic, 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Tajawal', 'Cairo', Tahoma, sans-serif;
  color: var(--text);
  background: var(--bg);
}

::selection {
  background: #2b8a57;
  color: #ffffff;
}

::-moz-selection {
  background: #2b8a57;
  color: #ffffff;
}

body.splash-active {
  overflow: hidden;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.container {
  width: min(1280px, calc(100% - 44px));
  margin: 0 auto;
}

.startup-splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  background: #ffffff;
  opacity: 1;
  visibility: visible;
  transition: opacity 360ms ease, visibility 360ms ease;
}

.startup-splash::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgb(20 130 69 / 6%), transparent 42%),
    radial-gradient(circle at 82% 70%, rgb(20 130 69 / 5%), transparent 40%);
}

.startup-splash-logo {
  position: relative;
  z-index: 1;
  width: min(420px, 78vw);
  max-height: 145px;
  object-fit: contain;
  filter: drop-shadow(0 10px 26px rgb(0 0 0 / 35%));
}

.startup-splash.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.startup-splash.is-hidden-immediate {
  display: none;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

h1,
h2,
h3,
h4,
.block-title,
.components-title,
.portal-menu a,
.show-components-btn,
.floor-name,
.topbar-row h1,
.admin-card h2,
.auth-card h1,
.simple-card h1 {
  font-family: var(--heading-font);
}

.btn {
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 9px 14px;
  font: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
}

.btn:hover {
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-outline {
  border-color: #b5c4d9;
  color: #193251;
  background: #fff;
}

.btn-outline:hover {
  background: #f3f7fb;
}

.btn-secondary {
  background: #e9f2f7;
  border-color: #d2e4ef;
  color: #1f4d5e;
}

.btn-secondary:hover {
  background: #deebf3;
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-small {
  padding: 6px 10px;
  font-size: 0.85rem;
}

.alert {
  border-radius: 10px;
  padding: 11px 12px;
  margin-bottom: 14px;
  border: 1px solid transparent;
}

.alert.success {
  background: #e8f8ef;
  border-color: #b4e4c5;
  color: #13663a;
}

.alert.error {
  background: #fdecec;
  border-color: #f8c5c5;
  color: #8f1d1d;
}

/* Public page (Balady-like) */
.balady-page {
  background: rgb(255, 255, 255);
}

.gov-banner {
  background: #eef0f3;
  border-bottom: 1px solid #d7dde4;
  position: sticky;
  top: 0;
  z-index: 90;
  box-shadow: 0 1px 0 rgb(213 221 228 / 90%), 0 8px 24px rgb(18 29 37 / 6%);
}

.gov-banner-details {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 320ms ease, opacity 220ms ease;
}

.gov-banner.is-open .gov-banner-details {
  max-height: 780px;
  opacity: 1;
}

.gov-banner-top {
  width: 100%;
  max-width: none;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 4px 44px;
}

.gov-banner-verify,
.gov-banner-tools,
.gov-banner-tools a {
  display: flex;
  align-items: center;
  gap: 20px;
}

.gov-banner-verify {
  color: #20252b;
  font-size: 12px;
  font-weight: 700;
  flex: 1;
  justify-content: flex-start;
}

.gov-banner-tools a {
  color: #2c3036;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.gov-banner-tools svg {
  width: 18px;
  height: 18px;
}

.gov-mini-flag {
  width: 19px;
  height: 14px;
  border-radius: 2px;
  background: linear-gradient(135deg, #148245 0%, #0f7a40 100%);
  position: relative;
}

.gov-mini-flag::before {
  content: '';
  position: absolute;
  inset: 4px 3px;
  border-top: 1px solid rgb(255 255 255 / 85%);
  border-bottom: 1px solid rgb(255 255 255 / 85%);
}

.gov-check-link {
  border: 0;
  padding: 0;
  color: #1f7b43;
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
  line-height: 1.2;
}

.gov-check-link:hover {
  color: #165f33;
}

.gov-check-link:focus-visible {
  outline: 2px solid #98c6aa;
  outline-offset: 2px;
}

.gov-banner-main {
  width: 100%;
  max-width: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 26px;
  padding: 22px 44px 18px;
}

.gov-banner-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  color: #1d242a;
}

.gov-banner-icon {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border: 1px solid #84b59a;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #4d9b73;
}

.gov-banner-icon svg {
  width: 20px;
  height: 20px;
}

.gov-banner-copy {
  display: grid;
  gap: 8px;
  text-align: right;
}

.gov-banner-copy h3 {
  color: #1d2329;
  font-size: 15.5px;
  font-weight: 700;
  line-height: 1.5;
}

.gov-banner-copy h3 span,
.gov-banner-copy p span {
  color: #248b4d;
}

.gov-banner-copy p {
  color: #525d68;
  font-size: 13.5px;
  line-height: 1.8;
  font-weight: 600;
}

.gov-register-wrap {
  width: 100%;
  max-width: none;
  padding: 0 44px 24px;
}

.gov-register-card {
  min-height: 50px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid #eaedf1;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  padding: 10px 18px;
}

.gov-register-card p {
  color: #2a3138;
  font-size: 14.5px;
  font-weight: 700;
}

.gov-register-card a {
  color: #268e65;
  text-decoration: underline;
}

.gov-register-icon {
  color: #4a72b4;
}

.gov-register-icon svg {
  width: 26px;
  height: 26px;
}

.portal-nav-wrap {
  position: relative;
  background: #fff;
  color: #19212a;
  border-top: 1px solid #d5dce3;
  border-bottom: 1px solid #d5dce3;
}

.portal-nav {
  position: relative;
  width: 100%;
  max-width: none;
  padding: 0 44px;
  min-height: 80px;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 16px;
}

.portal-right,
.portal-left {
  display: flex;
  align-items: stretch;
}

.portal-right {
  gap: 0;
  flex: none;
  justify-content: flex-start;
}

.portal-menu {
  display: flex;
  align-items: stretch;
  gap: 0;
}

.portal-menu-item {
  position: static;
  display: flex;
  align-items: stretch;
}

.portal-link {
  min-height: 80px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 20px;
  color: #171d24;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  border-inline-start: 1px solid transparent;
  border-inline-end: 1px solid transparent;
  position: relative;
  transition: background-color 160ms ease, color 160ms ease;
}

.portal-link-label {
  display: inline-block;
}

.portal-link-caret {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: currentColor;
  flex: 0 0 16px;
}

.portal-link-caret svg {
  width: 14px;
  height: 14px;
}

.portal-link::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 0;
  background: #222833;
  transition: height 160ms ease;
}

.portal-menu-item.is-active > .portal-link {
  background: #25804a;
  color: #fff;
}

.portal-menu-item.is-active > .portal-link::after {
  height: 5px;
  background: #4faa69;
}

.portal-menu-item:hover > .portal-link,
.portal-menu-item:focus-within > .portal-link {
  background: #eceff4;
}

.portal-menu-item:hover > .portal-link::after,
.portal-menu-item:focus-within > .portal-link::after {
  height: 6px;
}

.portal-menu > .portal-link:hover,
.portal-menu > .portal-link:focus-visible {
  background: #f3f5f8;
}

.portal-menu > .portal-link:hover::after,
.portal-menu > .portal-link:focus-visible::after {
  height: 5px;
}

.portal-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border-inline-start: 1px solid #d9dee6;
  text-decoration: none;
}

.portal-logo-image {
  width: 96px;
  height: auto;
  display: block;
  object-fit: contain;
}

.portal-left {
  gap: 18px;
  flex: none;
  justify-content: flex-end;
}

.search-mini,
.balady-btn-work {
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-weight: 700;
}

.search-mini {
  color: #161d24;
  font-size: 14.5px;
}

.search-mini svg {
  width: 27px;
  height: 27px;
}

.balady-btn-work {
  min-height: 42px;
  border: 0;
  background: #228048;
  color: #fff;
  border-radius: 4px;
  padding: 0 18px;
  font-size: 14.5px;
}

.balady-btn-work svg {
  width: 18px;
  height: 18px;
}

.mega-panel {
  position: absolute;
  top: 100%;
  right: 0;
  left: 0;
  background: #fff;
  border-top: 1px solid #d8dfe6;
  border-bottom: 1px solid #e4e8ee;
  box-shadow: 0 16px 24px rgb(22 30 40 / 6%);
  padding: 28px 0 26px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 160ms ease, transform 160ms ease, visibility 160ms ease;
  z-index: 30;
}

.portal-menu-item:hover .mega-panel,
.portal-menu-item:focus-within .mega-panel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.mega-grid {
  width: min(1280px, calc(100% - 44px));
  margin: 0 auto;
  display: grid;
  gap: 26px;
}

.mega-grid-5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.mega-grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.mega-column {
  display: grid;
  align-content: start;
  gap: 14px;
}

.mega-column h3 {
  color: #228048;
  font-size: 20px;
  font-weight: 700;
}

.mega-column a {
  color: #181f26;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.9;
  text-decoration: none;
}

.mega-more-btn {
  width: fit-content;
  margin-top: 14px;
  background: #228048;
  color: #fff;
  border-radius: 4px;
  padding: 8px 16px;
}

.light-strip {
  background: #eff9f3;
  border-bottom: 1px solid #deebe4;
}

.light-strip-text {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  color: #8f9f97;
  font-size: 16px;
}

.balady-main {
  padding: 48px 0 40px;
}

.section-block {
  margin-bottom: 54px;
}

.block-title {
  text-align: right;
  font-size: clamp(34px, 2.8vw, 60px);
  margin-bottom: 24px;
  color: #11161c;
  font-weight: 800;
  line-height: 1.15;
}

.row.form-row {
  display: flex;
  flex-wrap: wrap;
  margin: 0 -18px;
  row-gap: 2px;
}

.col-md-6 {
  width: 50%;
  padding: 0 18px;
}

.form-group {
  margin: 0 0 24px;
}

.has-float-label {
  display: flex;
  flex-direction: column-reverse;
  align-items: stretch;
  gap: 10px;
}

.has-float-label .form-control {
  width: 100%;
  border: 1px solid #aeb7c1;
  background: #f2f2f2;
  border-radius: 5px;
  min-height: 43px;
  padding: 7px 13px;
  color: #4f5762;
  font: inherit;
  font-size: 18px;
  font-weight: 500;
  text-align: right;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 45%);
}

.has-float-label span {
  position: static;
  font-size: 18px;
  color: #171b20;
  pointer-events: none;
  font-weight: 700;
  line-height: 1.4;
  padding-right: 3px;
}

.table-responsive,
.table-wrap {
  overflow-x: auto;
}

.license-table-wrap {
  border-radius: 12px;
}

.license-table,
.balady-main .table,
.balady-main table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
  border: 1px solid #cfd6dd;
  border-radius: 12px;
  overflow: hidden;
  background: #ffffff;
}

.license-table th,
.license-table td,
.balady-main .table th,
.balady-main .table td,
.balady-main table th,
.balady-main table td {
  text-align: right;
  vertical-align: middle;
  padding: 10px 12px;
  border-bottom: 1px solid #d6dde4;
  color: #1d232b;
  font-size: 16px;
}

.license-table thead th,
.balady-main .table thead th,
.balady-main table thead th {
  background: #eceff3;
  color: #13171b;
  font-weight: 700;
  font-size: 14px;
  line-height: 1.25;
}

.license-table tbody th,
.license-table tbody td {
  font-size: 18px;
  line-height: 1.35;
}

.license-table tbody tr:last-child td,
.license-table tbody tr:last-child th {
  border-bottom: 0;
}

.license-table--plain tbody tr {
  background: #ffffff;
}

.license-table--striped tbody tr:nth-child(odd) {
  background: #ffffff;
}

.license-table--striped tbody tr:nth-child(even) {
  background: #f2f4f7;
}

.owners-table tbody tr {
  background: #b7d7d6;
}

.owners-table tbody td,
.owners-table tbody th {
  font-size: 20px;
}

.authority-table td:last-child,
.authority-table th:last-child {
  width: 36%;
}

.dimensions-table {
  min-width: 1080px;
}

.dimensions-table thead th:not(:last-child),
.dimensions-table tbody td:not(:last-child) {
  width: 17.5%;
}

.dimensions-table thead th:last-child,
.dimensions-table .dimension-label-cell {
  width: 30%;
  background: #f0f2f5;
}

.dimensions-table tbody tr:nth-child(odd) {
  background: #ffffff;
}

.dimensions-table tbody tr:nth-child(even) {
  background: #f2f4f7;
}

.dimension-label-cell {
  color: #1b2025;
  font-weight: 500;
}

.dimension-control {
  min-height: 48px;
  border: 1px solid #adb6c0;
  border-radius: 4px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  color: #28313a;
}

.dimension-control-icons {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #1f6e72;
  flex: 0 0 auto;
}

.dimension-control-icons svg {
  width: 19px;
  height: 19px;
}

.dimension-control-text {
  display: inline-block;
  flex: 1;
}

.coordinates-table tbody td,
.coordinates-table tbody th {
  font-size: 19px;
}

.empty,
.empty-state {
  color: var(--muted);
  text-align: center;
  padding: 14px;
}

.components-shell {
  margin-top: 10px;
  border: 1px solid #d6dde5;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 8px 20px rgb(19 31 41 / 6%);
  overflow: hidden;
  transition: all 0.2s ease;
}

.components-shell:hover {
  background: #f4f8f6;
  border-color: #2a7e57;
}

.components-shell[open] {
  border: 1px solid #2f8b82;
  background: #ffffff;
  box-shadow: none;
}

.components-shell[open]:hover {
  background: #f4f8f6;
  border-color: #2a7e57;
}

.components-shell-summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 28px 30px;
  cursor: pointer;
}

.components-shell-title {
  order: -1;
  margin: 0;
  font-size: clamp(24px, 1.5vw, 28px);
  font-weight: 900;
  line-height: 1.2;
}

.components-shell-caret {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #4f5d6a;
  flex: 0 0 36px;
}

.components-shell-caret svg {
  width: 30px;
  height: 30px;
  transition: transform 180ms ease;
}

.components-shell[open] .components-shell-caret svg {
  transform: rotate(180deg);
}

.components-shell-body, .model-body {
  padding: 0 24px 24px;
}

.component-info {
  width: max-content;
  max-width: 100%;
  margin: 4px 0 30px 0;
  border: 1px solid #b3cdfb;
  border-right: 4px solid #1b5ed6;
  background: #f0f5ff;
  color: #1b5ed6;
  border-radius: 8px;
  padding: 16px 20px;
  text-align: right;
  font-weight: 700;
  font-size: clamp(14px, 1vw, 17px);
  display: flex;
  align-items: center;
  gap: 12px;
}

.component-info .info-text {
  flex: none;
  text-align: right;
}

.component-info .info-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
}

.component-list {
  display: grid;
  gap: 22px;
}

.model-card {
  border: 1px solid #dce4eb;
  border-radius: 10px;
  background: #ffffff;
  overflow: hidden;
  transition: all 0.2s ease;
}

.model-card:hover {
  background: #f4f8f6;
  border-color: #2a7e57;
}

.model-summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 18px 16px;
  cursor: pointer;
}

.model-summary::-webkit-details-marker {
  display: none;
}

.model-main {
  display: flex;
  align-items: center;
  gap: 18px;
  flex: 1;
}

.show-components-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1.5px solid #111822;
  background: #f9fbff;
  border-radius: 6px;
  padding: 8px 16px;
  color: #1f2833;
  font-size: 14px;
  font-weight: 700;
}

.btn-arrow {
  color: #5f6f81;
  font-size: 15px;
  line-height: 1;
  display: inline-block;
  transition: transform 160ms ease;
}

.model-card[open] .btn-arrow {
  transform: rotate(180deg);
}

.model-meta {
  display: flex;
  align-items: center;
  gap: 40px;
}

.meta-item {
  display: grid;
  gap: 2px;
  text-align: center;
}

.meta-item span {
  display: block;
  font-size: 11px;
  color: #6a7c90;
  font-weight: 700;
}

.meta-item strong {
  display: block;
  margin-top: 4px;
  font-size: 13.5px;
  color: #212d3c;
  font-weight: 800;
}
.meta-item-name strong {
  font-size: clamp(18px, 1.35vw, 24px);
}

.model-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: #2a7e57;
  flex: 0 0 44px;
  background: #edf6f1;
  border: 1px solid #d6ece0;
  border-radius: 8px;
}

.model-icon svg,
.floor-icon svg {
  width: 24px;
  height: 24px;
}

.model-body {
  border-top: none;
  padding: 0 24px 24px;
}

.floor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}

.floor-card {
  border: 1px solid #dce4eb;
  border-radius: 12px;
  background: #ffffff;
  overflow: hidden;
  transition: all 0.2s ease;
}

.floor-card:hover {
  background: #f4f8f6;
  border-color: #2a7e57;
}

.floor-summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 16px;
  cursor: pointer;
  border-bottom: 0;
}

.floor-summary::-webkit-details-marker {
  display: none;
}

.floor-main {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-direction: row-reverse;
}

.floor-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.floor-caret {
  color: #6f7b87;
  font-size: 22px;
  line-height: 1;
  display: inline-block;
  transition: transform 160ms ease;
}

.floor-card[open] .floor-caret {
  transform: rotate(180deg);
}

.floor-badge {
  background: #f0f5ff;
  border: 1px solid #c9dafb;
  color: #3168be;
  border-radius: 6px;
  padding: 4px 12px;
  font-size: 13px;
  font-weight: 700;
}

.floor-name {
  color: #222d39;
  font-size: clamp(17px, 1.35vw, 20px);
  font-weight: 800;
}

.floor-icon {
  width: 38px;
  height: 38px;
  border: 1px solid #c2dfd0;
  border-radius: 8px;
  background: #e9f5ed;
  display: grid;
  place-items: center;
  color: #2a7e57;
  flex: 0 0 38px;
}

.floor-body {
  padding: 0 24px 24px;
  background: #ffffff;
}

.floor-stats {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  min-height: 80px;
}

/* Dimension Settings */
.dimension-input-wrapper {
  display: block;
  background: #f7f9fa;
  border: 1px solid #dbe2e8;
  border-radius: 6px;
  padding: 6px 10px;
  color: #1a232f;
  min-height: 34px;
  text-align: center;
}

.floor-stats-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.floor-stats-item span {
  font-size: 16px;
  color: #484e56;
  font-weight: 400;
}

.floor-stats-item b {
  font-size: 16px;
  color: #111822;
  font-weight: 800;
}

.floor-units-title {
  margin-top: 14px;
  margin-inline: -12px;
  border-top: 1px solid #dde5ed;
  background: #eceff3;
  padding: 9px 12px;
  color: #253341;
  font-size: 15px;
  font-weight: 800;
}

.commitments-box {
  border: 1px solid #d4d9df;
  border-radius: 8px;
  background: #ffffff;
  padding: 18px 20px;
}

.commitments-box p {
  line-height: 2.05;
  margin-bottom: 10px;
  color: #262d36;
  font-size: 17px;
}

.attachments-card {
  border: 1px solid #d6dde4;
  border-radius: 12px;
  background: #ffffff;
  min-height: 58px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.attachments-help-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #f7f8fa;
  color: #272c31;
  display: grid;
  place-items: center;
  flex: 0 0 34px;
}

.attachments-help-icon svg {
  width: 22px;
  height: 22px;
}

.attachments-copy {
  flex: 1;
  color: #1f2328;
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.7;
  text-align: right;
}

.attachments-copy a,
.attachments-link-text {
  color: #248b4d;
  font-weight: 800;
  margin-right: 6px;
}

.site-footer-banner {
  margin-top: 40px;
  background: linear-gradient(135deg, #074d37 0%, #0a543c 50%, #0d5f44 100%);
  color: #eef8f2;
  border-radius: 0 0 20px 20px;
  overflow: hidden;
}

.site-footer-top {
  display: flex;
  justify-content: flex-start;
  padding-top: 20px;
}

.site-footer-links {
  display: flex;
  align-items: center;
  gap: 36px;
}

.site-footer-links a {
  color: #eef8f2;
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.site-footer-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 26px 0 30px;
}

.site-footer-copy {
  display: grid;
  gap: 10px;
  text-align: right;
}

.site-footer-title {
  color: #fff;
  font-size: 14.5px;
  font-weight: 700;
}

.site-footer-subtitle {
  color: #dceee5;
  font-size: 13px;
  font-weight: 400;
}

.site-footer-brands {
  display: flex;
  align-items: center;
  gap: 18px;
}

.site-footer-stamp-card,
.site-footer-logo-card {
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgb(255 255 255 / 4%);
  border: 1px solid rgb(255 255 255 / 28%);
}

.site-footer-stamp-card {
  width: 198px;
  padding: 8px 10px;
  background: rgb(8 25 54 / 28%);
}

.site-footer-logo-card {
  width: 116px;
  padding: 8px 12px;
}

.site-footer-stamp {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

.site-footer-logo {
  width: 92px;
  height: auto;
  display: block;
}

/* Admin + auth */
.admin-page {
  background: #f4f8fc;
}

.admin-topbar {
  background: #fff;
  border-bottom: 1px solid var(--border);
}

.topbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
}

.topbar-row h1 {
  font-size: 1.5rem;
}

.topbar-row p {
  color: var(--muted);
  margin-top: 4px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-content {
  padding: 24px 0 36px;
}

.admin-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 4px 16px rgb(15 31 50 / 6%);
}

.admin-card h2 {
  font-size: 1.15rem;
  margin-bottom: 14px;
}

.record-actions-card {
  padding: 14px;
}

.record-actions-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.record-action-btn {
  min-height: 84px;
  border-radius: 20px;
  border: 2px solid transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: clamp(1.25rem, 2vw, 2rem);
  font-weight: 700;
  text-decoration: none;
  transition: transform 140ms ease, filter 140ms ease;
  padding: 10px 16px;
  line-height: 1.2;
  cursor: pointer;
  font-family: var(--heading-font);
}

.record-action-btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
  filter: brightness(0.98);
}

.record-action-btn-primary {
  background: #0d7a83;
  color: #fff;
}

.record-action-btn-light {
  background: #f6f8fb;
  color: #203555;
  border-color: #b9c8de;
}

.record-delete-form {
  margin-top: 14px;
  display: flex;
  justify-content: flex-end;
}

.record-action-btn-danger {
  min-height: 74px;
  min-width: min(100%, 300px);
  border: 0;
  background: #c32017;
  color: #fff;
}

.admin-form {
  display: grid;
  gap: 18px;
}

.qr-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.qr-image {
  width: 150px;
  height: 150px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}

.public-link {
  display: inline-block;
  margin-top: 8px;
  word-break: break-all;
}

.qr-actions {
  margin-top: 10px;
}

.admin-card .table-wrap {
  margin-top: 8px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

.admin-table th,
.admin-table td {
  text-align: right;
  vertical-align: top;
  padding: 10px;
  border-bottom: 1px solid #e2e8f0;
  font-size: 14px;
}

.admin-table th {
  background: #f4f7fb;
  color: #1d334e;
  font-weight: 700;
}

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

.form-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.form-grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.dashboard-license-table th,
.dashboard-license-table td {
  padding: 10px;
}

.dashboard-license-table input,
.dashboard-license-table select {
  background: transparent !important;
  border: 1px solid transparent !important;
  border-bottom: 1px solid #c0c7d0 !important;
  color: #111822 !important;
  font-weight: 600;
  padding: 4px 6px !important;
  font-size: 15px;
  width: 100%;
  text-align: right;
  border-radius: 0 !important;
  outline: none;
  transition: border-bottom-color 0.2s;
}

.dashboard-license-table input:focus,
.dashboard-license-table select:focus {
  border-bottom-color: #248b4d !important;
}

.form-grid label,
.auth-form label {
  display: grid;
  gap: 7px;
  color: #1f3045;
  font-weight: 600;
}

.form-grid input,
.form-grid textarea,
.auth-form input,
.admin-table input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  color: var(--text);
  background: #fff;
}

.balady-primary-data label {
  background: #f1f3f6;
  padding: 12px 16px;
  border-radius: 8px;
  text-align: center;
  border: 1px solid #dce2e8;
  color: #171d24;
  font-size: 13.5px;
}

.balady-primary-data input,
.balady-primary-data textarea {
  background: transparent !important;
  border: none !important;
  border-bottom: 1px solid #c0c7d0 !important;
  text-align: center;
  font-weight: 700;
  padding: 4px 0 !important;
  box-shadow: none;
  font-size: 16px;
  border-radius: 0 !important;
  outline: none;
  color: #111822 !important;
  transition: border-bottom-color 0.2s ease;
}

.balady-primary-data input:focus,
.balady-primary-data textarea:focus {
  border-bottom-color: #248b4d !important;
}

.form-grid textarea {
  resize: vertical;
}

.full-width {
  grid-column: 1 / -1;
}

.section-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.sticky-submit {
  position: sticky;
  bottom: 10px;
  background: rgb(255 255 255 / 96%);
  backdrop-filter: blur(2px);
}

.btn-save {
  width: 100%;
  font-size: 1rem;
  padding: 12px;
}

.admin-auth-page,
.simple-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 16px;
}

.auth-card,
.simple-card {
  width: min(460px, 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
  padding: 20px;
  box-shadow: 0 12px 28px rgb(15 31 50 / 8%);
  display: grid;
  gap: 12px;
}

.auth-card h1,
.simple-card h1 {
  font-size: 1.4rem;
}

.auth-form {
  display: grid;
  gap: 12px;
}

.muted,
.hint,
.simple-card p {
  color: var(--muted);
}

@media (max-width: 960px) {
  .container {
    width: calc(100% - 28px);
  }

  .gov-banner-main,
  .topbar-row,
  .qr-card,
  .site-footer-main,
  .section-row {
    flex-direction: column;
    align-items: stretch;
  }

  .gov-banner-top,
  .portal-nav {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .portal-right {
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
  }

  .gov-banner-main {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .gov-banner.is-open .gov-banner-details {
    max-height: 1200px;
  }

  .gov-register-card {
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .site-footer-top {
    justify-content: center;
  }

  .site-footer-links {
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
  }

  .site-footer-brands {
    justify-content: flex-start;
  }

  .record-actions-grid {
    grid-template-columns: 1fr;
  }

  .record-action-btn {
    min-height: 72px;
    font-size: 1.45rem;
  }

  .record-delete-form {
    justify-content: stretch;
  }

  .record-action-btn-danger {
    width: 100%;
    min-width: 0;
  }

  .section-block {
    margin-bottom: 30px;
  }

  .col-md-6 {
    width: 100%;
  }

  .component-info {
    width: 100%;
    margin-left: 0;
  }

  .components-shell-summary {
    padding: 22px 20px;
  }

  .components-shell-body {
    padding: 0 20px 22px;
  }

  .license-table tbody td,
  .license-table tbody th {
    font-size: 16px;
  }

  .owners-table tbody td,
  .owners-table tbody th,
  .coordinates-table tbody td,
  .coordinates-table tbody th {
    font-size: 17px;
  }

  .attachments-card {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .attachments-help-icon {
    margin-inline-start: auto;
  }

  .attachments-copy {
    width: 100%;
    text-align: right;
    font-size: 15px;
  }

  .model-summary {
    flex-wrap: wrap;
  }

  .model-main {
    width: 100%;
    justify-content: space-between;
  }

  .model-meta {
    justify-content: flex-end;
    gap: 16px;
  }

  .show-components-btn {
    width: 100%;
    justify-content: center;
  }

  .floor-grid {
    grid-template-columns: 1fr;
  }

  .floor-grid--stacked .floor-card:first-child {
    grid-row: auto;
  }

  .floor-summary {
    flex-wrap: wrap;
  }

  .portal-nav {
    min-height: auto;
    padding: 10px 0 14px;
  }

  .portal-right {
    gap: 12px;
  }

  .portal-menu {
    flex-wrap: wrap;
    gap: 10px;
  }

  .portal-link {
    min-height: 56px;
    padding: 0 14px;
    font-size: 16px;
  }

  .portal-logo {
    border-inline-start: 0;
    padding: 0;
    justify-content: flex-end;
  }

  .portal-logo-image {
    width: min(96px, 30vw);
  }

  .portal-left {
    justify-content: space-between;
    gap: 12px;
  }

  .mega-panel {
    display: none;
  }
}

@media (max-width: 860px) {
  .gov-banner-top,
  .gov-banner-tools,
  .portal-left {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
  }

  .gov-banner-verify {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .site-footer-copy {
    text-align: center;
  }

  .site-footer-brands {
    justify-content: center;
    flex-wrap: wrap;
  }

  .portal-left {
    width: auto;
    justify-content: space-between;
  }

  .table,
  .admin-table,
  table {
    min-width: 560px;
  }

  .qr-image {
    width: 130px;
    height: 130px;
  }
}

@media (max-width: 640px) {
  .gov-banner-top,
  .portal-nav,
  .portal-right,
  .portal-left {
    justify-content: space-between;
  }

  .gov-banner-tools {
    gap: 12px;
  }

  .gov-banner-verify,
  .gov-banner-tools {
    width: 100%;
  }

  .components-shell-summary {
    padding: 20px 16px;
  }

  .components-shell-body {
    padding: 0 14px 18px;
  }

  .gov-banner-copy h3 {
    font-size: 22px;
  }

  .gov-banner-copy p,
  .gov-register-card p {
    font-size: 15px;
  }

  .site-footer-links a {
    font-size: 15px;
  }

  .site-footer-title {
    font-size: 20px;
  }

  .site-footer-subtitle {
    font-size: 15px;
  }

  .site-footer-stamp-card {
    width: min(100%, 198px);
  }

  .gov-banner.is-open .gov-banner-details {
    max-height: 1400px;
  }

  .component-info {
    font-size: 14px;
    padding: 13px 12px;
  }

  .components-block {
    padding: 14px 12px;
  }

  .block-title {
    margin-bottom: 10px;
  }

  .portal-menu {
    justify-content: flex-start;
  }

  .portal-link {
    min-height: 50px;
    font-size: 15px;
    padding: 0 12px;
  }

  .balady-btn-work,
  .search-mini {
    font-size: 15px;
  }
}

/* Building Components Custom Dashboard Styles */
.bc-outer-card {
  background: #fff;
  border-radius: 12px;
  border: 1px solid #eaedf1;
  padding: 30px;
  margin-bottom: 40px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.02);
}

.bc-outer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.bc-outer-header h2 {
  font-weight: 700;
  color: #1a1a1a;
}

.bc-info-alert {
  display: flex;
  align-items: center;
  gap: 12px;
  background-color: #f0f7ff;
  border-right: 4px solid #2b78e4;
  padding: 14px 20px;
  border-radius: 8px;
  margin-bottom: 30px;
  color: #2b78e4;
  font-size: 14px;
  font-weight: 500;
}

.bc-info-text {
  flex-grow: 1;
}

.bc-model-card {
  border: 1px solid #eaedf1;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
  background: #fff;
}

.bc-model-header-row {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
  margin-bottom: 25px;
}

.bc-input-group {
  flex: 1;
  min-width: 130px;
  display: flex;
  flex-direction: column;
}

.bc-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.bc-input-wrap input {
  width: 100%;
  border: 1px dashed transparent;
  background: transparent;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  color: #1a1a1a;
  padding: 8px 8px;
  outline: none;
  transition: all 0.2s;
  border-radius: 4px;
}

.bc-input-wrap input:focus, .bc-input-wrap input:hover {
  border-color: #c0cddb;
}

.bc-input-wrap.has-icon input {
  padding-right: 40px;
}

.bc-input-icon {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  color: #208e54;
  background: #e8f5ed;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bc-input-icon svg {
  width: 16px;
  height: 16px;
}

.bc-model-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-right: auto;
}

.bc-btn-toggle-floors {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border: 1px solid #d9e2ec;
  border-radius: 6px;
  background: #fff;
  color: #1a1a1a;
  font-weight: 600;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.bc-btn-toggle-floors:hover, .bc-btn-toggle-floors.active {
  background: #f8fafc;
  border-color: #c0cddb;
}

.bc-btn-delete-model {
  background: #fee2e2;
  color: #ef4444;
  border: none;
  border-radius: 4px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
}

.bc-btn-delete-model:hover {
  background: #fecaca;
}

.bc-floors-list {
  padding-top: 20px;
  border-top: 1px dashed #e4e8ee;
  margin-top: 20px;
}

.bc-floors-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

@media(max-width: 768px) {
  .bc-floors-grid {
    grid-template-columns: 1fr;
  }
}

.bc-floor-card {
  border: 1px solid #eaedf1;
  border-radius: 8px;
  background: #fff;
}

.bc-floor-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  cursor: pointer;
}

.bc-floor-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bc-comp-name-label {
  font-size: 14px;
  font-weight: 600;
  color: #1a1a1a;
}

.bc-btn-delete-floor {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #ff4c4c;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}

.bc-floor-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.bc-usage-badge {
  background: #e8f4fc;
  color: #2b78e4;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 4px;
}

.bc-floor-caret {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.3s;
}

.bc-floor-inputs {
  padding: 16px;
  border-top: 1px solid #eaedf1;
  background: #fafbfc;
  border-radius: 0 0 8px 8px;
}

.bc-btn-add-floor {
  background: #115e3a;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: block;
  margin: 0 auto;
}

.bc-btn-add-floor:hover {
  background: #0f4d30;
}
