/* ================================================
   نظام إدارة العقارات — Design System v3
   Aesthetic: Refined Dark Luxury + Sharp Accents
   ================================================ */

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

/* ── Variables ─────────────────────────────────── */
:root {
  /* Core */
  --bg:          #0d0f14;
  --bg-2:        #13161e;
  --bg-3:        #1a1d28;
  --surface:     #1e2130;
  --surface-2:   #252840;
  --border:      rgba(255,255,255,.07);
  --border-2:    rgba(255,255,255,.12);

  /* Text */
  --text:        #f0f2f8;
  --text-2:      #8b90a8;
  --text-3:      #555b78;

  /* Accents */
  --gold:        #e8b84b;
  --gold-dim:    rgba(232,184,75,.15);
  --gold-glow:   rgba(232,184,75,.3);
  --teal:        #3ecfb2;
  --teal-dim:    rgba(62,207,178,.12);
  --red:         #f05c5c;
  --red-dim:     rgba(240,92,92,.15);
  --blue:        #5b8cff;
  --blue-dim:    rgba(91,140,255,.12);
  --purple:      #a78bfa;

  /* Sidebar */
  --sb-w: 252px;
  --header-h: 56px;

  /* Radius */
  --r:    10px;
  --r-lg: 16px;
  --r-sm: 6px;

  /* Shadow */
  --shadow: 0 1px 3px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.2);
  --shadow-lg: 0 4px 6px rgba(0,0,0,.4), 0 20px 40px rgba(0,0,0,.3);
}

/* ── Reset ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'IBM Plex Sans Arabic', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Layout ─────────────────────────────────────── */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sb-w);
  background: var(--bg-2);
  border-left: 1px solid var(--border);
  position: fixed;
  right: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  z-index: 300;
  transition: transform .3s cubic-bezier(.4,0,.2,1);
}

.main-wrap {
  margin-right: var(--sb-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Sidebar Logo ───────────────────────────────── */
.sb-logo {
  padding: 22px 20px 18px;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.sb-logo-mark {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.sb-logo-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--gold), #f0a020);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  box-shadow: 0 0 20px var(--gold-glow);
  flex-shrink: 0;
}
.sb-logo-name { font-size: 14px; font-weight: 700; color: var(--text); line-height: 1.2; }
.sb-logo-sub  { font-size: 11px; color: var(--text-3); }
.sb-role-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid;
}
.pill-admin  { background: rgba(232,184,75,.1);  color: var(--gold);   border-color: rgba(232,184,75,.25); }
.pill-owner  { background: rgba(62,207,178,.1);  color: var(--teal);   border-color: rgba(62,207,178,.25); }
.pill-tenant { background: rgba(91,140,255,.1);  color: var(--blue);   border-color: rgba(91,140,255,.25); }

/* ── Sidebar Nav ────────────────────────────────── */
.sb-nav { padding: 8px 0; flex: 1; }
.sb-section {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 16px 20px 5px;
}
.sb-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all .15s;
  position: relative;
  border-right: 2px solid transparent;
}
.sb-item:hover  { color: var(--text); background: rgba(255,255,255,.04); }
.sb-item.active { color: var(--gold); background: var(--gold-dim); border-right-color: var(--gold); }
.sb-icon {
  width: 32px; height: 32px;
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  background: rgba(255,255,255,.05);
  flex-shrink: 0;
  transition: background .15s;
}
.sb-item.active .sb-icon { background: var(--gold-dim); }
.sb-badge {
  margin-right: auto;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 20px;
  min-width: 20px;
  text-align: center;
}
.sb-badge.amber { background: var(--gold); color: #000; }
.sb-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-3);
  font-family: 'IBM Plex Mono', monospace;
}

/* ── Topbar ─────────────────────────────────────── */
.topbar {
  height: var(--header-h);
  background: rgba(13,15,20,.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 200;
}
.tb-title { font-size: 16px; font-weight: 600; color: var(--text); flex: 1; }
.tb-actions { display: flex; align-items: center; gap: 10px; }
.tb-btn {
  width: 34px; height: 34px;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-2);
  font-size: 15px;
  position: relative;
  transition: all .15s;
}
.tb-btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--border-2); }
.tb-notif-dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 7px; height: 7px;
  background: var(--red);
  border-radius: 50%;
  border: 2px solid var(--bg);
}
.tb-user {
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--surface);
  border: 1px solid var(--border-2);
  padding: 5px 12px 5px 8px;
  border-radius: 30px;
  cursor: pointer;
  text-decoration: none;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 500;
  transition: all .15s;
}
.tb-user:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.tb-avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}
.av-admin  { background: var(--gold-dim);  color: var(--gold); }
.av-owner  { background: var(--teal-dim);  color: var(--teal); }
.av-tenant { background: var(--blue-dim);  color: var(--blue); }

/* ── Page Content ───────────────────────────────── */
.page-content { padding: 24px; flex: 1; }

/* ── Page Header ────────────────────────────────── */
.page-hd {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}
.page-hd h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}
.page-hd p { font-size: 13px; color: var(--text-2); margin-top: 3px; }
.page-hd-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Flash ──────────────────────────────────────── */
.flash {
  padding: 12px 16px;
  border-radius: var(--r);
  margin-bottom: 20px;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid;
  animation: slideDown .3s ease;
}
.flash-success { background: rgba(62,207,178,.1); color: var(--teal); border-color: rgba(62,207,178,.2); }
.flash-error   { background: var(--red-dim);       color: var(--red);  border-color: rgba(240,92,92,.25); }
@keyframes slideDown { from { opacity:0; transform:translateY(-8px); } to { opacity:1; transform:translateY(0); } }

/* ── Stats Grid ─────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
  transition: border-color .2s, transform .2s;
}
.stat-card:hover { border-color: var(--border-2); transform: translateY(-1px); }
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}
.stat-gold::before   { background: linear-gradient(90deg, var(--gold), transparent); }
.stat-teal::before   { background: linear-gradient(90deg, var(--teal), transparent); }
.stat-red::before    { background: linear-gradient(90deg, var(--red), transparent); }
.stat-blue::before   { background: linear-gradient(90deg, var(--blue), transparent); }
.stat-purple::before { background: linear-gradient(90deg, var(--purple), transparent); }

.stat-label { font-size: 11px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
.stat-value { font-size: 28px; font-weight: 700; color: var(--text); line-height: 1; }
.stat-value.sm { font-size: 20px; }
.stat-sub   { font-size: 11px; color: var(--text-3); margin-top: 5px; }
.stat-icon  { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); font-size: 40px; opacity: .06; }

/* ── Cards ──────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  margin-bottom: 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.card-hd {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.card-title { font-size: 14px; font-weight: 600; color: var(--text); }
.card-bd    { padding: 20px; }

/* ── Badges ─────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid;
}
.b-gold   { background: var(--gold-dim);            color: var(--gold);   border-color: rgba(232,184,75,.25); }
.b-teal   { background: var(--teal-dim);            color: var(--teal);   border-color: rgba(62,207,178,.25); }
.b-red    { background: var(--red-dim);             color: var(--red);    border-color: rgba(240,92,92,.25); }
.b-blue   { background: var(--blue-dim);            color: var(--blue);   border-color: rgba(91,140,255,.25); }
.b-gray   { background: rgba(255,255,255,.05);      color: var(--text-2); border-color: var(--border-2); }
.b-purple { background: rgba(167,139,250,.1);       color: var(--purple); border-color: rgba(167,139,250,.25); }

/* ── Table ──────────────────────────────────────── */
.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 460px; }
thead th {
  background: var(--bg-3);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 10px 16px;
  text-align: right;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-2);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background .1s; }
tbody tr:hover td { background: rgba(255,255,255,.02); color: var(--text); }
td.right { text-align: left; white-space: nowrap; }
td strong { color: var(--text); font-weight: 600; }

/* ── Buttons ────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--r);
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  font-weight: 600;
  text-decoration: none;
  transition: all .15s;
  white-space: nowrap;
  line-height: 1;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--gold);   color: #000; border-color: var(--gold); }
.btn-primary:hover { background: #f5cb6e; }
.btn-teal   { background: var(--teal);   color: #000; border-color: var(--teal); }
.btn-teal:hover { background: #5de0cb; }
.btn-danger  { background: var(--red);   color: #fff; border-color: var(--red); }
.btn-danger:hover { background: #f57676; }
.btn-ghost   { background: transparent; border-color: var(--border-2); color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); border-color: var(--border-2); }
.btn-sm  { padding: 5px 12px; font-size: 12px; border-radius: 7px; }
.btn-xs  { padding: 3px 9px;  font-size: 11px; border-radius: 6px; }
.btn-block { width: 100%; justify-content: center; }

/* ── Forms ──────────────────────────────────────── */
.form-grid   { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.fg          { display: flex; flex-direction: column; gap: 6px; }
.fg.full     { grid-column: 1/-1; }
.fg label    { font-size: 11px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; }
.fg input, .fg select, .fg textarea {
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  border-radius: var(--r);
  padding: 9px 12px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  width: 100%;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.fg input:focus, .fg select:focus, .fg textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-dim);
}
.fg textarea { resize: vertical; min-height: 80px; }
.fg input[type=file] { padding: 6px 8px; cursor: pointer; }
/* Fix dropdown options visibility on dark background */
.fg select option         { background: #1a1d28; color: #f0f2f8; padding: 6px 10px; }
.fg select option:checked { background: #e8b84b; color: #000; }
.fg select optgroup       { background: #13161e; color: #e8b84b; font-weight: 700; font-size: 11px; }
/* Also fix inline selects used outside .fg */
select option { background: #1a1d28; color: #f0f2f8; }
.form-sep {
  grid-column: 1/-1;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .08em;
  padding-top: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.img-preview { max-width: 100%; max-height: 160px; border-radius: var(--r); margin-top: 8px; border: 1px solid var(--border); display: none; }

/* ── Modal ──────────────────────────────────────── */
.modal-bg {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(4px);
  z-index: 999;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-bg.open { display: flex; }
.modal {
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-radius: var(--r-lg);
  width: 640px;
  max-width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalIn .2s cubic-bezier(.34,1.56,.64,1);
}
.modal-sm  { width: 420px; }
.modal-lg  { width: 800px; }
@keyframes modalIn { from { opacity:0; transform:scale(.96) translateY(8px); } to { opacity:1; transform:scale(1) translateY(0); } }
.modal-hd {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: var(--bg-2);
  z-index: 1;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}
.modal-title { font-size: 15px; font-weight: 700; color: var(--text); }
.modal-close {
  width: 28px; height: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
  cursor: pointer;
  color: var(--text-2);
  font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.modal-close:hover { background: var(--surface-2); color: var(--text); }
.modal-bd { padding: 22px; }
.modal-ft {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ── Tabs ───────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 2px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  padding: 3px;
  border-radius: var(--r);
  margin-bottom: 20px;
  width: fit-content;
  flex-wrap: wrap;
}
.tab {
  padding: 6px 14px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  border: none;
  background: none;
  font-family: inherit;
  transition: all .15s;
  white-space: nowrap;
  text-decoration: none;
}
.tab:hover   { color: var(--text-2); background: rgba(255,255,255,.05); }
.tab.active  { background: var(--surface-2); color: var(--gold); box-shadow: var(--shadow); }

/* ── Progress ───────────────────────────────────── */
.prog-track { height: 6px; background: var(--bg-3); border-radius: 3px; overflow: hidden; }
.prog-fill  { height: 100%; border-radius: 3px; transition: width .5s; }
.prog-gold   { background: linear-gradient(90deg, var(--gold), #f0a020); }
.prog-teal   { background: linear-gradient(90deg, var(--teal), #27b59b); }
.prog-red    { background: var(--red); }

/* ── Check Row ──────────────────────────────────── */
.check-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  margin-bottom: 8px;
  flex-wrap: wrap;
  transition: border-color .15s;
}
.check-row:hover { border-color: var(--border-2); }
.check-day {
  width: 42px; height: 42px;
  border-radius: 9px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 800;
  flex-shrink: 0;
  font-family: 'IBM Plex Mono', monospace;
}
.cd-normal { background: var(--blue-dim);  color: var(--blue); }
.cd-soon   { background: var(--gold-dim);  color: var(--gold); }
.cd-urgent { background: var(--red-dim);   color: var(--red); }
.check-info { flex: 1; min-width: 120px; }
.check-info strong { font-size: 13px; color: var(--text); display: block; }
.check-info small  { font-size: 11px; color: var(--text-3); }
.check-amount { font-size: 16px; font-weight: 700; color: var(--teal); white-space: nowrap; font-family: 'IBM Plex Mono', monospace; }
.check-img-thumb { width: 36px; height: 36px; border-radius: 7px; object-fit: cover; border: 1px solid var(--border); cursor: pointer; transition: opacity .15s; }
.check-img-thumb:hover { opacity: .8; }

/* ── Building Card ──────────────────────────────── */
.grid-3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.bld-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: border-color .2s, transform .2s;
  box-shadow: var(--shadow);
}
.bld-card:hover { border-color: var(--border-2); transform: translateY(-2px); }
.bld-card-top {
  padding: 20px;
  background: linear-gradient(135deg, var(--bg-3), var(--surface-2));
  position: relative;
  border-bottom: 1px solid var(--border);
}
.bld-card-icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); font-size: 48px; opacity: .08; }
.bld-card-top h3 { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 3px; }
.bld-card-top p  { font-size: 12px; color: var(--text-3); }
.bld-card-body { padding: 16px; }
.bld-mini-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin-bottom: 14px; }
.bld-stat { text-align: center; background: var(--bg-3); padding: 8px 4px; border-radius: var(--r-sm); }
.bld-stat-val { font-size: 18px; font-weight: 700; font-family: 'IBM Plex Mono', monospace; }
.bld-stat-lbl { font-size: 10px; color: var(--text-3); margin-top: 2px; }

/* ── Unit Card ──────────────────────────────────── */
.unit-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px;
  transition: border-color .2s, transform .2s;
}
.unit-card:hover { border-color: var(--border-2); transform: translateY(-2px); }

/* ── Alert Item ─────────────────────────────────── */
.alert-item {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  border-right: 3px solid;
  margin-bottom: 10px;
  align-items: flex-start;
  transition: border-color .15s;
}
.alert-item:hover { background: var(--surface-2); }
.alert-gold   { border-right-color: var(--gold); }
.alert-red    { border-right-color: var(--red); }
.alert-teal   { border-right-color: var(--teal); }
.alert-blue   { border-right-color: var(--blue); }
.alert-icon  { font-size: 20px; flex-shrink: 0; margin-top: 1px; }
.alert-body  { flex: 1; min-width: 0; }
.alert-body strong { font-size: 13px; color: var(--text); display: block; margin-bottom: 3px; }
.alert-body span   { font-size: 12px; color: var(--text-3); }
.alert-meta  { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }

/* ── Notifications Panel ────────────────────────── */
.notif-panel {
  display: none;
  position: fixed;
  top: 62px;
  right: calc(var(--sb-w) + 16px);
  width: 320px;
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  z-index: 500;
  max-height: 420px;
  overflow-y: auto;
}
.notif-panel.open { display: block; animation: modalIn .15s ease; }
.np-hd { padding: 12px 16px; font-size: 13px; font-weight: 700; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; color: var(--text); }
.np-item { padding: 11px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background .1s; }
.np-item:hover { background: var(--surface); }
.np-item.unread { background: rgba(232,184,75,.05); border-right: 2px solid var(--gold); }
.np-item strong { font-size: 12px; color: var(--text); display: block; margin-bottom: 2px; }
.np-item span   { font-size: 11px; color: var(--text-3); }

/* ── Detail Table ───────────────────────────────── */
.detail-table { width: 100%; }
.detail-table tr td { padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.detail-table tr:last-child td { border: none; }
.detail-table .dt-lbl { color: var(--text-3); width: 42%; font-size: 12px; }
.detail-table .dt-val { color: var(--text); font-weight: 500; }

/* ── Dashboard 2-col ────────────────────────────── */
.dash-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; }

/* ── Owners Section ─────────────────────────────── */
.owner-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: border-color .2s, transform .2s;
}
.owner-card:hover { border-color: var(--border-2); transform: translateY(-2px); }
.owner-card-top {
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--border);
}
.owner-avatar {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--teal-dim), var(--blue-dim));
  border: 2px solid var(--border-2);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  font-weight: 700;
  color: var(--teal);
  flex-shrink: 0;
}
.owner-info h3 { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 3px; }
.owner-info p  { font-size: 12px; color: var(--text-3); }
.owner-stats   { display: grid; grid-template-columns: repeat(3,1fr); }
.owner-stat    { padding: 12px 16px; border-left: 1px solid var(--border); text-align: center; }
.owner-stat:last-child { border: none; }
.owner-stat-val { font-size: 20px; font-weight: 700; color: var(--text); font-family: 'IBM Plex Mono', monospace; }
.owner-stat-lbl { font-size: 10px; color: var(--text-3); margin-top: 2px; }
.owner-stat-val.gold  { color: var(--gold); }
.owner-stat-val.teal  { color: var(--teal); }
.owner-stat-val.red   { color: var(--red); }

/* ── Filter Bar ─────────────────────────────────── */
.filter-bar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.filter-bar input, .filter-bar select {
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--r);
  padding: 8px 12px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  outline: none;
  transition: border-color .15s;
}
.filter-bar input  { flex: 1; min-width: 160px; max-width: 260px; }
.filter-bar input:focus, .filter-bar select:focus { border-color: var(--gold); }
.filter-bar input::placeholder { color: var(--text-3); }

/* ── Lightbox ───────────────────────────────────── */
#lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.9);
  backdrop-filter: blur(8px);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}
#lightbox.open { display: flex; }

/* ── Empty State ────────────────────────────────── */
.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-3);
}
.empty-icon { font-size: 52px; margin-bottom: 14px; opacity: .4; }
.empty p { font-size: 14px; color: var(--text-3); }

/* ── Mono Numbers ───────────────────────────────── */
.mono { font-family: 'IBM Plex Mono', monospace; }

/* ── Scrollbar ──────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface-2); border-radius: 3px; }

/* ── Login Page ─────────────────────────────────── */
.login-wrap {
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  overflow: hidden;
}
.login-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 20% 50%, rgba(232,184,75,.06) 0%, transparent 60%),
    radial-gradient(ellipse 50% 60% at 80% 30%, rgba(62,207,178,.04) 0%, transparent 60%);
}
.login-box {
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-radius: 20px;
  padding: 40px;
  width: 440px;
  max-width: 100%;
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 1;
}
.login-logo { text-align: center; margin-bottom: 32px; }
.login-logo-icon {
  width: 64px; height: 64px;
  background: linear-gradient(135deg, var(--gold), #f0a020);
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin-bottom: 16px;
  box-shadow: 0 0 30px var(--gold-glow);
}
.login-logo h1 { font-size: 20px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.login-logo p  { font-size: 13px; color: var(--text-3); }
.login-inp-group { margin-bottom: 16px; }
.login-inp-group label { font-size: 11px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; display: block; margin-bottom: 6px; }
.login-inp-group input {
  width: 100%;
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  border-radius: var(--r);
  padding: 11px 14px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.login-inp-group input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-dim); }
.login-btn {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, var(--gold), #f0a020);
  color: #000;
  border: none;
  border-radius: var(--r);
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: opacity .15s, transform .15s;
  margin-top: 8px;
}
.login-btn:hover { opacity: .9; transform: translateY(-1px); }
.demo-cards { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border); }
.demo-cards h4 { font-size: 11px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; text-align: center; margin-bottom: 12px; }
.demo-row { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.demo-item {
  text-align: center;
  padding: 10px 6px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--r);
  cursor: pointer;
  transition: all .15s;
  font-size: 12px;
  color: var(--text-2);
}
.demo-item:hover { border-color: var(--gold); color: var(--gold); background: var(--gold-dim); }
.demo-item span { display: block; font-size: 22px; margin-bottom: 4px; }
.demo-item small { color: var(--text-3); font-size: 10px; display: block; margin-top: 2px; }

/* ── Responsive ─────────────────────────────────── */
@media (max-width: 900px) {
  .dash-2 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 768px) {
  :root { --sb-w: 0px; }
  .sidebar { transform: translateX(100%); width: 252px; }
  .sidebar.open { transform: translateX(0); }
  .main-wrap { margin-right: 0; }
  .form-grid { grid-template-columns: 1fr; }
  .notif-panel { right: 8px; }
  .page-content { padding: 16px; }
}
