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

:root {
  --bg: #ecfdf5;
  --surface: #ffffff;
  --primary: #059669;
  --primary-hover: #047857;
  --primary-soft: rgba(5, 150, 105, 0.12);
  --text: #064e3b;
  --text-muted: #047857;
  --border: rgba(5, 150, 105, 0.2);
  --shadow: 0 4px 6px -1px rgba(6, 78, 59, 0.08), 0 2px 4px -2px rgba(6, 78, 59, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(6, 78, 59, 0.08), 0 4px 6px -4px rgba(6, 78, 59, 0.06);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Layout 6 */
.layout { min-height: 100vh; display: flex; flex-direction: column; }
.nav {
  position: sticky; top: 0; z-index: 100;
  background: var(--surface); padding: 1rem 2rem;
  border-bottom: 1px solid var(--border); box-shadow: var(--shadow);
  display: flex; justify-content: space-between; align-items: center;
}
.nav .logo { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 700; font-size: 1.125rem; color: var(--primary); text-decoration: none; }
.nav .logo:hover { color: var(--primary-hover); }
.nav .logo-icon { height: 28px; width: auto; display: block; }
.nav .links { display: flex; align-items: center; gap: 1.5rem; }
.nav a { color: var(--text-muted); text-decoration: none; font-weight: 500; transition: color 0.2s; }
.nav a:hover { color: var(--primary); }
.nav .btn-link { background: none; border: none; color: var(--text-muted); font: inherit; font-weight: 500; cursor: pointer; padding: 0; }
.nav .btn-link:hover { color: var(--primary); }
.account-dropdown { position: relative; }
.account-btn { background: none; border: none; color: var(--text-muted); font: inherit; font-weight: 500; cursor: pointer; padding: 0; display: flex; align-items: center; gap: 0.5rem; }
.account-btn:hover { color: var(--primary); }
.account-btn-avatar, .account-btn-placeholder { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.account-btn-placeholder { background: var(--primary-soft); flex-shrink: 0; display: inline-block; }
.account-menu { position: absolute; right: 0; top: 100%; margin-top: 0.5rem; min-width: 180px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 0.5rem; display: flex; flex-direction: column; gap: 0.25rem; z-index: 100; }
.account-menu[hidden] { display: none; }
.account-menu a, .account-menu .btn-link { display: block; padding: 0.5rem 0.75rem; text-align: left; border-radius: 6px; }
.account-menu a:hover, .account-menu .btn-link:hover { background: var(--primary-soft); }
.account-menu form { margin: 0; }
.lang-switcher { display: flex; align-items: center; gap: 0.5rem; }
.lang-icon { font-size: 1rem; opacity: 0.8; }
.lang-option { color: var(--text-muted); text-decoration: none; font-weight: 500; font-size: 0.875rem; padding: 0.25rem 0.5rem; border-radius: 4px; }
.lang-option:hover { color: var(--primary); }
.lang-option.active { color: var(--primary); font-weight: 600; }
.hero {
  flex: 0 0 25vh; min-height: 133px; background: linear-gradient(135deg, var(--primary) 0%, #047857 100%);
  display: flex; align-items: center; justify-content: center; padding: 2rem; text-align: center;
  color: white;
}
.hero h1 { font-size: 2rem; font-weight: 700; margin: 0 0 0.5rem; letter-spacing: -0.02em; }
.hero p { margin: 0; opacity: 0.9; font-size: 0.9375rem; }
.content { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 2rem; }
.content:has(.dashboard-layout) { justify-content: stretch; align-items: stretch; padding: 0; min-width: 0; overflow: hidden; }
.center-box { width: 100%; max-width: 420px; }
.card {
  background: var(--surface); padding: 2rem; border-radius: 16px;
  border: 1px solid var(--border); box-shadow: var(--shadow-lg);
}
.card h3 { font-size: 1.125rem; font-weight: 600; margin: 0 0 0.5rem; }
.card p { color: var(--text-muted); font-size: 0.9375rem; margin: 0 0 1rem; line-height: 1.5; }
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 0 1.25rem; height: 38px; min-height: 38px; box-sizing: border-box; background: var(--primary); color: white; border: none; border-radius: 10px; font-weight: 600; cursor: pointer; transition: background 0.2s; font-family: inherit; }
.btn:hover { background: var(--primary-hover); }
.btn-primary { background: var(--primary); color: white; height: 38px; min-height: 38px; }
.btn-primary:hover { background: var(--primary-hover); }
.icon-btn { background: none; border: none; padding: 0.35rem; cursor: pointer; color: var(--text-muted); border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; }
.icon-btn:hover { color: var(--primary); background: var(--primary-soft); }
.edit-cell { width: 50px; min-width: 50px; padding: 0.35rem !important; }
.user-id-display { margin: 0 0 1rem; font-size: 0.9rem; color: var(--text-muted); }
.btn-outline { display: inline-flex; align-items: center; justify-content: center; background: transparent; color: var(--primary); border: 2px solid var(--primary); padding: 0 1rem; height: 38px; min-height: 38px; box-sizing: border-box; }
.btn-outline:hover { background: var(--primary-soft); }
.btn-outline.btn-danger { color: #dc2626; border-color: #dc2626; }
.btn-outline.btn-danger:hover { background: rgba(220,38,38,0.1); }

/* Tabs */
.form-tabs { display: flex; gap: 0.5rem; margin-bottom: 1.5rem; }
.form-tabs .tab { padding: 0.6rem 1.2rem; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; font: inherit; font-weight: 500; color: var(--text-muted); cursor: pointer; transition: all 0.2s; }
.form-tabs .tab:hover { color: var(--primary); border-color: var(--primary); }
.form-tabs .tab.active { background: var(--primary); color: white; border-color: var(--primary); }
.form-panel { display: none; }
.form-panel.active { display: block; }
.form-switch-link { display: block; text-align: center; margin-top: 1rem; font-size: 0.9375rem; color: var(--primary); text-decoration: none; font-weight: 500; }
.form-switch-link:hover { text-decoration: underline; }

/* Auth forms */
.auth-form { background: var(--surface); padding: 2rem; border-radius: 16px; border: 1px solid var(--border); box-shadow: var(--shadow-lg); }
.auth-form label { display: block; font-size: 0.875rem; font-weight: 500; margin: 1rem 0 0.4rem; color: var(--text); }
.auth-form label:first-of-type { margin-top: 0; }
.auth-form input { width: 100%; padding: 0.7rem 1rem; border: 1px solid var(--border); border-radius: 8px; font: inherit; font-size: 1rem; }
.auth-form input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.auth-form .row { display: flex; gap: 1rem; }
.auth-form .row .field { flex: 1; }
.auth-form .row .field label { margin-top: 0; }
.auth-form .row .field:not(:first-child) label { margin-top: 0; }
.auth-form .btn { width: 100%; margin-top: 1.25rem; }

/* Flash */
.flash-wrap { width: 100%; max-width: 420px; margin-bottom: 1rem; }
.flash { padding: 0.75rem 1rem; border-radius: 8px; font-size: 0.9375rem; }
.flash-error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.flash-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
body.dark-mode .flash-error { background: rgba(185, 28, 28, 0.3); color: #fca5a5; border-color: rgba(185, 28, 28, 0.4); }
body.dark-mode .flash-success { background: rgba(5, 150, 105, 0.25); color: #6ee7b7; border-color: rgba(5, 150, 105, 0.4); }
.flash-info { background: var(--primary-soft); color: var(--text); border: 1px solid var(--border); }

/* Color schemes */
body.scheme-emerald { /* default, already in :root */ }
body.scheme-blue { --bg: #eff6ff; --primary: #2563eb; --primary-hover: #1d4ed8; --primary-soft: rgba(37, 99, 235, 0.12); --text: #1e3a8a; --text-muted: #1d4ed8; --border: rgba(37, 99, 235, 0.2); --shadow: 0 4px 6px -1px rgba(30, 58, 138, 0.08), 0 2px 4px -2px rgba(30, 58, 138, 0.06); --shadow-lg: 0 10px 15px -3px rgba(30, 58, 138, 0.08), 0 4px 6px -4px rgba(30, 58, 138, 0.06); }
body.scheme-blue .hero { background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%); }
body.scheme-slate { --bg: #f1f5f9; --primary: #475569; --primary-hover: #334155; --primary-soft: rgba(71, 85, 105, 0.12); --text: #0f172a; --text-muted: #475569; --border: rgba(71, 85, 105, 0.2); --shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.06); --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.06); }
body.scheme-slate .hero { background: linear-gradient(135deg, #475569 0%, #334155 100%); }
body.scheme-amber { --bg: #fffbeb; --primary: #d97706; --primary-hover: #b45309; --primary-soft: rgba(217, 119, 6, 0.12); --text: #78350f; --text-muted: #b45309; --border: rgba(217, 119, 6, 0.2); --shadow: 0 4px 6px -1px rgba(120, 53, 15, 0.08), 0 2px 4px -2px rgba(120, 53, 15, 0.06); --shadow-lg: 0 10px 15px -3px rgba(120, 53, 15, 0.08), 0 4px 6px -4px rgba(120, 53, 15, 0.06); }
body.scheme-amber .hero { background: linear-gradient(135deg, #d97706 0%, #b45309 100%); }
body.scheme-rose { --bg: #fff1f2; --primary: #e11d48; --primary-hover: #be123c; --primary-soft: rgba(225, 29, 72, 0.12); --text: #881337; --text-muted: #be123c; --border: rgba(225, 29, 72, 0.2); --shadow: 0 4px 6px -1px rgba(136, 19, 55, 0.08), 0 2px 4px -2px rgba(136, 19, 55, 0.06); --shadow-lg: 0 10px 15px -3px rgba(136, 19, 55, 0.08), 0 4px 6px -4px rgba(136, 19, 55, 0.06); }
body.scheme-rose .hero { background: linear-gradient(135deg, #e11d48 0%, #be123c 100%); }
body.scheme-violet { --bg: #f5f3ff; --primary: #7c3aed; --primary-hover: #6d28d9; --primary-soft: rgba(124, 58, 237, 0.12); --text: #4c1d95; --text-muted: #6d28d9; --border: rgba(124, 58, 237, 0.2); --shadow: 0 4px 6px -1px rgba(76, 29, 149, 0.08), 0 2px 4px -2px rgba(76, 29, 149, 0.06); --shadow-lg: 0 10px 15px -3px rgba(76, 29, 149, 0.08), 0 4px 6px -4px rgba(76, 29, 149, 0.06); }
body.scheme-violet .hero { background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%); }
body.scheme-indigo { --bg: #eef2ff; --primary: #4f46e5; --primary-hover: #4338ca; --primary-soft: rgba(79, 70, 229, 0.12); --text: #312e81; --text-muted: #4338ca; --border: rgba(79, 70, 229, 0.2); --shadow: 0 4px 6px -1px rgba(49, 46, 129, 0.08), 0 2px 4px -2px rgba(49, 46, 129, 0.06); --shadow-lg: 0 10px 15px -3px rgba(49, 46, 129, 0.08), 0 4px 6px -4px rgba(49, 46, 129, 0.06); }
body.scheme-indigo .hero { background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%); }
body.scheme-cyan { --bg: #ecfeff; --primary: #0891b2; --primary-hover: #0e7490; --primary-soft: rgba(8, 145, 178, 0.12); --text: #164e63; --text-muted: #0e7490; --border: rgba(8, 145, 178, 0.2); --shadow: 0 4px 6px -1px rgba(22, 78, 99, 0.08), 0 2px 4px -2px rgba(22, 78, 99, 0.06); --shadow-lg: 0 10px 15px -3px rgba(22, 78, 99, 0.08), 0 4px 6px -4px rgba(22, 78, 99, 0.06); }
body.scheme-cyan .hero { background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%); }
body.scheme-lime { --bg: #f7fee7; --primary: #65a30d; --primary-hover: #4d7c0f; --primary-soft: rgba(101, 163, 13, 0.12); --text: #365314; --text-muted: #4d7c0f; --border: rgba(101, 163, 13, 0.2); --shadow: 0 4px 6px -1px rgba(54, 83, 20, 0.08), 0 2px 4px -2px rgba(54, 83, 20, 0.06); --shadow-lg: 0 10px 15px -3px rgba(54, 83, 20, 0.08), 0 4px 6px -4px rgba(54, 83, 20, 0.06); }
body.scheme-lime .hero { background: linear-gradient(135deg, #65a30d 0%, #4d7c0f 100%); }
body.scheme-pink { --bg: #fdf2f8; --primary: #db2777; --primary-hover: #be185d; --primary-soft: rgba(219, 39, 119, 0.12); --text: #831843; --text-muted: #be185d; --border: rgba(219, 39, 119, 0.2); --shadow: 0 4px 6px -1px rgba(131, 24, 67, 0.08), 0 2px 4px -2px rgba(131, 24, 67, 0.06); --shadow-lg: 0 10px 15px -3px rgba(131, 24, 67, 0.08), 0 4px 6px -4px rgba(131, 24, 67, 0.06); }
body.scheme-pink .hero { background: linear-gradient(135deg, #db2777 0%, #be185d 100%); }

/* Dark mode: invert bg/text, keep primary accents */
body.dark-mode { --bg: #111827; --surface: #1f2937; --text: #f9fafb; --text-muted: #d1d5db; --border: rgba(255,255,255,0.1); --shadow: 0 4px 6px -1px rgba(0,0,0,0.3), 0 2px 4px -2px rgba(0,0,0,0.2); --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.3), 0 4px 6px -4px rgba(0,0,0,0.2); }
body.dark-mode .hero { filter: brightness(0.9); }

/* Settings */
.settings-wrap { width: 100%; max-width: min(900px, 90vw); }
.settings-card, .settings-wrap .card { max-width: none; width: 100%; }
.settings-desc { color: var(--text-muted); font-size: 0.9375rem; margin: 0 0 1.5rem; }
.settings-form { margin-top: 0; }
.settings-row { margin-bottom: 1.5rem; }
.settings-row h3 { font-size: 1rem; margin: 0 0 0.5rem; }
.settings-toggle-row { display: flex; align-items: center; gap: 0.75rem; cursor: pointer; font-weight: 500; }
.settings-toggle-label { user-select: none; }
.settings-checkbox { width: 1.25rem; height: 1.25rem; accent-color: var(--primary); cursor: pointer; }
.settings-select { width: 100%; max-width: 200px; padding: 0.6rem 1rem; border: 1px solid var(--border); border-radius: 8px; font: inherit; font-size: 0.9375rem; }
.settings-label { display: block; font-size: 0.9375rem; font-weight: 500; margin: 0.75rem 0 0.25rem; color: var(--text); }
.settings-input { width: 100%; max-width: 280px; padding: 0.6rem 1rem; border: 1px solid var(--border); border-radius: 8px; font: inherit; font-size: 0.9375rem; }
.settings-row.rera-fields .settings-label:first-of-type { margin-top: 0; }
.color-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; margin-bottom: 1.5rem; }
.color-tile {
  position: relative;
  cursor: pointer;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid transparent;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.color-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.color-tile:has(input:checked) { border-color: var(--text); box-shadow: 0 0 0 1px var(--border); }
.color-tile input { position: absolute; opacity: 0; pointer-events: none; }
.color-preview { display: block; aspect-ratio: 1.4; min-height: 40px; }
.color-label {
  display: block;
  padding: 0.4rem 0.6rem;
  background: var(--surface);
  font-weight: 600;
  font-size: 0.8125rem;
  text-align: center;
}
.color-tile:has(input:checked) .color-label { background: var(--primary-soft); color: var(--primary); }
@media (min-width: 480px) {
  .color-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 900px) {
  .color-grid { grid-template-columns: repeat(5, 1fr); max-width: 500px; }
}

/* Dashboard layout B */
.dashboard-layout { flex: 1; display: flex; min-height: 0; }
.dashboard-layout .sidebar { width: 260px; background: var(--surface); border-right: 1px solid var(--border); padding: 1.5rem 0; flex-shrink: 0; box-shadow: var(--shadow); }
.dashboard-layout .sidebar-title { padding: 0 1.25rem 1rem; font-weight: 600; font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.dashboard-layout .sidebar-nav { display: flex; flex-direction: column; gap: 0.5rem; padding: 0 0.75rem; }
.dashboard-layout .sidebar-nav a { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 1rem; color: var(--text-muted); text-decoration: none; font-weight: 500; font-size: 0.9375rem; border-radius: 10px; transition: all 0.2s; }
.dashboard-layout .sidebar-nav a:hover { color: var(--primary); background: var(--primary-soft); }
.dashboard-layout .sidebar-nav a.active { color: white; background: var(--primary); }
.dashboard-layout .sidebar-nav .icon { width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; font-size: 1rem; opacity: 0.9; }
.dashboard-layout .sidebar-group { margin: 0; }
.dashboard-layout .sidebar-group-trigger { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 1rem; color: var(--text-muted); font-weight: 500; font-size: 0.9375rem; border-radius: 10px; cursor: pointer; list-style: none; transition: all 0.2s; user-select: none; }
.dashboard-layout .sidebar-group-trigger::-webkit-details-marker { display: none; }
.dashboard-layout .sidebar-group-trigger::marker { display: none; }
.dashboard-layout .sidebar-group-trigger::after { content: '▾'; font-size: 0.75rem; transition: transform 0.2s; margin-left: auto; }
.dashboard-layout .sidebar-group[open] .sidebar-group-trigger::after { transform: rotate(180deg); }
.dashboard-layout .sidebar-group-trigger:hover { color: var(--primary); background: var(--primary-soft); }
.dashboard-layout .sidebar-group-items { display: flex; flex-direction: column; gap: 0.25rem; padding: 0.25rem 0 0.25rem 1rem; border-left: 2px solid var(--border); margin-left: 0.5rem; }
.dashboard-layout .sidebar-group-items a { padding: 0.5rem 0.75rem; font-size: 0.875rem; }
.dashboard-layout .dashboard-main { flex: 1; min-width: 0; min-height: 0; padding: 2rem; overflow: auto; }
.dashboard-top { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; margin-bottom: 1.5rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
.stats-bar { display: flex; gap: 1rem; flex-wrap: wrap; flex: 1; }
.stat-box { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 0.75rem 1rem; min-width: 100px; }
.stat-box .stat-label { display: block; font-size: 0.75rem; color: var(--text-muted); margin-bottom: 0.25rem; }
.stat-box .stat-value { font-size: 1.25rem; font-weight: 700; }
.user-profile-block { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; margin-inline-start: auto; }
.dashboard-avatar, .dashboard-avatar-placeholder { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; }
.dashboard-avatar-placeholder { background: var(--primary-soft); }
.dashboard-username { font-size: 0.875rem; font-weight: 600; }
.dashboard-layout .containers { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; min-width: 0; }
.dashboard-layout .container { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 1.5rem; box-shadow: var(--shadow); min-width: 0; overflow: hidden; }
.dashboard-layout .container h2 { font-size: 1rem; margin: 0 0 0.75rem; font-weight: 600; }
.dashboard-layout .container p { color: var(--text-muted); font-size: 0.9375rem; margin: 0; }
@media (max-width: 768px) {
  .dashboard-layout { flex-direction: column; }
  .dashboard-layout .sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border); }
  .dashboard-layout .sidebar-nav { flex-direction: row; flex-wrap: wrap; }
  .dashboard-layout .sidebar-group { flex: 1 1 100%; min-width: 100%; }
  .dashboard-layout .sidebar-group-items { flex-direction: row; flex-wrap: wrap; padding: 0.25rem 0; margin-left: 0; margin-right: 0; border-left: none; border-right: none; gap: 0.35rem; }
  .dashboard-layout .sidebar-group-items a { flex: 1 1 auto; min-width: 0; }
  .dashboard-layout .containers { grid-template-columns: 1fr; }
  .dashboard-layout .dashboard-main { padding: 1rem; }
  .dashboard-layout .container { padding: 1rem; }
}

/* RTL / Arabic */
[dir="rtl"] body { font-family: 'Noto Sans Arabic', 'Plus Jakarta Sans', system-ui, sans-serif; }
[dir="rtl"] .account-menu { right: auto; left: 0; }
[dir="rtl"] .account-menu a, [dir="rtl"] .account-menu .btn-link { text-align: right; }
[dir="rtl"] .dashboard-layout .sidebar { border-right: none; border-left: 1px solid var(--border); }
[dir="rtl"] .dashboard-layout .sidebar-group-trigger::after { margin-left: 0; margin-right: auto; }
[dir="rtl"] .dashboard-layout .sidebar-group-items { margin-left: 0; margin-right: 0.5rem; padding-right: 1rem; padding-left: 0; border-left: none; border-right: 2px solid var(--border); }
[dir="rtl"] .color-label, [dir="rtl"] .form-switch-link { text-align: center; }

/* User details */
.user-details-form { display: flex; flex-direction: column; gap: 1rem; }
.user-details-form label { font-size: 0.875rem; font-weight: 500; }
.user-details-form input[type="text"],
.user-details-form input[type="tel"] { width: 100%; padding: 0.7rem 1rem; border: 1px solid var(--border); border-radius: 8px; font: inherit; }
.user-details-form input[type="text"]:focus,
.user-details-form input[type="tel"]:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.user-details-form .contact-error { font-size: 0.8125rem; color: #b91c1c; margin: 0.25rem 0 0; display: block; }
.user-details-form .contact-error[hidden] { display: none !important; }
#user-details-save.save-btn-hidden { display: none !important; }
.user-details-form .settings-input { max-width: none; }
.avatar-upload { display: flex; flex-direction: column; align-items: center; gap: 0.75rem; }
.avatar-wrap { position: relative; display: inline-block; }
.avatar-clickable { cursor: pointer; }
.avatar-edit-btn {
  position: absolute; top: 0; right: 0;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--primary); color: white; border: 2px solid var(--surface);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; padding: 0; box-shadow: var(--shadow);
  transition: background 0.2s;
}
.avatar-edit-btn:hover { background: var(--primary-hover); }
.avatar-preview, .avatar-placeholder { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; display: block; }
.avatar-placeholder { background: var(--primary-soft); }
.avatar-upload input[type="file"] { display: none; }

/* Modals */
body:has(.modal:not([hidden])) { overflow: hidden; }
.modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left)); box-sizing: border-box; overscroll-behavior: contain; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.5); cursor: pointer; }
.modal-content { position: relative; background: var(--surface); border-radius: 12px; max-width: 90vw; max-height: 90vh; overflow: hidden; overscroll-behavior: contain; }
.modal-header { padding: 1rem 1.5rem; border-bottom: 1px solid var(--border); }
.modal-header h3 { margin: 0; font-size: 1rem; }
.crop-wrap { width: 400px; height: 400px; background: #000; }
.crop-wrap img { display: block; max-width: 100%; }
.modal-footer { padding: 1rem 1.5rem; padding-inline: max(1.5rem, env(safe-area-inset-left)); border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; justify-content: flex-end; }
.modal-view .modal-content { padding: 0; }
.modal-view img { max-width: 90vw; max-height: 90vh; display: block; }

.search-modal-content { max-width: min(640px, calc(100vw - 2rem)); max-height: 85vh; overflow-y: auto; margin: 1rem; overscroll-behavior: contain; }
.search-form { padding: 1rem 1.5rem; }
.search-fields { display: grid; grid-template-columns: 1fr; gap: 0.75rem 1rem; margin-bottom: 1rem; }
.search-field label { display: block; font-size: 0.8125rem; font-weight: 500; margin-bottom: 0.25rem; color: var(--text); }
.search-field input, .search-field select, .search-field textarea { width: 100%; padding: 0.5rem 0.75rem; border: 1px solid var(--border); border-radius: 8px; font: inherit; font-size: 0.875rem; box-sizing: border-box; }
.search-field textarea { resize: vertical; min-height: 80px; }
.search-field.search-field-full { grid-column: 1 / -1; }
.search-field.search-field-full textarea { width: 100%; min-width: 0; }
.search-field.required-empty input, .search-field.required-empty select { border-color: #dc2626; box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.2); }
.price-with-currency { display: flex; gap: 0.5rem; align-items: stretch; }
.price-with-currency input { flex: 3; min-width: 0; }
.price-with-currency select { flex: 1; min-width: 70px; }
@media (min-width: 480px) {
  .search-fields { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 720px) {
  .search-fields { grid-template-columns: repeat(3, 1fr); }
}

/* Listings */
.listing-mgmt-actions { display: flex; justify-content: flex-end; align-items: center; margin-bottom: 1rem; }
.listings-tools { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.tools-left { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.tools-right { display: flex; align-items: center; gap: 0.5rem; margin-inline-start: auto; }
.listings-count { padding: 0.4rem 0.75rem; background: var(--primary-soft); color: var(--text); font-size: 0.875rem; font-weight: 500; border-radius: 8px; }
.tool-dropdown { position: relative; }
.tool-btn-icon { min-width: 36px; width: 38px; height: 38px; padding: 0; display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; }
.dropdown-opt { display: block; width: 100%; padding: 0.5rem 0.75rem; background: none; border: none; font: inherit; font-size: 0.875rem; color: var(--text); cursor: pointer; text-align: left; border-radius: 6px; }
.dropdown-opt:hover { background: var(--primary-soft); color: var(--primary); }
.tool-btn { display: inline-flex; align-items: center; justify-content: center; padding: 0 1rem; height: 38px; min-height: 38px; box-sizing: border-box; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; font: inherit; font-size: 0.875rem; color: var(--text); cursor: pointer; }
.tool-btn:hover { border-color: var(--primary); color: var(--primary); }
.tool-btn.btn-primary { background: var(--primary); border-color: var(--primary); color: white; }
.tool-btn.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: white; }
.dropdown-menu { position: absolute; top: 100%; left: 0; margin-top: 0.25rem; min-width: 180px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 0.75rem; z-index: 100; }
.dropdown-placeholder { font-size: 0.875rem; color: var(--text-muted); }
.dropdown-columns { min-width: 220px; max-height: 300px; overflow-y: auto; overscroll-behavior: contain; }
.column-checkboxes { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 0.75rem; }
.column-opt { display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; cursor: pointer; }
.column-opt input { margin: 0; }
.btn-sm { padding: 0.4rem 0.75rem; font-size: 0.8125rem; }
.old-age-controls { display: flex; align-items: center; gap: 0.75rem; padding: 0.5rem 0; }
.old-age-controls input[type="range"] { flex: 1; min-width: 120px; }
.listings-table { table-layout: fixed; width: max-content; }
.listings-table th { position: relative; }
.resize-handle { position: absolute; right: 0; top: 0; bottom: 0; width: 10px; cursor: col-resize; user-select: none; z-index: 1; }
.resize-handle:hover { background: var(--primary-soft); }
.th-content { padding-right: 0.5rem; }
.listings-table-wrap { overflow: auto; max-height: 60vh; min-height: 200px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); overscroll-behavior: contain; }
.listings-table thead th { box-shadow: 0 1px 0 var(--border); }
.listings-table { width: 100%; border-collapse: collapse; min-width: 1200px; }
.listings-table th, .listings-table td { padding: 0.5rem 0.75rem; text-align: left; border-bottom: 1px solid var(--border); font-size: 0.8125rem; }
.listings-table td { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.listings-table th { background: color-mix(in srgb, var(--primary) 12%, var(--surface) 88%); font-weight: 600; white-space: nowrap; position: sticky; top: 0; z-index: 2; }
.listings-table .empty-msg { text-align: center; color: var(--text-muted); padding: 4rem 2rem; width: 100%; min-width: 200px; display: block; font-size: 1.25rem; }
.listings-table a.ext-link { color: inherit; text-decoration: none; font-weight: inherit; }
.listings-table a.ext-link:hover { text-decoration: underline; color: inherit; }
.listings-table .portal-link { display: inline-flex; align-items: center; gap: 0.25rem; }
.listings-table .portal-icon { max-width: 48px; max-height: 36px; width: auto; height: auto; display: block; vertical-align: middle; object-fit: contain; }
.listings-table .owner-link { cursor: pointer; color: inherit; font-weight: inherit; text-decoration: none; }
.listings-table .owner-link:hover { color: inherit; text-decoration: underline; }
.listings-table tr.empty-row td { border: none; padding: 0; vertical-align: middle; text-align: center; }
.listings-table tr.empty-row td[colspan] { min-width: 300px; min-height: 120px; }
.listings-table th.draggable-col { cursor: grab; }
.listings-table th.draggable-col:active { cursor: grabbing; }
.listings-table th.draggable-col.dragging { opacity: 0.5; }
.listings-table th.draggable-col.drag-over { background: var(--primary); color: white; }
.listings-table th.col-hidden, .listings-table td.col-hidden { display: none !important; }
.dashboard-main h1 { font-size: 1.5rem; margin: 0 0 1rem; }

/* Listing Requests */
.requests-toolbar { margin-bottom: 0.5rem; }
.requests-search-panel { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 1rem; margin-bottom: 1rem; }
.requests-search-fields { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: 0.75rem; }
.requests-search-fields .search-field { min-width: 140px; }
.requests-search-actions { display: flex; gap: 0.5rem; }
.requests-section { margin-bottom: 1rem; }
.requests-section-title { font-size: 1rem; margin: 0 0 0.75rem; }
.requests-separator { border: none; border-top: 1px solid var(--border); margin: 1rem 0; }
.requests-cards { display: flex; flex-direction: column; gap: 0.75rem; }
.request-card { display: block; padding: 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; cursor: pointer; position: relative; text-align: left; width: 100%; transition: border-color 0.2s, box-shadow 0.2s; }
.request-card.request-card-with-avatar { display: flex; flex-direction: row; align-items: flex-start; gap: 0.75rem; }
.request-card-avatar-wrap { flex-shrink: 0; width: 48px; height: 48px; border-radius: 50%; overflow: hidden; position: relative; }
.request-card-avatar { width: 100%; height: 100%; object-fit: cover; display: block; }
.request-card-avatar-placeholder { width: 100%; height: 100%; border-radius: 50%; background: var(--primary-soft); display: none; }
.request-card-avatar-placeholder.show { display: block; }
.request-card-body { flex: 1; min-width: 0; }
.request-card:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.request-card-ref { font-weight: 600; margin-bottom: 0.25rem; }
.request-card-prop { color: var(--text-muted); font-size: 0.875rem; margin-bottom: 0.25rem; }
.request-card-owner { font-size: 0.8125rem; margin-bottom: 0.25rem; }
.request-card-dates { font-size: 0.75rem; color: var(--text-muted); }
.request-card-status,
.request-card-status-badge { position: absolute; top: 0.75rem; right: 0.75rem; }
.request-card-status { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.request-card-status.pending { background: #fff; border: 1px solid #b8860b; color: #b8860b; }
.request-card-status.approved { background: #fff; border: 1px solid #22c55e; color: #22c55e; }
.request-card-status.rejected { background: #fff; border: 1px solid #ef4444; color: #ef4444; }
.request-card-status-badge { background: #fff !important; padding: 0.25rem 0.5rem; border-radius: 8px; font-size: 0.75rem; font-weight: 700; }
.request-card-status-badge.status-pending { color: #b8860b; }
.request-card-status-badge.status-approved { color: #15803d; }
.request-card-status-badge.status-auto_approved { color: #16a34a; }
.request-card-status-badge.status-rejected { color: #dc2626; }
.request-card-status-badge.status-cancelled { color: #374151; }
.request-detail-status-badge { background: #fff !important; padding: 0.25rem 0.5rem; border-radius: 8px; font-size: 0.75rem; font-weight: 700; margin-left: auto; }
.request-detail-status-badge.status-pending { color: #b8860b; }
.request-detail-status-badge.status-approved { color: #15803d; }
.request-detail-status-badge.status-auto_approved { color: #16a34a; }
.request-detail-status-badge.status-rejected { color: #dc2626; }
.request-detail-status-badge.status-cancelled { color: #374151; }
.modal-header-with-status { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.modal-header-with-status h3 { flex: 1; min-width: 0; }
.request-card-menu { position: absolute; bottom: 0.5rem; right: 0.5rem; }
.request-detail-body { padding: 0 1rem 1rem; max-height: 50vh; overflow-y: auto; overscroll-behavior: contain; }

/* DLD Alerts */
.dld-alerts-list { display: flex; flex-direction: column; gap: 0.75rem; }
.dld-alert-card, .dld-contract-card { padding: 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; text-align: left; width: 100%; position: relative; }
.dld-invalid-permit-card { border: 10px solid #b91c1c; }
.dld-alert-card:hover, .dld-contract-card { cursor: default; transition: border-color 0.2s, box-shadow 0.2s; }
.dld-contract-card { cursor: pointer; }
.dld-alert-card:hover, .dld-contract-card:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.dld-invalid-permit-card:hover { border-color: #b91c1c; }
.dld-alert-menu-wrap { position: absolute; top: 0.75rem; right: 0.75rem; }
.dld-alert-menu-btn { padding: 0.25rem; background: var(--surface); border: 1px solid var(--border); cursor: pointer; color: var(--text); border-radius: 6px; display: flex; align-items: center; justify-content: center; }
.dld-alert-menu-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.dld-alert-menu-dropdown { position: absolute; top: 100%; right: 0; margin-top: 0.25rem; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow-lg); min-width: 160px; z-index: 50; padding: 0.25rem; }
.dld-menu-opt { display: block; width: 100%; padding: 0.5rem 0.75rem; text-align: left; background: none; border: none; font: inherit; font-size: 0.875rem; color: var(--text); cursor: pointer; border-radius: 6px; }
.dld-menu-opt:hover { background: var(--primary-soft); color: var(--primary); }
.dld-alert-msg { margin-bottom: 0.5rem; font-size: 0.9375rem; }
.dld-alert-props { font-size: 0.8125rem; color: var(--text-muted); margin-bottom: 0.25rem; }
.dld-alert-ref { font-size: 0.8125rem; margin-bottom: 0.25rem; }
.dld-alert-actions { margin-top: 0.5rem; }
.dld-contract-line { font-weight: 600; margin-bottom: 0.25rem; }
.dld-contract-client { font-size: 0.875rem; color: var(--text-muted); }
.dld-contract-card { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.dld-contract-content { flex: 1; min-width: 0; cursor: pointer; }
.dld-invalid-permit-content { cursor: pointer; }
.dld-contract-right { display: flex; flex-direction: column; align-items: flex-end; gap: 0.5rem; flex-shrink: 0; }
[dir="rtl"] .dld-contract-right { align-items: flex-start; }
.dld-contract-actions { flex-shrink: 0; }
.dld-contract-unread { border-left: 3px solid var(--primary); }
.dld-contract-type-badge { padding: 0.35rem 0.6rem; font-size: 1rem; font-weight: 400; background: var(--primary-soft); color: var(--primary); border-radius: 6px; }
.dld-contract-type-letter { font-weight: 700; }
.dld-section-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.75rem; }
.dld-section-header .requests-section-title { margin: 0; }
.dld-section-header-actions { display: flex; align-items: center; gap: 0.75rem; }
#dld-mark-all-read[hidden], #dld-take-all-down[hidden] { display: none !important; }
.dld-contract-search-wrap { display: flex; align-items: center; gap: 0.5rem; }
.dld-contract-search-input { min-width: 160px; width: 200px; padding: 0.5rem 0.75rem; font-size: 0.9375rem; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); }
.dld-contract-search-input:focus { outline: none; border-color: var(--primary); }
.dld-contract-search-clear { padding: 0.25rem 0.4rem; background: transparent; border: 1px solid var(--border); border-radius: 6px; color: var(--text-muted); cursor: pointer; font-size: 0.875rem; line-height: 1; }
.dld-contract-search-clear:hover { color: var(--text); border-color: var(--primary); }
.dld-contract-search-clear[hidden] { display: none !important; }
.dld-contract-card[hidden] { display: none !important; }
.dld-subsection-title { font-size: 0.9375rem; font-weight: 600; color: var(--text-muted); margin: 1rem 0 0.5rem; }
.dld-subsection-title:first-of-type { margin-top: 0.5rem; }
.dld-unread-history-separator { margin: 1.5rem 0 0.75rem; }
.dld-history-toggle { display: block; width: 100%; text-align: center; padding: 0.75rem; background: transparent; border: none; color: var(--primary); cursor: pointer; font-size: 0.9375rem; }
.dld-history-toggle:hover { color: var(--primary-hover, var(--primary)); text-decoration: underline; }
.dld-history-content { overflow: hidden; }
.dld-history-content[hidden] { display: none; }

/* Property owners sub-tabs - attached to container */
.sub-tab-container { background: var(--surface); border: 2px solid var(--primary); border-radius: 12px; overflow: visible; box-shadow: var(--shadow); }
.sub-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); background: var(--bg); overflow: visible; }
.sub-tab { padding: 0.75rem 1.25rem; background: none; border: none; font: inherit; font-weight: 500; color: var(--text-muted); cursor: pointer; position: relative; overflow: visible; }
.sub-tab:hover { color: var(--primary); }
.sub-tab.active { color: white; background: var(--primary); }
.sub-tab-badge { position: absolute; top: 0; right: 0.75em; transform: translate(50%, -50%); display: inline-flex; align-items: center; justify-content: center; width: 2.9em; height: 2.9em; min-width: 2.9em; padding: 0; margin: 0; font-size: 0.7rem; font-weight: 600; border-radius: 50%; background: var(--primary); color: white; box-sizing: border-box; }
[dir="rtl"] .sub-tab-badge { right: auto; left: 0.75em; transform: translate(-50%, -50%); }
.sub-tab-badge[hidden] { display: none !important; }
.sub-tab.active .sub-tab-badge { background: rgba(255,255,255,0.3); }
.sub-tab-badge.badge-red { background: #b91c1c; color: white; border: 1px solid white; }
.sub-tab.active .sub-tab-badge.badge-red { background: #b91c1c; border: 1px solid white; color: white; }
.sub-tab.active::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--primary); }
.sub-tab.active { border-bottom: 1px solid var(--primary); margin-bottom: -1px; }
.sub-tab-panels { padding: 1.5rem; }
.sub-tab-panel { display: none; }
.sub-tab-panel.active { display: block; }
.placeholder-msg { color: var(--text-muted); margin: 0; }

/* Dashboard quick search */
.quick-search-desc { margin-bottom: 1rem; }
.quick-search-form { margin-bottom: 1rem; }
.quick-search-fields { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.75rem; }
.quick-search-fields input,
.quick-search-fields select { padding: 0.5rem 0.75rem; border: 1px solid var(--border); border-radius: 8px; font-size: 0.875rem; font-family: inherit; min-width: 100px; }
.quick-search-fields input:focus,
.quick-search-fields select:focus { outline: none; border-color: var(--primary); }
.quick-search-actions { display: flex; align-items: center; gap: 0.5rem; }
.quick-search-results { margin-top: 1rem; min-height: 120px; max-height: 50vh; overflow: auto; overscroll-behavior: contain; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 1rem; box-shadow: var(--shadow); min-width: 0; }
.quick-search-results-placeholder { color: var(--text-muted); font-size: 0.9375rem; padding: 2rem; text-align: center; }
.quick-search-results-placeholder[hidden] { display: none !important; }
.combobox-wrap { position: relative; display: inline-block; }
.combobox-wrap input { min-width: 120px; }
.combobox-dropdown { position: absolute; top: 100%; left: 0; right: 0; margin-top: 2px; max-height: 200px; overflow-y: auto; overscroll-behavior: contain; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow-lg); z-index: 200; }
.combobox-dropdown[hidden] { display: none !important; }
.combobox-opt { padding: 0.5rem 0.75rem; cursor: pointer; font-size: 0.875rem; }
.combobox-opt:hover { background: var(--primary-soft); color: var(--primary); }
.combobox-opt.combobox-empty-msg { cursor: default; color: var(--text-muted); }
.combobox-opt.combobox-empty-msg:hover { background: transparent; color: var(--text-muted); }
.quick-search-table { width: 100%; border-collapse: collapse; font-size: 0.8125rem; }
.quick-search-table th, .quick-search-table td { padding: 0.5rem 0.75rem; text-align: left; border-bottom: 1px solid var(--border); }
.quick-search-table th { background: color-mix(in srgb, var(--primary) 12%, var(--surface) 88%); font-weight: 600; }
.quick-search-table tbody tr:hover { background: var(--primary-soft); }
.quick-search-table a.ext-link { color: inherit; text-decoration: none; font-weight: inherit; }
.quick-search-table a.ext-link:hover { text-decoration: underline; color: inherit; }
.portal-link { display: inline-flex; align-items: center; gap: 0.25rem; }
.portal-icon { max-width: 48px; max-height: 36px; width: auto; height: auto; display: block; vertical-align: middle; object-fit: contain; }
.quick-search-table .owner-link { cursor: pointer; color: inherit; font-weight: inherit; text-decoration: none; }
.quick-search-table .owner-link:hover { color: inherit; text-decoration: underline; }
.quick-search-count { font-size: 0.875rem; color: var(--text-muted); margin: 0.5rem 0 0; }

/* Owner profile modal */
.owner-modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 1rem; box-sizing: border-box; }
.owner-modal[hidden] { display: none; }
.owner-modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.5); cursor: pointer; }
.owner-modal-content { position: relative; background: var(--surface); border-radius: 12px; box-shadow: var(--shadow-lg); min-width: 420px; max-width: 92vw; padding: 2.25rem; }
.owner-modal-close { position: absolute; top: 0.75rem; right: 0.75rem; background: none; border: none; font-size: 1.5rem; color: var(--text-muted); cursor: pointer; line-height: 1; padding: 0.25rem; }
.owner-modal-close:hover { color: var(--primary); }
.owner-modal-header { display: flex; flex-direction: column; align-items: center; gap: 0.75rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
.owner-modal-avatar { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; }
.owner-modal-avatar-clickable { cursor: pointer; }
.owner-modal-avatar-placeholder { width: 120px; height: 120px; border-radius: 50%; background: var(--primary-soft); display: none; }
.owner-modal-avatar-placeholder.show { display: block; }
.owner-modal-name { margin: 0; font-size: 1.125rem; font-weight: 600; }
.owner-modal-body { display: flex; flex-direction: column; gap: 0.75rem; padding-top: 1rem; }
.owner-modal-row { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.owner-modal-text { font-size: 0.9375rem; color: var(--text); margin-right: 0.25rem; }
.owner-modal-icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; min-width: 32px; min-height: 32px; padding: 0; border: none; background: var(--primary-soft); color: var(--primary); border-radius: 8px; cursor: pointer; text-decoration: none; transition: background 0.2s, color 0.2s; }
.owner-modal-icon-btn:hover { background: var(--primary); color: white; }

.owner-avatar-lightbox { position: fixed; inset: 0; z-index: 10001; display: flex; align-items: center; justify-content: center; }
.owner-avatar-lightbox[hidden] { display: none; }
.owner-avatar-lightbox-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.8); cursor: pointer; }
.owner-avatar-lightbox-img { position: relative; z-index: 1; max-width: 90vw; max-height: 90vh; object-fit: contain; border-radius: 8px; }

/* Pocket listing pictures */
.pictures-upload-area { display: flex; gap: 0.5rem; align-items: center; margin-bottom: 0.75rem; }
.pictures-upload-area input[type="file"] { font-size: 0.875rem; }
.pictures-list { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.picture-item { display: flex; flex-direction: column; align-items: center; gap: 0.35rem; }
.picture-item img { width: 80px; height: 80px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.picture-actions { display: flex; gap: 0.5rem; align-items: center; }
.picture-actions a, .picture-actions .picture-delete { color: var(--primary); text-decoration: none; background: none; border: none; cursor: pointer; padding: 0.25rem; display: inline-flex; align-items: center; justify-content: center; }
.picture-actions a:hover, .picture-actions .picture-delete:hover { opacity: 0.8; }
.picture-actions .pic-action-icon { display: block; }

/* Dashboard DLD alerts (admin only) */
#dashboard-dld-alerts { margin-top: 0.5rem; }
#dashboard-dld-none { color: var(--text-muted); margin: 0; }
.dashboard-dld-section { margin-bottom: 1.25rem; }
.dashboard-dld-section-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.5rem; }
.dashboard-dld-go-there { color: var(--primary); text-decoration: none; font-size: 0.875rem; font-weight: 500; }
.dashboard-dld-go-there:hover { text-decoration: underline; }
.dashboard-dld-title { font-size: 1rem; font-weight: 600; margin: 0; color: var(--text); }
.dashboard-dld-list { display: flex; flex-direction: column; gap: 0.5rem; }
.dashboard-dld-card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 0.6rem 0.85rem; font-size: 0.8125rem; }
.dashboard-dld-card-line { margin: 0 0 0.2rem; }
.dashboard-dld-card-line:last-child { margin-bottom: 0; }
.dashboard-dld-card-props { margin-top: 0.25rem; color: var(--text-muted); font-size: 0.75rem; }
.dashboard-notif-card { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 0.6rem 0.85rem; font-size: 0.8125rem; }
.dashboard-notif-card-content { flex: 1; min-width: 0; }
.dashboard-notif-card-content .dashboard-dld-card-line { margin: 0 0 0.2rem; }
.dashboard-notif-go-there { flex-shrink: 0; }

@media (max-width: 768px) {
  .hero { flex: 0 0 32vh; min-height: 160px; }
  .auth-form .row { flex-direction: column; gap: 0; }
}
