/* ==========================================================================
   Estate Control v2 — a distinctive, animated design system.
   Palette: deep navy ink base + vivid blue accent (matched to the mobile
   app's own branding), glass surfaces, soft glow shadows. Cairo carries
   Arabic copy, Inter the English/UI numerals. Motion is used deliberately:
   entrance fades, count-up numbers, magnetic hover lifts, animated
   active-nav indicator.
   ========================================================================== */
:root{
  --ink:        #0A1E3D;
  --ink-2:      #102A52;
  --ink-3:      #163862;
  --violet:     #1B6FE0;
  --violet-2:   #2F80ED;
  --violet-light:#5B9EF5;
  --coral:      #FF7A45;
  --coral-light:#FFB088;
  --amber:      #FFB020;
  --canvas:     #EAF0F8;
  --surface:    #FFFFFF;
  --glass:      rgba(255,255,255,.72);
  --text:       #14213D;
  --text-muted: #66738F;
  --border:     #E1E8F5;
  --success:    #16C79A;
  --success-bg: #E7FAF3;
  --rent:       #0FA3A3;
  --rent-bg:    #E3F7F5;
  --danger:     #FF5C72;
  --danger-bg:  #FFEEF0;
  --radius:     18px;
  --radius-sm:  12px;
  --shadow:     0 2px 4px rgba(10,30,61,.05), 0 16px 32px -16px rgba(10,30,61,.16);
  --shadow-lg:  0 8px 16px rgba(10,30,61,.08), 0 30px 60px -20px rgba(10,30,61,.26);
  --glow:       0 8px 24px -6px rgba(27,111,224,.45);
}

*{ box-sizing:border-box; }

[dir="rtl"] body{ font-family:'Cairo', 'Inter', sans-serif; }
[dir="ltr"] body{ font-family:'Inter', 'Cairo', sans-serif; }

html, body{ height:100%; }
body{
  background: var(--canvas);
  color: var(--text);
  font-size: .925rem;
  background-image:
    radial-gradient(600px 300px at 100% -10%, rgba(27,111,224,.08), transparent),
    radial-gradient(500px 260px at -5% 10%, rgba(255,122,69,.06), transparent);
  background-attachment: fixed;
}

h1,h2,h3,h4,h5,.brand-title{ font-weight: 800; letter-spacing: -.01em; }
a{ text-decoration:none; }

/* ---------- Entrance animation ---------- */
@keyframes fadeUp{
  from{ opacity:0; transform: translateY(10px); }
  to{ opacity:1; transform: translateY(0); }
}
.content > *{ animation: fadeUp .5s cubic-bezier(.2,.8,.2,1) backwards; }
.content > *:nth-child(1){ animation-delay: .02s; }
.content > *:nth-child(2){ animation-delay: .07s; }
.content > *:nth-child(3){ animation-delay: .12s; }
.content > *:nth-child(4){ animation-delay: .17s; }
.content > *:nth-child(5){ animation-delay: .22s; }

/* ---------- Shell layout ---------- */
.app-shell{ display:flex; min-height:100vh; }

.sidebar{
  width: 272px;
  flex-shrink: 0;
  background: linear-gradient(190deg, var(--ink) 0%, var(--ink-2) 55%, var(--ink-3) 100%);
  color: #C9C3E8;
  display:flex;
  flex-direction:column;
  position: sticky;
  top:0;
  height:100vh;
  overflow:hidden;
}
.sidebar::before{
  content:"";
  position:absolute; inset-inline-end:-80px; top:-80px; width:260px; height:260px;
  background: radial-gradient(circle, rgba(27,111,224,.35), transparent 70%);
  pointer-events:none;
}
.sidebar::after{
  content:"";
  position:absolute; inset-inline-start:-100px; bottom:10%; width:280px; height:280px;
  background: radial-gradient(circle, rgba(255,122,69,.18), transparent 70%);
  pointer-events:none;
}

.sidebar .brand{
  padding: 28px 22px 20px;
  display:flex;
  align-items:center;
  gap:12px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  position:relative; z-index:1;
}
.sidebar .brand-mark{
  width:42px; height:42px; border-radius:13px;
  background: linear-gradient(135deg, var(--violet-light), var(--violet));
  display:flex; align-items:center; justify-content:center;
  color: #fff; font-weight:800; font-size:1.1rem;
  box-shadow: var(--glow);
}
.sidebar .brand-title{ color:#fff; font-size:1.04rem; line-height:1.15; }
.sidebar .brand-sub{ color:#8E86B8; font-size:.72rem; }

.sidebar nav{ padding: 16px 12px; flex:1; overflow-y:auto; position:relative; z-index:1; }
.sidebar .nav-link{
  color:#B0A8D6;
  padding:11px 14px;
  border-radius: var(--radius-sm);
  font-size:.9rem;
  display:flex; align-items:center; gap:12px;
  margin-bottom:4px;
  position:relative;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}
.sidebar .nav-link i{ font-size:1.05rem; width:20px; text-align:center; color:#8880B0; transition: color .18s ease; }
.sidebar .nav-link:hover{ background: rgba(255,255,255,.07); color:#fff; transform: translateX(2px); }
[dir="rtl"] .sidebar .nav-link:hover{ transform: translateX(-2px); }
.sidebar .nav-link.active{
  background: linear-gradient(90deg, rgba(27,111,224,.35), rgba(27,111,224,.08));
  color:#fff;
}
.sidebar .nav-link.active i{ color: var(--violet-light); }
.sidebar .nav-link.active::before{
  content:"";
  position:absolute; inset-inline-start:0; top:6px; bottom:6px; width:3px;
  border-radius:3px;
  background: linear-gradient(180deg, var(--violet-light), var(--coral));
}

.sidebar .sidebar-footer{
  padding: 14px 18px 20px;
  border-top:1px solid rgba(255,255,255,.08);
  position:relative; z-index:1;
}

/* ---------- Main column ---------- */
.main-col{ flex:1; min-width:0; display:flex; flex-direction:column; }

.topbar{
  background: var(--glass);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border-bottom: 1px solid var(--border);
  padding: 16px 26px;
  display:flex; align-items:center; justify-content:space-between;
  gap: 16px;
  position: sticky; top:0; z-index: 20;
}
.topbar h1{ font-size:1.2rem; margin:0; }
.topbar .page-eyebrow{ color:var(--violet); font-size:.75rem; font-weight:700; letter-spacing:.04em; text-transform:uppercase; margin-bottom:2px; }

.lang-switch{
  display:flex; border:1px solid var(--border); border-radius: 999px; overflow:hidden;
  background: var(--surface);
}
.lang-switch a{
  padding:6px 14px; font-size:.8rem; color:var(--text-muted); font-weight:700;
  transition: all .15s ease;
}
.lang-switch a.active{ background: linear-gradient(135deg, var(--violet-light), var(--violet)); color:#fff; }

.content{ padding: 28px; flex:1; }

/* ---------- Cards ---------- */
.card{
  background: var(--surface);
  border:1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.kpi-card{
  padding: 20px 20px;
  position:relative;
  overflow:hidden;
  transition: box-shadow .22s ease, transform .22s ease;
}
.kpi-card:hover{
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}
.kpi-card .kpi-label{ color:var(--text-muted); font-size:.78rem; font-weight:700; }
.kpi-card .kpi-value{ font-size:1.85rem; font-weight:800; margin-top:2px; letter-spacing:-.02em; }
.kpi-card .kpi-icon{
  position:absolute; inset-inline-end:16px; top:16px;
  width:42px; height:42px; border-radius:13px;
  display:flex; align-items:center; justify-content:center;
  font-size:1.1rem; color:#fff;
}
.kpi-icon.violet{ background: linear-gradient(135deg, var(--violet-light), var(--violet)); box-shadow: var(--glow); }
.kpi-icon.success{ background: linear-gradient(135deg, #5FE3C0, var(--success)); box-shadow: 0 8px 20px -8px rgba(22,199,154,.5); }
.kpi-icon.rent{ background: linear-gradient(135deg, #5FD6D6, var(--rent)); box-shadow: 0 8px 20px -8px rgba(15,163,163,.5); }
.kpi-icon.coral{ background: linear-gradient(135deg, var(--coral-light), var(--coral)); box-shadow: 0 8px 20px -8px rgba(255,122,69,.5); }
.kpi-icon.amber{ background: linear-gradient(135deg, #FFD37A, var(--amber)); box-shadow: 0 8px 20px -8px rgba(255,176,32,.5); }
/* backwards-compat aliases used by existing templates */
.kpi-icon.gold{ background: linear-gradient(135deg, #FFD37A, var(--amber)); box-shadow: 0 8px 20px -8px rgba(255,176,32,.5); }
.kpi-icon.ink{ background: linear-gradient(135deg, #8880B0, var(--ink-3)); }

.section-card{ padding:22px 24px; }
.section-card .section-title{
  font-weight:800; font-size:1rem; margin-bottom:18px;
  display:flex; align-items:center; justify-content:space-between;
}
.section-card .section-title a{ color: var(--violet); font-weight:700; }

/* ---------- Period filter pills ---------- */
.period-switch{
  display:inline-flex; gap:4px; background: var(--surface);
  border:1px solid var(--border); border-radius:999px; padding:4px;
}
.period-switch a{
  padding:7px 16px; font-size:.8rem; font-weight:700; color:var(--text-muted);
  border-radius:999px; transition: all .18s ease;
}
.period-switch a.active{
  background: linear-gradient(135deg, var(--violet-light), var(--violet));
  color:#fff; box-shadow: var(--glow);
}
.period-switch a:not(.active):hover{ background: var(--canvas); color:var(--text); }

/* ---------- Bar list (dependency-free chart) ---------- */
.bar-row{ margin-bottom:14px; }
.bar-row .bar-row-top{ display:flex; justify-content:space-between; font-size:.82rem; margin-bottom:6px; }
.bar-row .bar-row-top span.count{ color:var(--text-muted); font-weight:700; }
.bar-track{ height:9px; border-radius:999px; background:#F0EEFA; overflow:hidden; }
.bar-fill{
  height:100%; border-radius:999px;
  background: linear-gradient(90deg, var(--violet), var(--violet-light));
  width:0; transition: width 1s cubic-bezier(.2,.8,.2,1);
}
.bar-fill.alt{ background: linear-gradient(90deg, var(--rent), #5FD6D6); }
.bar-fill.coral{ background: linear-gradient(90deg, var(--coral), var(--coral-light)); }

/* ---------- Tables ---------- */
.table-card{ padding:0; overflow:hidden; }
table.data-table{ width:100%; border-collapse:collapse; margin:0; }
table.data-table th{
  text-align: start;
  font-size:.72rem; text-transform:uppercase; letter-spacing:.05em;
  color:var(--text-muted); font-weight:800;
  padding: 14px 18px; border-bottom:1px solid var(--border); background:#FAFAFD;
}
table.data-table td{
  padding: 14px 18px; border-bottom:1px solid var(--border); font-size:.87rem; vertical-align:middle;
}
table.data-table tr:last-child td{ border-bottom:none; }
table.data-table tr{ transition: background .12s ease; }
table.data-table tr:hover td{ background: #FAF9FF; }

.thumb{ width:44px; height:44px; border-radius:12px; object-fit:cover; background:#F0EEFA; flex-shrink:0; }
.thumb-fallback{
  width:44px; height:44px; border-radius:12px; background:#F0EEFA; color:#B4ACD6;
  display:flex; align-items:center; justify-content:center; font-size:1.1rem;
}

.badge-pill{
  display:inline-flex; align-items:center; gap:5px;
  padding:5px 12px; border-radius:999px; font-size:.73rem; font-weight:800;
}
.badge-sale{ background:linear-gradient(135deg,#FFE7C2,#FFD37A); color:#8A5A00; }
.badge-rent{ background:var(--rent-bg); color:var(--rent); }
.badge-active{ background:var(--success-bg); color:var(--success); }
.badge-disactive{ background:var(--danger-bg); color:var(--danger); }
.badge-tour{ background: linear-gradient(135deg,#EDE8FF,#E4EEFB); color: var(--violet); }
.badge-tour i{ font-size: .8rem; }

/* ---------- Row action buttons ---------- */
.btn-icon{
  width:34px; height:34px; border-radius:10px;
  display:inline-flex; align-items:center; justify-content:center;
  border:1px solid var(--border); background:var(--surface); color:var(--text-muted);
  transition: all .18s ease;
}
.btn-icon:hover{ background: linear-gradient(135deg, var(--violet-light), var(--violet)); color:#fff; border-color:transparent; box-shadow: var(--glow); transform: translateY(-2px); }

/* ---------- Buttons ---------- */
.btn-gold{
  background: linear-gradient(135deg, var(--violet-light), var(--violet));
  border:none; color:#fff;
  border-radius: var(--radius-sm); font-weight:800; padding:10px 18px;
  transition: box-shadow .18s ease, transform .12s ease;
  box-shadow: var(--glow);
  position:relative; overflow:hidden;
}
.btn-gold:hover{ color:#fff; box-shadow: 0 12px 28px -8px rgba(27,111,224,.6); transform: translateY(-1px); }
.btn-gold:active{ transform: scale(.97); }
.btn-outline-gold{
  background: var(--surface); border:1px solid var(--border); color: var(--ink-3);
  border-radius: var(--radius-sm); font-weight:700; padding:9px 16px;
  transition: all .18s ease;
}
.btn-outline-gold:hover{ border-color: var(--violet); color: var(--violet); background: #F5F3FF; }

/* Ripple */
.btn-gold .ripple, .btn-icon .ripple{
  position:absolute; border-radius:50%; transform:scale(0);
  background: rgba(255,255,255,.55); animation: ripple .6s ease-out;
  pointer-events:none;
}
@keyframes ripple{ to{ transform:scale(3); opacity:0; } }

/* ---------- Form controls ---------- */
.form-control, .form-select{
  border-radius: var(--radius-sm);
  border-color: var(--border);
  padding: 10px 14px;
  font-size:.9rem;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.form-control:focus, .form-select:focus{
  border-color: var(--violet);
  box-shadow: 0 0 0 4px rgba(27,111,224,.14);
}
.form-label{ font-size:.78rem; font-weight:700; color:var(--text-muted); }

/* ---------- Edit form ---------- */
.form-section{
  background: var(--surface);
  border:1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 24px;
  margin-bottom: 18px;
}
.form-section .form-section-title{
  font-weight:800; font-size:.94rem; margin-bottom:18px;
  display:flex; align-items:center; gap:9px;
  color: var(--ink-3);
}
.form-section .form-section-title i{ color: var(--violet); }
.sticky-save-bar{
  position: sticky; bottom:0; z-index:15;
  background: var(--glass);
  backdrop-filter: blur(14px);
  border-top:1px solid var(--border);
  padding: 14px 22px; margin: 0 -22px -22px;
  display:flex; justify-content:flex-end; gap:10px;
  box-shadow: 0 -8px 20px -12px rgba(28,16,64,.14);
}

/* ---------- Zone cards ---------- */
.zone-card{ transition: box-shadow .22s ease, transform .22s ease; }
.zone-card:hover{ box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.zone-stat{ flex:1; border-radius: var(--radius-sm); background: #F3EFFF; padding: 11px 12px; }
.zone-stat.zone-stat-alt{ background: var(--rent-bg); }
.zone-stat-value{ font-size:1.35rem; font-weight:800; color: var(--violet); line-height:1.1; }
.zone-stat-alt .zone-stat-value{ color: var(--rent); }
.zone-stat-label{ font-size:.7rem; color: var(--text-muted); font-weight:700; margin-top:2px; }

/* ---------- Login page ---------- */
.login-shell{ min-height:100vh; display:flex; align-items:stretch; background: var(--ink); }
.login-art{
  flex:1.1; position:relative; overflow:hidden;
  background: radial-gradient(120% 120% at 15% 15%, #123262 0%, #0A1E3D 60%);
  display:flex; align-items:flex-end; padding:48px;
}
.login-art .seal{ position:absolute; inset-inline-end:-60px; top:-60px; width:340px; height:340px; border:1px dashed rgba(91,158,245,.25); border-radius:50%; }
.login-art .seal.s2{ width:230px; height:230px; inset-inline-end:20px; top:40px; border-color: rgba(255,122,69,.18); }
.login-art blockquote{ color:#E4E0FA; font-size:1.4rem; font-weight:700; line-height:1.5; max-width:420px; }
.login-art cite{ color:#8E86B8; font-size:.82rem; font-style:normal; }

.login-panel{ width: 460px; flex-shrink:0; background: var(--surface); display:flex; align-items:center; justify-content:center; padding: 32px; }
.login-card{ width:100%; max-width:340px; }
.login-card .brand-mark{
  width:48px; height:48px; border-radius:14px;
  background: linear-gradient(135deg, var(--violet-light), var(--violet));
  display:flex; align-items:center; justify-content:center;
  color: #fff; font-weight:800; font-size:1.2rem; margin-bottom:18px;
  box-shadow: var(--glow);
}

@media (max-width: 992px){
  .login-art{ display:none; }
  .login-panel{ width:100%; }
}
@media (max-width: 900px){
  .sidebar{ display:none; }
  .content{ padding:16px; }
}

/* ---------- Offer / service cards ---------- */
.offer-grid{ display:grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap:18px; }
.offer-card{
  background: var(--surface);
  border:1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow:hidden;
  display:flex; flex-direction:column;
  transition: box-shadow .22s ease, transform .22s ease;
}
.offer-card:hover{ box-shadow: var(--shadow-lg); transform: translateY(-4px); }
.offer-card-media{
  position:relative; height:150px; background: linear-gradient(135deg,#F0EEFA,#E9F4FC);
  display:flex; align-items:center; justify-content:center; overflow:hidden;
}
.offer-card-media img{ width:100%; height:100%; object-fit:cover; }
.offer-card-media .placeholder-icon{ font-size:2rem; color:#C7C0E8; }
.offer-ribbon{
  position:absolute; top:12px; inset-inline-start:12px;
  background: linear-gradient(135deg, var(--coral), var(--coral-light));
  color:#fff; font-weight:800; font-size:.78rem;
  padding: 5px 12px; border-radius:999px;
  box-shadow: 0 6px 14px -4px rgba(255,122,69,.55);
}
.offer-ribbon.price-tag{ background: linear-gradient(135deg, var(--violet), var(--violet-light)); box-shadow: var(--glow); }
.offer-card-status{ position:absolute; top:12px; inset-inline-end:12px; }
.offer-card-body{ padding:16px 16px 14px; flex:1; display:flex; flex-direction:column; gap:8px; }
.offer-card-title{ font-weight:800; font-size:.95rem; line-height:1.3; }
.offer-card-desc{ font-size:.8rem; color:var(--text-muted); display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.offer-provider-chip{
  display:inline-flex; align-items:center; gap:6px; font-size:.76rem; color:var(--text-muted);
  background:#FAFAFD; border:1px solid var(--border); border-radius:999px; padding:4px 10px; width:fit-content;
}
.offer-card-footer{
  display:flex; align-items:center; justify-content:space-between;
  padding: 12px 16px; border-top:1px solid var(--border); background:#FAFAFD;
}
.offer-expiry{ font-size:.74rem; color:var(--text-muted); }
.offer-expiry.soon{ color: var(--coral); font-weight:700; }

/* ---------- Services stats panel (dashboard) ---------- */
.status-stack{
  display:flex; height:14px; border-radius:999px; overflow:hidden;
  background:#F0EEFA; margin-bottom:14px;
}
.status-stack > span{ height:100%; transition: width 1s cubic-bezier(.2,.8,.2,1); }
.status-stack .seg-pending{ background: linear-gradient(90deg, #FFD37A, var(--amber)); }
.status-stack .seg-accept{ background: linear-gradient(90deg, #5FE3C0, var(--success)); }
.status-stack .seg-reject{ background: linear-gradient(90deg, var(--coral-light), var(--coral)); }

.status-legend{ display:flex; flex-wrap:wrap; gap:14px; margin-bottom:6px; }
.status-legend .legend-item{ display:flex; align-items:center; gap:6px; font-size:.78rem; color:var(--text-muted); }
.status-legend .legend-dot{ width:9px; height:9px; border-radius:50%; display:inline-block; }
.status-legend .legend-dot.pending{ background: var(--amber); }
.status-legend .legend-dot.accept{ background: var(--success); }
.status-legend .legend-dot.reject{ background: var(--coral); }
.status-legend .legend-item b{ color: var(--text); }

.provider-row{
  display:flex; align-items:center; gap:12px;
  padding: 10px 0; border-bottom:1px solid var(--border);
}
.provider-row:last-child{ border-bottom:none; }
.provider-rank{
  width:28px; height:28px; border-radius:50%; flex-shrink:0;
  display:flex; align-items:center; justify-content:center;
  font-size:.75rem; font-weight:800; color:#fff;
  background: linear-gradient(135deg, var(--violet-light), var(--violet));
}
.provider-row:nth-child(1) .provider-rank{ background: linear-gradient(135deg, #FFD37A, var(--amber)); }
.provider-row:nth-child(2) .provider-rank{ background: linear-gradient(135deg, #D9D9E6, #9C96B8); }
.provider-row:nth-child(3) .provider-rank{ background: linear-gradient(135deg, #E3B48A, #B87A45); }
.provider-name{ font-weight:700; font-size:.85rem; }
.provider-phone{ font-size:.74rem; color:var(--text-muted); }
.provider-count{ margin-inline-start:auto; font-weight:800; color:var(--violet); font-size:.9rem; }

/* ---------- Report cards ---------- */
.report-card{
  display:flex; gap:16px;
  background: var(--surface);
  border:1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  margin-bottom: 14px;
  transition: box-shadow .2s ease, transform .2s ease;
}
.report-card:hover{ box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.report-flag{
  width:42px; height:42px; border-radius:13px; flex-shrink:0;
  background: linear-gradient(135deg, var(--coral-light), var(--coral));
  color:#fff; display:flex; align-items:center; justify-content:center;
  font-size:1.05rem; box-shadow: 0 8px 20px -8px rgba(255,122,69,.5);
}
.report-body{ flex:1; min-width:0; }
.report-desc{ margin: 8px 0 12px; font-size:.87rem; color:var(--text); }
.report-date{ font-size:.76rem; color:var(--text-muted); white-space:nowrap; }
.report-estate-chip{
  display:flex; align-items:center; gap:10px;
  border:1px solid var(--border); border-radius: var(--radius-sm);
  padding: 8px 12px; margin-bottom:10px;
  transition: all .15s ease;
}
a.report-estate-chip:hover{ border-color: var(--violet); background:#F5F9FF; }
.report-reporter{ display:flex; align-items:center; gap:6px; font-size:.78rem; color:var(--text-muted); }

/* ---------- Property portfolio report ---------- */
.pr-header{
  background: linear-gradient(120deg, var(--ink) 0%, var(--ink-2) 55%, var(--ink-3) 100%);
  border-radius: var(--radius);
  padding: 30px 32px;
  color: #fff;
  position: relative;
  overflow: hidden;
  margin-bottom: 22px;
}
.pr-header::before{
  content:""; position:absolute; inset-inline-end:-70px; top:-70px; width:240px; height:240px;
  background: radial-gradient(circle, rgba(27,111,224,.35), transparent 70%);
}
.pr-header-title{ font-size:1.4rem; font-weight:800; margin-bottom:4px; position:relative; z-index:1; }
.pr-header-sub{ color:#AEB9D4; font-size:.85rem; position:relative; z-index:1; }
.pr-header-meta{ color:#8E9DC2; font-size:.78rem; margin-top:10px; position:relative; z-index:1; }
.pr-header .btn-gold{ position:relative; z-index:1; }

.pr-rank-table{ width:100%; border-collapse:collapse; }
.pr-rank-table th{
  text-align:start; font-size:.72rem; text-transform:uppercase; letter-spacing:.05em;
  color:var(--text-muted); font-weight:800; padding:10px 12px; border-bottom:1px solid var(--border);
}
.pr-rank-table td{ padding:11px 12px; border-bottom:1px solid var(--border); font-size:.85rem; }
.pr-rank-table tr:last-child td{ border-bottom:none; }
.pr-rank-badge{
  display:inline-flex; align-items:center; justify-content:center;
  width:22px; height:22px; border-radius:50%; font-size:.7rem; font-weight:800;
  background:#F0EEFA; color:var(--text-muted); margin-inline-end:8px;
}
.pr-rank-table tr:nth-child(1) .pr-rank-badge{ background: linear-gradient(135deg,#FFD37A,var(--amber)); color:#fff; }
.pr-rank-table tr:nth-child(2) .pr-rank-badge{ background: linear-gradient(135deg,#D9D9E6,#9C96B8); color:#fff; }
.pr-rank-table tr:nth-child(3) .pr-rank-badge{ background: linear-gradient(135deg,#E3B48A,#B87A45); color:#fff; }

.trend-chart{ display:flex; align-items:flex-end; gap:8px; height:160px; padding-top:10px; }
.trend-col{ flex:1; display:flex; flex-direction:column; align-items:center; justify-content:flex-end; height:100%; gap:6px; }
.trend-bar{
  width:100%; max-width:28px; border-radius:6px 6px 0 0;
  background: linear-gradient(180deg, var(--violet-light), var(--violet));
  transition: height 1s cubic-bezier(.2,.8,.2,1);
}
.trend-count{ font-size:.7rem; font-weight:700; color:var(--text); }
.trend-label{ font-size:.65rem; color:var(--text-muted); text-align:center; white-space:nowrap; }

@media print{
  .sidebar, .topbar, .pr-header .btn-gold, .btn-outline-gold{ display:none !important; }
  .content{ padding:0 !important; }
  .card{ box-shadow:none !important; border:1px solid #ddd !important; break-inside: avoid; }
  body{ background:#fff !important; }
  .pr-header{ color:#fff; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- Notification preview mockup ---------- */
.notif-phone-mock{
  background: linear-gradient(180deg, #E9EEF7, #DCE4F3);
  border-radius: 20px;
  padding: 22px 16px;
  min-height: 160px;
  display:flex; align-items:flex-start; justify-content:center;
}
.notif-preview-card{
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(6px);
  border-radius: 14px;
  padding: 12px 14px;
  width: 100%;
  max-width: 320px;
  display:flex; gap:10px; align-items:flex-start;
  box-shadow: 0 8px 20px -8px rgba(10,30,61,.25);
}
.notif-preview-icon{
  width:34px; height:34px; border-radius:9px; flex-shrink:0;
  background: linear-gradient(135deg, var(--violet-light), var(--violet));
  color:#fff; display:flex; align-items:center; justify-content:center; font-size:.9rem;
}
.notif-preview-title{ font-weight:800; font-size:.85rem; color:var(--text); }
.notif-preview-body{ font-size:.78rem; color:var(--text-muted); margin-top:2px; word-break:break-word; }

/* ---------- Dashboard map tabs ---------- */
.map-tabs{ display:flex; gap:6px; }
.map-tab{
  display:flex; align-items:center; gap:7px;
  padding:8px 14px; border-radius:10px; border:1px solid transparent;
  background:transparent; color:var(--text-muted); font-weight:700; font-size:.86rem;
  transition: all .18s ease;
}
.map-tab:hover{ background: var(--canvas); color: var(--text); }
.map-tab.active{
  background: linear-gradient(135deg, var(--violet-light), var(--violet));
  color:#fff; box-shadow: var(--glow);
}
.map-tab-count{
  font-size:.7rem; font-weight:800; padding:1px 7px; border-radius:999px;
  background: rgba(255,255,255,.25); color:inherit;
}
.map-tab:not(.active) .map-tab-count{ background:#EFEDFA; color: var(--violet); }

/* ---------- Estate photo gallery management ---------- */
.photo-grid{
  display:grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap:14px;
}
.photo-card{
  position:relative; aspect-ratio:1; border-radius: var(--radius-sm); overflow:hidden;
  background:#F0EEFA; box-shadow: var(--shadow);
}
.photo-card img{ width:100%; height:100%; object-fit:cover; transition: transform .25s ease; }
.photo-card:hover img{ transform: scale(1.06); }
.photo-card-badge{
  position:absolute; top:8px; inset-inline-start:8px;
  background: linear-gradient(135deg, var(--violet-light), var(--violet));
  color:#fff; font-size:.68rem; font-weight:800; padding:3px 10px; border-radius:999px;
  box-shadow: var(--glow);
}
.photo-card-delete{ position:absolute; top:8px; inset-inline-end:8px; margin:0; }
.photo-card-delete button{
  width:30px; height:30px; border-radius:50%; border:none;
  background: rgba(20,10,40,.55); color:#fff; font-size:.85rem;
  display:flex; align-items:center; justify-content:center;
  opacity:0; transition: all .18s ease; backdrop-filter: blur(4px);
}
.photo-card:hover .photo-card-delete button{ opacity:1; }
.photo-card-delete button:hover{ background: var(--danger); }
@media (max-width: 600px){
  .photo-card-delete button{ opacity:1; } /* no hover on touch devices - always visible */
}

/* ---------- Topbar dropdowns (notifications, profile) ---------- */
.nav-dropdown{ position:relative; }
.nav-icon-btn{
  position:relative;
  width:40px; height:40px; border-radius:12px;
  display:flex; align-items:center; justify-content:center;
  border:1px solid var(--border); background:var(--surface); color:var(--text-muted);
  font-size:1.05rem; transition: all .18s ease;
}
.nav-icon-btn:hover{ background: var(--canvas); color: var(--violet); border-color: var(--violet); }
.nav-profile-btn{
  background: linear-gradient(135deg, var(--violet-light), var(--violet));
  color:#fff; border:none;
}
.nav-profile-btn:hover{ box-shadow: var(--glow); color:#fff; }
.nav-icon-badge{
  position:absolute; top:-4px; inset-inline-end:-4px;
  min-width:18px; height:18px; padding:0 4px; border-radius:999px;
  background: linear-gradient(135deg, var(--coral-light), var(--coral));
  color:#fff; font-size:.65rem; font-weight:800;
  display:flex; align-items:center; justify-content:center;
  box-shadow: 0 0 0 2px var(--surface);
}
.nav-dropdown-menu{
  display:none;
  position:absolute; top:calc(100% + 10px); inset-inline-end:0;
  width:340px; max-width:88vw;
  background: var(--surface);
  border:1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index:50;
  overflow:hidden;
  animation: fadeUp .18s ease;
}
.nav-dropdown-menu.open{ display:block; }
.nav-dropdown-menu-sm{ width:220px; }
.nav-dropdown-header{
  padding:14px 16px; border-bottom:1px solid var(--border);
  font-weight:800; font-size:.88rem;
  display:flex; align-items:center; justify-content:space-between; gap:8px;
}
.nav-dropdown-body{ max-height:320px; overflow-y:auto; }
.nav-dropdown-item{
  display:flex; align-items:center; gap:10px;
  padding:11px 16px; font-size:.83rem; color:var(--text);
  transition: background .15s ease;
}
.nav-dropdown-item:hover{ background: var(--canvas); color:var(--text); }
.nav-dropdown-item i{ color:var(--text-muted); font-size:1rem; }
.nav-dropdown-item-title{ font-weight:700; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:230px; }
.nav-dropdown-item-sub{ font-size:.74rem; color:var(--text-muted); }
.nav-dropdown-footer{
  display:block; text-align:center; padding:11px; font-weight:700; font-size:.82rem;
  color:var(--violet); border-top:1px solid var(--border); background: var(--canvas);
}
.nav-dropdown-footer:hover{ color: var(--violet-2); }
