/* ================================================================
   DoorGroup Property Management – Design System 2.0
   Premium SaaS Theme · 2026
   ================================================================ */

/* ── Google Fonts loaded via header ─────────────────────────── */

:root {
  /* ── Core Palette ─────────────────────────────────────── */
  --bg:           #F6F8FC;
  --surface:      #FFFFFF;
  --navy:         #0B1F3A;
  --blue:         #234C7C;
  --accent:       #D62828;
  --accent-hover: #B71C1C;
  --success:      #22C55E;
  --warning:      #F59E0B;
  --danger:       #EF4444;
  --info:         #3B82F6;
  --border:       #E5E7EB;
  --text:         #1F2937;
  --muted:        #6B7280;

  /* ── Legacy aliases (backward compat for other modules) ── */
  --primary:       #0B1F3A;
  --primary-light: #234C7C;
  --white:         #FFFFFF;
  --card-border:   #E5E7EB;
  --text-muted:    #6B7280;

  /* ── Layout ────────────────────────────────────────────── */
  --sidebar-width: 280px;
  --header-height: 72px;

  /* ── Tokens ────────────────────────────────────────────── */
  --radius-sm:    8px;
  --radius-md:    14px;
  --radius-lg:    18px;
  --shadow-xs:    0 1px 3px rgba(0,0,0,.06);
  --shadow-sm:    0 2px 8px rgba(0,0,0,.07);
  --shadow-md:    0 6px 20px rgba(0,0,0,.09);
  --shadow-lg:    0 12px 36px rgba(0,0,0,.1);
  --transition:   .22s ease;
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1,h2,h3,h4,h5,h6 {
  font-family: 'Poppins', 'Inter', system-ui, sans-serif;
  font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════
   TOP NAVBAR
═══════════════════════════════════════════════════════════════ */
.top-navbar {
  position: fixed;
  top: 0; left: var(--sidebar-width); right: 0;
  height: var(--header-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  z-index: 900;
  box-shadow: 0 1px 0 var(--border), 0 4px 16px rgba(0,0,0,.04);
  transition: left var(--transition);
  gap: 16px;
}
.navbar-left   { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.navbar-center { flex: 1; max-width: 400px; }
.navbar-right  { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

/* Search */
.navbar-search { position: relative; }
.navbar-search input {
  width: 100%; height: 40px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 40px;
  padding: 0 16px 0 40px;
  font-size: .875rem; font-family: 'Inter', sans-serif;
  color: var(--text); outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.navbar-search input::placeholder { color: var(--muted); }
.navbar-search input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(35,76,124,.1);
  background: #fff;
}
.navbar-search .search-icon {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-size: .82rem; pointer-events: none;
}

/* Sidebar toggle */
.sidebar-toggle {
  background: none; border: none; cursor: pointer;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); border-radius: var(--radius-sm);
  font-size: 1rem;
  transition: background var(--transition), color var(--transition);
  flex-shrink: 0;
}
.sidebar-toggle:hover { background: var(--bg); color: var(--navy); }

.navbar-brand-text {
  font-family: 'Poppins', sans-serif;
  font-weight: 700; font-size: .95rem; color: var(--navy);
}

/* Icon buttons */
.nav-icon-btn {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  width: 38px; height: 38px;
  background: none; border: none; border-radius: var(--radius-sm);
  color: var(--muted); font-size: .95rem;
  text-decoration: none; cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.nav-icon-btn:hover { background: var(--bg); color: var(--navy); }

.badge-dot {
  position: absolute; top: 4px; right: 4px;
  background: var(--accent); color: #fff;
  font-size: .62rem; font-weight: 700;
  min-width: 16px; height: 16px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
}

/* Vertical divider in navbar */
.nav-divider {
  width: 1px; height: 26px;
  background: var(--border); margin: 0 6px;
  flex-shrink: 0;
}

/* ── Quick Add Button ─────────────────────────────────────── */
.btn-quick-add {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 16px; height: 38px;
  background: var(--navy); color: #fff; border: none;
  border-radius: 10px; font-size: .825rem; font-weight: 600;
  font-family: 'Inter', sans-serif; cursor: pointer;
  text-decoration: none;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  white-space: nowrap;
}
.btn-quick-add:hover {
  background: var(--blue); color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(11,31,58,.25);
}
.btn-quick-add i { font-size: .8rem; }

/* ═══════════════════════════════════════════════════════════════
   USER DROPDOWN
═══════════════════════════════════════════════════════════════ */
.user-dropdown {
  position: relative;
  display: flex; align-items: center; gap: 9px;
  cursor: pointer; padding: 5px 10px 5px 5px;
  border-radius: 40px;
  border: 1.5px solid var(--border);
  transition: border-color var(--transition), box-shadow var(--transition);
  user-select: none; flex-shrink: 0;
}
.user-dropdown:hover {
  border-color: rgba(35,76,124,.4);
  box-shadow: 0 0 0 3px rgba(35,76,124,.05);
}

.user-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, var(--navy) 0%, var(--blue) 100%);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: .72rem; font-weight: 700;
  flex-shrink: 0; letter-spacing: .5px;
}
.user-name  { font-size: .835rem; font-weight: 600; color: var(--text); }

.user-dropdown-menu {
  display: none; position: absolute;
  top: calc(100% + 10px); right: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
  min-width: 210px; z-index: 1000; overflow: hidden;
}
.user-dropdown-menu.open { display: block; animation: fadeInDown .16s ease; }

.dropdown-header {
  padding: 16px; border-bottom: 1px solid var(--border);
  display: flex; gap: 12px; align-items: center;
}
.dh-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, var(--navy), var(--blue));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: .9rem; font-weight: 700; flex-shrink: 0;
}
.dh-info strong { font-size: .875rem; color: var(--navy); display: block; line-height: 1.3; }
.dh-info small  { color: var(--muted); font-size: .775rem; }
.dh-status {
  display: flex; align-items: center; gap: 5px;
  font-size: .72rem; color: var(--success); margin-top: 3px; font-weight: 500;
}
.dh-status::before {
  content: ''; width: 6px; height: 6px;
  border-radius: 50%; background: var(--success); display: block;
}

.user-dropdown-menu a {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px; font-size: .875rem;
  color: var(--text); text-decoration: none;
  transition: background var(--transition);
}
.user-dropdown-menu a i { width: 14px; color: var(--muted); text-align: center; }
.user-dropdown-menu a:hover { background: var(--bg); }
.user-dropdown-menu a.danger-link { color: var(--accent); }
.user-dropdown-menu a.danger-link i { color: var(--accent); }
.dropdown-divider { border-top: 1px solid var(--border); margin: 4px 0; }

/* ═══════════════════════════════════════════════════════════════
   SIDEBAR
═══════════════════════════════════════════════════════════════ */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--sidebar-width);
  background: #FAFBFC;
  border-right: 1px solid var(--border);
  box-shadow: 4px 0 24px rgba(11,31,58,.05);
  z-index: 950;
  display: flex; flex-direction: column;
  overflow-y: auto; overflow-x: hidden;
  transition: width var(--transition), transform var(--transition);
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.sidebar::-webkit-scrollbar { width: 3px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* Logo */
.sidebar-logo {
  display: flex; align-items: center; gap: 12px;
  padding: 0 20px;
  height: var(--header-height);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sidebar-logo-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--navy);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.sidebar-logo-icon i { color: var(--accent); font-size: .95rem; }
.sidebar-logo-text { display: flex; flex-direction: column; line-height: 1.15; }
.sidebar-logo-text strong {
  font-family: 'Poppins', sans-serif; font-size: .92rem;
  font-weight: 700; color: var(--navy);
}
.sidebar-logo-text span {
  font-size: .65rem; color: var(--muted);
  letter-spacing: .4px; text-transform: uppercase;
}

/* Navigation */
.sidebar-nav { flex: 1; padding: 14px 0 8px; }

.nav-section-title {
  font-size: .66rem; font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--muted);
  padding: 16px 22px 6px;
  font-family: 'Inter', sans-serif;
}

.sidebar-nav .nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; margin: 1px 10px;
  color: var(--muted);
  text-decoration: none; font-size: .875rem; font-weight: 500;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  font-family: 'Inter', sans-serif;
}
.sidebar-nav .nav-link .nav-icon {
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem;
  transition: background var(--transition), color var(--transition);
  flex-shrink: 0;
  color: var(--muted);
}
.sidebar-nav .nav-link:hover {
  background: rgba(35,76,124,.06);
  color: var(--blue);
}
.sidebar-nav .nav-link:hover .nav-icon {
  background: rgba(35,76,124,.1);
  color: var(--blue);
}
.sidebar-nav .nav-link.active {
  background: rgba(214,40,40,.07);
  color: var(--accent);
  font-weight: 600;
}
.sidebar-nav .nav-link.active .nav-icon {
  background: var(--accent);
  color: #fff;
}

/* ── NAV GROUP (collapsible submenu) ───────────────────────────── */
.nav-group { position: relative; }

.nav-group-toggle {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; margin: 1px 8px; border-radius: 10px;
  color: var(--muted); font-size: .84rem; font-weight: 500;
  cursor: pointer; transition: background .15s, color .15s;
  user-select: none;
}
.nav-group-toggle .nav-icon {
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(107,114,128,.08); font-size: .82rem;
  transition: background .15s, color .15s; flex-shrink: 0;
}
.nav-group-toggle:hover { background: var(--bg); color: var(--navy); }
.nav-group-toggle:hover .nav-icon { background: rgba(214,40,40,.09); color: var(--accent); }
.nav-group-toggle.open { color: var(--navy); font-weight: 600; }
.nav-group-toggle.open .nav-icon { background: var(--accent); color: #fff; }

.nav-group-chevron {
  margin-left: auto; font-size: .65rem; opacity: .5;
  transition: transform .22s ease; flex-shrink: 0;
}
.nav-group-toggle.open .nav-group-chevron { transform: rotate(90deg); opacity: .7; }

.nav-group-children {
  overflow: hidden;
  max-height: 0;
  transition: max-height .25s ease;
}
.nav-group-children.open { max-height: 200px; }

.nav-sub-link {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 12px 7px 22px; margin: 1px 8px 1px 16px;
  border-radius: 8px; color: var(--muted); font-size: .82rem;
  text-decoration: none; transition: background .14s, color .14s;
}
.nav-sub-link::before {
  content: ''; width: 5px; height: 5px; border-radius: 50%;
  background: currentColor; opacity: .35; flex-shrink: 0;
}
.nav-sub-link:hover { background: var(--bg); color: var(--navy); }
.nav-sub-link:hover::before { opacity: .6; }
.nav-sub-link.active { background: rgba(214,40,40,.07); color: var(--accent); font-weight: 600; }
.nav-sub-link.active::before { opacity: 1; }

/* collapsed sidebar — hide children and chevron */
body.sidebar-collapsed .nav-group-toggle > span:not(.nav-icon),
body.sidebar-collapsed .nav-group-chevron,
body.sidebar-collapsed .nav-group-children { display: none; }
body.sidebar-collapsed .nav-group-toggle {
  justify-content: center; padding: 9px; margin: 1px 8px; gap: 0;
}
body.sidebar-collapsed .nav-group-toggle .nav-icon { margin: 0; width: 36px; height: 36px; }

.sidebar-footer {
  padding: 10px 10px 16px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* ── COLLAPSED STATE ───────────────────────────────────────── */
body.sidebar-collapsed .sidebar         { width: 66px; }
body.sidebar-collapsed .sidebar-logo-text,
body.sidebar-collapsed .sidebar-nav .nav-link > span:not(.nav-icon),
body.sidebar-collapsed .nav-section-title { display: none; }
body.sidebar-collapsed .sidebar-logo    { justify-content: center; padding: 0; }
body.sidebar-collapsed .sidebar-nav .nav-link {
  justify-content: center; padding: 9px; margin: 1px 8px; gap: 0;
}
body.sidebar-collapsed .sidebar-nav .nav-link .nav-icon {
  margin: 0; width: 36px; height: 36px;
}
body.sidebar-collapsed .top-navbar   { left: 66px; }
body.sidebar-collapsed .page-wrapper { margin-left: 66px; }

/* ═══════════════════════════════════════════════════════════════
   PAGE LAYOUT
═══════════════════════════════════════════════════════════════ */
.page-wrapper {
  margin-left: var(--sidebar-width);
  padding-top: var(--header-height);
  min-height: 100vh; display: flex;
  transition: margin-left var(--transition);
}
.main-content {
  flex: 1; padding: 32px 32px 52px;
  max-width: 100%; overflow-x: hidden;
}

/* ═══════════════════════════════════════════════════════════════
   PAGE HEADER
═══════════════════════════════════════════════════════════════ */
.content-header {
  display: flex; align-items: flex-start;
  justify-content: space-between; flex-wrap: wrap; gap: 12px;
  margin-bottom: 28px;
}
.breadcrumb-nav {
  font-size: .775rem; color: var(--muted); margin-bottom: 4px;
  display: flex; align-items: center; gap: 4px;
}
.breadcrumb-nav a { color: var(--muted); text-decoration: none; }
.breadcrumb-nav a:hover { color: var(--navy); }
.breadcrumb-sep { color: var(--border); font-size: .7rem; }

.page-title {
  font-size: 1.55rem; font-weight: 700;
  color: var(--navy); line-height: 1.2;
  font-family: 'Poppins', sans-serif;
}
.page-subtitle { color: var(--muted); font-size: .875rem; margin-top: 3px; }
.header-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ═══════════════════════════════════════════════════════════════
   LEGACY STAT CARDS (for non-dashboard module pages)
═══════════════════════════════════════════════════════════════ */
.stat-card-link { display: block; text-decoration: none; color: inherit; }
.stat-card-link:hover { text-decoration: none; color: inherit; }

.stat-card {
  background: var(--surface); border-radius: var(--radius-md);
  border: 1px solid var(--border); box-shadow: var(--shadow-xs);
  padding: 22px; display: flex; align-items: center; gap: 18px;
  transition: box-shadow var(--transition), transform var(--transition);
  height: 100%;
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat-card-sm { padding: 16px; }

.stat-icon {
  width: 52px; height: 52px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; flex-shrink: 0;
}
.bg-primary-soft { background: rgba(11,31,58,.08); }
.bg-success-soft { background: rgba(34,197,94,.1); }
.bg-warning-soft { background: rgba(245,158,11,.12); }
.bg-danger-soft  { background: rgba(239,68,68,.1); }
.bg-info-soft    { background: rgba(59,130,246,.1); }
.bg-orange-soft  { background: rgba(249,115,22,.1); }
.text-orange     { color: #F97316 !important; }

.stat-body { flex: 1; min-width: 0; }
.stat-value {
  font-size: 1.8rem; font-weight: 800;
  color: var(--navy); line-height: 1;
  font-family: 'Poppins', sans-serif;
}
.stat-value small { font-size: 1rem; font-weight: 500; color: var(--muted); }
.stat-label { font-size: .8rem; color: var(--muted); margin-top: 5px; font-weight: 500; }

/* ═══════════════════════════════════════════════════════════════
   GENERIC CARDS (used across modules)
═══════════════════════════════════════════════════════════════ */
.card-custom {
  background: var(--surface); border-radius: var(--radius-md);
  border: 1px solid var(--border); box-shadow: var(--shadow-xs);
  overflow: hidden; height: 100%;
}
.card-header-custom {
  padding: 18px 22px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.card-header-custom h5 {
  margin: 0; font-size: .94rem; font-weight: 600; color: var(--navy);
  display: flex; align-items: center;
  font-family: 'Poppins', sans-serif;
}
.card-body { padding: 22px; }

/* ═══════════════════════════════════════════════════════════════
   ACTIVITY LIST
═══════════════════════════════════════════════════════════════ */
.activity-list { padding: 0; }
.activity-item {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 14px 22px; border-bottom: 1px solid var(--border);
}
.activity-item:last-child { border-bottom: none; }
.activity-icon { color: var(--accent); font-size: .65rem; margin-top: 5px; flex-shrink: 0; }
.activity-body { flex: 1; min-width: 0; }
.activity-text { display: block; font-size: .875rem; color: var(--text); }
.activity-meta { display: block; font-size: .775rem; color: var(--muted); margin-top: 2px; }

/* ═══════════════════════════════════════════════════════════════
   TABLE CARDS (used across modules)
═══════════════════════════════════════════════════════════════ */
.table-card {
  background: var(--surface); border-radius: var(--radius-md);
  border: 1px solid var(--border); box-shadow: var(--shadow-xs); overflow: hidden;
}
.table-card-header {
  padding: 18px 22px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
}
.table-card-header h5 {
  margin: 0; font-size: .94rem; font-weight: 600; color: var(--navy);
  font-family: 'Poppins', sans-serif;
}

.table { margin: 0; font-size: .875rem; }
.table thead th {
  background: #F9FAFB; color: var(--muted);
  font-size: .73rem; font-weight: 700; letter-spacing: .7px;
  text-transform: uppercase; border: none; padding: 12px 18px;
  white-space: nowrap;
}
.table tbody td { padding: 14px 18px; border-color: var(--border); vertical-align: middle; }
.table tbody tr:hover { background: rgba(11,31,58,.018); }
.table tbody tr:last-child td { border-bottom: none; }

/* Tenant name link in tables */
.tenant-name-link {
  font-weight: 600; color: var(--navy);
  text-decoration: none;
}
.tenant-name-link:hover {
  color: var(--accent); text-decoration: underline;
}

/* DataTables overrides */
.dataTables_wrapper .dataTables_filter input {
  border: 1.5px solid var(--border); border-radius: 8px;
  padding: 7px 12px; font-size: .875rem;
}
.dataTables_wrapper .dataTables_length select {
  border: 1.5px solid var(--border); border-radius: 8px; padding: 5px;
}
div.dataTables_wrapper div.dataTables_info { font-size: .8rem; color: var(--muted); }
.paginate_button { border-radius: 6px !important; }

/* ═══════════════════════════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════════════════════════ */
.btn {
  border-radius: 10px; font-weight: 500; font-size: .875rem;
  font-family: 'Inter', sans-serif;
  transition: all var(--transition);
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-primary   { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-danger    { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-danger:hover  { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn-success   { background: var(--success); border-color: var(--success); color: #fff; }
.btn-success:hover { background: #16A34A; border-color: #16A34A; color: #fff; }
.btn-outline-secondary {
  border-color: var(--border); color: var(--muted);
  background: transparent;
}
.btn-outline-secondary:hover { background: var(--bg); color: var(--text); border-color: #d1d5db; }
.btn-sm  { padding: 6px 14px; font-size: .8rem; border-radius: 8px; }
.btn-icon { padding: 7px 11px; }

/* ═══════════════════════════════════════════════════════════════
   BADGES
═══════════════════════════════════════════════════════════════ */
.badge {
  font-size: .73rem; font-weight: 600;
  padding: 4px 10px; border-radius: 6px;
  font-family: 'Inter', sans-serif;
}

/* ═══════════════════════════════════════════════════════════════
   MODALS
═══════════════════════════════════════════════════════════════ */
.modal-content {
  border-radius: var(--radius-lg); border: none;
  box-shadow: 0 25px 60px rgba(0,0,0,.18);
}
.modal-header {
  background: var(--navy); color: #fff;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 20px 24px; border: none;
}
.modal-header .modal-title { font-weight: 600; font-size: 1rem; font-family: 'Poppins', sans-serif; }
.modal-header .btn-close { filter: brightness(0) invert(1); }
.modal-body   { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); }

/* ═══════════════════════════════════════════════════════════════
   FORMS
═══════════════════════════════════════════════════════════════ */
.form-label {
  font-size: .835rem; font-weight: 600; color: var(--text);
  margin-bottom: 6px; font-family: 'Inter', sans-serif;
}
.form-control, .form-select {
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  padding: 9px 13px; font-size: .875rem; font-family: 'Inter', sans-serif;
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus, .form-select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(35,76,124,.1);
  outline: none;
}
textarea.form-control { min-height: 90px; resize: vertical; }

/* ═══════════════════════════════════════════════════════════════
   ALERTS
═══════════════════════════════════════════════════════════════ */
.alert { border-radius: var(--radius-sm); border: none; font-size: .875rem; }

/* ═══════════════════════════════════════════════════════════════
   MISC UTILITIES
═══════════════════════════════════════════════════════════════ */
.legend-dot {
  display: inline-block; width: 10px; height: 10px;
  border-radius: 50%; margin-right: 5px;
}

.priority-low       { color: #3B82F6; }
.priority-medium    { color: #F59E0B; }
.priority-high      { color: #EF4444; }
.priority-emergency { color: #7C3AED; font-weight: 700; }

/* Messaging */
.message-list        { border-right: 1px solid var(--border); height: 500px; overflow-y: auto; }
.message-item        { padding: 14px 18px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background var(--transition); }
.message-item:hover  { background: var(--bg); }
.message-item.active { background: rgba(11,31,58,.04); border-left: 3px solid var(--accent); }
.message-item.unread .msg-subject { font-weight: 700; }
.msg-subject         { font-size: .875rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-meta            { font-size: .75rem; color: var(--muted); margin-top: 2px; display: flex; justify-content: space-between; }
.message-body        { padding: 20px; height: 500px; overflow-y: auto; }
.msg-detail-header   { border-bottom: 1px solid var(--border); padding-bottom: 14px; margin-bottom: 16px; }
.msg-detail-header h6 { font-weight: 700; font-size: 1rem; margin: 0 0 6px; }
.msg-bubble          { background: var(--bg); border-radius: 10px; padding: 16px; font-size: .875rem; line-height: 1.7; white-space: pre-wrap; }

/* Reports */
.report-section {
  background: var(--surface); border-radius: var(--radius-md);
  border: 1px solid var(--border); padding: 24px; margin-bottom: 24px;
}
.report-section h5 {
  font-weight: 600; color: var(--navy); margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px;
  font-family: 'Poppins', sans-serif;
}

/* Settings Tabs */
.settings-nav .nav-link { color: var(--muted); font-weight: 500; border-radius: 8px; padding: 9px 16px; }
.settings-nav .nav-link.active { background: var(--navy); color: #fff; }
.settings-nav .nav-link:hover:not(.active) { background: var(--bg); color: var(--navy); }

/* Text utility overrides (our navy, not Bootstrap blue) */
.text-primary-custom { color: var(--navy) !important; }
.text-accent         { color: var(--accent) !important; }
.bg-primary-custom   { background: var(--navy) !important; }
.border-card         { border: 1px solid var(--border); }
.rounded-xl          { border-radius: var(--radius-md) !important; }
.shadow-card         { box-shadow: var(--shadow-xs) !important; }

/* ═══════════════════════════════════════════════════════════════
   ANIMATIONS
═══════════════════════════════════════════════════════════════ */
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-width) !important;
    box-shadow: 4px 0 24px rgba(0,0,0,.15);
  }
  .sidebar.open { transform: translateX(0); }
  .top-navbar   { left: 0 !important; }
  .page-wrapper { margin-left: 0 !important; }
  .main-content { padding: 22px 18px 36px; }
  body.sidebar-collapsed .sidebar { transform: translateX(-100%); }
  body.sidebar-collapsed .sidebar.open { transform: translateX(0); }
  .navbar-center { display: none; }
  .btn-quick-add span { display: none; }
}

/* ═══════════════════════════════════════════════════════════════
   GLOBAL SEARCH DROPDOWN
═══════════════════════════════════════════════════════════════ */
#globalSearchWrap { position: relative; }

.gs-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0; right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 32px rgba(0,0,0,.13);
  z-index: 9999;
  max-height: 420px;
  overflow-y: auto;
}
.gs-section-label {
  padding: 8px 14px 4px;
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: var(--muted);
  border-top: 1px solid var(--border);
}
.gs-section-label:first-child { border-top: none; }

.gs-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 14px;
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
  transition: background .12s;
}
.gs-item:hover, .gs-item.gs-active {
  background: rgba(59,130,246,.07);
  color: var(--navy);
}
.gs-item-icon {
  width: 30px; height: 30px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; flex-shrink: 0;
}
.gs-icon-tenant   { background: rgba(59,130,246,.12);  color: #3B82F6; }
.gs-icon-property { background: rgba(16,185,129,.12);  color: #10B981; }
.gs-icon-unit     { background: rgba(245,158,11,.12);  color: #F59E0B; }
.gs-icon-workorder{ background: rgba(239,68,68,.12);   color: #EF4444; }

.gs-item-body { flex: 1; min-width: 0; }
.gs-item-label { font-size: .84rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gs-item-sub   { font-size: .73rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gs-item-badge { flex-shrink: 0; font-size: .67rem; padding: 2px 7px; border-radius: 20px; background: var(--bg); border: 1px solid var(--border); color: var(--muted); font-weight: 600; }

.gs-empty { padding: 18px 14px; text-align: center; color: var(--muted); font-size: .84rem; }
.gs-spinner { padding: 14px; text-align: center; color: var(--muted); font-size: .8rem; }
