/* ============================================================
   PROPERTIX-360 — Design System v1.6
   Sidebar + Topbar SaaS layout, clean light theme
   ============================================================ */

/* ── 1. FONTS ─────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  /* Palette */
  --brand-900:   #064e3b;
  --brand-800:   #065f46;
  --brand-700:   #047857;
  --brand-600:   #059669;
  --brand-accent:#10b981;
  --brand-accent-hover: #059669;
  --brand-accent-light: #ecfdf5;

  /* Sidebar */
  --sidebar-width: 240px;
  --sidebar-bg:    var(--brand-900);
  --sidebar-text:  #a7f3d0;
  --sidebar-hover-bg: rgba(255,255,255,.06);
  --sidebar-hover-text: #e2e8f0;
  --sidebar-active-bg: rgba(16,185,129,.18);
  --sidebar-active-text: #ffffff;
  --sidebar-active-border: var(--brand-accent);
  --sidebar-group-label: #6ee7b7;
  --sidebar-subgroup-label: #475569;
  --sidebar-divider: rgba(255,255,255,.06);
  --sidebar-border: transparent;
  --sidebar-submenu-bg: rgba(0,0,0,.15);
  --sidebar-brand-strong: #ffffff;
  --sidebar-brand-logo: #ffffff;
  --sidebar-scrollbar: var(--brand-700);

  /* Topbar */
  --topbar-height: 60px;
  --topbar-bg:     #ffffff;
  --topbar-border: #e2e8f0;
  --topbar-text:   var(--text-heading);
  --topbar-icon:   var(--text-muted);

  /* Page */
  --page-bg:       #f1f5f9;
  --content-max:   1400px;

  /* Cards */
  --card-bg:       #ffffff;
  --card-border:   #e2e8f0;
  --card-radius:   12px;
  --card-shadow:   0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.04);
  --card-shadow-md:0 4px 12px rgba(0,0,0,.08), 0 2px 4px rgba(0,0,0,.04);

  /* Text */
  --text-heading:  #0f172a;
  --text-body:     #334155;
  --text-muted:    #64748b;
  --text-subtle:   #94a3b8;

  /* Accents for stat cards */
  --stat-blue:     #3b82f6;
  --stat-green:    #10b981;
  --stat-amber:    #f59e0b;
  --stat-red:      #ef4444;
  --stat-purple:   #8b5cf6;
  --stat-teal:     #14b8a6;

  /* Inputs */
  --input-border:  #cbd5e1;
  --input-focus:   var(--brand-accent);
  --input-radius:  8px;

  /* Buttons */
  --btn-primary-bg:           var(--brand-accent);
  --btn-primary-hover:        var(--brand-accent-hover);
  --btn-primary-shadow:       rgba(59,130,246,.25);
  --btn-primary-shadow-hover: rgba(59,130,246,.35);

  /* Status badges */
  --badge-success-bg:   var(--stat-green);
  --badge-success-text: #fff;
  --badge-muted-bg:     #f1f5f9;
  --badge-muted-text:   var(--text-muted);

  /* Tables */
  --table-head-bg:   linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  --table-head-text: var(--text-muted);

  /* Transitions */
  --transition: 0.18s ease;
}

/* ── 1b. NAVY THEME (toggle via html[data-theme="navy"]) ──── */
[data-theme="navy"] {
  --brand-900: #14304F;
  --brand-800: #1e3a5f;
  --brand-700: #2c4a6e;
  --brand-600: #64748b;
  --brand-accent: #2563eb;
  --brand-accent-hover: #1d4ed8;
  --brand-accent-light: #eff6ff;

  --sidebar-bg: #f1f5f9;
  --sidebar-text: #475569;
  --sidebar-hover-bg: rgba(15,23,42,.05);
  --sidebar-hover-text: #0f172a;
  --sidebar-active-bg: #dbeafe;
  --sidebar-active-text: #1d4ed8;
  --sidebar-active-border: #2563eb;
  --sidebar-group-label: #94a3b8;
  --sidebar-subgroup-label: #94a3b8;
  --sidebar-divider: #e2e8f0;
  --sidebar-border: #e2e8f0;
  --sidebar-submenu-bg: rgba(15,23,42,.03);
  --sidebar-brand-strong: #1f2937;
  --sidebar-brand-logo: #14304F;
  --sidebar-scrollbar: #cbd5e1;

  --topbar-bg: #14304F;
  --topbar-border: #14304F;
  --topbar-text: #ffffff;
  --topbar-icon: #cbd5e1;

  --page-bg: #f8fafc;

  --text-heading: #1f2937;
  --text-body: #374151;
  --text-muted: #64748b;

  --input-focus: #2563eb;

  --btn-primary-bg: #14304F;
  --btn-primary-hover: #0f2640;
  --btn-primary-shadow: rgba(20,48,79,.25);
  --btn-primary-shadow-hover: rgba(20,48,79,.35);

  --badge-success-bg: #d1fae5;
  --badge-success-text: #047857;
  --badge-muted-bg: #e2e8f0;
  --badge-muted-text: #64748b;
}

/* ── 2. BASE RESETS ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  color: var(--text-body);
  background: var(--page-bg);
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--text-heading);
  font-weight: 600;
  letter-spacing: -0.01em;
}

a { color: var(--brand-accent); }
a:hover { color: var(--brand-accent-hover); }

/* ── 3. APP SHELL ─────────────────────────────────────────── */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

/* ── 4. SIDEBAR ───────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 1000;
  transition: transform var(--transition);
  overflow-y: auto;
  overflow-x: hidden;
}

/* Scrollbar in sidebar */
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--sidebar-scrollbar); border-radius: 2px; }

/* Logo area */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px 16px;
  border-bottom: 1px solid var(--sidebar-divider);
  text-decoration: none;
  flex-shrink: 0;
}
.sidebar-brand img {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  object-fit: cover;
}
.sidebar-brand-icon {
  width: 38px;
  height: 38px;
  color: var(--sidebar-brand-logo);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sidebar-brand-icon svg {
  width: 38px;
  height: 38px;
}
.sidebar-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.sidebar-brand-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--sidebar-brand-strong);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.sidebar-brand-sub {
  font-size: 10px;
  color: var(--sidebar-text);
  font-weight: 400;
}

/* Nav groups */
.sidebar-nav {
  flex: 1;
  padding: 12px 0;
}

.sidebar-group-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sidebar-group-label);
  padding: 14px 20px 4px;
  user-select: none;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 400;
  border-left: 3px solid transparent;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  white-space: nowrap;
}
.sidebar-item i {
  font-size: 15px;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
  opacity: 0.7;
}
.sidebar-item:hover {
  background: var(--sidebar-hover-bg);
  color: var(--sidebar-hover-text);
  border-left-color: transparent;
  text-decoration: none;
}
.sidebar-item:hover i { opacity: 1; }

.sidebar-item.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active-text);
  border-left-color: var(--sidebar-active-border);
  font-weight: 500;
}
.sidebar-item.active i { opacity: 1; }

/* Collapsible sub-menu */
.sidebar-submenu {
  list-style: none;
  padding: 0;
  margin: 0;
  background: var(--sidebar-submenu-bg);
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.sidebar-submenu.open { max-height: 600px; }

.sidebar-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  color: var(--sidebar-text);
  font-size: 13.5px;
  font-weight: 400;
  border-left: 3px solid transparent;
  cursor: pointer;
  user-select: none;
  transition: background var(--transition), color var(--transition);
  width: 100%;
  background: none;
  border-top: none;
  border-right: none;
  border-bottom: none;
  text-align: left;
}
.sidebar-toggle i.toggle-icon { margin-left: auto; font-size: 11px; transition: transform 0.2s; }
.sidebar-toggle.open i.toggle-icon { transform: rotate(180deg); }
.sidebar-toggle:hover { background: var(--sidebar-hover-bg); color: var(--sidebar-hover-text); }
.sidebar-toggle.active-parent {
  color: var(--sidebar-hover-text);
  border-left-color: rgba(59,130,246,.4);
}
.sidebar-toggle i:not(.toggle-icon) { font-size: 15px; width: 18px; text-align: center; opacity: 0.7; }

.sidebar-subitem {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 20px 7px 48px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 13px;
  transition: background var(--transition), color var(--transition);
}
.sidebar-subitem:hover { background: var(--sidebar-hover-bg); color: var(--sidebar-hover-text); text-decoration: none; }
.sidebar-subitem.active { color: var(--brand-accent); font-weight: 500; }

.sidebar-subgroup-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--sidebar-subgroup-label);
  padding: 8px 20px 2px 48px;
}

/* Sidebar divider */
.sidebar-divider {
  height: 1px;
  background: var(--sidebar-divider);
  margin: 8px 16px;
}

/* User section at bottom of sidebar */
.sidebar-user {
  border-top: 1px solid var(--sidebar-divider);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.sidebar-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--brand-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--sidebar-hover-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-role {
  font-size: 11px;
  color: var(--sidebar-text);
}
.sidebar-logout {
  color: var(--sidebar-text);
  font-size: 16px;
  text-decoration: none;
  padding: 4px;
  border-radius: 6px;
  transition: color var(--transition), background var(--transition);
  display: flex;
  align-items: center;
}
.sidebar-logout:hover { color: #ef4444; background: rgba(239,68,68,.1); }

/* ── 5. MAIN CONTENT AREA ─────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
}

/* ── 6. TOPBAR ────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-height);
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--topbar-border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.topbar-hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--topbar-icon);
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
}
.topbar-title {
  flex: 1;
  font-size: 16px;
  font-weight: 600;
  color: var(--topbar-text);
}
.topbar-theme-btn {
  background: none;
  border: none;
  color: var(--topbar-icon);
  font-size: 17px;
  cursor: pointer;
  padding: 5px 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  transition: color var(--transition), background var(--transition);
}
.topbar-theme-btn:hover {
  color: var(--brand-accent);
  background: var(--brand-accent-light);
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.topbar-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: var(--brand-accent-light);
  color: var(--brand-accent);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

/* ── 7. PAGE CONTENT ──────────────────────────────────────── */
.page-content {
  flex: 1;
  padding: 28px 28px 40px;
  width: 100%;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  gap: 16px;
}
.page-header-left h1, .page-header-left .h1,
.page-header-left h2, .page-header-left .h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 2px;
}
.page-header-left p { color: var(--text-muted); margin: 0; font-size: 13px; }

/* ── 8. FLASH MESSAGES ────────────────────────────────────── */
.flash-container { margin-bottom: 20px; }
.alert {
  border: none !important;
  border-radius: 10px !important;
  font-size: 13.5px;
  padding: 12px 16px !important;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.alert-success { background: #f0fdf4 !important; color: #15803d !important; border-left: 3px solid #22c55e !important; }
.alert-danger  { background: #fef2f2 !important; color: #b91c1c !important; border-left: 3px solid #ef4444 !important; }
.alert-warning { background: #fffbeb !important; color: #92400e !important; border-left: 3px solid #f59e0b !important; }
.alert-info    { background: #eff6ff !important; color: #1d4ed8 !important; border-left: 3px solid #3b82f6 !important; }

/* ── 9. CARDS ─────────────────────────────────────────────── */
.card {
  background: var(--card-bg) !important;
  border: 1px solid var(--card-border) !important;
  border-radius: var(--card-radius) !important;
  box-shadow: var(--card-shadow) !important;
}
.card-header {
  background: var(--card-bg) !important;
  border-bottom: 1px solid var(--card-border) !important;
  padding: 14px 18px !important;
  border-radius: var(--card-radius) var(--card-radius) 0 0 !important;
  font-weight: 600;
  color: var(--text-heading);
  font-size: 14px;
}
.card-body { padding: 18px !important; }
.card-footer {
  background: #f8fafc !important;
  border-top: 1px solid var(--card-border) !important;
  padding: 10px 18px !important;
  font-size: 12px;
  color: var(--text-muted);
  border-radius: 0 0 var(--card-radius) var(--card-radius) !important;
}
.card-body.p-0 { padding: 0 !important; }

/* ── 10. STAT CARDS ───────────────────────────────────────── */
.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: box-shadow var(--transition), transform var(--transition);
  text-decoration: none;
  color: inherit;
}
.stat-card:hover {
  box-shadow: var(--card-shadow-md);
  transform: translateY(-1px);
  text-decoration: none;
  color: inherit;
}
.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.stat-icon.blue   { background: #eff6ff; color: var(--stat-blue);   }
.stat-icon.green  { background: #ecfdf5; color: var(--stat-green);  }
.stat-icon.amber  { background: #fffbeb; color: var(--stat-amber);  }
.stat-icon.red    { background: #fef2f2; color: var(--stat-red);    }
.stat-icon.purple { background: #f5f3ff; color: var(--stat-purple); }
.stat-icon.teal   { background: #f0fdfa; color: var(--stat-teal);   }
.stat-icon.slate  { background: #f8fafc; color: var(--brand-600);   }

.stat-body { flex: 1; min-width: 0; }
.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-heading);
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.stat-label {
  font-size: 12.5px;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 2px;
}
.stat-sub {
  font-size: 12px;
  color: var(--text-subtle);
  margin-top: 4px;
}
.stat-trend {
  font-size: 12px;
  font-weight: 500;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 3px;
}
.stat-trend.up   { color: var(--stat-green); }
.stat-trend.down { color: var(--stat-red);   }

/* ── 11. TABLES ───────────────────────────────────────────── */
.table {
  font-size: 13.5px;
  color: var(--text-body);
  margin-bottom: 0;
}
.table thead th {
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: #f8fafc !important;
  border-bottom: 1px solid var(--card-border) !important;
  padding: 10px 14px !important;
  white-space: nowrap;
}
.table-dark thead th {
  background: var(--brand-800) !important;
  color: #94a3b8 !important;
  border-bottom: 1px solid var(--brand-700) !important;
}
.table tbody td {
  padding: 11px 14px !important;
  border-bottom: 1px solid #f1f5f9 !important;
  vertical-align: middle;
}
.table-hover tbody tr:hover td { background: #f8fafc !important; }
.table tbody tr:last-child td { border-bottom: none !important; }
.table-sm thead th { padding: 7px 10px !important; }
.table-sm tbody td { padding: 7px 10px !important; }

/* ── 12. BUTTONS ──────────────────────────────────────────── */
.btn {
  font-size: 13.5px;
  font-weight: 500;
  border-radius: 8px !important;
  padding: 7px 16px;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-width: 1px !important;
  line-height: 1.4;
}
.btn-sm { font-size: 12px !important; padding: 4px 10px !important; }
.btn-lg { font-size: 15px !important; padding: 10px 22px !important; }

.btn-primary {
  background: var(--btn-primary-bg) !important;
  border-color: var(--btn-primary-bg) !important;
  color: #fff !important;
  box-shadow: 0 1px 3px var(--btn-primary-shadow);
}
.btn-primary:hover {
  background: var(--btn-primary-hover) !important;
  border-color: var(--btn-primary-hover) !important;
  box-shadow: 0 3px 8px var(--btn-primary-shadow-hover);
}
.btn-secondary {
  background: #f1f5f9 !important;
  border-color: var(--card-border) !important;
  color: var(--text-body) !important;
}
.btn-secondary:hover {
  background: #e2e8f0 !important;
  border-color: #cbd5e1 !important;
  color: var(--text-heading) !important;
}
.btn-outline-primary {
  color: var(--brand-accent) !important;
  border-color: var(--brand-accent) !important;
  background: transparent !important;
}
.btn-outline-primary:hover {
  background: var(--brand-accent-light) !important;
  color: var(--brand-accent-hover) !important;
}
.btn-outline-secondary {
  color: var(--text-muted) !important;
  border-color: var(--card-border) !important;
  background: transparent !important;
}
.btn-outline-secondary:hover {
  background: #f1f5f9 !important;
  color: var(--text-body) !important;
}
.btn-success  { background: var(--stat-green)  !important; border-color: var(--stat-green)  !important; color: #fff !important; }
.btn-success:hover { background: #059669 !important; border-color: #059669 !important; }
.btn-danger   { background: var(--stat-red)    !important; border-color: var(--stat-red)    !important; color: #fff !important; }
.btn-danger:hover  { background: #dc2626 !important; border-color: #dc2626 !important; }
.btn-warning  { background: var(--stat-amber)  !important; border-color: var(--stat-amber)  !important; color: #fff !important; }
.btn-outline-danger   { color: var(--stat-red)  !important; border-color: var(--stat-red) !important;  background: transparent !important; }
.btn-outline-danger:hover  { background: #fef2f2 !important; }
.btn-outline-success  { color: var(--stat-green) !important; border-color: var(--stat-green) !important; background: transparent !important; }
.btn-outline-success:hover { background: #ecfdf5 !important; }
.btn-outline-warning  { color: #d97706 !important; border-color: var(--stat-amber) !important; background: transparent !important; }
.btn-outline-info     { color: #0891b2 !important; border-color: #22d3ee !important; background: transparent !important; }
.btn-group .btn { border-radius: 6px !important; }
.btn-group .btn:not(:first-child) { border-left-color: rgba(255,255,255,.2) !important; }

/* ── 13. FORMS ────────────────────────────────────────────── */
.form-control, .form-select {
  border: 1px solid var(--input-border) !important;
  border-radius: var(--input-radius) !important;
  font-size: 13.5px !important;
  padding: 8px 12px !important;
  color: var(--text-body) !important;
  background: #fff !important;
  box-shadow: 0 1px 2px rgba(0,0,0,.04) !important;
  transition: border-color var(--transition), box-shadow var(--transition) !important;
}
.form-control:focus, .form-select:focus {
  border-color: var(--input-focus) !important;
  box-shadow: 0 0 0 3px rgba(59,130,246,.12) !important;
  outline: none !important;
}
.form-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-body);
  margin-bottom: 5px;
}
.form-text { font-size: 12px; color: var(--text-muted); }
.input-group-text {
  border: 1px solid var(--input-border) !important;
  background: #f8fafc !important;
  color: var(--text-muted) !important;
  font-size: 13px !important;
  border-radius: var(--input-radius) !important;
}

/* ── 14. BADGES ───────────────────────────────────────────── */
.badge {
  font-size: 11px !important;
  font-weight: 500 !important;
  padding: 3px 8px !important;
  border-radius: 20px !important;
  letter-spacing: 0.02em;
}
.bg-success  { background: var(--stat-green)  !important; }
.bg-danger   { background: var(--stat-red)    !important; }
.bg-warning  { background: var(--stat-amber)  !important; color: #fff !important; }
.bg-primary  { background: var(--stat-blue)   !important; }
.bg-info     { background: #0ea5e9 !important; }
.bg-secondary{ background: var(--brand-600)   !important; }
.bg-light    { background: #f1f5f9 !important; color: var(--text-muted) !important; }
.badge.bg-light { color: var(--text-muted) !important; border: 1px solid var(--card-border); }
/* Theme-aware status badges (mint Active / muted inactive in Navy) */
.badge.bg-success { background: var(--badge-success-bg) !important; color: var(--badge-success-text) !important; }
.badge.bg-secondary { background: var(--badge-muted-bg) !important; color: var(--badge-muted-text) !important; }
.badge.bg-light { background: var(--badge-muted-bg) !important; color: var(--badge-muted-text) !important; }

/* ── 15. MODALS ───────────────────────────────────────────── */
.modal-content {
  border: none !important;
  border-radius: 14px !important;
  box-shadow: 0 20px 60px rgba(0,0,0,.15) !important;
}
.modal-header {
  border-bottom: 1px solid var(--card-border) !important;
  padding: 16px 20px !important;
  border-radius: 14px 14px 0 0 !important;
}
.modal-body   { padding: 20px !important; }
.modal-footer {
  border-top: 1px solid var(--card-border) !important;
  padding: 14px 20px !important;
  border-radius: 0 0 14px 14px !important;
}
.modal-title { font-size: 15px; font-weight: 600; }

/* ── 16. DROPDOWNS ────────────────────────────────────────── */
.dropdown-menu {
  border: 1px solid var(--card-border) !important;
  border-radius: 10px !important;
  box-shadow: 0 8px 24px rgba(0,0,0,.1) !important;
  padding: 6px !important;
  font-size: 13.5px;
}
.dropdown-item {
  border-radius: 6px !important;
  padding: 8px 12px !important;
  color: var(--text-body) !important;
  transition: background var(--transition) !important;
}
.dropdown-item:hover { background: var(--brand-accent-light) !important; color: var(--brand-accent) !important; }
.dropdown-item.active, .dropdown-item:active { background: var(--brand-accent) !important; color: #fff !important; }
.dropdown-divider { border-color: var(--card-border) !important; margin: 4px 0 !important; }
.dropdown-header { font-size: 10.5px !important; font-weight: 600 !important; color: var(--text-subtle) !important; text-transform: uppercase; letter-spacing: 0.06em; padding: 6px 12px 2px !important; }

/* ── 17. PAGINATION ───────────────────────────────────────── */
.pagination { gap: 3px; }
.page-link {
  border: 1px solid var(--card-border) !important;
  border-radius: 6px !important;
  color: var(--text-body) !important;
  font-size: 12.5px !important;
  padding: 5px 10px !important;
  transition: all var(--transition) !important;
}
.page-link:hover { background: var(--brand-accent-light) !important; color: var(--brand-accent) !important; border-color: var(--brand-accent) !important; }
.page-item.active .page-link { background: var(--brand-accent) !important; border-color: var(--brand-accent) !important; color: #fff !important; }
.page-item.disabled .page-link { opacity: 0.4; }

/* ── 18. LIST GROUPS ──────────────────────────────────────── */
.list-group-item {
  border-color: var(--card-border) !important;
  font-size: 13.5px;
  color: var(--text-body);
}
.list-group-item-action:hover { background: var(--brand-accent-light) !important; }
.list-group-item-action.active { background: var(--brand-accent) !important; border-color: var(--brand-accent) !important; color: #fff !important; }

/* ── 19. NAV TABS ─────────────────────────────────────────── */
.nav-tabs .nav-link {
  border: none !important;
  border-bottom: 2px solid transparent !important;
  color: var(--text-muted) !important;
  font-size: 13.5px;
  font-weight: 500;
  padding: 8px 14px !important;
  border-radius: 0 !important;
}
.nav-tabs .nav-link:hover { color: var(--text-heading) !important; background: none !important; border-bottom-color: var(--card-border) !important; }
.nav-tabs .nav-link.active { color: var(--brand-accent) !important; border-bottom-color: var(--brand-accent) !important; background: none !important; }
.nav-tabs { border-bottom: 1px solid var(--card-border) !important; }

/* ── 20. SEARCH BAR (macros) ──────────────────────────────── */
.card .card-body .input-group .form-control.border-start-0 {
  border-left: none !important;
}
.card .card-body .input-group .input-group-text.border-end-0 {
  border-right: none !important;
}

/* ── 21. FOOTER ───────────────────────────────────────────── */
.app-footer {
  background: var(--card-bg);
  border-top: 1px solid var(--card-border);
  padding: 14px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-subtle);
  margin-top: auto;
}

/* ── 22. UTILITIES ────────────────────────────────────────── */
.text-muted { color: var(--text-muted) !important; }
.fw-semibold { font-weight: 600; }
.section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-heading);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--card-border);
}
.divider-line { height: 1px; background: var(--card-border); margin: 20px 0; }

/* Summary-card link style for leases/files etc */
.summary-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}
.summary-card-link:hover .card {
  box-shadow: var(--card-shadow-md) !important;
  transform: translateY(-1px);
}

/* ── 23. PRINT ────────────────────────────────────────────── */
@media print {
  .sidebar, .topbar, .app-footer, .no-print { display: none !important; }
  .main-content { margin-left: 0 !important; }
  .page-content { padding: 0 !important; }
  body { background: #fff !important; }
  .card { box-shadow: none !important; border: 1px solid #e2e8f0 !important; }
}

/* ── 24. RESPONSIVE ───────────────────────────────────────── */
@media (max-width: 991.98px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.mobile-open {
    transform: translateX(0);
    box-shadow: 4px 0 20px rgba(0,0,0,.25);
  }
  .main-content { margin-left: 0; }
  .topbar-hamburger { display: flex !important; }
  .page-content { padding: 16px; }

  /* Overlay when sidebar open on mobile */
  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 999;
  }
  .sidebar-overlay.show { display: block; }
}

/* ── 25. DASHBOARD-SPECIFIC ───────────────────────────────── */
.dashboard-chart-card .card-body {
  padding: 16px 18px !important;
}

.lease-donut-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 140px;
  height: 140px;
  margin: 0 auto;
}
.lease-donut-inner {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
}
.lease-donut-inner .donut-count { font-size: 22px; font-weight: 700; color: var(--text-heading); line-height: 1; }
.lease-donut-inner .donut-label { font-size: 10px; color: var(--text-muted); }

/* Upcoming item row */
.upcoming-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 13px;
}
.upcoming-item:last-child { border-bottom: none; }
.upcoming-item-name { font-weight: 500; color: var(--text-heading); }
.upcoming-item-sub  { font-size: 12px; color: var(--text-muted); }
.upcoming-item-right { text-align: right; flex-shrink: 0; }

/* ═══════════════════════════════════════════════════════════════════
   Enhanced Table Row Separation & Readability (v2.4)
   ═══════════════════════════════════════════════════════════════════ */

/* Enhanced table header styling */
.table thead th {
  background: var(--table-head-bg) !important;
  color: var(--table-head-text);
  border-bottom: 2px solid var(--card-border) !important;
  padding: 12px 14px !important;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Dark theme table header */
.table-dark thead th {
  background: linear-gradient(135deg, var(--brand-800) 0%, #1a2332 100%) !important;
  border-bottom: 2px solid var(--brand-700) !important;
}

/* Enhanced row separation with subtle borders */
.table tbody tr {
  border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
  transition: background-color var(--transition), box-shadow var(--transition);
}

/* Alternating row backgrounds for better readability */
.table tbody tr:nth-child(even) td {
  background: rgba(0, 0, 0, 0.02) !important;
}

/* Improved cell padding for vertical breathing room */
.table tbody td {
  padding: 13px 14px !important;
  vertical-align: middle;
}

/* Enhanced hover effect with subtle highlight */
.table-hover tbody tr:hover td {
  background: rgba(59, 130, 246, 0.06) !important;
}

/* Handle alternating + hover state */
.table-hover tbody tr:nth-child(even):hover td {
  background: rgba(59, 130, 246, 0.08) !important;
}

/* Focused/active row styling for better selection feedback */
.table tbody tr.table-active td {
  background: rgba(59, 130, 246, 0.1) !important;
  border-bottom: 1px solid rgba(59, 130, 246, 0.2) !important;
}

.table tbody tr.table-active:hover td {
  background: rgba(59, 130, 246, 0.14) !important;
}

/* Last row: remove default border-bottom conflict */
.table tbody tr:last-child td {
  border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
}

/* Small tables with enhanced spacing */
.table-sm tbody td {
  padding: 9px 10px !important;
}

.table-sm thead th {
  padding: 8px 10px !important;
}

/* Dark theme table body rows */
.table-dark tbody tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
}

.table-dark tbody tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.02) !important;
}

.table-dark.table-hover tbody tr:hover td {
  background: rgba(59, 130, 246, 0.08) !important;
}

.table-dark.table-hover tbody tr:nth-child(even):hover td {
  background: rgba(59, 130, 246, 0.1) !important;
}

/* Striped table enhancement */
.table-striped tbody tr:nth-child(odd) td {
  background: rgba(0, 0, 0, 0.01) !important;
}

.table-striped tbody tr:nth-child(even) td {
  background: rgba(0, 0, 0, 0.03) !important;
}

.table-striped.table-hover tbody tr:hover td {
  background: rgba(59, 130, 246, 0.07) !important;
}

/* Dark striped tables */
.table-dark.table-striped tbody tr:nth-child(odd) td {
  background: rgba(255, 255, 255, 0.01) !important;
}

.table-dark.table-striped tbody tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.03) !important;
}

/* Focus indicator for keyboard navigation */
.table tbody tr:focus-within td {
  outline: 2px solid var(--brand-accent) !important;
  outline-offset: -1px !important;
}

/* Link styling within tables */
.table a {
  color: var(--brand-accent);
  text-decoration: none;
  transition: color var(--transition);
}

.table a:hover {
  color: var(--brand-accent-hover);
  text-decoration: underline;
}

/* Print-friendly: maintain readability without colors */
@media print {
  .table thead th {
    background: #fff !important;
    border: 1px solid #e2e8f0 !important;
  }

  .table tbody tr {
    border-bottom: 1px solid #e2e8f0 !important;
  }

  .table tbody tr:nth-child(even) td {
    background: #fff !important;
  }

  .table-hover tbody tr:hover td {
    background: #fff !important;
  }

  .table tbody tr.table-active td {
    background: #fff !important;
  }
}
