@import url("https://fonts.googleapis.com/css2?family=Noto+Naskh+Arabic+UI:wght@400;500;600;700&family=Inter:wght@400;500;600;700;800&display=swap");

/* ==========================================================
   ROX MALL — PRODUCTION DESIGN SYSTEM
   Brand: ROX | Return on Xperience
   Arabic-first | RTL + LTR | Light + Dark

   Arabic font: Noto Naskh Arabic UI
   Latin / numbers: Inter

   Brand colors:
   Black: #0C0C0C
   Gold:  #C8A970
   Cream: #F6F3EE
   ========================================================== */

/* 01 — DESIGN TOKENS */

:root {
  color-scheme: light;

  --black: #0C0C0C;
  --gold: #C8A970;
  --gold-dark: #A8894F;
  --cream: #F6F3EE;
  --white: #FFFFFF;

  --bg: #F6F3EE;
  --surface: #FFFFFF;
  --surface-alt: #FAF8F4;
  --surface-hover: #F3EEE5;
  --sidebar-bg: #0C0C0C;
  --sidebar-hover: #211E19;
  --sidebar-active: #2C261D;

  --text: #171512;
  --text-secondary: #6D675F;
  --text-muted: #968D81;
  --border: #EAE5DC;
  --border-strong: #DCD4C8;

  --gold-soft: #F4E9D7;
  --gold-glow: rgba(200,169,112,.18);

  --green: #4F8B65;
  --green-bg: #E8F3EB;
  --amber: #A77A31;
  --amber-bg: #F8EEDB;
  --red: #B85B52;
  --red-bg: #FAEAE7;
  --blue: #5D7F86;
  --blue-bg: #E8F0F1;

  --unit-leased: #86B28E;
  --unit-vacant: #E6E2DB;
  --unit-reserved: #E9CB93;
  --unit-maintenance: #E3ADA8;

  --font-ar: "Noto Naskh Arabic UI", "Noto Naskh Arabic", serif;
  --font-en: "Inter", sans-serif;

  --radius-sm: 7px;
  --radius-md: 12px;
  --radius-lg: 17px;
  --radius-xl: 22px;

  --shadow-card: 0 3px 18px rgba(24,19,12,.035);
  --shadow-hover: 0 12px 32px rgba(24,19,12,.09);
  --shadow-modal: 0 28px 80px rgba(0,0,0,.26);

  --side-width: 248px;
  --content-width: 1600px;

  --ease: cubic-bezier(.22,1,.36,1);
  --speed: 180ms;
}

/* 02 — RESET */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

html[dir="rtl"] {
  direction: rtl;
}

html[dir="ltr"] {
  direction: ltr;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ar);
  font-size: 14px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

html[dir="ltr"] body {
  font-family: var(--font-en);
  line-height: 1.55;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: .5;
}

a {
  color: inherit;
  text-decoration: none;
}

img,
svg {
  display: block;
  max-width: 100%;
}

svg {
  flex-shrink: 0;
}

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

h1,
h2,
h3 {
  font-weight: 700;
  letter-spacing: 0;
}

html[dir="ltr"] h1,
html[dir="ltr"] h2,
html[dir="ltr"] h3 {
  letter-spacing: -.025em;
}

::selection {
  background: var(--gold);
  color: var(--black);
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.sp {
  flex: 1 1 auto;
  min-width: 0;
}

.num,
.kpi .v,
.hero .big,
td.n {
  font-family: var(--font-en);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  letter-spacing: -.035em;
}

html[dir="rtl"] .num,
html[dir="rtl"] td.n {
  direction: ltr;
  unicode-bidi: isolate;
}

.req {
  margin-inline-start: 3px;
  color: var(--red);
  font-weight: 700;
}

/* 03 — APPLICATION SHELL */

.shell {
  display: grid;
  grid-template-columns: var(--side-width) minmax(0,1fr);
  min-height: 100vh;
}

.main {
  min-width: 0;
  min-height: 100vh;
  padding: 0 clamp(20px,3.2vw,52px) 52px;
  background: var(--bg);
}

.main > :not(.top) {
  max-width: var(--content-width);
  margin-inline: auto;
}

/* 04 — SIDEBAR */

.side {
  position: sticky;
  inset-block-start: 0;
  display: flex;
  flex-direction: column;
  width: var(--side-width);
  height: 100vh;
  padding: 27px 14px 16px;
  background: var(--sidebar-bg);
  color: #F6F3EE;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #40392F transparent;
  z-index: 80;
}

.side .logo {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 8px 17px 24px;
  margin-block-end: 14px;
}

.side .logo img {
  width: 125px;
  max-height: 78px;
  object-fit: contain;
  object-position: center;
}

.side .logo small {
  color: var(--gold);
  font-family: var(--font-en);
  font-size: 10px;
  line-height: 1.35;
  letter-spacing: .01em;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.nav > button[data-p] {
  position: relative;
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  min-height: 45px;
  padding: 10px 15px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: #E7E2DA;
  text-align: start;
  font-size: 13px;
  font-weight: 500;
  transition:
    background var(--speed) var(--ease),
    color var(--speed) var(--ease);
}

.nav > button[data-p] svg {
  width: 19px;
  height: 19px;
  stroke-width: 1.7;
}

.nav > button[data-p] > span:not(.badge) {
  flex: 1;
}

.nav > button[data-p]:hover {
  background: var(--sidebar-hover);
  color: #FFFFFF;
}

.nav > button[data-p].on {
  background: var(--sidebar-active);
  color: var(--gold);
  font-weight: 600;
}

.nav > button[data-p].on::before {
  content: "";
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: 3px;
  border-radius: 3px;
  background: var(--gold);
}

.nav .badge,
span.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding-inline: 6px;
  border-radius: 100px;
  background: var(--gold);
  color: var(--black);
  font-family: var(--font-en);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.side .foot {
  margin-block-start: auto;
  padding: 19px 11px 0;
  border-block-start: 1px solid rgba(200,169,112,.28);
}

.side .foot > b {
  display: block;
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 600;
}

.side .foot > span {
  display: block;
  margin-block-end: 15px;
  color: #ABA49A;
  font-size: 11px;
}

.side .foot .row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.side .foot .ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 35px;
  padding: 7px 11px;
  border: 1px solid #70675A;
  border-radius: 7px;
  background: transparent;
  color: #F6F3EE;
  font-size: 11px;
  transition: all var(--speed) var(--ease);
}

.side .foot .ghost:hover {
  border-color: var(--gold);
  background: rgba(200,169,112,.12);
  color: var(--gold);
}

.side .foot .ghost svg {
  width: 15px;
  height: 15px;
}

#lang,
#out {
  flex: 1 1 100%;
}

/* 05 — MOBILE TOP BAR */

.mbar {
  display: none;
}

#mnav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(200,169,112,.35);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--gold);
}

#mnav svg {
  width: 21px;
  height: 21px;
}

/* 06 — PAGE HEADER */

.top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  min-height: 78px;
  max-width: var(--content-width);
  margin-inline: auto;
  margin-block-end: 20px;
  padding-block: 21px 16px;
}

.top h1 {
  color: var(--text);
  font-size: clamp(23px,2.1vw,29px);
  line-height: 1.4;
}

.demo-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 15px;
  border-radius: 100px;
  background: #EFE4D2;
  color: var(--gold-dark);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

#topx {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 38px;
  min-height: 38px;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  transition: all var(--speed) var(--ease);
}

#topx:hover {
  border-color: var(--border);
  background: var(--surface);
  color: var(--gold-dark);
}

#topx svg {
  width: 20px;
  height: 20px;
}

/* 07 — KPI CARDS */

.kpis {
  display: grid;
  grid-template-columns: repeat(5,minmax(0,1fr));
  gap: 13px;
  margin-block-end: 18px;
}

.kpi {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  min-height: 155px;
  padding: 21px 20px 17px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition:
    transform var(--speed) var(--ease),
    box-shadow var(--speed) var(--ease),
    border-color var(--speed) var(--ease);
}

.kpi:hover {
  transform: translateY(-2px);
  border-color: rgba(200,169,112,.4);
  box-shadow: var(--shadow-hover);
}

.kpi .l {
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.7;
}

.kpi .v {
  display: block;
  margin-block: 9px 5px;
  color: var(--text);
  font-size: clamp(23px,2.1vw,32px);
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.kpi .s {
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.7;
}

.kpi.gold {
  border-color: transparent;
  background: linear-gradient(
    145deg,
    #D8B777 0%,
    #C8A970 44%,
    #9F7D40 100%
  );
  color: #FFFFFF;
  box-shadow: 0 10px 28px rgba(168,137,79,.17);
}

.kpi.gold .l,
.kpi.gold .v,
.kpi.gold .s {
  color: #FFFFFF;
}

.kpi.gold .v {
  font-size: clamp(29px,2.7vw,39px);
}

.kpi.gold .s {
  color: rgba(255,255,255,.88);
}

.bar {
  width: 100%;
  height: 8px;
  margin-block: 12px 5px;
  border-radius: 100px;
  background: rgba(0,0,0,.10);
  overflow: hidden;
}

.bar > i {
  display: block;
  width: 0;
  max-width: 100%;
  height: 100%;
  border-radius: inherit;
  background: var(--gold);
  transition: width 450ms var(--ease);
}

.kpi.gold .bar {
  background: rgba(74,53,20,.27);
}

.kpi.gold .bar > i {
  background: #F6E7C2;
}

/* 08 — DASHBOARD CARDS */

.grid2 {
  display: grid;
  grid-template-columns: minmax(0,1.45fr) minmax(0,1fr);
  gap: 16px;
  align-items: stretch;
  margin-block-end: 18px;
}

.card {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.card > h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 27px;
  margin-block-end: 16px;
  padding-block-end: 12px;
  border-block-end: 1px solid var(--border);
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.card > h3 .sp {
  flex: 1;
}

.card .body {
  min-width: 0;
  color: var(--text-secondary);
  font-size: 13px;
}

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 180px;
  padding: 28px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  color: var(--text-muted);
  text-align: center;
  font-size: 13px;
}

.empty svg {
  width: 34px;
  height: 34px;
  color: var(--gold);
  opacity: .75;
}

/* 09 — INPUTS & BUTTONS */

input,
select,
textarea {
  min-width: 0;
  padding: 10px 13px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  outline: none;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  transition:
    border-color var(--speed) var(--ease),
    box-shadow var(--speed) var(--ease),
    background var(--speed) var(--ease);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
  opacity: 1;
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--gold);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--gold-dark);
  box-shadow: 0 0 0 3px var(--gold-glow);
}

input[type="search"] {
  appearance: none;
  -webkit-appearance: none;
}

input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--gold-dark);
}

select {
  cursor: pointer;
}

textarea {
  min-height: 100px;
  resize: vertical;
}

.tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-block: 16px;
}

.tools input[type="search"] {
  width: min(100%,285px);
  min-height: 41px;
}

.tools select {
  min-width: 145px;
  min-height: 41px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 41px;
  padding: 9px 17px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  text-align: center;
  white-space: nowrap;
  transition:
    background var(--speed) var(--ease),
    border-color var(--speed) var(--ease),
    color var(--speed) var(--ease),
    transform var(--speed) var(--ease),
    box-shadow var(--speed) var(--ease);
}

.btn:hover {
  transform: translateY(-1px);
  border-color: var(--gold);
  background: var(--surface-hover);
}

.btn:active {
  transform: translateY(0);
}

.btn svg {
  width: 16px;
  height: 16px;
}

.btn.pri {
  border-color: var(--gold);
  background: var(--gold);
  color: #17130C;
}

.btn.pri:hover {
  border-color: var(--gold-dark);
  background: var(--gold-dark);
  color: #FFFFFF;
  box-shadow: 0 5px 18px rgba(168,137,79,.2);
}

.btn.sm {
  min-height: 31px;
  padding: 5px 10px;
  font-size: 11px;
}

.btn.danger {
  border-color: rgba(184,91,82,.3);
  background: var(--red-bg);
  color: var(--red);
}

.btn.danger:hover {
  border-color: var(--red);
  background: var(--red);
  color: #FFFFFF;
}

/* 10 — DATA TABLES */

.tbl-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  -webkit-overflow-scrolling: touch;
}

table.t {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  color: var(--text);
  font-size: 12px;
  text-align: start;
}

.t th,
.t td {
  padding: 14px 17px;
  border-block-end: 1px solid var(--border);
  vertical-align: middle;
  text-align: start;
}

.t th {
  background: var(--surface-alt);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.t td {
  background: var(--surface);
  transition: background var(--speed) var(--ease);
}

.t tbody tr:hover td {
  background: var(--gold-soft);
}

.t tbody tr:last-child td {
  border-block-end: 0;
}

.t td.n {
  font-size: 12px;
  font-weight: 600;
  text-align: end;
  white-space: nowrap;
}

.t td.act {
  text-align: end;
  white-space: nowrap;
}

.t td.act .btn {
  margin-inline: 2px;
}

.t .sub {
  display: block;
  margin-block-start: 3px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 400;
  line-height: 1.5;
}

/* 11 — STATUS CHIPS */

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 24px;
  padding: 3px 10px;
  border: 1px solid transparent;
  border-radius: 100px;
  background: var(--surface-hover);
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}

.chip::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.chip.ok {
  background: var(--green-bg);
  color: var(--green);
}

.chip.warn {
  background: var(--amber-bg);
  color: var(--amber);
}

.chip.bad {
  background: var(--red-bg);
  color: var(--red);
}

.chip.info {
  background: var(--blue-bg);
  color: var(--blue);
}

.chip.gold {
  background: var(--gold-soft);
  color: var(--gold-dark);
}

/* 12 — ARCHITECTURAL UNIT MAP */

.umap {
  position: relative;
  display: grid;
  grid-template-columns: repeat(6,minmax(0,1fr));
  grid-auto-rows: minmax(80px,auto);
  gap: 7px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background:
    linear-gradient(
      90deg,
      transparent 49.8%,
      rgba(200,169,112,.09) 50%,
      transparent 50.2%
    ),
    repeating-linear-gradient(
      0deg,
      transparent 0,
      transparent 39px,
      rgba(200,169,112,.045) 40px
    ),
    var(--surface-alt);
  overflow: hidden;
}

.umap::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(200,169,112,.22);
  border-radius: 5px;
  pointer-events: none;
}

.umap > .ucell {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 78px;
  padding: 12px 5px;
  border: 1px solid rgba(255,255,255,.75);
  border-radius: 3px;
  text-align: center;
  box-shadow: 0 2px 5px rgba(30,23,12,.035);
  transition:
    transform var(--speed) var(--ease),
    box-shadow var(--speed) var(--ease),
    filter var(--speed) var(--ease);
}

.umap > .ucell:hover {
  transform: translateY(-3px);
  filter: brightness(1.035);
  box-shadow: 0 7px 17px rgba(30,23,12,.14);
  z-index: 2;
}

.umap > .ucell b {
  font-family: var(--font-en);
  font-size: 12px;
  font-weight: 600;
  direction: ltr;
  unicode-bidi: isolate;
}

.umap > .ucell small {
  font-size: 10px;
  font-weight: 500;
}

.umap > .ucell.leased {
  background: var(--unit-leased);
  color: #FFFFFF;
}

.umap > .ucell.vacant {
  background: var(--unit-vacant);
  color: #5E5952;
}

.umap > .ucell.reserved {
  background: var(--unit-reserved);
  color: #544021;
}

.umap > .ucell.maintenance {
  background: var(--unit-maintenance);
  color: #693B36;
}

/* Optional corridor elements for floor-plan layouts */

.umap > .corridor {
  grid-column: 1 / -1;
  min-height: 28px;
  border-block: 1px dashed rgba(168,137,79,.35);
  background: rgba(200,169,112,.06);
}

/* 13 — MODALS */

.ov {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(12,12,12,.68);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  overflow-y: auto;
  z-index: 200;
}

.modal {
  width: min(100%,650px);
  max-height: min(90vh,900px);
  margin: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-modal);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.modal > header {
  position: sticky;
  inset-block-start: 0;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 25px;
  border-block-end: 1px solid var(--border);
  background: var(--surface);
  z-index: 2;
}

.modal > header h2 {
  flex: 1;
  font-size: 19px;
  font-weight: 700;
}

.modal > header button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 33px;
  height: 33px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface-alt);
  color: var(--text-secondary);
  font-size: 20px;
  line-height: 1;
}

.modal > header button:hover {
  background: var(--red-bg);
  color: var(--red);
}

.modal form.mb {
  padding: 24px 25px 0;
}

.modal .form {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 17px;
}

.form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
}

.form label > span {
  display: block;
}

.form label input,
.form label select,
.form label textarea {
  width: 100%;
  min-height: 42px;
  font-weight: 400;
}

.form label.full {
  grid-column: 1 / -1;
}

.modal footer,
.modal .mb > footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  margin-block-start: 24px;
  padding: 18px 0 24px;
  border-block-start: 1px solid var(--border);
}

.modal > footer {
  padding-inline: 25px;
}

/* 14 — TIMELINE */

ul.timeline {
  position: relative;
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline > li {
  position: relative;
  padding-block: 3px 21px;
  padding-inline-start: 28px;
  color: var(--text);
  font-size: 12px;
}

.timeline > li:not(:last-child)::before {
  content: "";
  position: absolute;
  inset-inline-start: 8px;
  inset-block-start: 16px;
  height: calc(100% - 7px);
  border-inline-start: 1px solid var(--border-strong);
}

.timeline > li::after {
  content: "";
  position: absolute;
  inset-inline-start: 3px;
  inset-block-start: 8px;
  width: 11px;
  height: 11px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 1px var(--gold);
}

.timeline > li small {
  display: block;
  margin-block-start: 4px;
  color: var(--text-muted);
  font-size: 10px;
}

/* 15 — TOASTS */

.toast {
  position: fixed;
  inset-inline-end: 25px;
  inset-block-end: 25px;
  display: flex;
  align-items: center;
  gap: 11px;
  max-width: min(420px,calc(100vw - 32px));
  padding: 13px 18px;
  border: 1px solid rgba(200,169,112,.4);
  border-inline-start: 4px solid var(--gold);
  border-radius: var(--radius-sm);
  background: var(--black);
  color: #FFFFFF;
  box-shadow: var(--shadow-modal);
  font-size: 12px;
  z-index: 300;
  animation: rox-toast-in .25s var(--ease) both;
}

.toast.err {
  border-color: rgba(184,91,82,.45);
  border-inline-start-color: var(--red);
}

@keyframes rox-toast-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 16 — LOGIN */

.login {
  display: grid;
  grid-template-columns: minmax(0,1.05fr) minmax(0,.95fr);
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--cream);
}

.login > section.art {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 14px;
  min-height: 100vh;
  padding: clamp(35px,5vw,80px);
  background-color: #171512;
  background-image:
    linear-gradient(
      180deg,
      rgba(12,12,12,.28) 0%,
      rgba(12,12,12,.18) 35%,
      rgba(12,12,12,.83) 100%
    ),
    var(
      --login-image,
      url("https://images.unsplash.com/photo-1494412519320-aa613dfb7738?auto=format&fit=crop&w=1800&q=85")
    );
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  color: #FFFFFF;
  overflow: hidden;
}

.login .art > img {
  position: absolute;
  inset-block-start: clamp(30px,4vw,60px);
  inset-inline-start: clamp(35px,5vw,80px);
  width: clamp(125px,14vw,185px);
  max-height: 110px;
  object-fit: contain;
  object-position: left center;
}

.login .art h2 {
  position: relative;
  max-width: 490px;
  color: #FFFFFF;
  font-size: clamp(32px,3.7vw,57px);
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0;
}

.login .art h2 em {
  color: var(--gold);
  font-style: normal;
}

.login .art p {
  max-width: 430px;
  color: rgba(255,255,255,.86);
  font-size: 15px;
  line-height: 2;
}

.login .art small {
  display: block;
  width: 100%;
  margin-block-start: 24px;
  padding-block-start: 17px;
  border-block-start: 2px solid var(--gold);
  color: #E9D9B8;
  font-family: var(--font-en);
  font-size: 11px;
  letter-spacing: .015em;
}

.login > section.pane {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: clamp(28px,5vw,85px);
  background: var(--cream);
  color: #171512;
}

.login .pane .box {
  width: min(100%,430px);
  margin-inline: auto;
}

.login .box h1 {
  margin-block-end: 6px;
  color: #171512;
  font-size: clamp(25px,2.6vw,34px);
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
}

.login .box > p {
  margin-block-end: 28px;
  color: #77716A;
  text-align: center;
  font-size: 13px;
}

.login .box form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.login .box form label {
  color: #29251F;
  font-size: 12px;
  font-weight: 600;
}

.login .box input {
  display: block;
  width: 100%;
  min-height: 46px;
  padding: 12px 15px;
  border-color: #DED7CC;
  background: #FAF8F4;
  color: #171512;
  font-size: 13px;
}

.login .box input:focus {
  background: #FFFFFF;
}

.login .box .btn.pri {
  width: 100%;
  min-height: 46px;
  margin-block-start: 5px;
  border: 0;
  background: var(--gold);
  color: #171512;
  font-size: 13px;
  font-weight: 700;
}

.login .box button.link {
  display: block;
  width: fit-content;
  margin: 5px auto 0;
  padding: 4px 8px;
  border: 0;
  background: transparent;
  color: var(--gold-dark);
  font-size: 12px;
  text-align: center;
}

.login .box button.link:hover {
  text-decoration: underline;
}

.login .box .err {
  padding: 10px 12px;
  border: 1px solid #E9C7C2;
  border-radius: var(--radius-sm);
  background: #FBEDEA;
  color: #A3443C;
  font-size: 12px;
}

.login .demo-list {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 10px;
  margin-block-start: 27px;
  padding-block-start: 24px;
  border-block-start: 1px solid #DDD6CC;
}

.login .demo-list > button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 85px;
  padding: 12px 6px;
  border: 1px solid #E2DBD0;
  border-radius: var(--radius-sm);
  background: #FAF8F4;
  color: #171512;
  text-align: center;
  transition: all var(--speed) var(--ease);
}

.login .demo-list > button:hover {
  transform: translateY(-2px);
  border-color: var(--gold);
  background: #F2E9DA;
}

.login .demo-list > button b {
  font-size: 12px;
  font-weight: 700;
}

.login .demo-list > button span {
  color: #8B8174;
  font-size: 10px;
}

.login .demo-list > button span small {
  font-size: 10px;
}

/* 17 — TENANT PORTAL HERO */

.hero {
  position: relative;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 22px;
  min-height: 185px;
  margin-block-end: 20px;
  padding: clamp(23px,3.5vw,40px);
  border: 1px solid rgba(200,169,112,.25);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(
      ellipse at 95% 0%,
      rgba(200,169,112,.17),
      transparent 48%
    ),
    linear-gradient(135deg,#171512,#0C0C0C);
  color: #FFFFFF;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: 4px;
  background: var(--gold);
}

.hero::after {
  content: "";
  position: absolute;
  inset-inline-end: -50px;
  inset-block-end: -95px;
  width: 270px;
  height: 270px;
  border: 1px solid rgba(200,169,112,.12);
  border-radius: 50%;
  pointer-events: none;
}

.hero h2 {
  position: relative;
  width: 100%;
  color: #FFFFFF;
  font-size: clamp(23px,2.4vw,32px);
  font-weight: 700;
  line-height: 1.4;
  z-index: 1;
}

.hero p {
  position: relative;
  max-width: 470px;
  color: #C8C2B8;
  font-size: 13px;
  z-index: 1;
}

.hero .sp {
  flex: 1;
}

.hero .big {
  position: relative;
  color: var(--gold);
  font-size: clamp(29px,3.3vw,47px);
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  z-index: 1;
}

.hero .btn.pri {
  position: relative;
  z-index: 1;
}

/* 18 — DIRECTIONAL REFINEMENTS */

html[dir="rtl"] .t th,
html[dir="rtl"] .t td {
  text-align: right;
}

html[dir="ltr"] .t th,
html[dir="ltr"] .t td {
  text-align: left;
}

html[dir="rtl"] .t td.n,
html[dir="ltr"] .t td.n,
html[dir="rtl"] .t td.act,
html[dir="ltr"] .t td.act {
  text-align: end;
}

html[dir="rtl"] input[type="email"],
html[dir="rtl"] input[type="url"],
html[dir="rtl"] input[type="tel"] {
  direction: ltr;
  text-align: left;
}

html[dir="rtl"] input[type="number"] {
  direction: ltr;
  text-align: right;
}

html[dir="rtl"] .login .art > img {
  object-position: right center;
}

/* 19 — DARK MODE */

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;

    --bg: #141311;
    --surface: #1D1B18;
    --surface-alt: #24211D;
    --surface-hover: #302B24;

    --sidebar-bg: #0C0C0C;
    --sidebar-hover: #211D17;
    --sidebar-active: #30291F;

    --text: #F3EFE8;
    --text-secondary: #C2B9AA;
    --text-muted: #968E82;

    --border: #353028;
    --border-strong: #514739;

    --gold-soft: #382E20;
    --gold-glow: rgba(200,169,112,.19);

    --green: #91C9A1;
    --green-bg: #213B2B;
    --amber: #E0BD7B;
    --amber-bg: #42341E;
    --red: #E6A09A;
    --red-bg: #422724;
    --blue: #9DC3CB;
    --blue-bg: #263A3F;

    --unit-leased: #446E52;
    --unit-vacant: #504B43;
    --unit-reserved: #967542;
    --unit-maintenance: #915A56;

    --shadow-card: 0 3px 14px rgba(0,0,0,.12);
    --shadow-hover: 0 12px 35px rgba(0,0,0,.22);
    --shadow-modal: 0 24px 70px rgba(0,0,0,.55);
  }

  .demo-pill {
    background: #3D3222;
    color: #E1C28A;
  }

  .kpi.gold {
    background: linear-gradient(
      145deg,
      #C8A970 0%,
      #A8894F 60%,
      #806334 100%
    );
  }

  .kpi.gold .l,
  .kpi.gold .v,
  .kpi.gold .s {
    color: #FFFFFF;
  }

  .umap > .ucell.leased {
    color: #F5FFF6;
  }

  .umap > .ucell.vacant {
    color: #E7E1D7;
  }

  .umap > .ucell.reserved {
    color: #FFF0CF;
  }

  .umap > .ucell.maintenance {
    color: #FFE5E2;
  }

  .login > section.pane {
    background: #171512;
    color: #F3EFE8;
  }

  .login .box h1,
  .login .box form label {
    color: #F3EFE8;
  }

  .login .box > p {
    color: #AAA194;
  }

  .login .box input {
    border-color: #453E33;
    background: #24211D;
    color: #F3EFE8;
  }

  .login .box input:focus {
    background: #2B261F;
  }

  .login .demo-list {
    border-block-start-color: #453E33;
  }

  .login .demo-list > button {
    border-color: #453E33;
    background: #24211D;
    color: #F3EFE8;
  }

  .login .demo-list > button:hover {
    background: #342B20;
  }

  .login .box .err {
    border-color: #70403A;
    background: #422724;
    color: #F1B3AD;
  }

  .t tbody tr:hover td {
    background: #30291F;
  }
}

/* 20 — TABLET */

@media (max-width: 1200px) {
  .main {
    padding-inline: 25px;
  }

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

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

  .kpi {
    min-height: 140px;
  }
}

/* 21 — MOBILE NAVIGATION */

@media (max-width: 900px) {
  .shell {
    display: block;
  }

  .side {
    position: fixed;
    inset-block: 0;
    inset-inline-start: 0;
    width: min(var(--side-width),85vw);
    height: 100vh;
    height: 100dvh;
    transform: translateX(-105%);
    transition: transform 280ms var(--ease);
    z-index: 150;
    box-shadow: none;
  }

  html[dir="rtl"] .side {
    transform: translateX(105%);
  }

  .side.open,
  html[dir="rtl"] .side.open,
  html[dir="ltr"] .side.open {
    transform: translateX(0);
    box-shadow: 0 0 65px rgba(0,0,0,.45);
  }

  .mbar {
    position: sticky;
    inset-block-start: 0;
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    height: 62px;
    padding-inline: 20px;
    border-block-end: 1px solid rgba(200,169,112,.18);
    background: #0C0C0C;
    z-index: 100;
  }

  .mbar img {
    width: 92px;
    max-height: 43px;
    object-fit: contain;
  }

  .main {
    min-height: calc(100vh - 62px);
    padding-inline: 22px;
    padding-block-end: 35px;
  }

  .top {
    margin-block-end: 13px;
  }

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

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

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

  .login > section.art {
    padding: 35px;
  }

  .login .art > img {
    inset-inline-start: 35px;
  }

  .login .art h2 {
    font-size: 31px;
  }

  .login > section.pane {
    padding: 32px;
  }
}

/* 22 — PHONE */

@media (max-width: 600px) {
  .main {
    padding-inline: 15px;
    padding-block-end: 90px;
  }

  .top {
    gap: 9px;
    padding-block: 16px;
    margin-block-end: 8px;
  }

  .top h1 {
    font-size: 22px;
  }

  .demo-pill {
    padding: 4px 10px;
    font-size: 10px;
  }

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

  .kpi {
    min-height: 132px;
    padding: 15px 13px;
  }

  .kpi .l {
    font-size: 11px;
  }

  .kpi .v {
    font-size: clamp(19px,5vw,27px);
    margin-block: 7px;
  }

  .kpi.gold .v {
    font-size: 30px;
  }

  .kpi .s {
    font-size: 10px;
  }

  .kpis > .kpi:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

  .grid2 {
    gap: 12px;
  }

  .card {
    padding: 15px;
    border-radius: 10px;
  }

  .card > h3 {
    font-size: 13px;
  }

  .tools {
    gap: 8px;
  }

  .tools input[type="search"] {
    width: 100%;
    flex: 1 1 100%;
  }

  .tools select {
    flex: 1 1 130px;
    min-width: 0;
  }

  .tools .sp {
    display: none;
  }

  .tbl-wrap {
    border-radius: 9px;
  }

  table.t {
    min-width: 620px;
  }

  .t th,
  .t td {
    padding: 12px;
  }

  .umap {
    grid-template-columns: repeat(4,minmax(0,1fr));
    grid-auto-rows: minmax(65px,auto);
    gap: 5px;
    padding: 12px;
  }

  .umap > .ucell {
    min-height: 65px;
    padding: 8px 3px;
  }

  .umap > .ucell b {
    font-size: 10px;
  }

  .umap > .ucell small {
    font-size: 9px;
  }

  .hero {
    align-items: flex-start;
    flex-direction: column;
    gap: 9px;
    min-height: 0;
    padding: 23px 20px;
    border-radius: 13px;
  }

  .hero h2 {
    font-size: 24px;
  }

  .hero p {
    font-size: 12px;
  }

  .hero .sp {
    display: none;
  }

  .hero .big {
    margin-block: 9px;
    font-size: 36px;
  }

  .hero .btn.pri {
    width: 100%;
  }

  .ov {
    padding: 10px;
  }

  .modal {
    width: 100%;
    max-height: 94dvh;
    border-radius: 12px;
  }

  .modal > header {
    padding: 15px 17px;
  }

  .modal > header h2 {
    font-size: 17px;
  }

  .modal form.mb {
    padding: 18px 17px 0;
  }

  .modal .form {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .modal .form label.full {
    grid-column: auto;
  }

  .modal footer .btn,
  .modal .mb > footer .btn {
    flex: 1;
  }

  .login {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
  }

  .login > section.art {
    min-height: 245px;
    flex: 0 0 auto;
    gap: 6px;
    padding: 85px 25px 25px;
    background-position: center 55%;
  }

  .login .art > img {
    inset-block-start: 21px;
    inset-inline-start: 25px;
    width: 100px;
  }

  .login .art h2 {
    max-width: 350px;
    font-size: 27px;
  }

  .login .art p {
    font-size: 11px;
    line-height: 1.8;
  }

  .login .art small {
    display: none;
  }

  .login > section.pane {
    flex: 1;
    padding: 32px 23px 45px;
  }

  .login .pane .box {
    max-width: 420px;
  }

  .login .box h1 {
    font-size: 26px;
  }

  .login .demo-list {
    gap: 7px;
  }

  .login .demo-list > button {
    min-height: 76px;
    padding: 9px 4px;
  }

  .login .demo-list > button b {
    font-size: 11px;
  }

  .toast {
    inset-inline: 12px;
    inset-block-end: 12px;
    max-width: none;
  }
}

/* 23 — EXTRA SMALL PHONES */

@media (max-width: 380px) {
  .kpis {
    gap: 8px;
  }

  .kpi {
    padding: 12px 10px;
  }

  .kpi .v {
    font-size: 20px;
  }

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

  .hero .big {
    font-size: 30px;
  }

  .login .art h2 {
    font-size: 24px;
  }
}

/* 24 — ACCESSIBILITY */

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

@media (forced-colors: active) {
  .nav > button[data-p].on {
    outline: 2px solid Highlight;
  }

  .umap > .ucell {
    border: 1px solid CanvasText;
  }
}

/* 25 — PRINT */

@media print {
  @page {
    size: A4;
    margin: 13mm;
  }

  html,
  body {
    min-width: 0;
    min-height: 0;
    background: #FFFFFF !important;
    color: #111111 !important;
    font-size: 10pt;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .side,
  .tools,
  .act,
  .mbar,
  .ov,
  .toast,
  #topx,
  .demo-pill,
  .btn {
    display: none !important;
  }

  .shell {
    display: block !important;
  }

  .main {
    min-height: 0;
    padding: 0 !important;
    background: #FFFFFF !important;
  }

  .top {
    min-height: 0;
    margin-block-end: 15px;
    padding: 0 0 12px;
    border-block-end: 1px solid #BBBBBB;
  }

  .top h1 {
    color: #111111 !important;
    font-size: 20pt;
  }

  .kpis {
    grid-template-columns: repeat(3,minmax(0,1fr));
    gap: 8px;
  }

  .kpi,
  .card,
  .tbl-wrap,
  .hero {
    box-shadow: none !important;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .kpi,
  .card,
  .tbl-wrap {
    border: 1px solid #CCCCCC !important;
    background: #FFFFFF !important;
    color: #111111 !important;
  }

  .kpi.gold {
    border-color: #A8894F !important;
    background: #C8A970 !important;
  }

  .kpi.gold .l,
  .kpi.gold .v,
  .kpi.gold .s {
    color: #111111 !important;
  }

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

  .tbl-wrap {
    overflow: visible;
  }

  table.t {
    min-width: 0;
    font-size: 9pt;
  }

  .t th,
  .t td {
    padding: 7px 9px;
    color: #111111 !important;
  }

  .t thead {
    display: table-header-group;
  }

  .t tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .umap {
    break-inside: avoid;
  }

  .hero {
    border: 1px solid #C8A970;
    background: #FFFFFF !important;
    color: #111111 !important;
  }

  .hero h2,
  .hero p {
    color: #111111 !important;
  }

  .hero .big {
    color: #8D6D35 !important;
  }
}
/* Fallback wordmark when the logo image cannot load (kept from app shell) */
.wordmark { font-family: var(--font-en); font-weight: 700; letter-spacing: .18em; color: var(--gold); font-size: 26px; }

/* App overrides: keep reference numbers and KPI values on one line */
.t td .num, .t td b.num, .kpi .v { white-space: nowrap; }
.kpi .v { font-size: clamp(20px, 1.6vw, 28px); overflow-wrap: normal; }
.t td { white-space: normal; }
