/* ==========================================================================
   PROPERTY ADMINISTRATION THEME
   ========================================================================== */

:root,
html.theme-greenbricks {
  --brand-primary: #2e7d32;
  --brand-primary-rgb: 46, 125, 50;
  --brand-primary-hover: #1b5e20;
  --brand-accent: #689f38;
  --sidebar-gradient: linear-gradient(180deg, #0d3316 0%, #175225 60%, #1f6b31 100%);
  --btn-gradient: linear-gradient(135deg, #1b5e20 0%, #388e3c 100%);
  --btn-gradient-hover: linear-gradient(135deg, #144618 0%, #2e7d32 100%);
  --badge-subtle-bg: #e8f5e9;
  --badge-subtle-color: #1b5e20;
  --card-accent-border: rgba(46, 125, 50, 0.2);
  --active-nav-bg: rgba(255, 255, 255, 0.16);
  --focus-ring-color: rgba(46, 125, 50, 0.22);

  /* Layout & Neutral Surface Tokens */
  --sidebar-width: 260px;
  --topbar-height: 64px;
  --body-bg: #f8fafc;
  --surface-card: #ffffff;
  --border-color: #e2e8f0;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --shadow-card: 0 1px 3px 0 rgba(15, 23, 42, 0.04), 0 1px 2px -1px rgba(15, 23, 42, 0.03);
  --shadow-dropdown: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
}

html.theme-speedys {
  --brand-primary: #147bbe;
  --brand-primary-rgb: 20, 123, 190;
  --brand-primary-hover: #0c4a75;
  --brand-accent: #38bdf8;
  --sidebar-gradient: linear-gradient(180deg, #071f36 0%, #0c3b66 60%, #147bbe 100%);
  --btn-gradient: linear-gradient(135deg, #0f5282 0%, #147bbe 100%);
  --btn-gradient-hover: linear-gradient(135deg, #0a385a 0%, #0f5c8f 100%);
  --badge-subtle-bg: #e0f2fe;
  --badge-subtle-color: #0369a1;
  --card-accent-border: rgba(20, 123, 190, 0.2);
  --active-nav-bg: rgba(255, 255, 255, 0.16);
  --focus-ring-color: rgba(20, 123, 190, 0.22);
}

/* ==========================================================================
   BASE TYPOGRAPHY & RESET
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 0.875rem; /* 14px standard dashboard density */
  line-height: 1.5;
  color: var(--text-primary);
  background-color: var(--body-bg);
  margin: 0;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

h1, .h1,
h2, .h2,
h3, .h3,
h4, .h4,
h5, .h5,
h6, .h6 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.015em;
  margin-bottom: 0.5rem;
}

h4, .h4 {
  font-size: 1.25rem;
  line-height: 1.35;
}

h5, .h5 {
  font-size: 1rem;
  line-height: 1.4;
}

h6, .h6 {
  font-size: 0.875rem;
  line-height: 1.4;
}

.tabular-nums,
.kpi-value,
.table td,
.badge,
.otp-input {
  font-variant-numeric: tabular-nums;
}

a {
  color: var(--brand-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

/* ==========================================================================
   APPLICATION SHELL LAYOUT (SIDEBAR + TOPBAR + MAIN WORKSPACE)
   ========================================================================== */

.app-wrapper {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* Sidebar (260px Fixed on Desktop, Offcanvas on < 992px) */
.app-sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-gradient);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.32s ease, background 0.3s ease, border-color 0.3s ease;
  z-index: 1050;
}

/* Floating Bubble Close Button Outside Top-Right of Mobile Sidebar */
.sidebar-close-bubble {
  display: none;
}

@media (min-width: 992px) {
  .app-sidebar.offcanvas-lg {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: var(--sidebar-width) !important;
    height: 100vh;
    visibility: visible !important;
    transform: none !important;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 1035;
  }

  .app-main {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
  }
}

@media (max-width: 991.98px) {
  .app-sidebar.offcanvas-lg {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: var(--sidebar-width) !important;
    max-width: calc(100vw - 3.5rem) !important;
    height: 100dvh;
    background: var(--sidebar-gradient);
    z-index: 1055 !important;
    pointer-events: auto !important;
    overflow: visible !important;
    transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.32s ease !important;
  }

  .sidebar-close-bubble {
    position: absolute;
    top: 0.875rem;
    left: calc(100% + 0.625rem);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.82);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.28);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.35);
    cursor: pointer;
    z-index: 1060;
    opacity: 0;
    pointer-events: none;
    transform: scale(0.85);
    transition: opacity 0.22s ease, transform 0.22s ease, background-color 0.2s ease;
  }

  .app-sidebar.offcanvas-lg.showing .sidebar-close-bubble,
  .app-sidebar.offcanvas-lg.show .sidebar-close-bubble {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
  }

  .sidebar-close-bubble:hover,
  .sidebar-close-bubble:focus {
    background: var(--brand-primary);
    border-color: #ffffff;
    color: #ffffff;
    outline: none;
  }

  .offcanvas-backdrop {
    z-index: 1045 !important;
    transition: opacity 0.28s ease !important;
  }

  .app-main {
    margin-left: 0;
    width: 100%;
  }
}

.app-main {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
}

.app-content {
  flex: 1 1 auto;
  padding: 1.5rem;
}

@media (max-width: 575.98px) {
  .app-content {
    padding: 1rem;
  }
}

/* ==========================================================================
   SIDEBAR WORKSPACE SWITCHER & NAVIGATION
   ========================================================================== */

.sidebar-workspace-header {
  padding: 1rem 1rem 0.875rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  position: relative;
  z-index: 2;
}

.sidebar-workspace-header .dropdown {
  width: 100%;
  position: relative;
}

.workspace-switcher-btn {
  width: 100%;
  max-width: 100%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-md);
  padding: 0.625rem 0.75rem;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  text-align: left;
  overflow: hidden;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.workspace-switcher-btn > div {
  flex: 1 1 0%;
  min-width: 0;
  overflow: hidden;
}

.workspace-switcher-btn > .d-flex {
  flex: 1 1 0%;
  min-width: 0;
  overflow: hidden;
}

.workspace-switcher-btn .workspace-title {
  min-width: 0;
  text-overflow: ellipsis;
}

.workspace-switcher-btn > div > div {
  flex: 1 1 0%;
  min-width: 0;
  overflow: hidden;
}

.workspace-switcher-btn > i {
  flex-shrink: 0;
  margin-left: 0.25rem;
  font-size: 0.875rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.workspace-switcher-btn:hover,
.workspace-switcher-btn:focus,
.workspace-switcher-btn.show {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.3);
  color: #ffffff;
}

.workspace-switcher-btn::after {
  display: none !important;
}

.workspace-brand-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.18);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.0625rem;
  color: #ffffff;
  flex-shrink: 0;
}

.workspace-title {
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.25;
  color: #ffffff;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.workspace-dropdown-menu {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: 0.375rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-dropdown);
  box-sizing: border-box;
}

.dropdown-item.workspace-option,
.workspace-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  max-width: 100%;
  padding: 0.5rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  color: var(--text-primary);
  cursor: pointer;
  white-space: normal;
  overflow: hidden;
  box-sizing: border-box;
  transition: background-color 0.15s ease;
}

.workspace-option > div {
  flex: 1 1 0%;
  min-width: 0;
  overflow: hidden;
}

.workspace-option > div > div {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.workspace-option-name {
  flex: 1 1 0%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-option .tenant-check-icon {
  flex-shrink: 0;
  margin-left: 0.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.workspace-option:hover {
  background-color: #f1f5f9;
}

.workspace-option.active {
  background-color: var(--badge-subtle-bg);
  color: var(--badge-subtle-color);
  font-weight: 600;
}

.workspace-option-swatch {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 0.875rem;
  flex-shrink: 0;
}

.swatch-greenbricks {
  background: linear-gradient(135deg, #1b5e20 0%, #388e3c 100%);
}

.swatch-speedys {
  background: linear-gradient(135deg, #0f5282 0%, #147bbe 100%);
}

/* Sidebar Navigation Scroll Container */
.sidebar-nav-container {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 1rem 0.75rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.sidebar-nav {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-nav-item {
  margin-bottom: 0.25rem;
}

.sidebar-nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5625rem 0.75rem;
  border-radius: var(--radius-md);
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.84375rem;
  font-weight: 500;
  transition: background-color 0.2s ease, color 0.2s ease;
  text-decoration: none;
}

.sidebar-nav-link:hover,
.sidebar-nav-link:focus {
  background-color: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.sidebar-nav-link.active,
.sidebar-nav-link[aria-expanded="true"] {
  background-color: var(--active-nav-bg);
  color: #ffffff;
  font-weight: 600;
}

.sidebar-nav-link-content {
  display: flex;
  align-items: center;
  gap: 0.6875rem;
}

.sidebar-nav-icon {
  font-size: 1.0625rem;
  width: 1.25rem;
  text-align: center;
  opacity: 0.9;
}

.sidebar-chevron {
  font-size: 0.75rem;
  transition: transform 0.25s ease;
  opacity: 0.75;
}

.statement-upload-card {
  max-width: 680px;
}

.statement-drop-zone {
  min-height: 240px;
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius-lg);
  background: #f8fafc;
  color: var(--text-primary);
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.statement-drop-zone:hover,
.statement-drop-zone:focus-visible,
.statement-drop-zone.is-dragging {
  border-color: var(--brand-primary);
  background: var(--badge-subtle-bg);
  outline: none;
}

.statement-upload-icon {
  display: inline-flex;
  width: 3.5rem;
  height: 3.5rem;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--badge-subtle-bg);
  color: var(--brand-primary);
  font-size: 1.75rem;
}

.sidebar-nav-link[aria-expanded="true"] .sidebar-chevron {
  transform: rotate(180deg);
}

/* Sidebar Submenu */
.sidebar-submenu {
  list-style: none;
  padding: 0.25rem 0 0.25rem 2.15rem;
  margin: 0;
}

.sidebar-submenu-link {
  display: flex;
  align-items: center;
  padding: 0.4375rem 0.75rem;
  border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.8125rem;
  font-weight: 400;
  position: relative;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.sidebar-submenu-link::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.35);
  margin-right: 0.625rem;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.sidebar-submenu-link:hover {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.08);
}

.sidebar-submenu-link.active {
  color: #ffffff;
  font-weight: 600;
  background-color: rgba(255, 255, 255, 0.14);
}

.sidebar-submenu-link.active::before {
  background-color: #ffffff;
  transform: scale(1.25);
}

/* Sidebar Bottom Pinned Admin Profile Card */
.sidebar-footer {
  padding: 0.875rem 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.14);
}

.sidebar-profile-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.625rem;
}

.sidebar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.8125rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid rgba(255, 255, 255, 0.45);
  flex-shrink: 0;
}

.sidebar-profile-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #ffffff;
  line-height: 1.2;
}

.sidebar-profile-role {
  font-size: 0.6875rem;
  color: rgba(255, 255, 255, 0.7);
}

.sidebar-status-pill {
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.1875rem 0.5rem;
  border-radius: 999px;
  background-color: rgba(34, 197, 94, 0.22);
  color: #bbf7d0;
  border: 1px solid rgba(74, 222, 128, 0.35);
  white-space: nowrap;
}

/* ==========================================================================
   TOP HEADER BAR (STRICTLY NO SEARCH BAR)
   ========================================================================== */

.app-topbar {
  height: var(--topbar-height);
  background-color: var(--surface-card);
  border-bottom: 1px solid var(--border-color);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  position: sticky;
  top: 0;
  z-index: 1020;
  transition: border-color 0.3s ease;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
}

.topbar-left nav {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
}

.topbar-toggle-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background-color: #ffffff;
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  flex-shrink: 0;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.topbar-toggle-btn:hover {
  background-color: #f1f5f9;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  flex-shrink: 0;
}

@media (max-width: 575.98px) {
  .app-topbar {
    padding: 0 0.75rem;
    gap: 0.5rem;
  }

  .topbar-left {
    gap: 0.5rem;
  }

  .topbar-right {
    gap: 0.375rem;
  }

  .topbar-right .dropdown-menu {
    max-width: calc(100vw - 1.5rem);
  }
}

/* Notification Bell Button */
.topbar-icon-btn {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background-color: #ffffff;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.0625rem;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.topbar-icon-btn:hover,
.topbar-icon-btn:focus {
  background-color: #f8fafc;
  color: var(--brand-primary);
  border-color: var(--card-accent-border);
}

.notification-unread-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  font-size: 0.625rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background-color: #dc2626;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #ffffff;
}

/* User Avatar Dropdown Trigger */
.topbar-user-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.5rem 0.25rem 0.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background-color: #ffffff;
  color: var(--text-primary);
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.topbar-user-btn:hover {
  background-color: #f8fafc;
  border-color: var(--card-accent-border);
}

.topbar-user-btn::after {
  display: none;
}

.topbar-avatar {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: var(--btn-gradient);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease;
}

/* ==========================================================================
   BRAND BUTTONS, DROPDOWN MENUS, BADGES & CARDS
   ========================================================================== */

.btn {
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.4375rem 0.875rem;
  border-radius: var(--radius-md);
  transition: all 0.25s ease;
}

.btn-sm {
  font-size: 0.75rem;
  padding: 0.28125rem 0.625rem;
}

.btn-brand-gradient {
  background: var(--btn-gradient);
  color: #ffffff !important;
  border: none;
  box-shadow: 0 2px 6px rgba(var(--brand-primary-rgb), 0.22);
  transition: background 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
}

.btn-brand-gradient:hover,
.btn-brand-gradient:focus {
  background: var(--btn-gradient-hover);
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(var(--brand-primary-rgb), 0.32);
}

.btn-brand-outline {
  color: var(--brand-primary);
  border: 1px solid var(--brand-primary);
  background-color: transparent;
  transition: all 0.3s ease;
}

.btn-brand-outline:hover,
.btn-brand-outline:focus {
  background-color: var(--brand-primary);
  color: #ffffff;
}

/* ==========================================================================
   ENTERPRISE DROPDOWN MENUS & DROPDOWN TOGGLES (GLOBAL THEME OVERRIDES)
   ========================================================================== */

@keyframes dropdownMenuFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.dropdown-toggle {
  font-size: 0.78125rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.dropdown-toggle::after {
  content: "\F282";
  font-family: "bootstrap-icons" !important;
  border: none !important;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1;
  margin-left: 0.15rem;
  vertical-align: middle;
  opacity: 0.8;
  transition: transform 0.2s ease;
}

.dropdown-toggle.show::after {
  transform: rotate(180deg);
}

.workspace-switcher-btn::after,
.topbar-user-btn::after {
  display: none !important;
}

.topbar-user-btn.show .bi-chevron-down {
  transform: rotate(180deg);
  transition: transform 0.2s ease;
}

.dropdown-menu {
  --bs-dropdown-font-size: 0.78125rem;
  --bs-dropdown-padding-x: 0.3125rem;
  --bs-dropdown-padding-y: 0.3125rem;
  --bs-dropdown-item-padding-x: 0.625rem;
  --bs-dropdown-item-padding-y: 0.375rem;
  --bs-dropdown-border-radius: 0.5rem;
  --bs-dropdown-link-hover-bg: var(--badge-subtle-bg);
  --bs-dropdown-link-hover-color: var(--brand-primary);
  --bs-dropdown-link-active-bg: var(--badge-subtle-bg);
  --bs-dropdown-link-active-color: var(--badge-subtle-color);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.78125rem !important;
  color: var(--text-primary);
  background-color: #ffffff;
  border: 1px solid var(--border-color) !important;
  border-radius: 0.5rem !important;
  padding: 0.3125rem !important;
  min-width: 11rem;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.12), 0 4px 10px -4px rgba(15, 23, 42, 0.06) !important;
  z-index: 1060;
}

.dropdown-menu.show {
  animation: dropdownMenuFadeIn 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.dropdown-header {
  font-size: 0.65rem !important;
  font-weight: 700 !important;
  text-transform: uppercase;
  letter-spacing: 0.055em;
  color: var(--text-muted) !important;
  padding: 0.35rem 0.625rem 0.25rem !important;
  line-height: 1.2;
}

.dropdown-item,
.dropdown-menu .dropdown-item.py-2 {
  font-size: 0.78125rem !important;
  font-weight: 500;
  line-height: 1.35;
  color: var(--text-primary);
  padding: 0.375rem 0.625rem !important;
  border-radius: 0.375rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.dropdown-item:not(.workspace-option) > i,
.dropdown-item:not(.workspace-option) > .bi {
  font-size: 0.875rem !important;
  width: 1rem;
  text-align: center;
  margin-right: 0 !important;
  color: var(--text-secondary);
  flex-shrink: 0;
  transition: color 0.15s ease;
}

.dropdown-item:hover,
.dropdown-item:focus {
  background-color: var(--badge-subtle-bg) !important;
  color: var(--brand-primary) !important;
}

.dropdown-item:not(.workspace-option):hover > i:not(.text-danger):not(.text-success):not(.text-primary),
.dropdown-item:not(.workspace-option):focus > i:not(.text-danger):not(.text-success):not(.text-primary) {
  color: var(--brand-primary) !important;
}

.dropdown-item.active,
.dropdown-item:active {
  background-color: var(--badge-subtle-bg) !important;
  color: var(--badge-subtle-color) !important;
  font-weight: 600;
}

.dropdown-item.text-danger {
  color: #dc2626 !important;
}

.dropdown-item.text-danger > i,
.dropdown-item.text-danger > .bi {
  color: #dc2626 !important;
}

.dropdown-item.text-danger:hover,
.dropdown-item.text-danger:focus {
  background-color: #fef2f2 !important;
  color: #b91c1c !important;
}

.dropdown-divider {
  margin: 0.25rem 0.25rem !important;
  border-top: 1px solid var(--border-color);
  opacity: 1;
}

/* User Profile Header inside Topbar Dropdown */
.dropdown-menu > li.border-bottom {
  padding: 0.4rem 0.625rem 0.45rem !important;
  margin-bottom: 0.2rem;
  border-bottom-color: var(--border-color) !important;
}

.dropdown-menu > li.border-bottom .fw-semibold {
  font-size: 0.78125rem !important;
  color: var(--text-primary);
  line-height: 1.25;
}

.dropdown-menu > li.border-bottom .text-muted {
  font-size: 0.6875rem !important;
  line-height: 1.25;
  margin-top: 1px;
}

/* Topbar Notification Bell Dropdown (.dropdown-menu.p-0) */
.dropdown-menu.p-0 {
  padding: 0 !important;
  overflow: hidden;
  width: 295px !important;
}

.dropdown-menu.p-0 > .border-bottom {
  padding: 0.5rem 0.75rem !important;
  font-size: 0.75rem !important;
}

.dropdown-menu.p-0 > .border-bottom .small,
.dropdown-menu.p-0 > .border-bottom a {
  font-size: 0.72rem !important;
}

.dropdown-menu .list-group-item {
  padding: 0.55rem 0.75rem !important;
  font-size: 0.75rem !important;
  border-color: #f1f5f9;
  transition: background-color 0.15s ease;
}

.dropdown-menu .list-group-item:hover {
  background-color: #f8fafc;
}

.dropdown-menu .list-group-item .small.fw-semibold {
  font-size: 0.75rem !important;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.dropdown-menu .list-group-item .text-muted.small {
  font-size: 0.7rem !important;
  line-height: 1.35;
}

/* Table & DataTables Row Action Dropdown Trigger Button */
.table .dropdown > .btn,
table.dataTable .dropdown > .btn {
  width: 28px;
  height: 28px;
  padding: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  background-color: #ffffff;
  border: 1px solid var(--border-color) !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.table .dropdown > .btn:hover,
.table .dropdown > .btn:focus,
.table .dropdown > .btn.show,
table.dataTable .dropdown > .btn:hover,
table.dataTable .dropdown > .btn:focus,
table.dataTable .dropdown > .btn.show {
  background-color: var(--badge-subtle-bg) !important;
  color: var(--brand-primary) !important;
  border-color: var(--card-accent-border) !important;
}

/* Subtle Status Badges */
.badge-subtle-success {
  background-color: #dcfce7;
  color: #15803d;
  border: 1px solid rgba(21, 128, 61, 0.18);
  font-weight: 600;
}

.badge-subtle-warning {
  background-color: #fef3c7;
  color: #b45309;
  border: 1px solid rgba(180, 83, 9, 0.18);
  font-weight: 600;
}

.badge-subtle-danger {
  background-color: #fee2e2;
  color: #b91c1c;
  border: 1px solid rgba(185, 28, 28, 0.18);
  font-weight: 600;
}

.badge-subtle-info {
  background-color: #e0f2fe;
  color: #0369a1;
  border: 1px solid rgba(3, 105, 161, 0.18);
  font-weight: 600;
}

.badge-subtle-secondary {
  background-color: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
  font-weight: 600;
}

/* Enterprise Card Styling */
.app-content,
.row > *,
.card,
.card-header,
.card-body,
.tab-content {
  min-width: 0;
  max-width: 100%;
}

.card {
  background-color: var(--surface-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  margin-bottom: 1.25rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.card-accent {
  border-color: var(--card-accent-border);
}

.card-header {
  background-color: transparent;
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.card-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0;
}

.card-subtitle {
  font-size: 0.78125rem;
  color: var(--text-muted);
  margin-top: 0.1875rem;
}

.card-body {
  padding: 1.25rem;
}

.card-footer {
  background-color: #f8fafc;
  border-top: 1px solid var(--border-color);
  padding: 0.875rem 1.25rem;
  border-bottom-left-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-lg);
}

/* KPI Metric Card Elements */
.kpi-card {
  border: 1px solid var(--border-color);
  transition: border-color 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.kpi-card:hover {
  border-color: var(--card-accent-border);
  box-shadow: 0 6px 16px -4px rgba(15, 23, 42, 0.06);
}

.kpi-icon-pill {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background-color: var(--badge-subtle-bg);
  color: var(--brand-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.kpi-value {
  font-size: 1.625rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.kpi-label {
  font-size: 0.78125rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.375rem;
}

.kpi-trend-up {
  color: #15803d;
  background-color: #dcfce7;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.kpi-trend-down {
  color: #b91c1c;
  background-color: #fee2e2;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

/* ==========================================================================
   FORMS, INPUTS, TABS, ACCORDIONS & TABLES
   ========================================================================== */

.form-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.375rem;
}

.form-control,
.form-select {
  font-size: 0.84375rem;
  padding: 0.5rem 0.75rem;
  border-color: #cbd5e1;
  border-radius: var(--radius-md);
  color: var(--text-primary);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 0.2rem var(--focus-ring-color);
}

.form-check-input:checked {
  background-color: var(--brand-primary);
  border-color: var(--brand-primary);
}

.form-check-input:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 0.2rem var(--focus-ring-color);
}

.form-range::-webkit-slider-thumb {
  background: var(--brand-primary);
}

.form-range::-moz-range-thumb {
  background: var(--brand-primary);
}

/* Custom Underline & Pill Tabs — Clean Single-Line Scrollable with Hidden Scrollbar */
.nav-tabs,
.nav-tabs-underline,
.nav-pills:not(.flex-column) {
  display: flex !important;
  flex-wrap: nowrap !important;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

.nav-tabs::-webkit-scrollbar,
.nav-tabs-underline::-webkit-scrollbar,
.nav-pills::-webkit-scrollbar,
.nav-pills.flex-column::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

.nav-tabs .nav-item,
.nav-tabs-underline .nav-item,
.nav-pills:not(.flex-column) .nav-item {
  flex: 0 0 auto !important;
}

.nav-tabs .nav-link,
.nav-tabs-underline .nav-link,
.nav-pills .nav-link {
  white-space: nowrap !important;
  width: auto !important;
}

.nav-tabs-underline {
  border-bottom: 1px solid var(--border-color);
  gap: 1.25rem;
}

.nav-tabs-underline .nav-link {
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.84375rem;
  padding: 0.625rem 0.25rem;
  border-radius: 0;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.nav-tabs-underline .nav-link:hover {
  color: var(--brand-primary);
}

.nav-tabs-underline .nav-link.active {
  color: var(--brand-primary);
  border-bottom-color: var(--brand-primary);
  background: transparent;
}

/* Custom Pill Tabs */
.nav-pills-brand .nav-link {
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.84375rem;
  border-radius: var(--radius-md);
  padding: 0.5rem 1rem;
  transition: all 0.2s ease;
}

.nav-pills-brand .nav-link.active {
  background: var(--btn-gradient);
  color: #ffffff;
}

@media (max-width: 767.98px) {
  .card-header:has(.nav-tabs) {
    flex-direction: column;
    align-items: stretch !important;
    gap: 0.25rem;
  }

  .card-header .nav-tabs {
    width: 100%;
    max-width: 100%;
  }

  .nav-pills.flex-column {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
    padding-bottom: 0.25rem;
  }

  .nav-pills.flex-column .nav-link {
    flex: 0 0 auto !important;
    width: auto !important;
    white-space: nowrap !important;
  }
}

/* Accordion Refinements */
.accordion-item {
  border-color: var(--border-color);
}

.accordion-button {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  padding: 1rem 1.25rem;
}

.accordion-button:not(.collapsed) {
  background-color: var(--badge-subtle-bg);
  color: var(--badge-subtle-color);
  box-shadow: none;
}

.accordion-button:focus {
  border-color: var(--card-accent-border);
  box-shadow: 0 0 0 0.2rem var(--focus-ring-color);
}

/* Tables */
.table {
  font-size: 0.84375rem;
  vertical-align: middle;
  margin-bottom: 0;
}

.table > thead > tr > th {
  background-color: #f8fafc;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.table > tbody > tr > td {
  padding: 0.75rem 1rem;
  border-bottom-color: #f1f5f9;
  color: var(--text-primary);
}

/* Status Indicator Dots (Strictly for badge/status showcase & live notifications) */
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}

.status-dot-brand {
  background-color: var(--brand-primary);
}

.status-dot-success {
  background-color: #16a34a;
}

.status-dot-warning {
  background-color: #d97706;
}

.status-dot-danger {
  background-color: #dc2626;
}

/* Footer */
.app-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  background-color: #ffffff;
  font-size: 0.78125rem;
  color: var(--text-muted);
}

html.theme-speedys .only-greenbricks {
  display: none !important;
}

html.theme-greenbricks .only-speedys {
  display: none !important;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.page-header h1,
.page-header .h1 {
  margin: 0;
}

.page-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.stat-card {
  position: relative;
  display: block;
  height: 100%;
  padding: 1.25rem;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  color: var(--text-primary);
  text-decoration: none;
  transition: color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.stat-card > .bi {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
}

.stat-card:hover {
  color: var(--brand-primary);
  box-shadow: var(--shadow-dropdown);
  transform: translateY(-1px);
}

.stat-card-value {
  display: block;
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
}

.stat-card-label {
  display: block;
  margin-top: 0.375rem;
  color: var(--text-muted);
  font-size: 0.8125rem;
}

.row-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  color: var(--text-primary);
  text-decoration: none;
  border-bottom: 1px solid var(--border-color);
}

.row-link::after {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-top: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
  transform: rotate(45deg);
  flex: 0 0 auto;
}

.row-link:last-child {
  border-bottom: 0;
}

.row-link:hover {
  color: var(--brand-primary);
  background-color: #f8fafc;
}

.matrix-table th,
.matrix-table td {
  text-align: center;
  vertical-align: middle;
}

.matrix-table th:first-child,
.matrix-table td:first-child {
  text-align: left;
}

.paper {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
  padding: clamp(1.25rem, 4vw, 3rem);
}

.sidebar-chevron {
  width: 0.5rem;
  height: 0.5rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  flex: 0 0 auto;
}

.report-paper {
  padding: clamp(1rem, 3vw, 1.75rem);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  background: #ffffff;
  box-shadow: var(--shadow-card);
}

.report-print-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 600;
}

.report-print-header h2 {
  margin: 0.35rem 0;
  color: var(--text-primary);
  font-size: 1.25rem;
}

.report-filter-control {
  width: min(100%, 220px);
}

.report-net-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 1.25rem 0 0;
  padding-top: 1rem;
  border-top: 2px solid var(--text-primary);
  font-size: 1rem;
  font-weight: 700;
}

@media (max-width: 767.98px) {
  .app-content .btn {
    min-height: 44px;
  }

  .app-content .dropdown-menu .dropdown-item {
    display: flex;
    align-items: center;
    min-height: 44px;
  }
}

.sidebar-nav-link[aria-expanded="true"] .sidebar-chevron {
  transform: rotate(225deg);
}

@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }

  .app-sidebar,
  .app-topbar,
  .app-footer,
  .no-print {
    display: none !important;
  }

  .app-main,
  .app-content,
  .print-area {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    color: #000000 !important;
    background: #ffffff !important;
    box-shadow: none !important;
  }

  .report-paper {
    border: 0 !important;
    border-radius: 0 !important;
    padding: 0 !important;
  }

  .report-expense-tabs {
    display: none !important;
  }

  .report-expense-panels > .tab-pane {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
  }

  body * {
    visibility: hidden !important;
  }

  .print-area,
  .print-area * {
    visibility: visible !important;
  }

  .print-area {
    position: absolute;
    inset: 0 auto auto 0;
  }
}
