.leasing-screen { padding-bottom: 48px; }
.leasing-hero { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.leasing-hero-sub { margin: 7px 0 0; color: var(--text-dim); font-size: 13px; }
.leasing-hub-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  border-radius: var(--radius, 6px);
  border: 1px solid var(--border, #cbd5e1);
  background: var(--panel-raised, #f8fafc);
  color: var(--text-bright, #0f172a);
  cursor: pointer;
  transition: all 0.15s ease;
}
.leasing-hub-back-btn:hover {
  border-color: var(--brand, #d81e26);
  color: var(--brand, #d81e26);
  background: var(--brand-dim, rgba(216, 30, 38, 0.08));
}
.leasing-kpi-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.leasing-kpi { min-height: 126px; padding: 17px 16px; text-align: left; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: 0 7px 20px rgba(15,23,42,.045); transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease; cursor: pointer; }
.leasing-kpi:hover, .leasing-kpi.active { transform: translateY(-2px); border-color: var(--brand); box-shadow: 0 12px 26px rgba(15,23,42,.08); }
.leasing-kpi span { display: block; color: var(--text-dim); font-size: 11px; font-weight: 800; letter-spacing: .75px; text-transform: uppercase; }
.leasing-kpi strong { display: block; margin: 9px 0 6px; color: var(--text-bright); font-family: var(--font-display); font-size: 32px; line-height: 1; }
.leasing-kpi small { color: var(--text-faint); font-size: 11px; }
.leasing-kpi-warn strong { color: #EA580C; }
.leasing-kpi-primary strong { color: #2563EB; }
.leasing-kpi-purple strong { color: #7C3AED; }
.leasing-kpi-danger strong { color: var(--red); }
.leasing-kpi-success strong { color: var(--green); }

.leasing-toolbar { display: grid; grid-template-columns: minmax(240px, 2fr) minmax(180px, 1fr) auto; align-items: end; gap: 12px; margin-bottom: 16px; padding: 14px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.leasing-toolbar label { display: flex; flex-direction: column; gap: 6px; color: var(--text-dim); font-size: 11px; font-weight: 700; }
.leasing-toolbar input, .leasing-toolbar select { width: 100%; min-height: 40px; padding: 9px 11px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel-raised); color: var(--text-bright); font-size: 13px; outline: none; }
.leasing-toolbar input:focus, .leasing-toolbar select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(216,30,38,.1); }
.leasing-clear-filters { height: 40px; }

.leasing-table-shell { overflow: auto; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-soft); }
.leasing-table { width: 100%; min-width: 1200px; border-collapse: collapse; }
.leasing-table th { position: sticky; top: 0; z-index: 1; padding: 12px 13px; text-align: left; border-bottom: 1px solid var(--border); background: var(--panel-raised); color: var(--text-dim); font-size: 10px; font-weight: 800; letter-spacing: .7px; text-transform: uppercase; }
.leasing-table td { max-width: 260px; padding: 13px; vertical-align: top; border-bottom: 1px solid var(--border-soft); color: var(--text); font-size: 12px; }
.leasing-table tr:last-child td { border-bottom: 0; }
.leasing-table tr:hover td { background: rgba(148,163,184,.055); }
.leasing-table td strong, .leasing-table td span, .leasing-table td small { display: block; }
.leasing-table td small { margin-top: 4px; color: var(--text-dim); line-height: 1.4; }
.leasing-wip-no { color: var(--brand); font-family: var(--font-mono); font-size: 11px; font-weight: 700; }

.leasing-status-badge { display: inline-flex!important; width: max-content; padding: 4px 8px; border-radius: 999px; font-size: 10px; font-weight: 800; line-height: 1; border: 1px solid transparent; }
.leasing-status-waiting-leasing-approval { background: #FFEDD5; border-color: #FDBA74; color: #C2410C; font-weight: 800; }
.leasing-status-ready-for-delivery { background: var(--green-dim); border-color: #86EFAC; color: var(--green); }
.leasing-status-delivered { background: #F1F5F9; border-color: #CBD5E1; color: #475569; }
.leasing-status-work-in-progress, .leasing-status-pre-roadtest { background: #EDE9FE; border-color: #C4B5FD; color: #6D28D9; }
.leasing-status-awaiting-allotment, .leasing-status-awaiting-reallocation { background: #E0F2FE; border-color: #7DD3FC; color: #0369A1; }
.leasing-status-parts-hold, .leasing-status-parts-not-available, .leasing-status-parts-ict { background: #FEF3C7; border-color: #FCD34D; color: #B45309; }
.leasing-status-default { background: var(--panel-raised); border-color: var(--border); color: var(--text); }

.leasing-tag { display: inline-block; padding: 2px 6px; font-size: 9px; font-weight: 800; border-radius: 4px; background: #DBEAFE; color: #1E40AF; text-transform: uppercase; letter-spacing: .5px; margin-right: 4px; }

/* Dwell Time (Days in Workshop) Badges */
.leasing-dwell-badge {
  display: inline-flex !important;
  align-items: center;
  gap: 4px;
  width: max-content;
  margin-top: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: .3px;
  border: 1px solid transparent;
}
.leasing-dwell-fresh {
  background: #ECFDF5;
  border-color: #A7F3D0;
  color: #065F46;
}
.leasing-dwell-moderate {
  background: #FFFBEB;
  border-color: #FDE68A;
  color: #92400E;
}
.leasing-dwell-extended {
  background: #FEF2F2;
  border-color: #FECACA;
  color: #B91C1C;
  font-weight: 800;
}
.leasing-dwell-delivered {
  background: #F1F5F9;
  border-color: #E2E8F0;
  color: #64748B;
}

/* Promised Date / Overdue / Due Today Badges */
.leasing-due-badge {
  display: inline-flex !important;
  align-items: center;
  gap: 4px;
  width: max-content;
  margin-top: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: .3px;
  border: 1px solid transparent;
}
.leasing-due-overdue {
  background: #FEE2E2;
  border-color: #F87171;
  color: #991B1B;
  font-weight: 800;
}
.leasing-due-today {
  background: #EFF6FF;
  border-color: #93C5FD;
  color: #1D4ED8;
  font-weight: 800;
}
.leasing-due-upcoming {
  background: #F8FAFC;
  border-color: #CBD5E1;
  color: #475569;
}
.leasing-due-ready {
  background: #F0FDF4;
  border-color: #86EFAC;
  color: #166534;
}

/* Dark mode theme overrides */
html.theme-dark .leasing-dwell-fresh {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.35);
  color: #34D399;
}
html.theme-dark .leasing-dwell-moderate {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.35);
  color: #FBBF24;
}
html.theme-dark .leasing-dwell-extended {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
  color: #F87171;
}
html.theme-dark .leasing-dwell-delivered {
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.25);
  color: #94A3B8;
}
html.theme-dark .leasing-due-overdue {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
  color: #F87171;
}
html.theme-dark .leasing-due-today {
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.4);
  color: #60A5FA;
}
html.theme-dark .leasing-due-upcoming {
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.25);
  color: #94A3B8;
}
html.theme-dark .leasing-due-ready {
  background: rgba(34, 197, 94, 0.15);
  border-color: rgba(34, 197, 94, 0.35);
  color: #4ADE80;
}

.leasing-row-action { padding: 7px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel-raised); color: var(--text-bright); font-size: 11px; font-weight: 700; cursor: pointer; transition: all .15s ease; }
.leasing-row-action:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-dim); }

.leasing-drawer { width: min(680px, 96vw); }
.leasing-detail-view { display: flex; flex-direction: column; gap: 20px; padding: 18px 0; }
.leasing-detail-card { padding: 16px; background: var(--panel-raised); border: 1px solid var(--border-soft); border-radius: var(--radius); }
.leasing-detail-card h4 { margin: 0 0 12px; color: var(--text-bright); font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; }
.leasing-detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.leasing-detail-item label { display: block; color: var(--text-dim); font-size: 10px; font-weight: 700; text-transform: uppercase; margin-bottom: 3px; }
.leasing-detail-item span { display: block; color: var(--text-bright); font-size: 13px; font-weight: 600; }
.leasing-detail-full { grid-column: 1 / -1; }
.leasing-detail-item p { margin: 4px 0 0; color: var(--text); font-size: 12px; line-height: 1.5; white-space: pre-wrap; }

.leasing-timeline { display: flex; flex-direction: column; gap: 10px; }
.leasing-timeline-item { display: grid; grid-template-columns: 12px 1fr; gap: 10px; position: relative; }
.leasing-timeline-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); margin-top: 5px; }
.leasing-timeline-line { position: absolute; top: 14px; left: 3px; width: 2px; height: calc(100% - 4px); background: var(--border); }
.leasing-timeline-item:last-child .leasing-timeline-line { display: none; }
.leasing-timeline-content strong { display: block; color: var(--text-bright); font-size: 12px; }
.leasing-timeline-content small { display: block; color: var(--text-dim); font-size: 10px; margin-top: 2px; }

html.theme-dark .leasing-kpi,
html.theme-dark .leasing-toolbar,
html.theme-dark .leasing-table-shell,
html.theme-dark .leasing-detail-card { box-shadow: none; }

html.theme-dark .leasing-toolbar input,
html.theme-dark .leasing-toolbar select { color-scheme: dark; }

@media(max-width: 1180px) {
  .leasing-kpi-grid { grid-template-columns: repeat(3, 1fr); }
  .leasing-toolbar { grid-template-columns: 1fr 1fr auto; }
}

@media(max-width: 760px) {
  .leasing-hero { flex-direction: column; }
  .leasing-kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .leasing-toolbar { grid-template-columns: 1fr; }
  .leasing-detail-grid { grid-template-columns: 1fr; }
}

@media(max-width: 480px) {
  .leasing-kpi-grid { grid-template-columns: 1fr; }
}
.leasing-entry-tiles{ max-width:760px; margin-inline:auto; }
.leasing-analytics-kpis{
  display:grid;
  grid-template-columns:repeat(5, minmax(0,1fr));
  gap:14px;
  margin-bottom:18px;
}
.leasing-analytics-kpi,
.leasing-chart-card{
  background:var(--panel, #fff);
  border:1px solid var(--border-soft, #e2e8f0);
  border-radius:var(--radius-lg, 12px);
  box-shadow:var(--shadow-soft);
}
.leasing-analytics-kpi{ padding:18px; display:flex; flex-direction:column; gap:6px; }
.leasing-analytics-kpi span{ color:var(--text-dim); font-size:11px; font-weight:800; text-transform:uppercase; letter-spacing:.6px; }
.leasing-analytics-kpi strong{ color:var(--text-bright); font-family:var(--font-display); font-size:34px; line-height:1; }
.leasing-analytics-kpi small{ color:var(--text-dim); font-size:11px; }
.leasing-analytics-grid{ display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; }
.leasing-chart-card{ padding:22px; }
.leasing-chart-wide{ grid-column:1/-1; }
.leasing-chart-head{ margin-bottom:20px; }
.leasing-chart-head h3{ margin:3px 0 0; color:var(--text-bright); font-size:18px; }
.leasing-bar-chart{ display:grid; gap:14px; }
.leasing-bar-row{ display:grid; grid-template-columns:minmax(110px,1fr) 3fr 34px; align-items:center; gap:12px; font-size:12px; color:var(--text); }
.leasing-bar-row > span{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.leasing-bar-row > strong{ font-family:var(--font-mono); color:var(--text-bright); text-align:right; }
.leasing-bar-track{ height:12px; overflow:hidden; border-radius:999px; background:var(--panel-raised, #f1f5f9); }
.leasing-bar-track i{ display:block; height:100%; border-radius:inherit; background:#64748b; }
.leasing-bar-track i.green{ background:var(--green); }
.leasing-bar-track i.amber{ background:var(--amber); }
.leasing-bar-track i.red{ background:var(--red); }
.leasing-bar-track i.blue{ background:#3b82f6; }
@media (max-width:900px){
  .leasing-analytics-kpis{ grid-template-columns:repeat(2,minmax(0,1fr)); }
  .leasing-analytics-grid{ grid-template-columns:1fr; }
  .leasing-chart-wide{ grid-column:auto; }
}
@media (max-width:560px){
  .leasing-analytics-kpis{ grid-template-columns:1fr; }
  .leasing-bar-row{ grid-template-columns:90px 1fr 28px; gap:8px; }
}
