/* Property Planets – ProductivityTask-inspired UI (light/dark) */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
  --bg: #f0f4f8;
  --bg-card: #ffffff;
  --text: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --accent: #0ea5e9;
  --accent-hover: #0284c7;
  --accent-muted: rgba(14, 165, 233, 0.12);
  --accent-strip: #0ea5e9;
  --danger: #dc2626;
  --success: #10b981;
  --success-muted: rgba(16, 185, 129, 0.15);
  --code-bg: #f1f5f9;
  --header-bg: #ffffff;
  --header-border: #e2e8f0;
  --header-shadow: 0 1px 3px rgba(0,0,0,0.06);
  --input-bg: #ffffff;
  --shadow: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --radius: 12px;
  --radius-sm: 8px;
  --footer-bg: #f8fafc;
  --footer-text: #64748b;
  --footer-border: #e2e8f0;
}

[data-theme="dark"] {
  --bg: #0c1222;
  --bg-card: #151b2d;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --border: #334155;
  --accent: #38bdf8;
  --accent-hover: #7dd3fc;
  --accent-muted: rgba(56, 189, 248, 0.18);
  --accent-strip: #38bdf8;
  --danger: #ef4444;
  --success: #34d399;
  --success-muted: rgba(52, 211, 153, 0.2);
  --code-bg: #1e293b;
  --header-bg: #151b2d;
  --header-border: #334155;
  --header-shadow: 0 1px 3px rgba(0,0,0,0.4);
  --input-bg: #0f172a;
  --shadow: 0 1px 3px rgba(0,0,0,0.25);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.3);
  --footer-bg: #0c1222;
  --footer-text: #94a3b8;
  --footer-border: #334155;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Plus Jakarta Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
}

/* ========== Header ========== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  border-bottom: 1px solid var(--header-border);
  box-shadow: var(--header-shadow);
  padding: 0 1.5rem;
  min-height: 72px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
}

.app-header .header-brand {
  justify-self: start;
}

.header-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 1.3125rem;
  letter-spacing: -0.03em;
  padding: 0.375rem 0.5rem 0.375rem 0.375rem;
  margin: 0 -0.375rem;
  border-radius: var(--radius-sm);
  transition: color 0.2s, background 0.2s, transform 0.1s;
}

.header-brand:hover {
  color: var(--accent);
  background: var(--accent-muted);
}

.header-brand:active {
  transform: scale(0.98);
}

.header-brand-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
}

.header-brand img.header-brand-icon {
  vertical-align: middle;
}

.header-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  flex-wrap: wrap;
  justify-self: center;
  padding: 0.25rem;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.03);
}

[data-theme="dark"] .header-nav {
  background: rgba(255, 255, 255, 0.04);
}

.header-nav a {
  padding: 0.5rem 1rem;
  border-radius: 8px;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9375rem;
  transition: color 0.2s, background 0.2s, box-shadow 0.2s;
  position: relative;
}

.header-nav a:hover {
  color: var(--accent);
  background: var(--accent-muted);
}

.header-nav a.active {
  color: var(--accent);
  background: var(--accent-muted);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(14, 165, 233, 0.15);
}

[data-theme="dark"] .header-nav a.active {
  box-shadow: 0 1px 2px rgba(56, 189, 248, 0.2);
}

.header-nav a.active::after {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0.25rem;
  width: 20px;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0;
  justify-self: end;
  min-height: 40px;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 9999px;
  padding: 0 0.35rem 0 0.6rem;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

[data-theme="dark"] .header-actions {
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.header-actions-divider {
  width: 1px;
  height: 20px;
  background: var(--border);
  flex-shrink: 0;
  margin: 0 0.5rem;
}

.header-user {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.5rem 0.35rem 0.4rem;
  border-radius: 9999px;
  background: transparent;
  color: var(--accent);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.header-user::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  flex-shrink: 0;
  box-shadow: 0 0 0 2px var(--success-muted);
}

.header-actions-tools {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.theme-btn {
  width: 36px;
  height: 36px;
  border-radius: 9999px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, background 0.2s, transform 0.1s;
}

.theme-btn:hover {
  background: var(--border);
  color: var(--text);
}

.theme-btn:active {
  transform: scale(0.94);
}

.header-actions .btn,
.header-actions .logout-btn {
  height: 36px;
  padding: 0 1rem;
  border-radius: 9999px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, background 0.2s;
  font-family: inherit;
}

.header-actions .btn:hover,
.header-actions .logout-btn:hover {
  background: var(--border);
  color: var(--text);
}

.header-actions .btn.logout-btn--emphasis:hover {
  background: rgba(220, 38, 38, 0.12);
  color: var(--danger);
}

/* Minimal header (auth pages) */
.header-minimal .header-nav {
  margin-left: auto;
}

.header-minimal .header-nav a {
  padding: 0.5rem 1rem;
}

/* ========== Main content ========== */
main {
  flex: 1;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem;
  width: 100%;
}

/* Wider layout for list/database pages (e.g. Properties) */
.container--wide {
  max-width: 1800px;
}

/* ========== Hero / Section (ProductivityTask-style) ========== */
.page-hero {
  margin-bottom: 2rem;
  display: flex;
  align-items: flex-start;
  gap: 2rem;
  flex-wrap: wrap;
}

.hero-content {
  flex: 1;
  min-width: 0;
}

.hero-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

/* Dashboard date & time block */
.dashboard-datetime-wrap {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
  padding: 1rem 1.35rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.dashboard-datetime-icon {
  width: 2.5rem;
  height: 2.5rem;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  background: var(--accent-muted);
  color: var(--accent);
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpolyline points='12 6 12 12 16 14'/%3E%3C/svg%3E");
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpolyline points='12 6 12 12 16 14'/%3E%3C/svg%3E");
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
}

.dashboard-datetime-inner {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.dashboard-datetime-date {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
}

.dashboard-datetime-time {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 700px) {
  .page-hero {
    flex-direction: column;
    gap: 1.25rem;
  }
  .dashboard-datetime-wrap {
    align-self: flex-end;
  }
}

@media (max-width: 480px) {
  .dashboard-datetime-wrap {
    padding: 0.875rem 1rem;
    gap: 0.75rem;
    align-self: stretch;
  }
  .dashboard-datetime-icon {
    width: 2rem;
    height: 2rem;
  }
  .dashboard-datetime-time {
    font-size: 1.25rem;
  }
}

/* Dashboard recent properties section */
.dashboard-recent {
  border-left: 4px solid var(--accent-strip);
}

.dashboard-recent-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.dashboard-recent-header .section-title {
  margin-bottom: 0;
}

.dashboard-recent-wrap {
  position: relative;
}

.dashboard-recent-loading {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.dashboard-recent-empty {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.dashboard-recent-empty a {
  color: var(--accent);
  text-decoration: none;
}

.dashboard-recent-empty a:hover {
  text-decoration: underline;
}

.dashboard-recent-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.dashboard-recent-table th,
.dashboard-recent-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.dashboard-recent-table th {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--bg);
}

.dashboard-recent-table tbody tr:last-child td {
  border-bottom: none;
}

.dashboard-recent-table tbody tr:hover td {
  background: var(--bg);
}

.dashboard-recent-table td a {
  white-space: nowrap;
}

@media (max-width: 640px) {
  .dashboard-recent-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .dashboard-recent-table th:nth-child(2),
  .dashboard-recent-table td:nth-child(2) {
    display: none;
  }
  .dashboard-recent-table th,
  .dashboard-recent-table td {
    padding: 0.6rem 0.75rem;
    font-size: 0.875rem;
  }
}

.hero-title {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  margin: 0 0 0.5rem;
  line-height: 1.2;
}

.hero-tagline {
  font-size: 1.0625rem;
  color: var(--text-muted);
  margin: 0 0 1.25rem;
  max-width: 540px;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
  transition: background 0.2s, transform 0.1s;
}

.hero-cta:hover {
  background: var(--accent-hover);
  color: #fff;
}

.hero-cta:active {
  transform: scale(0.98);
}

/* ========== Cards ========== */
/* Modal overlay */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  cursor: pointer;
}
.modal-content {
  position: relative;
  max-width: 420px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-content label {
  display: block;
  margin-top: 0.75rem;
  margin-bottom: 0.25rem;
}
.modal-content input[type="email"],
.modal-content input[type="tel"],
.modal-content input[type="password"] {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--input-bg);
  color: var(--text);
}
.modal-content .form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.card--accent {
  border-left: 0px solid var(--accent-strip);
}

.card h2 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Quick-action / feature cards grid */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.card-tile {
  display: block;
  padding: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.card-tile:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}

.card-tile-title {
  font-weight: 600;
  font-size: 1rem;
  margin: 0 0 0.25rem;
}

.card-tile-count {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--accent);
  margin-left: 0.35rem;
}

.card-tile-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0;
}

.card-tile-arrow {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  color: var(--accent);
  font-weight: 500;
}

/* ========== Badges / Pills ========== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge--success {
  background: var(--success-muted);
  color: var(--success);
}

.badge--muted {
  background: var(--accent-muted);
  color: var(--accent);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* ========== Section titles ========== */
.section-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 1rem;
}

/* Monospace for IDs / code-like */
.mono {
  font-family: 'SF Mono', 'Consolas', 'Monaco', monospace;
  font-size: 0.875em;
}

/* ========== Auth pages (Login / Register) ========== */
.auth-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: min(60vh, 520px);
  padding: 2rem 1.5rem;
}

.auth-page .container {
  width: 100%;
  max-width: 420px;
  margin: 0;
  padding: 0;
}

.auth-hero {
  text-align: center;
  margin-bottom: 1.75rem;
}

.auth-hero .auth-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.auth-hero .auth-title {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  margin: 0 0 0.35rem;
  line-height: 1.2;
}

.auth-hero .auth-tagline {
  font-size: 0.9375rem;
  color: var(--text-muted);
  margin: 0;
}

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 1.75rem;
  border-left: 4px solid var(--accent-strip);
}

.auth-card form label {
  margin-bottom: 0.3rem;
}

.auth-card form input {
  max-width: none;
  margin-bottom: 1.25rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
}

.auth-card form input:last-of-type {
  margin-bottom: 1.5rem;
}

.auth-card .form-actions {
  margin-top: 1.5rem;
}

.auth-card .btn-primary {
  width: 100%;
  padding: 0.75rem 1.25rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
}

.auth-links {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.auth-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  transition: color 0.2s;
}

.auth-links a:hover {
  color: var(--accent-hover);
}

.auth-links a.secondary {
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 400;
}

.auth-links a.secondary:hover {
  color: var(--text);
}

/* Register: two-column name fields on larger screens */
.auth-card .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.auth-card .form-row .form-group {
  margin-bottom: 0;
}

.auth-card .form-row label,
.auth-card .form-row input {
  margin-bottom: 0;
}

.auth-card .form-row + label,
.auth-card .form-row + .form-row {
  margin-top: 0;
}

.auth-card .form-group {
  margin-bottom: 1.25rem;
}

.auth-card .form-group:last-of-type {
  margin-bottom: 1.5rem;
}

@media (max-width: 480px) {
  .auth-card .form-row {
    grid-template-columns: 1fr;
  }
  .auth-card .form-row input {
    margin-bottom: 1.25rem;
  }
}

/* ========== Form page (Add Property / Edit) ========== */
.form-card {
  border-left: 0px solid var(--accent-strip);
  padding: 1.85rem 2rem;
  /* max-width: 640px; */
}

.form-card-back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9375rem;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 1rem;
  font-weight: 500;
  transition: color 0.2s;
}

.form-card-back:hover {
  color: var(--accent);
}

.form-card .section-title {
  margin-bottom: 0.5rem;
}

.form-card-intro {
  color: var(--text-muted);
  font-size: 0.9375rem;
  margin: 0 0 1.5rem;
  line-height: 1.5;
}

.form-card #alert {
  margin-bottom: 1.25rem;
}

.add-form .form-section {
  border: none;
  padding: 0;
  margin: 0 0 1.75rem;
}

.add-form .form-section-legend {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 1rem;
  padding: 0;
}

.add-form .form-group {
  margin-bottom: 1.25rem;
}

.add-form .form-group:last-child {
  margin-bottom: 0;
}

.add-form .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.add-form .form-row .form-group {
  margin-bottom: 0;
}

.add-form .form-row + .form-actions,
.add-form .form-section + .form-section .form-group:first-child {
  margin-top: 0;
}

.add-form label {
  display: block;
  margin-bottom: 0.375rem;
  font-weight: 500;
  font-size: 0.9375rem;
  color: var(--text);
}

.add-form input,
.add-form select {
  width: 100%;
  max-width: none;
  padding: 0.75rem 1rem;
  margin-bottom: 0;
  height: 2.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--input-bg);
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.add-form input:focus,
.add-form select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-muted);
}

.add-form .form-hint {
  display: block;
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

.add-form .form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.add-form .form-actions .btn--submit {
  padding: 0.75rem 1.5rem;
  font-weight: 600;
}

@media (max-width: 560px) {
  .form-card {
    padding: 1.25rem 1rem;
  }
  .add-form .form-row {
    grid-template-columns: 1fr;
  }
  .add-form .form-row .form-group {
    margin-bottom: 1.25rem;
  }
  .add-form .form-row .form-group:last-child {
    margin-bottom: 0;
  }
  .add-form .form-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .add-form .form-actions .btn--submit {
    width: 100%;
  }
}

/* ========== Footer ========== */
.app-footer {
  position: relative;
  margin-top: auto;
  background: var(--footer-bg);
  border-top: 1px solid var(--footer-border);
  padding: 2.5rem 1.5rem 1.75rem;
  box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.12);
}

.app-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 140px;
  height: 3px;
  border-radius: 9999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover));
  opacity: 0.9;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 2.5rem;
  align-items: start;
}

.footer-brand {
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.02em;
  color: var(--text);
}

.footer-brand span {
  color: var(--accent);
}

.footer-tagline {
  margin: 0.35rem 0 0;
  font-size: 0.875rem;
  color: var(--footer-text);
  font-weight: 500;
  max-width: 360px;
  line-height: 1.5;
}

.footer-nav {
  display: flex;
  gap: 2.5rem;
  flex-wrap: wrap;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 7rem;
}

.footer-heading {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
  display: block;
}

.footer-links a {
  color: var(--footer-text);
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--accent);
}

.footer-bottom {
  max-width: 1200px;
  margin: 2rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--footer-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-copyright {
  font-size: 0.8125rem;
  color: var(--footer-text);
  line-height: 1.5;
}

.footer-copyright .footer-dev-link {
  color: var(--footer-text);
  text-decoration: none;
  font-weight: 500;
}

.footer-copyright .footer-dev-link:hover {
  color: var(--accent);
  text-decoration: underline;
}

.footer-legal {
  display: flex;
  gap: 1.25rem;
}

.footer-legal a {
  font-size: 0.8125rem;
  color: var(--footer-text);
  text-decoration: none;
}

.footer-legal a:hover {
  color: var(--accent);
}

/* Footer trust badges */
.footer-trust {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 1.25rem 0 0;
  margin-top: 1.5rem;
  border-top: 1px solid var(--footer-border);
}

.footer-trust span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.875rem;
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--footer-text);
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid var(--footer-border);
}

[data-theme="dark"] .footer-trust span {
  background: rgba(255, 255, 255, 0.04);
}

@media (max-width: 768px) {
  .app-footer {
    padding: 2rem 1rem 1.5rem;
  }
  .footer-inner {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 2rem;
  }
  .footer-nav {
    justify-content: center;
  }
  .footer-links {
    min-width: auto;
    align-items: center;
  }
  .footer-bottom {
    flex-direction: column;
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
  }
  .footer-copyright {
    text-align: center;
  }
  .footer-trust {
    margin-top: 1.25rem;
    padding-top: 1rem;
    gap: 0.5rem;
  }
  .footer-trust span {
    font-size: 0.75rem;
    padding: 0.35rem 0.65rem;
  }
}

/* ========== Forms ========== */
form label {
  display: block;
  margin-bottom: 0.375rem;
  font-weight: 500;
  font-size: 0.9375rem;
  color: var(--text);
}

form input,
form select {
  width: 100%;
  max-width: 400px;
  padding: 0.625rem 0.875rem;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--input-bg);
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

form input:focus,
form select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-muted);
}

/* ========== Buttons ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: background 0.15s, transform 0.1s;
  font-family: inherit;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  background: var(--input-bg);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--border);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-danger:hover {
  opacity: 0.92;
}

.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.875rem;
}

/* ========== Alerts ========== */
.alert {
  padding: 0.875rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: 0.9375rem;
}

.alert-error {
  background: rgba(220, 38, 38, 0.1);
  color: var(--danger);
  border: 1px solid rgba(220, 38, 38, 0.25);
}

.alert-success {
  background: rgba(22, 163, 74, 0.1);
  color: var(--success);
  border: 1px solid rgba(22, 163, 74, 0.25);
}

/* ========== Tables ========== */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--bg);
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: var(--bg);
}

/* ========== User Management page ========== */
.card--users .card-header {
  margin-bottom: 1.25rem;
}
.card--users .card-header h2 {
  margin-bottom: 0.35rem;
}
.card--users .card-description {
  font-size: 0.9375rem;
  color: var(--text-muted);
  margin: 0;
  max-width: 52ch;
}
.users-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
}
.users-table-wrap table {
  width: 100%;
  border-collapse: collapse;
}
.users-table-wrap th,
.users-table-wrap td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.users-table-wrap th {
  font-weight: 600;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  background: var(--bg);
}
.users-table-wrap tbody tr {
  transition: background 0.15s ease;
}
.users-table-wrap tbody tr:hover td {
  background: var(--bg);
}
.users-table-wrap tbody tr:last-child td {
  border-bottom: none;
}
.users-table-wrap .td-username {
  font-weight: 600;
  color: var(--text);
}
.users-table-wrap .table-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: nowrap;
}
.users-table-wrap .table-actions .btn {
  padding: 0.4rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  min-height: 32px;
  border-radius: 6px;
}
.users-table-wrap .table-actions .btn-secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}
.users-table-wrap .table-actions .btn-secondary:hover {
  background: var(--accent-muted);
  border-color: var(--accent);
}
.users-table-wrap .table-actions .btn-danger {
  background: rgba(220, 38, 38, 0.12);
  color: var(--danger);
  border: 1px solid rgba(220, 38, 38, 0.35);
}
[data-theme="dark"] .users-table-wrap .table-actions .btn-danger {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
}
.users-table-wrap .table-actions .btn-danger:hover {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}
.badge--role-admin {
  background: var(--accent-muted);
  color: var(--accent);
}
.badge--role-staff {
  background: var(--border);
  color: var(--text-muted);
}
[data-theme="dark"] .badge--role-staff {
  background: var(--code-bg);
  color: var(--text-muted);
}
.badge--theme {
  font-size: 0.6875rem;
  text-transform: capitalize;
  background: var(--bg);
  color: var(--text-muted);
}

/* ========== Pagination ========== */
.pagination {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.pagination button {
  padding: 0.5rem 0.875rem;
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.875rem;
  font-family: inherit;
}

.pagination button:hover:not(:disabled) {
  background: var(--border);
}

.pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pagination span {
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* Properties page: toolbar + filter + table */
.properties-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.properties-toolbar .section-label {
  margin-bottom: 0;
}

.properties-toolbar .section-title {
  margin-bottom: 0;
}

.properties-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.properties-toolbar-actions .btn-export {
  flex-shrink: 0;
}

.properties-toolbar-actions a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  font-weight: 500;
  font-size: 0.9375rem;
  text-decoration: none;
  transition: background 0.2s;
}

.properties-toolbar-actions a:hover {
  background: var(--accent-hover);
  color: #fff;
}

/* Filter bar (enhanced) */
.filter-bar {
  margin-bottom: 1.25rem;
  position: relative;
  z-index: 1;
  padding: 1.25rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.filter-bar-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.filter-bar-controls {
  display: flex;
  gap: 0.875rem;
  flex-wrap: wrap;
  align-items: stretch;
}

.filter-bar-search-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
}

.filter-bar-search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.125rem;
  height: 1.125rem;
  pointer-events: none;
  opacity: 0.5;
  background: currentColor;
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
}

.filter-bar-search-wrap input {
  width: 100%;
  height: 2.75rem;
  padding: 0 1rem 0 2.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--input-bg);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9375rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.filter-bar-search-wrap input::placeholder {
  color: var(--text-muted);
}

.filter-bar-search-wrap input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-muted);
}

.filter-bar-filters {
  display: flex;
  gap: 0.625rem;
  flex-shrink: 0;
}

.filter-bar select {
  height: 2.75rem;
  min-width: 150px;
  padding: 0 2rem 0 0.875rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--input-bg);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9375rem;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

[data-theme="dark"] .filter-bar select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

.filter-bar select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-muted);
}

.filter-bar-submit {
  height: 2.75rem;
  padding: 0 1.5rem;
  white-space: nowrap;
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: background 0.2s, transform 0.1s;
}

.filter-bar-submit:hover {
  transform: translateY(-1px);
}

.filter-bar-submit:active {
  transform: translateY(0);
}

/* Import from Excel (admin) */
.import-section {
  margin-bottom: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.import-section-inner {
  padding: 1.25rem 1.5rem;
}

.import-section-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.import-section-icon {
  font-size: 1.5rem;
  line-height: 1;
  opacity: 0.9;
}

.import-section-title {
  margin: 0 0 0.25rem 0;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.import-section-desc {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.45;
  max-width: 56ch;
}

.import-form {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.import-form input[type="file"] {
  font-size: 0.875rem;
  padding: 0.5rem 0;
  color: var(--text);
}

.import-form input[type="file"]::file-selector-button {
  padding: 0.5rem 1rem;
  margin-right: 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.import-result {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  border-radius: var(--radius-sm);
}

.import-result--success {
  background: var(--success-muted);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.import-result--error {
  background: rgba(220, 38, 38, 0.1);
  color: var(--danger);
  border: 1px solid rgba(220, 38, 38, 0.25);
}

.import-result-errors {
  margin: 0.5rem 0 0 0;
  padding-left: 1.25rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* Visually hidden (screen readers) */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Quick search bar */
.search-bar-wrap {
  margin-bottom: 1rem;
}
.search-bar-input {
  width: 100%;
  max-width: 28rem;
  padding: 0.625rem 1rem;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text);
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search-bar-input::placeholder {
  color: var(--text-muted);
}
.search-bar-input:hover {
  border-color: var(--accent);
}
.search-bar-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-muted);
}

/* Search Builder */
.search-builder {
  margin-bottom: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.search-builder-header {
  padding: 1.25rem 1.5rem;
  background: linear-gradient(135deg, var(--accent-muted) 0%, transparent 60%);
  border-bottom: 1px solid var(--border);
}

.search-builder-header-inner {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.search-builder-icon {
  font-size: 1.5rem;
  line-height: 1;
  opacity: 0.9;
}

.search-builder-title {
  margin: 0 0 0.25rem 0;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.search-builder-desc {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.45;
  max-width: 42ch;
}

.search-builder-badge {
  margin-left: auto;
  flex-shrink: 0;
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-muted);
  border-radius: 999px;
}

.search-builder-rows {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 1rem 1.5rem 0.75rem;
}

.search-builder-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  margin-bottom: 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-builder-row:hover {
  border-color: var(--accent-muted);
}

.search-builder-row:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-muted);
}

.search-builder-logic-wrap {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.search-builder-logic-placeholder {
  width: 3.25rem;
  display: inline-block;
}

.search-builder-logic {
  min-width: 4.25rem;
  height: 2.5rem;
  padding: 0 0.5rem;
  font-size: 0.8125rem;
  font-weight: 500;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.search-builder-logic:hover,
.search-builder-logic:focus {
  border-color: var(--accent);
  outline: none;
}

.search-builder-fields {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.search-builder-column,
.search-builder-operator {
  min-width: 140px;
  height: 2.5rem;
  padding: 0 0.75rem;
  font-size: 0.875rem;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.2s;
}

.search-builder-column:hover,
.search-builder-operator:hover,
.search-builder-column:focus,
.search-builder-operator:focus {
  border-color: var(--accent);
  outline: none;
}

.search-builder-value-cell {
  flex: 1;
  min-width: 140px;
  max-width: 260px;
}

.search-builder-value-input,
.search-builder-value-select {
  width: 100%;
  height: 2.5rem;
  padding: 0 0.75rem;
  font-size: 0.875rem;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  transition: border-color 0.2s;
}

.search-builder-value-input:hover,
.search-builder-value-input:focus,
.search-builder-value-select:hover,
.search-builder-value-select:focus {
  border-color: var(--accent);
  outline: none;
}

.search-builder-value-input::placeholder {
  color: var(--text-muted);
}

.search-builder-value-muted {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.search-builder-remove {
  width: 2.25rem;
  height: 2.5rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  line-height: 1;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.search-builder-remove span {
  display: block;
  margin-top: -0.15em;
}

.search-builder-remove:hover {
  color: var(--danger);
  background: rgba(220, 38, 38, 0.1);
  border-color: rgba(220, 38, 38, 0.2);
}

.search-builder-remove:focus {
  outline: none;
  color: var(--danger);
  background: rgba(220, 38, 38, 0.12);
}

.search-builder-add-wrap {
  padding: 0 1.5rem 0.5rem;
}

.search-builder-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--accent);
  background: transparent;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.search-builder-add-btn:hover {
  border-color: var(--accent);
  background: var(--accent-muted);
  color: var(--accent-hover);
}

.search-builder-add-btn:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-muted);
}

.search-builder-add-icon {
  font-size: 1.125rem;
  line-height: 1;
  font-weight: 300;
}

.search-builder-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.5rem 1.25rem;
  border-top: 1px solid var(--border);
  background: var(--bg);
  flex-wrap: wrap;
}

.search-builder-actions .btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.625rem 1.375rem;
  font-weight: 600;
}

/* Table (properties list) */
.properties-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
}

.properties-table-wrap table {
  width: 100%;
  border-collapse: collapse;
}

.properties-table-wrap th,
.properties-table-wrap td {
  padding: 0.875rem 1.125rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.9375rem;
}

.properties-table-wrap th {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--bg);
  white-space: nowrap;
}

.properties-table-wrap tbody tr {
  transition: background 0.15s;
}

.properties-table-wrap tbody tr:hover td {
  background: var(--bg);
}

.properties-table-wrap tbody tr:last-child td {
  border-bottom: none;
}

/* Bulk selection (admin) */
.bulk-action-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
  background: var(--accent-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  flex-wrap: wrap;
}

.bulk-action-bar-count {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
}

.properties-table-wrap .th-select,
.properties-table-wrap .td-select {
  width: 2.75rem;
  padding-left: 0.875rem;
  padding-right: 0.5rem;
  vertical-align: middle;
  text-align: center;
}

.properties-table-wrap .th-select input[type="checkbox"],
.properties-table-wrap .td-select input[type="checkbox"] {
  width: 1.125rem;
  height: 1.125rem;
  margin: 0;
  cursor: pointer;
  accent-color: var(--accent);
}

.table-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: nowrap;
}

.table-actions .btn,
.table-actions a.btn {
  padding: 0.4rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  min-height: 32px;
  border-radius: 6px;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}

/* View = primary action (accent outline) */
.table-actions .btn-action-view,
.table-actions a.btn-secondary.btn-sm {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.table-actions .btn-action-view:hover,
.table-actions a.btn-secondary.btn-sm:hover {
  background: var(--accent-muted);
  color: var(--accent);
  border-color: var(--accent);
}

/* Delete = destructive, subtle so it doesn't overpower */
.table-actions .btn-danger.btn-sm {
  background: rgba(220, 38, 38, 0.12);
  color: var(--danger);
  border: 1px solid rgba(220, 38, 38, 0.35);
}

.table-actions .btn-danger.btn-sm:hover {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 3rem 2rem;
  background: var(--bg);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.empty-state-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  opacity: 0.6;
}

.empty-state h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0 0 0.35rem;
  color: var(--text);
}

.empty-state p {
  font-size: 0.9375rem;
  color: var(--text-muted);
  margin: 0 0 1.25rem;
}

.empty-state .btn {
  padding: 0.5rem 1.25rem;
}

/* Pagination (enhanced for properties) */
.pagination-info {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-right: 0.5rem;
}

.pagination .pagination-current {
  font-weight: 600;
  color: var(--accent);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
  .container { padding: 1rem; }
  .app-header {
    padding: 0 1rem;
    min-height: 60px;
    gap: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
  }
  .app-header .header-brand { order: 1; }
  .header-actions { order: 2; }
  .header-nav {
    order: 3;
    width: 100%;
    justify-content: center;
    padding: 0.35rem 0 0;
    margin-top: 0.25rem;
    border-top: 1px solid var(--border);
  }
  .header-brand { font-size: 1.125rem; }
  .header-brand-icon { width: 34px; height: 34px; }
  .header-nav a { padding: 0.45rem 0.65rem; font-size: 0.875rem; }
  .header-nav a.active::after { left: 0.5rem; right: 0.5rem; bottom: 0.3rem; }
  .header-actions { padding: 0 0.25rem 0 0.5rem; min-height: 36px; }
  .header-user { font-size: 0.75rem; }
  .header-user::before { width: 5px; height: 5px; }
  .theme-btn { width: 34px; height: 34px; }
  .header-actions .logout-btn { padding: 0 0.75rem; font-size: 0.75rem; height: 34px; }
  .footer-inner { padding: 0; }
  th, td { padding: 0.6rem 0.75rem; font-size: 0.875rem; }
  .properties-toolbar { flex-direction: column; align-items: flex-start; }
  .filter-bar { padding: 1rem; }
  .filter-bar-controls { flex-direction: column; gap: 0.75rem; }
  .filter-bar-search-wrap { min-width: 100%; }
  .filter-bar-filters { flex-wrap: wrap; }
  .filter-bar select { min-width: 0; flex: 1; }
  .filter-bar-submit { width: 100%; }
  .search-builder-header,
  .search-builder-rows,
  .search-builder-add-wrap,
  .search-builder-actions { padding-left: 1rem; padding-right: 1rem; }
  .search-builder-header-inner { flex-wrap: wrap; }
  .search-builder-badge { margin-left: 0; margin-top: 0.25rem; }
  .search-builder-row { flex-direction: column; align-items: stretch; }
  .search-builder-fields { flex-direction: column; align-items: stretch; }
  .search-builder-value-cell { max-width: none; }
  .search-builder-actions { flex-direction: column; align-items: stretch; }
  .search-builder-actions .btn { width: 100%; justify-content: center; }
  .properties-table-wrap th,
  .properties-table-wrap td { padding: 0.6rem 0.75rem; font-size: 0.875rem; }
}
