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

:root {
  --bg: #ffffff;
  --text: #000000;
  --text-muted: #6b7280;
  --border: #e5e5e5;
  --gray-light: #f9f9f9;
  --black: #000000;
  --white: #ffffff;
  --radius: 0.5rem;
  --transition: 0.2s ease-in-out;
  --hover: #f9f9f9;
  --accent: #000000;
}

body {
  background-color: #fafafa; /* Subtle gray background for container definition */
  color: var(--text);
  font-family: 'Inter', sans-serif;
  margin: 1rem; /* Add margin to body to create space from viewport edges */
  padding: 0;
  overflow-x: hidden;
  line-height: 1.6;
  min-height: calc(100vh - 2rem); /* Ensure body takes full height minus margins */
}

.container {
  max-width: calc(100vw - 4rem); /* Account for body margins (1rem * 2) plus additional space */
  width: 100%;
  margin: 0 auto;
  padding: 3rem 2.5rem;
  background-color: #ffffff; /* Pure white containers on gray background */
  border-radius: 12px; /* Subtle rounded corners */
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06); /* Subtle elevation */
  border: 1px solid #e5e7eb; /* Light border for definition */
  box-sizing: border-box; /* Include padding and border in width calculation */
}

.title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 2rem;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 1.5rem;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2rem;
  width: 100%;
}

/* ===== UNIFIED BUTTON DESIGN SYSTEM ===== */
/* Base button styling - all buttons inherit from this */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  background-color: var(--black);
  color: var(--white);
  border: 2px solid var(--black);
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  line-height: 1;
  min-height: 44px; /* Accessibility: minimum touch target */
  box-sizing: border-box;
}

.btn:hover {
  background-color: #111;
  color: var(--white);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

.btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Primary button (default black) - main actions */
.btn-primary,
.btn.btn-primary {
  background-color: var(--black);
  color: var(--white);
  border: 2px solid var(--black);
}

.btn-primary:hover,
.btn.btn-primary:hover {
  background-color: #111;
  color: var(--white);
  border-color: #111;
}

/* Secondary button (white with black border) - secondary actions */
.btn-secondary,
.btn.btn-secondary,
.btn-secondary-bw,
.btn.btn-secondary-bw {
  background-color: var(--white);
  color: var(--black);
  border: 2px solid var(--black);
}

.btn-secondary:hover,
.btn.btn-secondary:hover,
.btn-secondary-bw:hover,
.btn.btn-secondary-bw:hover {
  background-color: var(--black);
  color: var(--white);
  border-color: var(--black);
}

/* Outline buttons - subtle actions */
.btn-outline,
.btn.btn-outline,
.btn-outline-secondary,
.btn.btn-outline-secondary {
  background-color: transparent;
  color: var(--black);
  border: 2px solid #d1d5db;
}

.btn-outline:hover,
.btn.btn-outline:hover,
.btn-outline-secondary:hover,
.btn.btn-outline-secondary:hover {
  background-color: #f9fafb;
  color: var(--black);
  border-color: var(--black);
}

/* Danger/Warning buttons - destructive actions */
.btn-danger,
.btn.btn-danger,
.btn-danger-bw,
.btn.btn-danger-bw {
  background-color: var(--white);
  color: #dc2626;
  border: 2px solid #dc2626;
}

.btn-danger:hover,
.btn.btn-danger:hover,
.btn-danger-bw:hover,
.btn.btn-danger-bw:hover {
  background-color: #dc2626;
  color: var(--white);
  border-color: #dc2626;
}

.btn-outline-danger,
.btn.btn-outline-danger {
  background-color: transparent;
  color: #dc2626;
  border: 2px solid #dc2626;
}

.btn-outline-danger:hover,
.btn.btn-outline-danger:hover {
  background-color: #dc2626;
  color: var(--white);
  border-color: #dc2626;
}

/* Warning buttons */
.btn-warning,
.btn.btn-warning,
.btn-outline-warning,
.btn.btn-outline-warning {
  background-color: var(--white);
  color: #d97706;
  border: 2px solid #d97706;
}

.btn-warning:hover,
.btn.btn-warning:hover,
.btn-outline-warning:hover,
.btn.btn-outline-warning:hover {
  background-color: #d97706;
  color: var(--white);
  border-color: #d97706;
}

/* Success buttons */
.btn-success,
.btn.btn-success {
  background-color: var(--white);
  color: #059669;
  border: 2px solid #059669;
}

.btn-success:hover,
.btn.btn-success:hover {
  background-color: #059669;
  color: var(--white);
  border-color: #059669;
}

.btn-outline-success,
.btn.btn-outline-success {
  background-color: transparent;
  color: #059669;
  border: 2px solid #059669;
}

.btn-outline-success:hover,
.btn.btn-outline-success:hover {
  background-color: #059669;
  color: var(--white);
  border-color: #059669;
}

/* Info buttons */
.btn-info,
.btn.btn-info {
  background-color: var(--white);
  color: #0284c7;
  border: 2px solid #0284c7;
}

.btn-info:hover,
.btn.btn-info:hover {
  background-color: #0284c7;
  color: var(--white);
  border-color: #0284c7;
}

.btn-outline-info,
.btn.btn-outline-info {
  background-color: transparent;
  color: #0284c7;
  border: 2px solid #0284c7;
}

.btn-outline-info:hover,
.btn.btn-outline-info:hover {
  background-color: #0284c7;
  color: var(--white);
  border-color: #0284c7;
}

/* Light buttons (for dark backgrounds) */
.btn-light,
.btn.btn-light,
.btn-outline-light,
.btn.btn-outline-light {
  background-color: var(--white);
  color: var(--black);
  border: 2px solid var(--white);
}

.btn-light:hover,
.btn.btn-light:hover,
.btn-outline-light:hover,
.btn.btn-outline-light:hover {
  background-color: #f9fafb;
  color: var(--black);
  border-color: #f9fafb;
}

/* Button sizes */
.btn-sm,
.btn.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  min-height: 36px;
}

.btn-lg,
.btn.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.1rem;
  min-height: 52px;
}

/* Button states */
.btn:disabled,
.btn.disabled,
.btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.btn:disabled:hover,
.btn.disabled:hover,
.btn[disabled]:hover {
  transform: none;
  box-shadow: none;
}

/* Button groups */
.btn-group .btn {
  border-radius: 0;
  margin-right: -2px;
}

.btn-group .btn:first-child {
  border-top-left-radius: var(--radius);
  border-bottom-left-radius: var(--radius);
}

.btn-group .btn:last-child {
  border-top-right-radius: var(--radius);
  border-bottom-right-radius: var(--radius);
  margin-right: 0;
}

.btn-group .btn.active {
  background-color: var(--black);
  color: var(--white);
  border-color: var(--black);
  z-index: 1;
}

/* Responsive button adjustments */
@media (max-width: 768px) {
  .btn {
    padding: 0.625rem 1.25rem;
    font-size: 0.9rem;
  }
  
  .btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
  }
  
  .btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
  }
}

/* Focus visible for accessibility */
@media (prefers-reduced-motion: no-preference) {
  .btn:focus-visible {
    outline: 2px solid var(--black);
    outline-offset: 2px;
  }
}

.btn-icon {
  margin-right: 0.5em;
}

.btn-icon svg {
  width: 1.25em;  /* Approx 20px if font-size is 1rem (0.95rem * 1.25 = ~1.18rem actual) */
  height: 1.25em; /* Approx 20px */
  vertical-align: middle; /* Better alignment with text typically */
  /* stroke: currentColor; will be inherited if svgs use it, or fill for solid icons */
}

/* Spinner Animation */
.btn-icon.spinner-icon svg {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.btn .btn-text {
  line-height: 1;
}

.dropdown-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

/* General Input, Select, and Textarea Styling */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="number"],
input[type="date"],
textarea,
.form-control,
.form-select,
select,
.select { 
  padding: 0.875rem 1rem;
  font-size: 0.95rem;
  border: 2px solid #d1d5db; /* Stronger, more visible border */
  border-radius: 8px; /* Modern rounded corners */
  background-color: #ffffff;
  color: var(--text);
  line-height: 1.5;
  width: 100%;
  box-sizing: border-box;
  transition: all 0.2s ease-in-out;
  font-weight: 400;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05); /* Subtle depth */
}

/* Enhanced dropdown styling with improved visibility */
select,
.form-select,
.form-control,
.select,
.filter-control-select,
.chart-control-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23374151' stroke-linecap='round' stroke-linejoin='round' stroke-width='2.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.75rem center;
  background-repeat: no-repeat;
  background-size: 18px 14px;
  padding-right: 2.75rem;
  cursor: pointer;
  border: 2px solid #d1d5db;
  border-radius: 8px;
  background-color: #ffffff;
  position: relative;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease-in-out;
}

/* Specific .select styling for custom arrow and overriding appearance */
/* This rule should come AFTER the general rule above to correctly apply padding-right */
.select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23000'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1.25em 1.25em;
  padding-right: 2.5rem; /* Overrides the general padding's right value to make space for the arrow */
}

/* Enhanced focus and hover states for better UX */
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
textarea:focus,
.form-control:focus,
.form-select:focus,
select:focus,
.select:focus,
.filter-control-select:focus,
.chart-control-select:focus {
  outline: none;
  border-color: var(--black);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
  background-color: #ffffff;
  transform: translateY(-1px); /* Subtle lift effect */
}

/* Hover states for better interactivity */
input[type="text"]:hover:not(:focus),
input[type="email"]:hover:not(:focus),
input[type="password"]:hover:not(:focus),
input[type="search"]:hover:not(:focus),
input[type="number"]:hover:not(:focus),
input[type="date"]:hover:not(:focus),
textarea:hover:not(:focus),
.form-control:hover:not(:focus),
.form-select:hover:not(:focus),
select:hover:not(:focus),
.select:hover:not(:focus),
.filter-control-select:hover:not(:focus),
.chart-control-select:hover:not(:focus) {
  border-color: #9ca3af;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}

/* Enhanced dropdown arrow on hover */
select:hover,
.form-select:hover,
.form-control:hover,
.select:hover,
.filter-control-select:hover,
.chart-control-select:hover {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23000000' stroke-linecap='round' stroke-linejoin='round' stroke-width='2.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
}

/* Small size dropdown styling */
.form-select-sm {
  padding: 0.375rem 2rem 0.375rem 0.75rem;
  font-size: 0.875rem;
  background-size: 16px 12px;
  background-position: right 0.5rem center;
}

/* Ensure select elements with form-control class get enhanced dropdown styling */
select.form-control {
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23374151' stroke-linecap='round' stroke-linejoin='round' stroke-width='2.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e") !important;
  background-position: right 0.75rem center !important;
  background-repeat: no-repeat !important;
  background-size: 18px 14px !important;
  padding-right: 2.75rem !important;
  cursor: pointer !important;
}

select.form-control:hover {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23000000' stroke-linecap='round' stroke-linejoin='round' stroke-width='2.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e") !important;
}

/* Note: The original standalone .select rule has been effectively replaced by the two rules above. 
   The general rule provides base styling, and the specific .select rule handles appearance and the arrow. */

.txn-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 0.95rem;
  color: var(--text);
}

.rows-dropdown select {
  margin-left: 0.5rem;
}

.connection-status {
  display: flex;
  gap: 1.5rem;
  margin-top: 2rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  width: 100%;
}

.status-box {
  flex: 1 1 240px;
  background: #ffffff; /* Pure white background */
  border: 1px solid #e5e7eb; /* Light border for definition */
  border-radius: 12px; /* Consistent rounded corners */
  padding: 1rem 1.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06); /* Subtle elevation */
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.2s ease;
}

.status-box:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12), 0 2px 4px rgba(0, 0, 0, 0.08);
  border-color: #d1d5db;
}

.status-label {
  font-weight: 600;
  font-size: 1rem;
}

.status-indicator {
  font-size: 0.85rem;
  font-weight: 500;
  text-transform: uppercase;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  border: 1px solid #ccc;
  background-color: var(--gray-light);
  color: var(--text-muted);
  transition: all 0.2s ease;
}

.status-indicator.connected {
  border-color: var(--black);
  color: var(--black);
  background-color: var(--white);
  font-weight: 600;
  box-shadow: inset 0 0 0 2px var(--black);
}

.status-indicator.disconnected {
  border: 1px dashed #bbb;
  background-color: #f5f5f5;
  color: #999;
  font-style: italic;
  opacity: 0.7;
}

#txn-count {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 400;
}

.table {
  min-width: 1200px; /* Increased from 1000px to accommodate wider Note column */
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  color: var(--text);
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

.table-head {
  background-color: var(--gray-light);
  border-bottom: 1px solid var(--border);
}

.table-header {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-muted);
}

.table-body tr:hover {
  background-color: #f1f1f1;
}

.table-cell {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
}

.table td {
  padding: 0.75rem 1rem;
  font-size: 0.75rem;       /* Same as header */
  color: var(--text);       /* Standard black text */
  font-weight: 400;         /* Normal font weight */
  text-transform: none;     /* No uppercase */
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
}

.table th:nth-child(1) {
  width: 8%;
  min-width: 80px;
}

.table th:nth-child(2) {
  width: 12%;
  min-width: 100px;
}

.table th:nth-child(3) {
  width: 25%;
  min-width: 100px;
  white-space: normal;
  word-break: break-word;
}

.table th:nth-child(4) {
  width: 25%;
  min-width: 150px;
  white-space: normal;
  word-break: break-word;
}

.table th:nth-child(5) {
  width: 10%;
  min-width: 90px;
  text-align: right;
}

.table th:nth-child(11) {
  width: auto;
  min-width: 400px;
  max-width: 600px;
  white-space: normal;
  word-break: break-word;
  background-color: #f0f8ff !important; /* Light blue background for identification */
  border-left: 3px solid #007bff !important; /* Blue left border */
}

.edit-btn {
  background-color: var(--black);
  color: var(--white);
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: var(--radius);
  border: 1px solid var(--black);
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.edit-btn:hover {
  background-color: #111;
}

.table input[type="text"],
.table input[type="date"],
.table select {
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background-color: var(--white);
  color: var(--text);
  width: 100%;
  box-sizing: border-box;
  transition: border-color 0.2s ease;
}

.table input:focus,
.table select:focus {
  outline: none;
  border-color: var(--black);
}

.save-btn {
  background-color: var(--black);
  color: var(--white);
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: var(--radius);
  border: 1px solid var(--black);
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.save-btn:hover {
  background-color: #111;
}

.cancel-btn {
  background-color: var(--gray-light);
  color: var(--text-muted);
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.cancel-btn:hover {
  background-color: #eaeaea;
}

.footer-note {
  padding: 1rem 1.25rem;
  background-color: var(--gray-light);
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
}

.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2rem;
  margin-bottom: 2rem;
}

.page-label {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.sync-result {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: var(--radius);
  font-size: 0.95rem;
  background-color: var(--gray-light);
  border: 1px solid var(--border);
}

@media (max-width: 768px) {
  .btn-row {
    flex-direction: column;
    align-items: stretch;
  }

  .status-box {
    width: 100%;
  }
}

#review-invoices-modal .modal-body {
  max-height: 60vh;
  overflow-y: auto;
}


/* ─────────────────────────────────────────
   Collapsible left navigation
   ───────────────────────────────────────── */
   .sidebar {
    position: fixed;            /* sticks to the left edge */
    top: 0;
    left: 0;
    height: 100vh;
    width: 56px;                /* collapsed width */
    background: var(--black);
    transition: width 0.25s var(--transition);
    z-index: 50;
    display: flex;
    flex-direction: column;
  }
  
  .sidebar:hover,
  .sidebar:focus-within {
    width: 220px;               /* expanded width on hover / keyboard focus */
  }
  
  .nav {
    margin-top: 4rem;           /* push items below top edge */
    display: flex;
    flex-direction: column;
  }
  
  .nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem 1.25rem;
    color: var(--white);
    text-decoration: none;
    font-size: 0.95rem;
    transition: background 0.2s var(--transition);
  }
  
  .nav-item:hover,
  .nav-item.active {
    background: rgba(255, 255, 255, 0.15);
  }
  
  /* Settings navigation follows standard navigation behavior - NO special overrides */
  /* Ensure Settings navigation item has consistent black background like other nav items */
  .nav-item[data-view="settings"] {
    background: transparent !important;
    color: var(--white) !important;
  }
  
  .nav-item[data-view="settings"]:hover,
  .nav-item[data-view="settings"].active {
    background: rgba(255, 255, 255, 0.15) !important;
  }
  
  .nav-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    fill: var(--white);
  }

  /* force sidebar icons to white so they show on black background */
  .nav-icon {
    fill: #fff !important;
  }


  .nav-text {
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.2s var(--transition);
  }
  
  .sidebar:hover .nav-text,
  .sidebar:focus-within .nav-text {
    opacity: 1;
  }
  
  /* Push page body right so content is never hidden under the sidebar */
  #layout {
    margin-left: 56px;          /* same collapsed width */
    padding-left: 1.5rem;       /* additional breathing room from sidebar */
    padding-right: 1.5rem;      /* breathing room from right edge */
    transition: margin 0.25s var(--transition);
  }
  
  .sidebar:hover ~ #content,
  .sidebar:hover ~ main,
  .sidebar:hover ~ #layout {
    margin-left: 220px;
    padding-left: 1.5rem;       /* maintain breathing room when expanded */
    padding-right: 1.5rem;      /* maintain breathing room from right edge */
  }
  
  @media (max-width: 768px) {
    /* Mobile: sidebar slides over content instead of pushing it */
    #layout { margin-left: 0; }
  }
  
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="number"],
input[type="date"],
textarea,
.select { /* Grouping .select here for consistency */
  padding: 0.875rem 1rem; /* Enhanced padding for better visibility */
  font-size: 0.95rem;    /* Match button font size */
  border: 2px solid #d1d5db; /* Stronger, more visible border */
  border-radius: 8px; /* Modern rounded corners */
  background-color: var(--white);
  color: var(--text);
  line-height: 1.5; /* Ensure text isn't cramped */
  width: 100%; /* Default to full width for form inputs, can be overridden by specific classes or parent flex/grid */
  box-sizing: border-box; /* Consistent box model */
  transition: all 0.2s ease-in-out; /* Smooth transitions for all properties */
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05); /* Subtle depth */
}

/* Enhanced hover states for better interactivity */
input[type="text"]:hover:not(:focus),
input[type="email"]:hover:not(:focus),
input[type="password"]:hover:not(:focus),
input[type="search"]:hover:not(:focus),
input[type="number"]:hover:not(:focus),
input[type="date"]:hover:not(:focus),
textarea:hover:not(:focus),
select:hover:not(:focus),
.select:hover:not(:focus) {
  border-color: #9ca3af;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

/* Enhanced focus styles with lift effect */
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
textarea:focus,
select:focus,
.select:focus {
  outline: none;
  border-color: var(--black);
  box-shadow: 0 0 0 3px rgba(0,0,0,0.1), 0 4px 6px rgba(0, 0, 0, 0.1); /* Enhanced focus ring with depth */
  transform: translateY(-1px); /* Subtle lift effect */
}

/* Enhanced dropdown arrow visibility for select elements */
select,
.select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.75rem center;
  background-repeat: no-repeat;
  background-size: 1.25rem 1.25rem;
  padding-right: 2.5rem;
  appearance: none;
}

/* Common focus style for these inputs */
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
textarea:focus,
.select:focus {
  outline: none;
  border-color: var(--black);
  box-shadow: 0 0 0 2px rgba(0,0,0,0.1); /* Optional: subtle focus ring */
}

/* Remove the old .select rule if it only contained the appearance:none and basic properties now covered above */
/* Original .select was: */
/* 
.select {
  appearance: none;
  padding: 0.6rem 1rem;
  border: 1px solid var(--border);
  background-color: var(--white);
  color: var(--text);
  font-size: 0.95rem;
  border-radius: var(--radius);
}
*/

.txn-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 0.95rem;
  color: var(--text);
}

#property-list-body tr.selected-property-row {
  background-color: var(--gray-light); /* Or a slightly darker gray if --gray-light is too subtle, e.g., #e9ecef */
  font-weight: 600; /* Optional: make text bold */
}

#property-list-body tr:not(.selected-property-row):hover {
  /* Ensure hover style is still visible but different from selected */
  background-color: #f5f5f5; /* A slightly different hover from default table row hover if needed */
}

.sidebar .nav-item {
  /* Add more specific sidebar styles here */
}

/* Badge styling for buttons like Review Invoices */
.badge {
  display: inline-block;
  vertical-align: middle;
  padding: 0.25em 0.5em;
  font-size: 0.75em;
  font-weight: 600;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  border-radius: 999px;
}

.badge.bg-primary {
  background-color: var(--black);
  color: var(--white);
}

.badge.bg-secondary {
  background-color: #6c757d;
  color: var(--white);
}

.ms-1 {
  margin-left: 0.25rem;
}

.rounded-pill {
  border-radius: 999px;
}

/* Make review button with badge look consistent */
#review-invoices-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
}

#review-invoices-btn .badge {
  margin-left: 0.5rem;
}

/* Add style for duplicate invoice rows */
.duplicate-invoice-row {
  background-color: #fff8e6 !important; /* Light yellow background */
  border-left: 4px solid #f0ad4e; /* Warning color left border */
}

.duplicate-invoice-row:hover {
  background-color: #fff2d1 !important; /* Slightly darker yellow on hover */
}

#review-invoices-modal .nav-tabs .nav-link[aria-controls="duplicates"] .badge {
  background-color: #f0ad4e !important; /* Warning color */
}

#duplicates-count {
  background-color: #f0ad4e !important; /* Warning color */
}

.duplicate-warning {
  padding: 2px 4px;
  color: #d9534f;
  font-size: 0.85em;
}

/* Review Invoices Modal Tab Styling */
#reviewTabs.nav-pills {
    display: block !important; /* Reset to block, let LIs control flow */
    padding-left: 0 !important; /* Remove default UL padding */
    list-style: none !important; /* Remove bullet points */
    white-space: nowrap !important; /* Prevent wrapping of the tab group itself */
}

#reviewTabs.nav-pills > .nav-item {
    display: inline-block !important; /* Force LIs to sit side-by-side */
    margin-right: 5px !important;
}

#reviewTabs.nav-pills > .nav-item:last-child {
    margin-right: 0 !important; /* No margin on the last tab */
}

#reviewTabs .nav-link {
    background-color: #f8f9fa !important;
    color: #495057 !important;
    border: 1px solid #dee2e6 !important;
    transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
    white-space: nowrap !important; /* Prevent text from wrapping within a tab */
}

#reviewTabs .nav-link:hover {
    background-color: #e9ecef !important; /* Slightly darker on hover */
    border-color: #ced4da !important;
}

#reviewTabs .nav-link.active {
    background-color: var(--black) !important;
    color: var(--white) !important;
    border-color: var(--black) !important; /* Match border to background */
}

#reviewTabs .nav-link .badge {
    margin-left: 8px; /* Space between tab text and badge */
    font-size: 0.8em; /* Adjust badge size */
    padding: 0.3em 0.6em; /* Adjust badge padding */
}

/* Ensure tab content has some top margin if needed */
#reviewTabsContent {
    margin-top: 1rem;
}

/* Review Invoices Modal Table Column Widths */

/* For Review Tab */
#review-invoices-modal .table th.col-review-date,
#review-invoices-modal #for-review-invoices-tbody td:nth-child(2) { /* Corresponds to Date */
    width: 12% !important; 
    min-width: 90px !important;
}

#review-invoices-modal .table th.col-review-amount,
#review-invoices-modal #for-review-invoices-tbody td:nth-child(3) { /* Corresponds to Amount */
    width: 8% !important;
    min-width: 80px !important;
    text-align: right !important; /* Align amounts to the right */
}

#review-invoices-modal .table th.col-review-vendor,
#review-invoices-modal #for-review-invoices-tbody td:nth-child(4) { /* Corresponds to Vendor */
    width: 15% !important;
    min-width: 120px !important;
}

#review-invoices-modal .table th.col-review-note, /* This is our Description column */
#review-invoices-modal #for-review-invoices-tbody td:nth-child(7) { /* Corresponds to Note */
    width: 40% !important;
    min-width: 250px !important;
    word-break: break-word; /* Ensure long descriptions wrap */
}

/* Ensure other columns don't take up too much space unnecessarily */
#review-invoices-modal #for-review-invoices-tbody td:nth-child(1) { /* Checkbox */
    width: 50px !important; 
}
#review-invoices-modal #for-review-invoices-tbody td:nth-child(5) { /* Property */
    width: 10% !important;
    min-width: 100px !important;
}
#review-invoices-modal #for-review-invoices-tbody td:nth-child(6) { /* Unit */
    width: 8% !important;
    min-width: 70px !important;
}
#review-invoices-modal #for-review-invoices-tbody td:nth-child(8) { /* Invoice action */
    width: 7% !important;
    min-width: 60px !important;
}

/* CSV Import Styles */
.import-container {
  max-width: 900px;
  margin: 0 auto;
}

.upload-area {
  border: 2px dashed #ccc;
  border-radius: 5px;
  padding: 25px;
  text-align: center;
  margin: 20px 0;
  transition: all 0.3s;
}

.upload-area.drag-over {
  background-color: #f0f8ff;
  border-color: #0d6efd;
}

.progress-bar {
  width: 100%;
  height: 10px;
  background-color: #e9ecef;
  border-radius: 5px;
  margin: 10px 0;
}

.progress-bar-fill {
  height: 100%;
  background-color: #0d6efd;
  border-radius: 5px;
  width: 0%;
  transition: width 0.3s;
}

.status-message {
  margin: 10px 0;
  padding: 10px;
  border-radius: 5px;
}

.status-message.success {
  background-color: #d4edda;
  color: #155724;
}

.status-message.error {
  background-color: #f8d7da;
  color: #721c24;
}

.preview-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}

.preview-table th, .preview-table td {
  border: 1px solid #ddd;
  padding: 8px;
  text-align: left;
}

.preview-table th {
  background-color: #f2f2f2;
}

.hidden {
  display: none;
}

/* =====================================
   ENHANCED PROFESSIONAL STYLING 
   Apple/Uber-inspired Black & White Theme
   ===================================== */

/* Transaction Amount Colors */
.expense-amount {
  color: #dc3545 !important; /* Red color for expenses */
  font-weight: 600 !important;
}

.income-amount {
  color: #198754 !important; /* Green color for income */  
  font-weight: 600 !important;
}

/* Property Details Enhancement */
.property-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.property-detail-item {
  display: flex;
  align-items: center;
  padding: 1rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  border-left: 3px solid var(--black);
  transition: all var(--transition);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.property-detail-item:hover {
  background: var(--gray-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  border-left-color: var(--black);
}

.property-detail-icon {
  width: 20px;
  height: 20px;
  margin-right: 0.75rem;
  color: var(--black);
  flex-shrink: 0;
}

.property-detail-content {
  flex: 1;
}

.property-detail-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.25rem;
}

.property-detail-value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

/* Enhanced Table Styling */
.enhanced-table {
  min-width: 1200px; /* Increased to accommodate wider Note column */
  background: #ffffff; /* Pure white background */
  border-radius: 12px; /* Consistent rounded corners */
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06); /* Subtle elevation */
  border: 1px solid #e5e7eb; /* Light border for definition */
}

.enhanced-table thead th {
  background: var(--black);
  color: var(--white);
  font-weight: 600;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 1rem 0.75rem;
  border: none;
}

.enhanced-table tbody tr {
  transition: all var(--transition);
  border-bottom: 1px solid var(--border);
  height: 3.5rem; /* Fixed row height to prevent jumping */
}

.enhanced-table tbody tr:nth-child(even) {
  background-color: var(--gray-light);
}

.enhanced-table tbody tr:hover {
  background-color: #f3f3f3;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.enhanced-table tbody td {
  padding: 0.875rem 0.75rem;
  vertical-align: middle;
  font-size: 0.85rem;
  max-height: 3rem; /* Prevent cells from getting too tall */
  overflow: hidden;
  line-height: 1.3;
  height: 3.5rem;
  box-sizing: border-box;
}

/* Property List Table Enhancement */
.property-list-row {
  cursor: pointer;
  transition: all var(--transition);
}

.property-list-row.selected-property {
  background-color: var(--gray-light) !important;
  border-left: 4px solid var(--black);
}

.property-list-row:hover {
  background-color: #f7f7f7;
}

/* Status Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: 1px solid var(--border);
}

.status-badge.occupied {
  background-color: var(--white);
  color: var(--black);
  border-color: var(--black);
}

.status-badge.vacant {
  background-color: var(--white);
  color: var(--black);
  border: 1px solid var(--border);
}

/* CSV Preview Status Badges */
.status-badge.status-success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.status-badge.status-warning {
  background-color: #fff3cd;
  color: #856404;
  border: 1px solid #ffeaa7;
}

.status-badge.status-error {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* Action Buttons Enhancement */
.action-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.375rem 0.75rem;
  margin: 0 0.125rem;
  border-radius: var(--radius);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: all var(--transition);
  border: 1px solid var(--border);
  cursor: pointer;
}

.action-btn.edit {
  background-color: var(--black);
  color: var(--white);
  border-color: var(--black);
}

.action-btn.edit:hover {
  background-color: #111;
  transform: translateY(-1px);
}

.action-btn.delete {
  background-color: var(--white);
  color: var(--black);
  border-color: var(--black);
}

.action-btn.delete:hover {
  background-color: var(--gray-light);
  transform: translateY(-1px);
}

/* Occupancy Summary Enhancement */
.occupancy-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.occupancy-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
  transition: all var(--transition);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.occupancy-card:hover {
  border-color: var(--black);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}

.occupancy-card-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--black);
  margin-bottom: 0.5rem;
}

.occupancy-card-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Card Headers Enhancement */
.card-header-enhanced {
  background: var(--gray-light);
  border-bottom: 1px solid var(--border);
  margin: -1rem -1rem 1.5rem -1rem;
  padding: 1rem;
  border-radius: var(--radius) var(--radius) 0 0;
}

.card-title-enhanced {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--black);
  margin: 0;
  display: flex;
  align-items: center;
}

.card-title-icon {
  width: 24px;
  height: 24px;
  margin-right: 0.75rem;
  color: var(--black);
}

/* Utility Classes for Layout */
.cursor-pointer {
  cursor: pointer;
}

.selected-property {
  background-color: var(--gray-light) !important;
  border-left: 4px solid var(--black) !important;
}

/* Properties Page Tables - Apply Enhanced Styling */
#properties-view .min-w-full {
  @extend .enhanced-table;
}

#properties-view .bg-gray-50 {
  background: var(--black) !important;
  color: var(--white) !important;
}

#properties-view .bg-white.divide-y tr:hover {
  background-color: #f7f7f7;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

/* Shadow Cards Enhancement */
.shadow.rounded-lg {
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  border: 1px solid var(--border);
}

/* Grid Responsive Enhancement */
.grid.grid-cols-1.md\\:grid-cols-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

/* Professional Spacing */
.space-y-6 > * + * {
  margin-top: 1.5rem;
}

.space-y-4 > * + * {
  margin-top: 1rem;
}

/* Properties Page Header Enhancement */
.properties-header {
  margin-bottom: 2rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
}

.properties-header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
}

.properties-title-section {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.properties-title-accent {
  width: 4px;
  height: 60px;
  background: linear-gradient(180deg, var(--black) 0%, #333  100%);
  border-radius: 2px;
  flex-shrink: 0;
}

.properties-title-text {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.properties-main-title {
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--black);
  margin: 0;
  line-height: 1.2;
}

.properties-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0;
  font-weight: 400;
}

.properties-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.properties-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  background-color: var(--black);
  color: var(--white);
  border: 1px solid var(--black);
  border-radius: var(--radius);
  transition: all var(--transition);
  white-space: nowrap;
}

.properties-add-btn:hover {
  background-color: #111;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.properties-add-btn .btn-icon {
  width: 16px;
  height: 16px;
  margin: 0;
}

/* Responsive Design for Properties Header */
@media (max-width: 768px) {
  .properties-header-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .properties-title-section {
    align-self: stretch;
  }
  
  .properties-actions {
    align-self: stretch;
    justify-content: flex-end;
  }
  
  .properties-main-title {
    font-size: 1.5rem;
  }
  
  .properties-subtitle {
    font-size: 0.8rem;
  }
}

/* Dashboard Page Header Enhancement - reusing same design pattern */
.dashboard-header {
  margin-bottom: 2rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
}

.dashboard-header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
}

.dashboard-title-section {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.dashboard-title-accent {
  width: 4px;
  height: 60px;
  background: linear-gradient(180deg, var(--black) 0%, #333  100%);
  border-radius: 2px;
  flex-shrink: 0;
}

.dashboard-title-text {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.dashboard-main-title {
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--black);
  margin: 0;
  line-height: 1.2;
}

.dashboard-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0;
  font-weight: 400;
}

.dashboard-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.dashboard-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  background-color: var(--black);
  color: var(--white);
  border: 1px solid var(--black);
  border-radius: var(--radius);
  transition: all var(--transition);
  white-space: nowrap;
}

.dashboard-action-btn:hover {
  background-color: #111;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.dashboard-action-btn .btn-icon {
  width: 16px;
  height: 16px;
  margin: 0;
}

/* Login/Auth Action Styling */
.dashboard-auth-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.dashboard-auth-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  background-color: var(--white);
  color: var(--black);
  border: 1px solid var(--black);
  border-radius: var(--radius);
  transition: all var(--transition);
  white-space: nowrap;
}

.dashboard-auth-btn:hover {
  background-color: var(--gray-light);
  transform: translateY(-1px);
}

.dashboard-auth-btn.primary {
  background-color: var(--black);
  color: var(--white);
}

.dashboard-auth-btn.primary:hover {
  background-color: #111;
}

.dashboard-auth-btn .heroicon {
  width: 1rem;
  height: 1rem;
  margin-right: 0.375rem;
}

/* Responsive Design for Headers */
@media (max-width: 768px) {
  .dashboard-header-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .dashboard-title-section {
    align-self: stretch;
  }
  
  .dashboard-actions,
  .dashboard-auth-actions {
    align-self: stretch;
    justify-content: flex-end;
  }
  
  .dashboard-main-title {
    font-size: 1.5rem;
  }
  
  .dashboard-subtitle {
    font-size: 0.8rem;
  }
}

/* Responsive Design for Properties Header */
@media (max-width: 768px) {
  .properties-header-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .properties-title-section {
    align-self: stretch;
  }
  
  .properties-actions {
    align-self: stretch;
    justify-content: flex-end;
  }
  
  .properties-main-title {
    font-size: 1.5rem;
  }
  
  .properties-subtitle {
    font-size: 0.8rem;
  }
}

/* CSV Import Page Professional Styling */
.csv-import-header {
  margin-bottom: 2rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
}

.csv-import-header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
}

.csv-import-title-section {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.csv-import-title-accent {
  width: 4px;
  height: 60px;
  background: linear-gradient(180deg, var(--black) 0%, #333  100%);
  border-radius: 2px;
  flex-shrink: 0;
}

.csv-import-title-text {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.csv-import-main-title {
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--black);
  margin: 0;
  line-height: 1.2;
}

.csv-import-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0;
  font-weight: 400;
}

.csv-import-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Enhanced Upload Area Styling */
.csv-upload-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  margin-bottom: 1.5rem;
  text-align: center;
}

.csv-upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 3rem 2rem;
  margin: 1.5rem 0;
  transition: all var(--transition);
  background: var(--gray-light);
  cursor: pointer;
}

.csv-upload-area:hover,
.csv-upload-area.drag-over {
  border-color: var(--black);
  background: var(--white);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.csv-upload-area p {
  margin: 0;
  font-size: 1.1rem;
  color: var(--text-muted);
  font-weight: 500;
}

.csv-upload-area:hover p {
  color: var(--black);
}

.csv-file-select-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  background-color: var(--black);
  color: var(--white);
  border: 1px solid var(--black);
  border-radius: var(--radius);
  transition: all var(--transition);
  margin-top: 1rem;
}

.csv-file-select-btn:hover {
  background-color: #111;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Collapsible Instructions Styling */
.csv-instructions-toggle {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.csv-instructions-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  margin: 0;
  padding: 0;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
}

.csv-instructions-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--black);
}

.csv-instructions-icon {
  width: 20px;
  height: 20px;
  color: var(--text-muted);
  transition: transform var(--transition);
}

.csv-instructions-toggle[aria-expanded="true"] .csv-instructions-icon {
  transform: rotate(90deg);
}

.csv-instructions-toggle[aria-expanded="true"] .csv-instructions-content {
  display: block !important;
}

/* Stripe Setup Status Display */
.stripe-status-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
}

.connection-status {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
}

.connection-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--gray-light);
}

.connection-icon i {
  font-size: 1.5rem;
}

.connection-details h4 {
  margin: 0 0 0.25rem 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--black);
}

.connection-details p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.4;
}

#stripe-onboard-btn {
  flex-shrink: 0;
  margin-left: 1rem;
}

.csv-instructions-content {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text);
}

.csv-instructions-content ul {
  margin-left: 1rem;
  margin-bottom: 0.75rem;
}

.csv-instructions-content li {
  margin-bottom: 0.5rem;
}

.csv-instructions-content strong {
  color: var(--black);
  font-weight: 600;
}

.csv-instructions-note {
  background: var(--gray-light);
  padding: 0.75rem;
  border-radius: var(--radius);
  border-left: 3px solid var(--black);
  margin-top: 1rem;
  font-size: 0.85rem;
}

/* Progress and Status Enhancement */
.csv-progress-card,
.csv-preview-card,
.csv-results-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  margin-bottom: 1.5rem;
}

.csv-preview-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.csv-summary-item {
  background: var(--gray-light);
  padding: 1rem;
  border-radius: var(--radius);
  text-align: center;
  border-left: 3px solid var(--black);
}

.csv-summary-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--black);
  margin-bottom: 0.25rem;
}

.csv-summary-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Preview Table Enhancement */
.csv-preview-table {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  border: 1px solid var(--border);
}

.csv-preview-table thead th {
  background: var(--black);
  color: var(--white);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.875rem 0.75rem;
  border: none;
}

.csv-preview-table tbody tr {
  transition: all var(--transition);
  border-bottom: 1px solid var(--border);
}

.csv-preview-table tbody tr:nth-child(even) {
  background-color: var(--gray-light);
}

.csv-preview-table tbody tr:hover {
  background-color: #f3f3f3;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.csv-preview-table tbody td {
  padding: 0.75rem;
  vertical-align: middle;
  font-size: 0.85rem;
}

/* Responsive Design for CSV Import */
@media (max-width: 768px) {
  .csv-import-header-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .csv-import-title-section {
    align-self: stretch;
  }
  
  .csv-import-actions {
    align-self: stretch;
    justify-content: flex-end;
  }
  
  .csv-import-main-title {
    font-size: 1.5rem;
  }
  
  .csv-import-subtitle {
    font-size: 0.8rem;
  }
  
  .csv-upload-area {
    padding: 2rem 1rem;
  }
  
  .csv-preview-summary {
    grid-template-columns: 1fr;
  }
}

/* Enhanced Dashboard Action Bar */
.dashboard-action-bar {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.action-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.action-group.primary {
  flex: 0 0 auto;
}

.action-group.secondary {
  flex: 1;
  justify-content: center;
  min-width: 200px;
}

.action-group.filters {
  flex: 0 0 auto;
}

/* Enhanced Dropdown Styling */
.action-dropdown {
  position: relative;
  display: inline-block;
}

.action-dropdown-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  background-color: var(--white);
  color: var(--black);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all var(--transition);
  cursor: pointer;
  white-space: nowrap;
}

.action-dropdown-btn:hover {
  background-color: var(--gray-light);
  border-color: var(--black);
  transform: translateY(-1px);
}

.action-dropdown-btn.primary {
  background-color: var(--black);
  color: var(--white);
  border-color: var(--black);
}

.action-dropdown-btn.primary:hover {
  background-color: #111;
}

.action-dropdown-btn .dropdown-arrow {
  width: 14px;
  height: 14px;
  margin-left: 0.25rem;
  transition: transform var(--transition);
}

.action-dropdown[aria-expanded="true"] .dropdown-arrow {
  transform: rotate(180deg);
}

.action-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 1000;
  min-width: 220px; /* Increased from 200px to prevent text wrapping */
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  padding: 0.5rem 0;
  margin-top: 0.25rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all var(--transition);
}

.action-dropdown[aria-expanded="true"] .action-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.action-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  color: var(--text);
  text-decoration: none;
  transition: background-color var(--transition);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.action-dropdown-item:hover {
  background-color: var(--gray-light);
  color: var(--black);
}

.action-dropdown-item.danger:hover {
  background-color: #fef2f2;
  color: #dc3545;
}

.action-dropdown-item .item-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Filter Controls Enhancement */
.filter-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.filter-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.filter-select {
  min-width: 140px;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background-color: var(--white);
  color: var(--text);
  transition: border-color var(--transition);
}

.filter-select:focus {
  outline: none;
  border-color: var(--black);
  box-shadow: 0 0 0 2px rgba(0,0,0,0.1);
}

/* Compact Table Actions */
.table-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  justify-content: flex-end;
}

.table-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--white);
  color: var(--text-muted);
  font-size: 0.75rem;
  transition: all var(--transition);
  cursor: pointer;
  position: relative;
}

.table-action-btn:hover {
  background: var(--gray-light);
  color: var(--black);
  border-color: var(--black);
  transform: translateY(-1px);
}

.table-action-btn.edit {
  color: var(--black);
}

.table-action-btn.edit:hover {
  background: var(--black);
  color: var(--white);
}

.table-action-btn.delete:hover {
  background-color: var(--red);
  color: var(--white);
}

/* Table Action Dropdown Alternative */
.table-action-dropdown {
  position: relative;
  display: inline-block;
}

.table-action-dropdown-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--white);
  color: var(--text-muted);
  font-size: 0.75rem;
  transition: all var(--transition);
  cursor: pointer;
}

.table-action-dropdown-btn:hover {
  background: var(--gray-light);
  color: var(--black);
  border-color: var(--black);
}

.table-action-dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 1000;
  min-width: 120px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  padding: 0.25rem 0;
  margin-top: 0.25rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all var(--transition);
}

.table-action-dropdown[aria-expanded="true"] .table-action-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.table-action-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  color: var(--text);
  text-decoration: none;
  transition: background-color var(--transition);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.table-action-dropdown-item:hover {
  background-color: var(--gray-light);
  color: var(--black);
}

.table-action-dropdown-item.danger:hover {
  background-color: #fef2f2;
  color: #dc3545;
}

.table-action-dropdown-item .item-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* Tooltip Styling */
.tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--black);
  color: var(--white);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition);
  pointer-events: none;
  margin-bottom: 0.25rem;
  z-index: 1000;
}

.tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: var(--black);
}

.table-action-btn:hover .tooltip {
  opacity: 1;
  visibility: visible;
}

/* Responsive Action Bar */
@media (max-width: 768px) {
  .dashboard-action-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }
  
  .action-group {
    justify-content: center;
  }
  
  .action-group.primary,
  .action-group.secondary,
  .action-group.filters {
    flex: none;
    width: 100%;
  }
  
  .filter-controls {
    justify-content: space-between;
  }
}

@media (max-width: 576px) {
  .filter-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
  
  .filter-select {
    min-width: auto;
  }
}

/* Specific column width and text handling */
.enhanced-table th[data-field="note"],
.enhanced-table td:nth-child(11) { /* Note column - adjust number based on your table structure */
  max-width: 200px;
  width: 200px;
}

.enhanced-table th[data-field="description"],
.enhanced-table td:nth-child(3) { /* Description column */
  max-width: 150px;
  width: 150px;
}

.enhanced-table th[data-field="vendor_name"],
.enhanced-table td:nth-child(6) { /* Vendor column */
  max-width: 120px;
  width: 120px;
}

/* Text truncation for long content */
.table-cell-truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
  position: relative;
  cursor: help;
}

.table-cell-truncate.description {
  max-width: 150px;
}

.table-cell-truncate.vendor {
  max-width: 120px;
}

.table-cell-truncate.note {
  max-width: 200px;
}

/* Enhanced tooltip for truncated text */
.table-cell-truncate:hover::after {
  content: attr(data-full-text);
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  background: var(--black);
  color: var(--white);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  font-size: 0.8rem;
  line-height: 1.4;
  white-space: normal;
  word-wrap: break-word;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  margin-bottom: 0.5rem;
  min-width: 200px;
  max-width: 300px;
  opacity: 0;
  visibility: hidden;
  animation: fadeInTooltip 0.2s ease-in-out forwards;
}

@keyframes fadeInTooltip {
  from {
    opacity: 0;
    visibility: hidden;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
}

/* Amount column alignment */
.enhanced-table th[data-field="amount"],
.enhanced-table td:nth-child(7) { /* Amount column */
  text-align: right;
  padding-right: 1rem;
}

/* Actions column */
.enhanced-table th[data-field="actions"],
.enhanced-table td:last-child {
  width: 80px;
  text-align: center;
  padding: 0.5rem;
}

/* Enhanced Gmail filter table actions */
.enhanced-table .table-actions .table-action-btn:hover.delete {
  background-color: var(--red);
  color: var(--white);
}

/* ================================================
   FINANCIAL METRICS DASHBOARD
   ================================================ */

.financial-metrics-section {
  margin: 2rem 0;
  background: #ffffff; /* Pure white background */
  border-radius: 12px; /* Consistent rounded corners */
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06); /* Subtle elevation */
  border: 1px solid #e5e7eb; /* Light border for definition */
  overflow: hidden;
}

/* Metrics Filter Controls */
.metrics-filters {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.25rem 1.5rem;
  background: linear-gradient(135deg, #f8f9fa 0%, #f1f3f4 100%);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.metrics-filter-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.metrics-filter-group .filter-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--black);
  white-space: nowrap;
  margin: 0;
}

.metrics-filter-group .filter-select {
  min-width: 140px;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--white);
  font-size: 0.875rem;
  transition: all var(--transition);
}

.metrics-filter-group .filter-select:focus {
  outline: none;
  border-color: var(--black);
  box-shadow: 0 0 0 3px rgba(0,0,0,0.1);
}

.metrics-filter-group .filter-select:disabled {
  background: #f5f5f5;
  color: #999;
  cursor: not-allowed;
}

.metrics-refresh-btn {
  margin-left: auto;
  padding: 0.5rem;
  background: var(--black);
  color: var(--white);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
}

.metrics-refresh-btn:hover {
  background: #333;
  transform: scale(1.05);
}

.metrics-refresh-btn i {
  font-size: 1rem;
}

/* Metrics Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  padding: 1.5rem;
  background: var(--white);
}

/* Metric Cards */
.metric-card {
  background: #ffffff; /* Pure white background */
  border: 1px solid #e5e7eb; /* Light border for definition */
  border-radius: 12px; /* Consistent rounded corners */
  padding: 1.25rem;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
  min-height: 140px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06); /* Subtle elevation */
}

.metric-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--black);
  transition: all var(--transition);
}

.metric-card.income::before {
  background: var(--black);
}

.metric-card.expense::before {
  background: #333;
}

.metric-card.net-income::before {
  background: #555;
}

.metric-card.cash-flow::before {
  background: #777;
}

.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12), 0 2px 4px rgba(0, 0, 0, 0.08); /* Enhanced hover shadow */
  border-color: #d1d5db; /* Slightly darker border on hover */
}

.metric-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.metric-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--white);
  background: var(--black);
  border: 2px solid var(--black);
}

.metric-card.income .metric-card-icon {
  background: var(--black);
  border-color: var(--black);
}

.metric-card.expense .metric-card-icon {
  background: var(--white);
  color: var(--black);
  border-color: var(--black);
}

.metric-card.net-income .metric-card-icon {
  background: var(--black);
  border-color: var(--black);
  border-style: dashed;
}

.metric-card.cash-flow .metric-card-icon {
  background: var(--white);
  color: var(--black);
  border-color: var(--black);
  border-width: 3px;
}

.metric-card-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.metric-card-content {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.metric-card-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--black);
  line-height: 1;
}

.metric-card-change {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
}

.change-icon {
  font-weight: 600;
  font-size: 0.9rem;
}

.change-text {
  font-weight: 500;
}

.metric-card-change.positive {
  color: var(--black);
}

.metric-card-change.negative {
  color: #666;
}

.metric-card-change.neutral {
  color: #6b7280;
}

.metric-card-change.positive .change-icon::before {
  content: '↗';
}

.metric-card-change.negative .change-icon::before {
  content: '↘';
}

.metric-card-change.neutral .change-icon::before {
  content: '→';
}

/* Metrics Summary Bar */
.metrics-summary {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 1rem 1.5rem;
  background: #f8f9fa;
  border-top: 1px solid var(--border);
  font-size: 0.875rem;
  flex-wrap: wrap;
}

.summary-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.summary-label {
  font-weight: 500;
  color: #6b7280;
}

.summary-value {
  font-weight: 600;
  color: var(--black);
}

/* Loading States */
.metric-card.loading .metric-card-value {
  background: linear-gradient(90deg, #f0f0f0 25%, transparent 37%, #f0f0f0 63%);
  background-size: 400% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  color: transparent;
  border-radius: 4px;
  height: 2rem;
}

@keyframes shimmer {
  0% {
    background-position: 100% 50%;
  }
  100% {
    background-position: -100% 50%;
  }
}

/* Responsive Design */
@media (max-width: 1200px) {
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    padding: 1.25rem;
  }
}

@media (max-width: 768px) {
  .metrics-filters {
    padding: 1rem;
    gap: 1rem;
  }
  
  .metrics-filter-group .filter-select {
    min-width: 120px;
  }
  
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    padding: 1rem;
  }
  
  .metric-card {
    padding: 1rem;
    min-height: 120px;
  }
  
  .metric-card-value {
    font-size: 1.25rem;
  }
  
  .metric-card-title {
    font-size: 0.7rem;
  }
  
  .metrics-summary {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
  }
}

@media (max-width: 576px) {
  .metrics-filters {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }
  
  .metrics-filter-group {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }
  
  .metrics-filter-group .filter-select {
    width: 100%;
    min-width: auto;
  }
  
  .metrics-refresh-btn {
    margin: 0;
    align-self: flex-end;
  }
  
  .metrics-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  
  .metric-card {
    min-height: 100px;
  }
}

/* Enhanced Dashboard Styles */
.enhanced-metrics-section {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.secondary-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.secondary-metric-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  transition: all var(--transition);
}

.secondary-metric-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.secondary-metric-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 500;
}

.secondary-metric-header i {
  font-size: 1rem;
}

.secondary-metric-value {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
}

/* Insights Section */
.insights-section {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.insights-header {
  margin-bottom: 1rem;
}

.insights-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.insights-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.insight-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--gray-light);
  border-radius: calc(var(--radius) - 2px);
  border-left: 3px solid transparent;
}

.insight-item.positive {
  border-left-color: #10b981;
  background: #f0fdf4;
}

.insight-item.negative {
  border-left-color: #ef4444;
  background: #fef2f2;
}

.insight-item.neutral {
  border-left-color: #6b7280;
  background: var(--gray-light);
}

.insight-icon {
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.125rem;
}

.insight-content {
  flex: 1;
}

.insight-text {
  font-size: 0.875rem;
  color: var(--text);
  line-height: 1.5;
  margin: 0;
}

/* Charts Section */
.charts-section {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

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

.charts-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.chart-controls {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.chart-control-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.chart-control-label {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 500;
}

.chart-control-select {
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  background-color: var(--white);
  color: var(--text);
  min-width: 120px;
}

.chart-control-select:focus {
  outline: none;
  border-color: var(--black);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
}

.charts-grid {
  display: grid;
  gap: 1.5rem;
}

.chart-container {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.chart-container.main-chart {
  grid-column: 1 / -1;
}

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

.chart-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.chart-legend {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.legend-color {
  width: 12px;
  height: 12px;
  border-radius: 2px;
}

.legend-color.income {
  background-color: #10b981;
}

.legend-color.expenses {
  background-color: #ef4444;
}

.legend-color.net-income {
  background-color: #3b82f6;
}

.chart-wrapper {
  position: relative;
  width: 100%;
  max-width: 100%;
  min-height: 300px;
  max-height: 400px;
  margin: 1rem 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chart-wrapper canvas {
  max-width: 100% !important;
  max-height: 100% !important;
  width: auto !important;
  height: auto !important;
}

.chart-summary {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.chart-summary-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.chart-summary-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.chart-summary-value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.chart-summary-value.positive {
  color: #10b981;
}

.chart-summary-value.negative {
  color: #ef4444;
}

/* Loading States */
.chart-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 300px;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.chart-loading::before {
  content: '';
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top: 2px solid var(--text-muted);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-right: 0.5rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .charts-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .chart-controls {
    width: 100%;
    justify-content: flex-start;
  }
  
  .chart-legend {
    flex-wrap: wrap;
  }
}

@media (max-width: 768px) {
  .secondary-metrics-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem;
  }
  
  .secondary-metric-card {
    padding: 0.75rem;
  }
  
  .secondary-metric-value {
    font-size: 1.125rem;
  }
  
  .charts-section,
  .insights-section {
    padding: 1rem;
  }
  
  .chart-wrapper {
    height: 250px;
  }
  
  .chart-controls {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  
  .chart-control-group {
    width: 100%;
    justify-content: space-between;
  }
  
  .chart-control-select {
    min-width: 100px;
  }
  
  .chart-summary {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .chart-summary-item {
    width: 100%;
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

@media (max-width: 576px) {
  .secondary-metrics-grid {
    grid-template-columns: 1fr;
  }
  
  .chart-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .chart-legend {
    width: 100%;
    justify-content: flex-start;
  }
}

/* ===============================
   Enhanced Dashboard Styles
   =============================== */

.dashboard-container {
    position: relative;
}

/* Phase 2: Mode Toggle Styles */
.dashboard-mode-toggle {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.dashboard-mode-toggle .btn-group .btn {
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.dashboard-mode-toggle .btn-group .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.dashboard-mode-toggle .btn-group .btn.active {
    background-color: #0d6efd;
    border-color: #0d6efd;
    color: white;
}

.dashboard-mode-toggle .btn-group .btn i {
    margin-right: 0.5rem;
}

/* Phase 2: Loading Overlay */
.dashboard-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: none;
    z-index: 1000;
    backdrop-filter: blur(2px);
}

.dashboard-loading-overlay .spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Phase 2: Forecast Section Styles */
.forecast-insights-section {
    background: linear-gradient(135deg, #f8f9ff 0%, #ffffff 100%);
    border: 1px solid #e3e6f0;
    border-radius: 0.75rem;
    padding: 2rem;
    margin-bottom: 2rem;
}

.forecast-insights-section h4 {
    color: #2c3e50;
    font-weight: 600;
    margin-bottom: 1rem;
}

.forecast-insights-section .alert {
    border: none;
    border-radius: 0.5rem;
    font-weight: 500;
}

.forecast-insights-section .card {
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
}

.forecast-insights-section .card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

/* Phase 2: Portfolio Comparison Styles */
.portfolio-comparison-section {
    background: linear-gradient(135deg, #fff8f0 0%, #ffffff 100%);
    border: 1px solid #e3e6f0;
    border-radius: 0.75rem;
    padding: 2rem;
    margin-bottom: 2rem;
}

.portfolio-comparison-section h4 {
    color: #2c3e50;
    font-weight: 600;
    margin-bottom: 1rem;
}

.portfolio-comparison-section .table {
    background: white;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.portfolio-comparison-section .table th {
    background: #f8f9fa;
    border: none;
    font-weight: 600;
    color: #495057;
    padding: 1rem;
}

.portfolio-comparison-section .table td {
    border: none;
    padding: 1rem;
    vertical-align: middle;
}

.portfolio-comparison-section .progress {
    background-color: #f1f3f4;
    border-radius: 10px;
}

.portfolio-comparison-section .progress-bar {
    border-radius: 10px;
    transition: width 0.6s ease;
}

/* Phase 2: KPI Dashboard Styles */
.kpi-dashboard-section {
    background: linear-gradient(135deg, #f0fff4 0%, #ffffff 100%);
    border: 1px solid #e3e6f0;
    border-radius: 0.75rem;
    padding: 2rem;
    margin-bottom: 2rem;
}

.kpi-dashboard-section h4 {
    color: #2c3e50;
    font-weight: 600;
    margin-bottom: 1rem;
}

.kpi-dashboard-section .card {
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    background: white;
}

.kpi-dashboard-section .card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    transform: translateY(-4px);
}

.kpi-dashboard-section .card-body {
    padding: 1.5rem;
}

.kpi-dashboard-section .badge {
    font-size: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
}

.kpi-dashboard-section .metric-value {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.kpi-dashboard-section .metric-label {
    font-size: 0.875rem;
    color: #6c757d;
    font-weight: 500;
}

.kpi-dashboard-section .progress {
    height: 8px;
    background-color: #f1f3f4;
    border-radius: 4px;
}

.kpi-dashboard-section .progress-bar {
    border-radius: 4px;
    transition: width 0.6s ease;
}

/* Phase 2: Export Modal Styles */
#export-dashboard-modal .modal-content {
    border: none;
    border-radius: 1rem;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

#export-dashboard-modal .modal-header {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border-radius: 1rem 1rem 0 0;
    border: none;
}

#export-dashboard-modal .modal-title {
    font-weight: 600;
}

#export-dashboard-modal .btn-close {
    filter: invert(1);
}

#export-dashboard-modal .form-label {
    font-weight: 600;
    color: #495057;
}

#export-dashboard-modal .form-select,
#export-dashboard-modal .form-check-input {
    border-radius: 0.5rem;
}

#export-dashboard-modal .form-check {
    padding: 0.5rem 0;
}

#export-dashboard-modal .form-check-label {
    margin-left: 0.5rem;
    cursor: pointer;
}

#export-dashboard-modal .btn-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border: none;
    border-radius: 0.5rem;
    padding: 0.75rem 2rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

#export-dashboard-modal .btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

/* Phase 2: Enhanced Metric Cards */
.metric-card {
    background: white;
    border: 1px solid #e3e6f0;
    border-radius: 0.75rem;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.metric-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    transform: translateY(-4px);
    border-color: #0d6efd;
}

.metric-card .metric-value {
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.metric-card .metric-label {
    font-size: 0.875rem;
    color: #6c757d;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Phase 2: Chart Enhancements */
#chart-section {
    position: relative;
}

#chart-section .chart-controls {
    background: #f8f9fa;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

#chart-section .chart-controls .form-select {
    border-radius: 0.375rem;
    border: 1px solid #dee2e6;
}

/* Phase 2: Responsive Design */
@media (max-width: 768px) {
    .dashboard-mode-toggle .btn-group {
        flex-direction: column;
        width: 100%;
    }
    
    .dashboard-mode-toggle .btn-group .btn {
        border-radius: 0.375rem !important;
        margin-bottom: 0.5rem;
    }
    
    .forecast-insights-section,
    .portfolio-comparison-section,
    .kpi-dashboard-section {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .metric-card {
        margin-bottom: 1rem;
    }
    
    .kpi-dashboard-section .metric-value {
        font-size: 1.25rem;
    }
}

@media (max-width: 576px) {
    .dashboard-mode-toggle .btn-group .btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
    
    .dashboard-mode-toggle .btn-group .btn i {
        margin-right: 0.25rem;
    }
    
    .metric-card .metric-value {
        font-size: 1.5rem;
    }
    
    .portfolio-comparison-section .table-responsive {
        font-size: 0.875rem;
    }
}

/* Phase 2: Animation Classes */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

.slide-in-up {
    animation: slideInUp 0.6s ease-out;
}

/* Phase 2: Status Indicators */
.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.status-indicator.good {
    color: #28a745;
}

.status-indicator.warning {
    color: #ffc107;
}

.status-indicator.danger {
    color: #dc3545;
}

.status-indicator i {
    font-size: 1.2em;
}

/* Phase 2: Enhanced Alerts */
.alert {
    border: none;
    border-radius: 0.75rem;
    padding: 1rem 1.5rem;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.alert-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
}

.alert-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: #856404;
}

.alert-danger {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
}

.alert-info {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    color: #0c5460;
}

/* Phase 2: Toast Notifications */
.toast {
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.toast .toast-body {
    font-weight: 500;
}

/* Phase 2: Enhanced Progress Bars */
.progress {
    background-color: #f1f3f4;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
}

.progress-bar {
    border-radius: 10px;
    background: linear-gradient(90deg, #28a745 0%, #20c997 100%);
    transition: width 0.6s ease, background-color 0.3s ease;
}

.progress-bar.bg-warning {
    background: linear-gradient(90deg, #ffc107 0%, #ffca2c 100%);
}

.progress-bar.bg-danger {
    background: linear-gradient(90deg, #dc3545 0%, #e65063 100%);
}

/* ===============================
   Existing Dashboard Styles
   =============================== */
  
/* Loading States */
.metric-card.loading {
  opacity: 0.7;
  pointer-events: none;
}

.metric-card.loading .metric-card-value {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  color: transparent;
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* Expense Breakdown Section */
.expense-breakdown-section {
  margin-top: 2rem;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 1rem;
}

.section-title i {
  color: var(--primary);
}

.expense-breakdown-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}

.expense-breakdown-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: all 0.2s ease;
}

.expense-breakdown-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.expense-breakdown-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.expense-breakdown-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: rgba(74, 144, 226, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.expense-breakdown-icon i {
  font-size: 1.25rem;
  color: var(--primary);
}

.expense-breakdown-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.expense-breakdown-content {
  text-align: center;
}

.expense-breakdown-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.expense-breakdown-description {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Responsive breakpoints */
@media (max-width: 768px) {
  .expense-breakdown-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
  }
  
  .expense-breakdown-card {
    padding: 1rem;
  }
  
  .expense-breakdown-value {
    font-size: 1.5rem;
  }
  
  .expense-breakdown-header {
    gap: 0.5rem;
  }
  
  .expense-breakdown-icon {
    width: 2rem;
    height: 2rem;
  }
  
  .expense-breakdown-icon i {
    font-size: 1rem;
  }
}

/* ======================================
   REDESIGNED DASHBOARD METRICS STYLES
   ====================================== */

/* Primary Cash Flow Card - Hero Metric */
.primary-metric-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 1rem;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 10px 25px rgba(102, 126, 234, 0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.primary-metric-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 35px rgba(102, 126, 234, 0.3);
}

.primary-metric-header {
  display: flex;
  align-items: center;
  margin-bottom: 1.5rem;
}

.primary-metric-icon {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 0.75rem;
  padding: 1rem;
  margin-right: 1rem;
  backdrop-filter: blur(10px);
}

.primary-metric-icon i {
  font-size: 1.5rem;
  color: white;
}

.primary-metric-info h3 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
}

.primary-metric-subtitle {
  margin: 0.25rem 0 0 0;
  font-size: 0.9rem;
  opacity: 0.9;
}

.primary-metric-content {
  text-align: left;
}

.primary-metric-value {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.primary-metric-change {
  display: flex;
  align-items: center;
  font-size: 0.9rem;
  margin-bottom: 1rem;
  opacity: 0.9;
}

.primary-metric-breakdown {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 0.5rem;
  padding: 1rem;
  backdrop-filter: blur(10px);
}

.primary-metric-breakdown .breakdown-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.primary-metric-breakdown .breakdown-item:last-child {
  margin-bottom: 0;
}

.primary-metric-breakdown .breakdown-label {
  font-size: 0.9rem;
  opacity: 0.9;
}

.primary-metric-breakdown .breakdown-value {
  font-weight: 600;
  font-size: 1rem;
}

/* Compact Metrics Bar */
.compact-metrics-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
  background: #ffffff; /* Pure white background */
  border: 1px solid #e5e7eb; /* Light border for definition */
  border-radius: 12px; /* Consistent rounded corners */
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06); /* Subtle elevation */
}

.compact-metric {
  display: flex;
  align-items: center;
  padding: 0.75rem;
  border-radius: 0.5rem;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.compact-metric:hover {
  background: var(--gray-light);
  transform: translateY(-1px);
}

.compact-metric-icon {
  margin-right: 0.75rem;
  padding: 0.5rem;
  border-radius: 0.5rem;
  flex-shrink: 0;
}

.compact-metric.income .compact-metric-icon {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.compact-metric.expense .compact-metric-icon {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.compact-metric.noi .compact-metric-icon {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

.compact-metric.margin .compact-metric-icon {
  background: rgba(168, 85, 247, 0.1);
  color: #a855f7;
}

.compact-metric-icon i {
  font-size: 1.25rem;
}

.compact-metric-content {
  flex: 1;
  min-width: 0;
}

.compact-metric-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
  font-weight: 500;
}

.compact-metric-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.compact-metric-change {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
}

.compact-metric-change .change-icon {
  margin-right: 0.25rem;
}

/* Collapsible Expense Breakdown */
.expense-breakdown-section {
  background: white;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  margin-bottom: 2rem;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.breakdown-toggle {
  padding: 1.5rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
  border-bottom: 1px solid var(--border);
}

.breakdown-toggle:hover {
  background: var(--gray-light);
}

.breakdown-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.breakdown-title i {
  margin-right: 0.5rem;
  color: var(--text-muted);
}

.breakdown-total {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-left: auto;
  margin-right: 1rem;
}

.breakdown-arrow {
  transition: transform 0.2s ease;
  color: var(--text-muted);
}

.breakdown-toggle[aria-expanded="true"] .breakdown-arrow {
  transform: rotate(180deg);
}

.breakdown-content {
  padding: 0 1.5rem 1.5rem 1.5rem;
  display: none;
}

.breakdown-content.show {
  display: block;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    max-height: 0;
  }
  to {
    opacity: 1;
    max-height: 200px;
  }
}

.breakdown-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.breakdown-item-card {
  background: var(--gray-light);
  border-radius: 0.5rem;
  padding: 1rem;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.breakdown-item-card:hover {
  background: #f0f0f0;
  transform: translateY(-1px);
}

.breakdown-item-header {
  display: flex;
  align-items: center;
  margin-bottom: 0.75rem;
}

.breakdown-item-icon {
  margin-right: 0.75rem;
  color: var(--text-muted);
  font-size: 1.1rem;
}

.breakdown-item-info {
  flex: 1;
}

.breakdown-item-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.breakdown-item-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.breakdown-item-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.breakdown-item-percentage {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Enhanced Summary Bar */
.metrics-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--gray-light);
  border-radius: 0.5rem;
  padding: 1rem 1.5rem;
  margin-bottom: 2rem;
  font-size: 0.85rem;
}

.summary-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.summary-label {
  color: var(--text-muted);
  font-weight: 500;
}

.summary-value {
  font-weight: 600;
  color: var(--text);
}

/* Responsive Design */
@media (max-width: 1024px) {
  .compact-metrics-bar {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
    padding: 1.25rem;
  }
  
  .breakdown-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
}

@media (max-width: 768px) {
  .primary-metric-card {
    padding: 1.5rem;
    text-align: center;
  }
  
  .primary-metric-header {
    flex-direction: column;
    text-align: center;
    margin-bottom: 1rem;
  }
  
  .primary-metric-icon {
    margin-right: 0;
    margin-bottom: 1rem;
  }
  
  .primary-metric-value {
    font-size: 2.5rem;
  }
  
  .compact-metrics-bar {
    grid-template-columns: 1fr;
    gap: 0.5rem;
    padding: 1rem;
  }
  
  .compact-metric {
    padding: 1rem;
  }
  
  .breakdown-grid {
    grid-template-columns: 1fr;
  }
  
  .metrics-summary {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }
  
  .summary-item {
    justify-content: center;
  }
}

@media (max-width: 576px) {
  .primary-metric-value {
    font-size: 2rem;
  }
  
  .breakdown-toggle {
    padding: 1rem;
  }
  
  .breakdown-content {
    padding: 0 1rem 1rem 1rem;
  }
  
  .breakdown-item-card {
    padding: 0.75rem;
  }
}

/* Enhanced Chart Controls */
.chart-controls {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 16px;
  border: 1px solid #e9ecef;
  margin-bottom: 16px;
}

.chart-control-row {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.chart-control-row:last-child {
  margin-bottom: 0;
}

.chart-control-group {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.chart-control-label {
  font-weight: 600;
  color: #374151;
  font-size: 14px;
  white-space: nowrap;
  margin: 0;
}

.chart-control-select {
  padding: 6px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: white;
  font-size: 14px;
  min-width: 120px;
  transition: border-color 0.2s ease;
}

.chart-control-select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.chart-control-select:disabled {
  background-color: #f3f4f6;
  color: #9ca3af;
  cursor: not-allowed;
}

/* Metric Checkboxes */
.metric-checkboxes {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.metric-checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  margin: 0;
  font-weight: normal;
}

.metric-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #3b82f6;
  cursor: pointer;
}

.checkbox-label {
  font-size: 14px;
  color: #374151;
  cursor: pointer;
  user-select: none;
}

.metric-checkbox:hover .checkbox-label {
  color: #1f2937;
}

/* Chart Refresh Button */
.chart-refresh-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: white;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chart-refresh-btn:hover {
  background: #f3f4f6;
  color: #374151;
  border-color: #9ca3af;
}

.chart-refresh-btn:active {
  transform: scale(0.95);
}

.chart-refresh-btn i {
  font-size: 16px;
}

/* Responsive Design */
@media (max-width: 768px) {
  .chart-control-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .metric-checkboxes {
    width: 100%;
  }
  
  .chart-control-select {
    width: 100%;
    min-width: unset;
  }
}

/* Chart Loading State */
.chart-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
  background: #f8f9fa;
  border-radius: 8px;
  color: #6b7280;
  font-size: 14px;
}

.chart-loading i {
  margin-right: 8px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Custom date range styling */
.custom-date-range {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.5rem;
  padding: 0.75rem;
  background-color: #f8f9fa;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all var(--transition);
}

.date-input-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.date-label {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
}

.date-input {
  padding: 0.25rem 0.375rem;
  font-size: 0.75rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  background-color: var(--white);
  color: var(--text);
  width: 75px;
  flex-shrink: 0;
  box-sizing: border-box;
}

.date-input:focus {
  outline: none;
  border-color: var(--black);
  box-shadow: 0 0 0 2px rgba(0,0,0,0.1);
}

.apply-custom-btn {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  background-color: var(--black);
  color: var(--white);
  border: 1px solid var(--black);
  border-radius: calc(var(--radius) * 0.75);
  cursor: pointer;
  transition: background-color var(--transition);
  white-space: nowrap;
}

.apply-custom-btn:hover {
  background-color: #111;
}

/* Responsive adjustments for custom date range */
@media (max-width: 768px) {
  .custom-date-range {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }
  
  .date-input-group {
    justify-content: space-between;
  }
  
  .date-input {
    width: auto;
    flex: 1;
  }
}

@media (max-width: 576px) {
  .custom-date-range {
    margin-top: 0.75rem;
    padding: 1rem;
  }
  
  .date-input-group {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .date-label {
    text-align: left;
  }
}

/* ===== ENHANCED ACTION BAR REORGANIZATION ===== */

/* Main container with professional two-row layout */
.enhanced-action-bar {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 24px;
    overflow: visible !important;
    position: relative;
    z-index: 1000;
}

/* Action bar rows */
.action-bar-row {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    min-height: 56px;
}

.action-bar-row.primary-row {
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    justify-content: space-between;
}

.action-bar-row.custom-date-row {
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from { max-height: 0; opacity: 0; }
    to { max-height: 200px; opacity: 1; }
}

/* Action groups */
.action-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.action-group.primary-actions {
    flex: 0 0 auto;
}

.action-group.filter-controls {
    flex: 1;
    justify-content: center;
}

.action-group.system-actions {
    flex: 0 0 auto;
}

/* Buttons */
.action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: 1px solid #000000;
    border-radius: 8px;
    background: #ffffff;
    color: #000000;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    position: relative;
}

.action-btn:hover {
    background: #000000;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.action-btn.primary {
    background: #000000;
    color: #ffffff;
}

.action-btn.primary:hover {
    background: #374151;
}

.action-btn.secondary {
    background: #ffffff;
    border: 1px solid #d1d5db;
    color: #374151;
}

.action-btn.secondary:hover {
    background: #f9fafb;
    border-color: #000000;
}

/* SUPER HIGH Z-INDEX DROPDOWN SYSTEM */
.action-dropdown {
    position: relative;
    z-index: 99999 !important;
}

.action-dropdown-menu {
    position: absolute !important;
    top: 100% !important;
    right: 0 !important;
    background: #ffffff !important;
    border: 2px solid #000000 !important;
    border-radius: 8px !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3) !important;
    z-index: 999999 !important;
    min-width: 200px !important;
    margin-top: 8px !important;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

.action-dropdown[aria-expanded="true"] .action-dropdown-menu {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
    z-index: 999999 !important;
}

.action-dropdown-item {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    width: 100% !important;
    padding: 12px 16px !important;
    border: none !important;
    background: transparent !important;
    text-align: left !important;
    font-size: 14px !important;
    color: #000000 !important;
    cursor: pointer !important;
    transition: background-color 0.2s ease !important;
}

.action-dropdown-item:hover {
    background: #f3f4f6 !important;
}

.action-dropdown-item.danger:hover {
    background: #fef2f2 !important;
    color: #dc2626 !important;
}

/* Period filter and custom date indicator sharing same space */
.period-filter-container {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #ffffff;
    padding: 8px 16px;
    border: 1px solid #000000;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    min-height: 40px;
    height: 40px;
    white-space: nowrap;
}

.period-filter-container.hidden-for-custom {
    opacity: 0;
    visibility: hidden;
    transform: scale(0.95);
    pointer-events: none;
    position: absolute;
}

.period-filter-container .filter-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    color: #000000;
    font-size: 14px;
}

.period-filter-container .filter-select {
    border: none;
    background: transparent;
    font-size: 14px;
    font-weight: 500;
    color: #000000;
    cursor: pointer;
    outline: none;
}

/* Custom date indicator in same space as period filter */
.active-period-display {
    position: relative;
    min-height: 40px;
    display: flex;
    align-items: center;
}

.custom-range-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #000000;
    color: #ffffff;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    animation: fadeInScale 0.3s ease;
}

@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.range-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.range-label {
    font-weight: 500;
}

.range-dates {
    font-weight: 600;
}

.clear-range-btn {
    background: transparent;
    border: none;
    color: #ffffff;
    padding: 4px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
}

.clear-range-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Custom date improvements - show indicator in period filter space */
.period-filter-container.custom-active {
    background: #000000 !important;
    color: #ffffff !important;
    font-weight: 500 !important;
    justify-content: space-between;
}

.period-filter-container.custom-active .filter-label,
.period-filter-container.custom-active .filter-select {
    color: #ffffff !important;
}

.period-filter-container.custom-active .range-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.period-filter-container.custom-active .range-info i {
    font-size: 14px;
}

.period-filter-container.custom-active .range-label {
    font-size: 14px;
    font-weight: 500;
}

.period-filter-container.custom-active .range-dates {
    font-size: 14px;
    font-weight: 600;
}

/* Ensure all financial sections stay below dropdowns */
.financial-metrics-section,
.compact-metrics-bar,
.expense-breakdown-section,
.charts-section,
.metrics-filters {
    position: relative;
    z-index: 1 !important;
}

/* Additional dropdown fixes for browser compatibility */
.action-dropdown {
    isolation: isolate;
}

.action-dropdown-menu {
    contain: layout style;
}

/* Ensure Bootstrap modals don't interfere */
.action-dropdown-menu {
    z-index: 999999 !important;
}

.modal {
    z-index: 1050;
}

.modal-backdrop {
    z-index: 1050 !important;
    background-color: rgba(0, 0, 0, 0.5) !important; /* Normal tinted backdrop for all modals */
}

/* Custom date improvements - show indicator in period filter space */
.period-filter-container.custom-active {
    background: #000000 !important;
    color: #ffffff !important;
    font-weight: 500 !important;
}

.period-filter-container.custom-active .filter-label,
.period-filter-container.custom-active .filter-select {
    color: #ffffff !important;
}

/* Responsive improvements */
@media (max-width: 768px) {
    .action-dropdown-menu {
        right: auto !important;
        left: 0 !important;
        width: 100% !important;
        min-width: 180px !important;
    }
    
    .action-bar-row.primary-row {
        flex-direction: column;
        gap: 12px;
        padding: 16px 20px;
    }
    
    .action-group {
        width: 100%;
        justify-content: center;
    }
    
    .action-group.filter-controls {
        order: -1;
    }
}

.apply-custom-btn:hover {
    background-color: #111;
}

.cancel-custom-btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    background-color: #ffffff;
    color: #374151;
    border: 1px solid #d1d5db;
    border-radius: calc(var(--radius) * 0.75);
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

.cancel-custom-btn:hover {
    background-color: #f9fafb;
    border-color: #9ca3af;
}

/* ── Level 1: Status & Quick Actions Bar ── */
.command-center-l1 {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 1.5rem 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.status-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  gap: 2rem;
}

/* Status Group - Left Side */
.status-group {
  display: flex;
  align-items: center;
  gap: 2rem;
  flex: 1;
}

/* Sync Status Indicator */
.sync-status-indicator {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sync-status-icon {
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gray-light);
  border: 1px solid var(--border);
  border-radius: 50%;
  transition: all var(--transition);
}

.sync-status-icon.syncing {
  background: var(--black);
  color: var(--white);
}

.sync-status-icon.syncing i {
  animation: spin 1s linear infinite;
}

.sync-status-icon.success {
  background: var(--black);
  color: var(--white);
}

.sync-status-icon.error {
  background: var(--white);
  color: var(--black);
  border-color: var(--black);
  border-width: 2px;
}

.sync-status-icon i {
  font-size: 1rem;
  transition: transform var(--transition);
}

.sync-status-content {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sync-status-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1;
}

.sync-status-details {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.sync-timestamp {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1;
}

.sync-next {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1;
}

/* Connection Status Pills */
.connection-status-pills {
  display: flex;
  gap: 0.75rem;
}

.connection-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 2rem;
  transition: all var(--transition);
  cursor: pointer;
  position: relative;
}

.connection-pill:hover {
  background: var(--gray-light);
}

.connection-pill-icon {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.connection-pill-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
}

.connection-pill-status {
  display: flex;
  align-items: center;
}

.connection-pill-status i {
  font-size: 0.5rem;
  color: var(--text-muted);
  transition: color var(--transition);
}

/* Connection Status States */
.connection-pill.connected .connection-pill-status i {
  color: var(--black);
}

.connection-pill.disconnected .connection-pill-status i {
  color: var(--text-muted);
}

.connection-pill.error .connection-pill-status i {
  color: var(--black);
}

.connection-pill.connected {
  border-color: var(--black);
}

.connection-pill.error {
  border-color: var(--black);
  border-width: 2px;
}

.connection-pill-count {
  position: absolute;
  top: -0.25rem;
  right: -0.25rem;
  min-width: 1rem;
  height: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--black);
  color: var(--white);
  font-size: 0.625rem;
  font-weight: 600;
  border-radius: 50%;
  padding: 0 0.125rem;
  border: 1px solid var(--white);
}

/* Provider badges for filters table */
.provider-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.5rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--gray-100);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.provider-badge-gmail {
  background: linear-gradient(135deg, #ea4335, #fbbc05);
  color: var(--white);
  border: none;
}

.provider-badge-yahoo {
  background: linear-gradient(135deg, #6001d2, #410093);
  color: var(--white);
  border: none;
}

.provider-badge-custom {
  background: linear-gradient(135deg, #6b7280, #374151);
  color: var(--white);
  border: none;
}

/* Connect Email Modal Styles */
.provider-options {
  display: grid;
  gap: 1rem;
}

.provider-option {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: var(--white);
  transition: all var(--transition);
}

.provider-option:hover {
  border-color: var(--black);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.provider-option .provider-icon {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--white);
  flex-shrink: 0;
}

.provider-option .provider-icon.gmail {
  background: linear-gradient(135deg, #ea4335, #fbbc05);
}

.provider-option .provider-icon.yahoo {
  background: linear-gradient(135deg, #6001d2, #410093);
}

.provider-option .provider-icon.outlook {
  background: linear-gradient(135deg, #0078d4, #106ebe);
}

.provider-option .provider-icon.custom {
  background: linear-gradient(135deg, #6b7280, #374151);
}

.provider-option .provider-info {
  flex: 1;
}

.provider-option .provider-info h6 {
  margin: 0 0 0.25rem 0;
  font-weight: 600;
  color: var(--black);
}

.provider-option .provider-info p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.provider-option .provider-status {
  margin-right: 1rem;
}

.status-badge {
  padding: 0.25rem 0.5rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.status-badge.connected {
  background: #dcfce7;
  color: #166534;
}

.status-badge.disconnected {
  background: #fef2f2;
  color: #991b1b;
}

.provider-config {
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.config-header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
}

.connection-test {
  margin-top: 1rem;
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Quick Actions Group - Right Side */
.quick-actions-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.quick-action-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--text);
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  text-decoration: none;
}

.quick-action-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.quick-action-btn.primary {
  background: var(--black);
  color: var(--white);
  border-color: var(--black);
}

.quick-action-btn.primary:hover {
  background: #111;
}

.quick-action-btn.secondary {
  background: var(--white);
  color: var(--black);
  border-color: var(--black);
}

.quick-action-btn.secondary:hover {
  background: var(--gray-light);
  color: var(--black);
  border-color: var(--black);
}

.quick-action-btn.tertiary {
  background: var(--white);
  color: var(--text-muted);
  border-color: var(--border);
  padding: 0.625rem;
  min-width: 2.375rem;
}

.quick-action-btn.tertiary:hover {
  background: var(--gray-light);
  color: var(--text);
}

.quick-action-btn i {
  font-size: 1rem;
  transition: transform var(--transition);
}

.quick-action-btn.syncing i {
  animation: spin 1s linear infinite;
}

.quick-action-label {
  font-size: 0.875rem;
  line-height: 1;
  white-space: nowrap;
}

/* Action Badge for Review Count */
.action-badge {
  position: absolute;
  top: -0.375rem;
  right: -0.375rem;
  min-width: 1.25rem;
  height: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--black);
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 50%;
  padding: 0 0.25rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .status-actions-bar {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
  }

  .status-group {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    width: 100%;
  }

  .connection-status-pills {
    width: 100%;
    justify-content: space-between;
  }

  .connection-pill {
    flex: 1;
    justify-content: center;
  }

  .quick-actions-group {
    width: 100%;
    justify-content: space-between;
  }

  .quick-action-btn {
    flex: 1;
    justify-content: center;
  }

  .quick-action-btn.tertiary {
    flex: 0 0 auto;
  }
}

@media (max-width: 576px) {
  .sync-status-indicator {
    gap: 0.5rem;
  }

  .sync-status-icon {
    width: 2rem;
    height: 2rem;
  }

  .sync-status-icon i {
    font-size: 0.875rem;
  }

  .connection-pill {
    padding: 0.375rem 0.5rem;
  }

  .connection-pill-label {
    font-size: 0.75rem;
  }

  .quick-action-label {
    display: none;
  }

  .quick-action-btn {
    padding: 0.625rem;
    min-width: 2.375rem;
  }

  /* Responsive inline badges */
  .inline-badge {
    font-size: 0.65rem;
    min-width: 1rem;
    height: 1rem;
    margin-left: 0.25rem;
  }
}

/* ── Enhanced Action Bar (Reorganized) ── */
  
/* Quick Action Buttons - Removed duplicate definition to prevent conflicts */

/* Inline Badge for Review Count - Better UX */
.inline-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #dc3545;
  color: white;
  border-radius: 10px;
  min-width: 1.25rem;
  height: 1.25rem;
  font-size: 0.7rem;
  font-weight: 600;
  margin-left: 0.375rem;
  padding: 0 0.25rem;
  border: 2px solid var(--white);
}

/* Legacy Action Badge - Keep for backward compatibility */
.action-badge {
  position: absolute;
  top: -0.375rem;
  right: -0.375rem;
  min-width: 1.25rem;
  height: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--black);
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 50%;
  padding: 0 0.25rem;
}

/* ── User Dropdown Styling ── */
.user-dropdown {
  position: relative;
  display: inline-block;
}

.user-dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--white);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
  cursor: pointer;
  min-height: 2.5rem;
}

.user-dropdown-trigger:hover {
  background: var(--hover);
  border-color: var(--accent);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.user-avatar {
  font-size: 1.25rem;
  color: var(--text-muted);
}

.user-name {
  color: var(--text);
  white-space: nowrap;
}

.user-dropdown .dropdown-arrow {
  font-size: 0.75rem;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.user-dropdown[aria-expanded="true"] .dropdown-arrow {
  transform: rotate(180deg);
}

.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  min-width: 16rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.2s ease;
  z-index: 1000;
}

.user-dropdown[aria-expanded="true"] .user-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.user-dropdown-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  border-bottom: 1px solid var(--border);
}

.user-menu-avatar {
  font-size: 2rem;
  color: var(--text-muted);
}

.user-menu-info {
  flex: 1;
}

.user-menu-name {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.125rem;
}

.user-menu-email {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.user-dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 0.5rem 0;
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.75rem 1rem;
  border: none;
  background: transparent;
  font-size: 0.875rem;
  color: var(--text);
  text-align: left;
  transition: background-color 0.2s ease;
  cursor: pointer;
}

.user-dropdown-item:hover {
  background: var(--hover);
}

.user-dropdown-item.logout {
  color: #dc3545;
}

.user-dropdown-item.logout:hover {
  background: #fef2f2;
}

.user-dropdown-item .item-icon {
  font-size: 1rem;
  color: var(--text-muted);
  width: 1rem;
  text-align: center;
}

.user-dropdown-item.logout .item-icon {
  color: #dc3545;
}

.dashboard-main-title {
  font-size: 1.5rem;
}

.dashboard-subtitle {
  font-size: 0.875rem;
}

/* User Dropdown Mobile Responsive */
.user-dropdown-trigger {
  padding: 0.375rem 0.5rem;
  min-height: 2rem;
}

.user-name {
  font-size: 0.8rem;
}

.user-dropdown-menu {
  min-width: 14rem;
  right: -1rem;
}

.user-dropdown-header {
  padding: 0.75rem;
}

.user-menu-avatar {
  font-size: 1.5rem;
}

.user-dropdown-item {
  padding: 0.625rem 0.75rem;
  font-size: 0.8rem;
}

/* ── Level 2: Primary Controls Bar ── */
.command-center-l2 {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 1.5rem 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.controls-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  gap: 2rem;
}

/* Filter Controls - Left Side */
.filter-controls-group {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex: 1;
}

.filter-control-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: relative; /* Add this to make it a positioned parent for absolute children */
}

.filter-control-label {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
  min-width: 24px;
  height: 24px;
  padding: 0;
}

.filter-control-label i {
  font-size: 1rem;
  color: var(--text-muted);
}

.filter-control-select {
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  background-color: var(--white);
  color: var(--text);
  min-width: 120px;
  transition: all var(--transition);
}

.filter-control-select:focus {
  outline: none;
  border-color: var(--black);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
}

.filter-control-select:disabled {
  background-color: var(--gray-light);
  color: var(--text-muted);
  cursor: not-allowed;
}

/* Custom Date Range Controls */
.custom-date-controls {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  background: var(--white);
  border: 2px solid var(--black);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  z-index: 9999;
  padding: 0.75rem;
  min-width: 340px;
  max-width: calc(100vw - 2rem);
  box-sizing: border-box;
  white-space: nowrap;
}

.custom-date-inputs {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  flex-wrap: nowrap;
  box-sizing: border-box;
}

.date-input-group {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}

.date-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
}

.date-input {
  padding: 0.25rem 0.375rem;
  font-size: 0.40rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  background-color: var(--white);
  color: var(--text);
  width: 40px;
  flex-shrink: 0;
  box-sizing: border-box;
}

.date-input:focus {
  outline: none;
  border-color: var(--black);
  box-shadow: 0 0 0 2px rgba(0,0,0,0.1);
}

.date-actions {
  display: flex;
  gap: 0.25rem;
  margin-left: auto;
  flex-shrink: 0;
}

.apply-custom-btn, .cancel-custom-btn {
  display: flex;
  align-items: center;
  gap: 0.125rem;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: calc(var(--radius) - 2px);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  border: 1px solid var(--border);
  flex-shrink: 0;
  box-sizing: border-box;
}

.apply-custom-btn {
  background-color: var(--black);
  color: var(--white);
  border-color: var(--black);
}

.apply-custom-btn:hover {
  background-color: #111;
}

.cancel-custom-btn {
  background-color: var(--white);
  color: var(--text-muted);
}

.cancel-custom-btn:hover {
  background-color: var(--gray-light);
  color: var(--text);
}

/* Action Controls - Right Side */
.action-controls-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.action-control-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--text);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.action-control-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.action-control-btn.primary {
  background: var(--black);
  color: var(--white);
  border-color: var(--black);
}

.action-control-btn.primary:hover {
  background: #111;
}

.action-control-btn i {
  font-size: 1rem;
}

.action-control-label {
  font-size: 0.875rem;
  line-height: 1;
}

/* Level 2 Dropdown */
.action-control-dropdown {
  position: relative;
}

.action-control-dropdown .dropdown-arrow {
  font-size: 0.75rem;
  color: var(--text-muted);
  transition: transform var(--transition);
}

.action-control-dropdown[aria-expanded="true"] .dropdown-arrow {
  transform: rotate(180deg);
}

.action-control-dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 1000;
  min-width: 240px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  padding: 0.5rem 0;
  margin-top: 0.25rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all var(--transition);
}

.action-control-dropdown[aria-expanded="true"] .action-control-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.action-control-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  color: var(--text);
  text-decoration: none;
  transition: background-color var(--transition);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.action-control-dropdown-item:hover {
  background-color: var(--gray-light);
  color: var(--black);
}

.action-control-dropdown-item .item-icon {
  font-size: 1rem;
  color: var(--text-muted);
  width: 1rem;
  text-align: center;
}

/* Connection Status in Dropdown */
.connection-item-content {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}

.connection-item-label {
  font-size: 0.875rem;
  color: var(--text);
  font-weight: 500;
}

.connection-item-status {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 400;
}

.connection-item-status.connected {
  color: #10b981;
}

.connection-item-status.error {
  color: #ef4444;
}

/* Dropdown Dividers */
.dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 0.5rem 0;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .controls-actions-bar {
    gap: 1rem;
  }
  
  .filter-controls-group {
    gap: 1rem;
  }
  
  .filter-control-select {
    min-width: 120px;
  }
}

@media (max-width: 768px) {
  .controls-actions-bar {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
  }

  .filter-controls-group {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    width: 100%;
  }

  .filter-control-item {
    flex-direction: column;
    align-items: stretch;
    gap: 0.375rem;
  }

  .filter-control-label {
    justify-content: flex-start;
  }

  .filter-control-select {
    min-width: auto;
    width: 100%;
  }

  .action-controls-group {
    width: 100%;
    justify-content: space-between;
  }

  .action-control-btn {
    flex: 1;
    justify-content: center;
  }

  .action-control-dropdown-menu {
    right: auto;
    left: 0;
    width: 100%;
  }

  .custom-date-inputs {
    flex-direction: column;
    gap: 0.75rem;
  }

  .date-input-group {
    width: 100%;
  }

  .date-input {
    flex: 1;
  }

  .date-actions {
    margin-left: 0;
    width: 100%;
    justify-content: space-between;
  }
}

@media (max-width: 576px) {
  .action-control-label {
    display: none;
  }

  .action-control-btn {
    padding: 0.625rem;
    min-width: 2.5rem;
  }

  .filter-control-label {
    font-size: 0.8rem;
  }

  .filter-control-select {
    font-size: 0.8rem;
    padding: 0.5rem;
  }
}

/* ── Enhanced Dashboard ── */
  
/* Custom Period Display */
.custom-period-display {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  background-color: var(--white);
  color: var(--text);
  min-width: 120px;
  max-width: 200px;
}

.custom-period-text {
  font-size: 0.875rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.custom-period-edit-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: 2px;
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
}

.custom-period-edit-btn:hover {
  background-color: var(--gray-light);
  color: var(--text);
}

.custom-period-edit-btn i {
  font-size: 0.75rem;
}

/* Custom Date Range Controls */
  
/* Responsive Custom Date Controls */
@media (max-width: 768px) {
  .custom-date-controls {
    position: fixed;
    top: 50%;
    left: 50%;
    right: auto;
    transform: translate(-50%, -50%);
    min-width: 300px;
    max-width: calc(100vw - 2rem);
    width: auto;
    padding: 0.75rem;
    box-sizing: border-box;
  }
  
  .custom-date-inputs {
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
  }
  
  .date-input-group {
    width: 100%;
    justify-content: space-between;
  }
  
  .date-input {
    width: 75px;
    flex-shrink: 0;
  }
  
  .date-actions {
    margin-left: 0;
    width: 100%;
    justify-content: space-between;
  }
  
  .apply-custom-btn, .cancel-custom-btn {
    flex: 1;
    justify-content: center;
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
  }
}

@media (max-width: 576px) {
  .custom-date-controls {
    min-width: 280px;
    max-width: calc(100vw - 1rem);
    padding: 0.75rem;
  }
  
  .date-input {
    width: 75px;
  }
  
  .apply-custom-btn, .cancel-custom-btn {
    padding: 0.375rem 0.625rem;
    font-size: 0.75rem;
  }
}

/* Tooltip icon styles for metric cards */
.tooltip-icon {
  margin-left: 8px;
  color: #6c757d;
  font-size: 0.875rem;
  cursor: pointer;
  transition: color 0.2s ease;
}

.tooltip-icon:hover {
  color: #007bff;
}

/* Metric breakdown modal styles */
.metric-breakdown-section {
  margin-bottom: 1.5rem;
}

.metric-breakdown-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #495057;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
}

.metric-breakdown-title i {
  margin-right: 0.5rem;
  color: #007bff;
}

.metric-breakdown-formula {
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 0.375rem;
  padding: 0.75rem;
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.metric-breakdown-items {
  list-style: none;
  padding: 0;
  margin: 0;
}

.metric-breakdown-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid #e9ecef;
}

.metric-breakdown-item:last-child {
  border-bottom: none;
}

.metric-breakdown-item-label {
  font-weight: 500;
  color: #495057;
}

.metric-breakdown-item-value {
  font-weight: 600;
  color: #28a745;
}

.metric-breakdown-item-note {
  font-size: 0.875rem;
  color: #6c757d;
  font-style: italic;
  margin-top: 0.25rem;
}

.metric-breakdown-method {
  background: rgba(0, 0, 0, 0.1);
  color: #666;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.75rem;
  margin-left: 8px;
}

/* Modal Animation Optimizations */
.modal {
  transition: opacity 0.15s linear !important;
}

.modal.fade .modal-dialog {
  transition: transform 0.15s ease-out !important;
  transform: translate(0, -50px);
}

.modal.show .modal-dialog {
  transform: translate(0, 0);
}

/* Faster backdrop transitions */
.modal-backdrop {
  transition: opacity 0.15s linear !important;
}

.modal-backdrop.fade {
  opacity: 0;
}

.modal-backdrop.show {
  opacity: 0.5 !important; /* Normal tinted backdrop for all modals */
}

/* Optimize modal content for faster rendering */
.modal-content {
  will-change: transform, opacity;
  backface-visibility: hidden;
  transform: translateZ(0);
}

/* Smooth close button interactions */
.modal .btn-close {
  transition: opacity 0.1s ease !important;
}

.modal .btn-close:hover {
  opacity: 0.75;
}

/* Prevent layout shifts during modal animations */
.modal-open {
  overflow: hidden !important;
}

/* Optimize tooltip modal specifically */
#metric-breakdown-modal .modal-dialog {
  transition: transform 0.12s ease-out !important;
}

#metric-breakdown-modal.fade {
  transition: opacity 0.12s linear !important;
}

/* Apply same width constraints to Note column cells */
.table td:nth-child(11) {
  min-width: 400px;
  max-width: 600px;
  white-space: normal;
  word-break: break-word;
  background-color: #f9f9f9; /* Light gray background for data cells */
}

/* Transaction Table Column Width Controls - Enhanced Table */
.enhanced-table th:nth-child(1) {
  width: 8%;
  min-width: 80px;
}

.enhanced-table th:nth-child(2) {
  width: 12%;
  min-width: 100px;
}

.enhanced-table th:nth-child(3) {
  width: 25%;
  min-width: 100px;
  white-space: normal;
  word-break: break-word;
}

.enhanced-table th:nth-child(4) {
  width: 25%;
  min-width: 150px;
  white-space: normal;
  word-break: break-word;
}

.enhanced-table th:nth-child(5) {
  width: 10%;
  min-width: 90px;
  text-align: right;
}

.enhanced-table th:nth-child(11) {
  width: auto !important; /* Note column */
  min-width: 400px !important;
  max-width: 600px !important;
  white-space: normal !important;
  word-break: break-word !important;
}

/* Apply same width constraints to Note column cells */
.enhanced-table td:nth-child(11) {
  min-width: 400px;
  max-width: 600px;
  white-space: normal;
  word-break: break-word;
}
  

/* Properties Table Column Width Controls - Enhanced Specificity */
#properties-view .enhanced-table th:nth-child(1),
#properties-view .enhanced-table td:nth-child(1) {
  width: 12% !important;
  min-width: 30px !important;
  max-width: none !important;
}

#properties-view .enhanced-table th:nth-child(2),
#properties-view .enhanced-table td:nth-child(2) {
  width: 8% !important;
  min-width: 30px !important;
  text-align: center !important;
}

#properties-view .enhanced-table th:nth-child(3),
#properties-view .enhanced-table td:nth-child(3) {
  width: 8% !important;
  min-width: 30px !important;
  text-align: center !important;
}

#properties-view .enhanced-table th:nth-child(4),
#properties-view .enhanced-table td:nth-child(4) {
  width: 3% !important;
  min-width: 60px !important;
  text-align: center !important;
}

/* Ensure the properties table itself has proper layout */
#properties-view .enhanced-table {
  table-layout: fixed !important;
  width: 25% !important;
}

/* Center-align action buttons in properties table Actions column */
#properties-view .enhanced-table td:nth-child(4) .table-actions,
#properties-view .enhanced-table td:nth-child(4) button,
#properties-view .enhanced-table td:nth-child(4) .action-btn {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  margin: 0 auto !important;
  gap: 0.25rem !important; /* Reduce space between buttons */
}

/* Make action buttons more compact */
#properties-view .enhanced-table td:nth-child(4) button {
  padding: 0.25rem 0.5rem !important;
  font-size: 0.75rem !important;
}

/* Units Table Unit Column - Make it 8% wide */
#properties-view .enhanced-table th:nth-child(1),
#properties-view .enhanced-table td:nth-child(1) {
  width: 6% !important;
  min-width: 80px !important;
  text-align: center !important;
}

/* Units Table SqFt Column - Make it 8% wide */
#properties-view .enhanced-table th:nth-child(4),
#properties-view .enhanced-table td:nth-child(4) {
  width: 9% !important;
  min-width: 80px !important;
  text-align: center !important;
}

/* Units Table Tenants Column - Make it 6% wide */
#properties-view .enhanced-table th:nth-child(6),
#properties-view .enhanced-table td:nth-child(6) {
  width: 6% !important;
  min-width: 100px !important;
  text-align: center !important;
}



/* Units Table Lease End Column - Make it 6% wide */
#properties-view .enhanced-table th:nth-child(7),
#properties-view .enhanced-table td:nth-child(7) {
  width: 6% !important;
  min-width: 100px !important;
  text-align: center !important;
}

/* Units Table Actions Column - Make it 5% wide */
#properties-view .enhanced-table th:nth-child(8),
#properties-view .enhanced-table td:nth-child(8) {
  width: 6% !important;
  min-width: 80px !important;
  text-align: right !important;
}



/* Tenant Information Table Column Width Controls - Simplified */
#property-tenants-table-body th:nth-child(1),
#property-tenants-table-body td:nth-child(1) {
  width: 5% !important;
  min-width: 40px !important;
  text-align: left !important;
}

#property-tenants-table-body th:nth-child(2),
#property-tenants-table-body td:nth-child(2) {
  width: 3% !important;
  min-width: 40px !important;
  text-align: center !important;
}

#property-tenants-table-body th:nth-child(3),
#property-tenants-table-body td:nth-child(3) {
  width: 6% !important;
  min-width: 60px !important;
  text-align: left !important;
}

#property-tenants-table-body th:nth-child(4),
#property-tenants-table-body td:nth-child(4) {
  width: 1.5% !important;
  min-width: 60px !important;
  text-align: center !important;
}

/* Also target the table headers directly */
#properties-view .enhanced-table thead th:nth-child(1) {
  width: 5% !important;
  min-width: 40px !important;
}

#properties-view .enhanced-table thead th:nth-child(2) {
  width: 3% !important;
  min-width: 40px !important;
}

#properties-view .enhanced-table thead th:nth-child(3) {
  width: 6% !important;
  min-width: 60px !important;
}

#properties-view .enhanced-table thead th:nth-child(4) {
  width: 3% !important;
  min-width: 60px !important;
}

/* ===============================================
   TABLE-SPECIFIC COLUMN WIDTH CONTROLS
   =============================================== */

/* ── PROPERTIES LIST TABLE (Top of Properties Page) ── */
#properties-view .enhanced-table th:nth-child(1),
#properties-view .enhanced-table td:nth-child(1) {
  width: 12% !important;
  min-width: 30px !important;
  max-width: none !important;
}

#properties-view .enhanced-table th:nth-child(2),
#properties-view .enhanced-table td:nth-child(2) {
  width: 8% !important;
  min-width: 30px !important;
  text-align: center !important;
}

#properties-view .enhanced-table th:nth-child(3),
#properties-view .enhanced-table td:nth-child(3) {
  width: 8% !important;
  min-width: 30px !important;
  text-align: center !important;
}

#properties-view .enhanced-table th:nth-child(4),
#properties-view .enhanced-table td:nth-child(4) {
  width: 3% !important;
  min-width: 60px !important;
  text-align: center !important;
}

/* Ensure the properties table itself has proper layout */
#properties-view .enhanced-table {
  table-layout: fixed !important;
  width: 25% !important;
}

/* Center-align action buttons in properties table Actions column */
#properties-view .enhanced-table td:nth-child(4) .table-actions,
#properties-view .enhanced-table td:nth-child(4) button,
#properties-view .enhanced-table td:nth-child(4) .action-btn {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  margin: 0 auto !important;
  gap: 0.25rem !important; /* Reduce space between buttons */
}

/* Make action buttons more compact */
#properties-view .enhanced-table td:nth-child(4) button {
  padding: 0.25rem 0.5rem !important;
  font-size: 0.75rem !important;
}

/* ── UNITS & OCCUPANCY TABLE ── */
/* Target specifically by the units table body ID */
table:has(tbody#property-units-table-body) th:nth-child(1),
table:has(tbody#property-units-table-body) td:nth-child(1),
tbody#property-units-table-body th:nth-child(1),
tbody#property-units-table-body td:nth-child(1) {
  width: 15% !important; /* Unit column */
  min-width: 80px !important;
  text-align: left !important;
}

table:has(tbody#property-units-table-body) th:nth-child(2),
table:has(tbody#property-units-table-body) td:nth-child(2),
tbody#property-units-table-body th:nth-child(2),
tbody#property-units-table-body td:nth-child(2) {
  width: 10% !important; /* Beds column */
  min-width: 60px !important;
  text-align: center !important;
}

table:has(tbody#property-units-table-body) th:nth-child(3),
table:has(tbody#property-units-table-body) td:nth-child(3),
tbody#property-units-table-body th:nth-child(3),
tbody#property-units-table-body td:nth-child(3) {
  width: 10% !important; /* Baths column */
  min-width: 60px !important;
  text-align: center !important;
}

table:has(tbody#property-units-table-body) th:nth-child(4),
table:has(tbody#property-units-table-body) td:nth-child(4),
tbody#property-units-table-body th:nth-child(4),
tbody#property-units-table-body td:nth-child(4) {
  width: 9% !important; /* SqFt column - your current setting */
  min-width: 80px !important;
  text-align: center !important;
}

table:has(tbody#property-units-table-body) th:nth-child(5),
table:has(tbody#property-units-table-body) td:nth-child(5),
tbody#property-units-table-body th:nth-child(5),
tbody#property-units-table-body td:nth-child(5) {
  width: 15% !important; /* Rent column */
  min-width: 100px !important;
  text-align: right !important;
}

table:has(tbody#property-units-table-body) th:nth-child(6),
table:has(tbody#property-units-table-body) td:nth-child(6),
tbody#property-units-table-body th:nth-child(6),
tbody#property-units-table-body td:nth-child(6) {
  width: 12% !important; /* Tenants column */
  min-width: 80px !important;
  text-align: center !important;
}

table:has(tbody#property-units-table-body) th:nth-child(7),
table:has(tbody#property-units-table-body) td:nth-child(7),
tbody#property-units-table-body th:nth-child(7),
tbody#property-units-table-body td:nth-child(7) {
  width: 4% !important; /* Lease End column - your current setting */
  min-width: 100px !important;
  text-align: center !important;
}

table:has(tbody#property-units-table-body) th:nth-child(8),
table:has(tbody#property-units-table-body) td:nth-child(8),
tbody#property-units-table-body th:nth-child(8),
tbody#property-units-table-body td:nth-child(8) {
  width: 3% !important; /* Actions column - your current setting */
  min-width: 80px !important;
  text-align: center !important;
}

/* ── TENANT INFORMATION TABLE ── */
/* Target specifically by the tenants table body ID */
table:has(tbody#property-tenants-table-body) th:nth-child(1),
table:has(tbody#property-tenants-table-body) td:nth-child(1),
tbody#property-tenants-table-body th:nth-child(1),
tbody#property-tenants-table-body td:nth-child(1) {
  width: 10% !important; /* Name column - your current setting */
  min-width: 60px !important;
  text-align: left !important;
}

table:has(tbody#property-tenants-table-body) th:nth-child(2),
table:has(tbody#property-tenants-table-body) td:nth-child(2),
tbody#property-tenants-table-body th:nth-child(2),
tbody#property-tenants-table-body td:nth-child(2) {
  width: 6% !important; /* Unit column - your current setting */
  min-width: 60px !important;
  text-align: center !important;
}

table:has(tbody#property-tenants-table-body) th:nth-child(3),
table:has(tbody#property-tenants-table-body) td:nth-child(3),
tbody#property-tenants-table-body th:nth-child(3),
tbody#property-tenants-table-body td:nth-child(3) {
  width: 6% !important; /* Contact column - your current setting */
  min-width: 60px !important;
  text-align: left !important;
}

table:has(tbody#property-tenants-table-body) th:nth-child(4),
table:has(tbody#property-tenants-table-body) td:nth-child(4),
tbody#property-tenants-table-body th:nth-child(4),
tbody#property-tenants-table-body td:nth-child(4) {
  width: 6% !important; /* Actions column - your current setting */
  min-width: 60px !important;
  text-align: center !important;
}

/* ── TRANSACTIONS TABLE (Dashboard/Transactions Page) ── */
/* Main transactions table column controls */
.enhanced-table th:nth-child(1),
.enhanced-table td:nth-child(1) {
  width: 8% !important; /* ID column */
  min-width: 80px !important;
}

.enhanced-table th:nth-child(2),
.enhanced-table td:nth-child(2) {
  width: 12% !important; /* Date column */
  min-width: 100px !important;
}

.enhanced-table th:nth-child(3),
.enhanced-table td:nth-child(3) {
  width: 25% !important; /* Description column */
  min-width: 100px !important;
  white-space: normal !important;
  word-break: break-word !important;
}

.enhanced-table th:nth-child(4),
.enhanced-table td:nth-child(4) {
  width: 25% !important; /* Property column */
  min-width: 150px !important;
  white-space: normal !important;
  word-break: break-word !important;
}

.enhanced-table th:nth-child(5),
.enhanced-table td:nth-child(5) {
  width: 10% !important; /* Unit column */
  min-width: 90px !important;
  text-align: right !important;
}

.enhanced-table th:nth-child(6),
.enhanced-table td:nth-child(6) {
  width: 12% !important; /* Vendor column */
  min-width: 90px !important;
}

.enhanced-table th:nth-child(7),
.enhanced-table td:nth-child(7) {
  width: 10% !important; /* Amount column */
  min-width: 90px !important;
  text-align: right !important;
}

.enhanced-table th:nth-child(8),
.enhanced-table td:nth-child(8) {
  width: 8% !important; /* Category column */
  min-width: 90px !important;
}

.enhanced-table th:nth-child(9),
.enhanced-table td:nth-child(9) {
  width: 8% !important; /* Type column */
  min-width: 90px !important;
}

.enhanced-table th:nth-child(10),
.enhanced-table td:nth-child(10) {
  width: 8% !important; /* Source column */
  min-width: 90px !important;
}

.enhanced-table th:nth-child(11),
.enhanced-table td:nth-child(11) {
  width: auto !important; /* Note column */
  min-width: 400px !important;
  max-width: 600px !important;
  white-space: normal !important;
  word-break: break-word !important;
}

/* ── REVIEW INVOICES MODAL TABLES ── */
/* For Review Tab */
#review-invoices-modal .table th.col-review-date,
#review-invoices-modal #for-review-invoices-tbody td:nth-child(2) {
  width: 12% !important; /* Date column */
  min-width: 90px !important;
}

#review-invoices-modal .table th.col-review-amount,
#review-invoices-modal #for-review-invoices-tbody td:nth-child(3) {
  width: 8% !important; /* Amount column */
  min-width: 80px !important;
  text-align: right !important;
}

#review-invoices-modal .table th.col-review-vendor,
#review-invoices-modal #for-review-invoices-tbody td:nth-child(4) {
  width: 15% !important; /* Vendor column */
  min-width: 120px !important;
}

#review-invoices-modal .table th.col-review-note,
#review-invoices-modal #for-review-invoices-tbody td:nth-child(7) {
  width: 40% !important; /* Note/Description column */
  min-width: 250px !important;
  word-break: break-word !important;
}

#review-invoices-modal #for-review-invoices-tbody td:nth-child(1) {
  width: 50px !important; /* Checkbox column */
}

#review-invoices-modal #for-review-invoices-tbody td:nth-child(5) {
  width: 10% !important; /* Property column */
  min-width: 100px !important;
}

#review-invoices-modal #for-review-invoices-tbody td:nth-child(6) {
  width: 8% !important; /* Unit column */
  min-width: 70px !important;
}

#review-invoices-modal #for-review-invoices-tbody td:nth-child(8) {
  width: 7% !important; /* Invoice action column */
  min-width: 60px !important;
}

/* ── CSV PREVIEW TABLE ── */
.csv-preview-table thead th {
  background: var(--black) !important;
  color: var(--white) !important;
  font-weight: 600 !important;
  font-size: 0.8rem !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
  padding: 0.875rem 0.75rem !important;
  border: none !important;
}

.csv-preview-table tbody tr {
  transition: all var(--transition) !important;
  border-bottom: 1px solid var(--border) !important;
}

.csv-preview-table tbody tr:nth-child(even) {
  background-color: var(--gray-light) !important;
}

.csv-preview-table tbody tr:hover {
  background-color: #f3f3f3 !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04) !important;
}

.csv-preview-table tbody td {
  padding: 0.75rem !important;
  vertical-align: middle !important;
  font-size: 0.85rem !important;
}

/* ── GMAIL FILTER TABLE ── */
/* Table action buttons for Gmail filters */
.table-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  align-items: center;
}

.table-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid #ddd;
  background: #fff;
  color: #666;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
  padding: 0;
}

.table-action-btn:hover {
  background: #f8f9fa;
  border-color: #ccc;
  color: #333;
}

.table-action-btn.edit:hover {
  background: #e3f2fd;
  border-color: #2196f3;
  color: #2196f3;
}

.table-action-btn.delete:hover {
  background: #ffebee;
  border-color: #f44336;
  color: #f44336;
}

/* Target specifically by the Gmail filters table body ID */
table:has(tbody#gmail-filters-tbody) th:nth-child(1),
table:has(tbody#gmail-filters-tbody) td:nth-child(1),
tbody#gmail-filters-tbody th:nth-child(1),
tbody#gmail-filters-tbody td:nth-child(1),
#filter-table th:nth-child(1),
#filter-table td:nth-child(1) {
  width: 35% !important; /* Sender Email column */
  min-width: 200px !important;
  text-align: left !important;
}

table:has(tbody#gmail-filters-tbody) th:nth-child(2),
table:has(tbody#gmail-filters-tbody) td:nth-child(2),
tbody#gmail-filters-tbody th:nth-child(2),
tbody#gmail-filters-tbody td:nth-child(2),
#filter-table th:nth-child(2),
#filter-table td:nth-child(2) {
  width: 20% !important; /* Role column */
  min-width: 120px !important;
  text-align: left !important;
}

table:has(tbody#gmail-filters-tbody) th:nth-child(3),
table:has(tbody#gmail-filters-tbody) td:nth-child(3),
tbody#gmail-filters-tbody th:nth-child(3),
tbody#gmail-filters-tbody td:nth-child(3),
#filter-table th:nth-child(3),
#filter-table td:nth-child(3) {
  width: 30% !important; /* Display Name column */
  min-width: 150px !important;
  text-align: left !important;
}

table:has(tbody#gmail-filters-tbody) th:nth-child(4),
table:has(tbody#gmail-filters-tbody) td:nth-child(4),
tbody#gmail-filters-tbody th:nth-child(4),
tbody#gmail-filters-tbody td:nth-child(4),
#filter-table th:nth-child(4),
#filter-table td:nth-child(4) {
  width: 15% !important; /* Actions column */
  min-width: 100px !important;
  text-align: center !important;
}

.modal {
    z-index: 1055 !important;
}

.modal-backdrop {
    z-index: 1050 !important;
    background-color: rgba(0, 0, 0, 0.5) !important; /* Normal tinted backdrop for all modals */
}

/* Ensure login modal specifically has proper backdrop */
#loginModal {
    z-index: 1060 !important;
}

#loginModal + .modal-backdrop {
    z-index: 1055 !important;
    background-color: rgba(0, 0, 0, 1.0) !important; /* Completely opaque black */
}

/* Force login modal backdrop to be completely opaque */
#loginModal + .modal-backdrop.show {
    opacity: 1.0 !important;
    background-color: rgba(0, 0, 0, 1.0) !important;
}

/* Eliminate backdrop animation delay for login modal */
#loginModal + .modal-backdrop {
    transition: none !important; /* Remove fade animation */
    opacity: 1.0 !important; /* Start at full opacity immediately */
    background-color: rgba(0, 0, 0, 1.0) !important;
}

#loginModal + .modal-backdrop.fade {
    opacity: 1.0 !important; /* Override fade class */
    transition: none !important; /* No animation */
}

/* Remove fade animation from login modal itself */
#loginModal.fade {
    transition: none !important; /* No modal animation */
}

#loginModal.fade .modal-dialog {
    transition: none !important; /* No dialog animation */
    transform: none !important; /* No transform animation */
}

/* Ensure login modal appears instantly */
#loginModal.show {
    display: block !important;
    opacity: 1 !important;
}

/* Prevent login modal from being dismissed */
#loginModal {
    pointer-events: auto !important;
}

#loginModal .modal-content {
    pointer-events: auto !important;
}

/* Disable backdrop click for login modal */
#loginModal + .modal-backdrop {
    pointer-events: none !important;
}

/* Prevent dashboard flash for unauthenticated users */
body.loading-auth #content,
body:not(.authenticated) #content {
    visibility: hidden !important;
}

/* Hide content by default until authentication is verified */
#content {
    visibility: hidden;
}

body.loading-auth #content::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 1.0);
    z-index: 9999;
    display: block;
}


/* Show content once authenticated */
body.authenticated #content {
    visibility: visible !important;
}

body.authenticated #content::before {
    display: none;
}

/* ===============================
   Logo and Branding Styles
   =============================== */

/* Sidebar Brand Section */
.sidebar-brand {
  display: flex;
  align-items: center;
  padding: 1.25rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 1rem;
  background: transparent;
}

.sidebar-logo {
  width: 32px;
  height: 32px;
  margin-right: 0.5rem;
  flex-shrink: 0;
}

.brand-text {
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--white);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s var(--transition);
}

/* Show brand text when sidebar is expanded */
.sidebar:hover .brand-text,
.sidebar:focus-within .brand-text {
  opacity: 1;
}

/* Hero Navigation with Logo */
.hero-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto 3rem auto;
  padding: 0 1.5rem;
}

.hero-brand {
  display: flex;
  align-items: center;
}

.hero-logo {
  width: 48px;
  height: 48px;
  margin-right: 0.5rem;
  flex-shrink: 0;
}

.brand-name {
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--white);
  white-space: nowrap;
}

.hero-navigation {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-link {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  font-weight: 500;
  font-size: 1rem;
  transition: all var(--transition);
  padding: 0.5rem 0;
  border-bottom: 2px solid transparent;
}

.nav-link:hover {
  color: var(--white);
  border-bottom-color: var(--white);
}

.nav-link.login-link {
  background: var(--white);
  color: var(--black);
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius);
  border-bottom: none;
  font-weight: 600;
}

.nav-link.login-link:hover {
  background: rgba(255, 255, 255, 0.9);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
}

/* Responsive Design for Logo Elements */
@media (max-width: 768px) {
  .hero-nav {
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
  }
  
  .hero-navigation {
    gap: 1.5rem;
  }
  
  .brand-name {
    font-size: 1.25rem;
  }
  
  .hero-logo {
    width: 40px;
    height: 40px;
  }
  
  .nav-link {
    font-size: 0.9rem;
  }
}

@media (max-width: 576px) {
  .hero-navigation {
    flex-direction: column;
    gap: 1rem;
    width: 100%;
  }
  
  .nav-link.login-link {
    width: 100%;
    text-align: center;
  }
  
  .sidebar-brand {
    padding: 1rem 0.75rem;
  }
  
  .brand-text {
    font-size: 1rem;
  }
  
  .sidebar-logo {
    width: 28px;
    height: 28px;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════════════════════════
   SETTINGS PAGE STYLES
   ═══════════════════════════════════════════════════════════════════════════════════════════════ */

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--border);
}

.settings-title-section {
    flex: 1;
}

.settings-main-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 0.5rem 0;
}

.settings-subtitle {
    font-size: 1rem;
    color: var(--text-muted);
    margin: 0;
}

.settings-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* Settings Navigation Tabs */
.settings-nav {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    padding-bottom: 0;
}

.settings-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    border-bottom: 3px solid transparent;
}

.settings-tab:hover {
    color: var(--text);
    background-color: var(--gray-light);
}

.settings-tab.active {
    color: var(--black);
    border-bottom-color: var(--black);
    background-color: transparent;
}

.settings-tab i {
    font-size: 1.1rem;
}

/* Settings Content */
.settings-content {
    min-height: 600px;
}

.settings-tab-content {
    display: none;
}

.settings-tab-content.active {
    display: block;
}

.settings-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 1024px) {
    .settings-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* Settings Cards */
.settings-card {
    background: white;
    border-radius: var(--radius);
    border: 1px solid var(--gray-light);
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.settings-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.settings-card-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--gray-light);
    background: var(--gray-lightest);
}

.settings-card-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
}

.settings-card-title i {
    font-size: 1.3rem;
    color: var(--black);
}

.settings-card-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0;
}

.settings-card-body {
    padding: 1.5rem;
}

/* Settings Forms */
.settings-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .form-row {
        grid-template-columns: 1fr 1fr;
    }
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.form-control {
    padding: 0.75rem;
    border: 1px solid var(--gray-light);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--black);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

.form-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-start;
    margin-top: 1rem;
}

/* Form Switches */
.form-check {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0.5rem 0;
}

.form-check-input {
    width: 1.25rem;
    height: 1.25rem;
    margin: 0;
}

.form-check-label {
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    margin: 0;
}

.form-switch .form-check-input {
    width: 2.5rem;
    height: 1.25rem;
    border-radius: 1rem;
    background-image: none;
    background-color: var(--gray-light);
    border: 1px solid var(--gray-light);
    transition: all 0.2s ease;
}

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

/* Statistics Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.stat-item {
    text-align: center;
    padding: 1rem;
    background: var(--gray-lightest);
    border-radius: var(--radius);
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--black);
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Connection Status */
.connection-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--gray-lightest);
    border-radius: var(--radius);
}

.connection-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.connection-icon {
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 50%;
    border: 2px solid var(--gray-light);
}

.connection-icon i {
    font-size: 1.5rem;
    color: var(--black);
}

.connection-details h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.25rem 0;
}

.connection-details p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0 0 0.25rem 0;
}

.connection-details small {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.connection-actions {
    display: flex;
    gap: 0.5rem;
}

/* Security Options */
.security-options {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.security-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--gray-lightest);
    border-radius: var(--radius);
}

.security-option-info {
    flex: 1;
}

.security-option-info h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.25rem 0;
}

.security-option-info p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0;
}

.security-option-action {
    display: flex;
    align-items: center;
}

/* Notification Options */
.notification-options {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.notification-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--gray-lightest);
    border-radius: var(--radius);
}

.notification-info {
    flex: 1;
}

.notification-info h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.25rem 0;
}

.notification-info p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0;
}

/* Export Options */
.export-options {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.export-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--gray-lightest);
    border-radius: var(--radius);
}

.export-info {
    flex: 1;
}

.export-info h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.25rem 0;
}

.export-info p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0;
}

/* Password Strength Indicator */
.password-strength {
    height: 4px;
    border-radius: 2px;
    margin-top: 0.5rem;
    transition: all 0.3s ease;
}

.password-strength.weak {
    background-color: #dc3545;
    width: 25%;
}

.password-strength.fair {
    background-color: #fd7e14;
    width: 50%;
}

.password-strength.good {
    background-color: #ffc107;
    width: 75%;
}

.password-strength.strong {
    background-color: #198754;
    width: 100%;
}

/* Badge Styles */
.badge {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.375rem;
}

.badge-secondary {
    color: #6c757d;
    background-color: #e9ecef;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .settings-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .settings-nav {
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .settings-nav::-webkit-scrollbar {
        display: none;
    }
    
    .connection-status {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .connection-actions {
        justify-content: center;
    }
    
    .security-option,
    .notification-option,
    .export-option {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* Loading States */
.settings-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: var(--text-muted);
}

.settings-loading i {
    margin-right: 0.5rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Success/Error Messages */
.settings-message {
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.settings-message.success {
    background-color: #d1e7dd;
    color: #0f5132;
    border: 1px solid #badbcc;
}

.settings-message.error {
    background-color: #f8d7da;
    color: #842029;
    border: 1px solid #f5c2c7;
}

.settings-message.warning {
    background-color: #fff3cd;
    color: #664d03;
    border: 1px solid #ffecb5;
}

.settings-message i {
    font-size: 1.1rem;
}

.settings-message i {
  margin-right: 0.5rem;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   PRIVACY & DATA RIGHTS SECTION
   ═══════════════════════════════════════════════════════════════════════════════ */

/* Privacy Section Layout */
.privacy-section {
  margin: 2rem 0;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
}

.privacy-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.privacy-section-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 1.5rem;
}

.privacy-section-title i {
  font-size: 1.25rem;
  color: var(--text-muted);
}

/* Consent Status Card */
.consent-status-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  transition: all 0.2s ease-in-out;
}

.consent-status-card:hover {
  border-color: var(--black);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.consent-status-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
}

.consent-status-icon {
  width: 3rem;
  height: 3rem;
  background: var(--gray-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.consent-status-icon i {
  font-size: 1.5rem;
  color: var(--text-muted);
}

.consent-status-details h5 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 0.25rem 0;
}

.consent-status-details p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0 0 0.25rem 0;
}

.consent-status-details small {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.consent-status-actions {
  flex-shrink: 0;
}

/* Consent Status States */
.consent-status-card.active .consent-status-icon {
  background: #d1fae5;
}

.consent-status-card.active .consent-status-icon i {
  color: #10b981;
}

.consent-status-card.withdrawn .consent-status-icon {
  background: #fee2e2;
}

.consent-status-card.withdrawn .consent-status-icon i {
  color: #ef4444;
}

.consent-status-card.loading .consent-status-icon {
  background: var(--gray-light);
}

.consent-status-card.loading .consent-status-icon i {
  color: var(--text-muted);
  animation: spin 1s linear infinite;
}

/* Data Summary Card */
.data-summary-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.data-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.data-summary-item {
  text-align: center;
  padding: 1rem;
  background: var(--gray-light);
  border-radius: var(--radius);
}

.data-summary-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.data-summary-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Privacy Controls */
.privacy-controls {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.privacy-control-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all 0.2s ease-in-out;
  gap: 1rem;
}

.privacy-control-item:hover {
  border-color: var(--black);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.privacy-control-item.border-danger {
  border-color: #ef4444;
  background: #fef2f2;
}

.privacy-control-item.border-danger:hover {
  border-color: #dc2626;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.2);
}

.privacy-control-info {
  flex: 1;
}

.privacy-control-info h5 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 0.25rem 0;
}

.privacy-control-info p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0;
}

.privacy-control-action {
  flex-shrink: 0;
}

/* Data Rights Information */
.data-rights-info {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.data-right-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--gray-light);
  border-radius: var(--radius);
}

.data-right-item i {
  font-size: 1.1rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.data-right-item span {
  font-size: 0.9rem;
  color: var(--text);
}

.data-rights-contact {
  padding: 1rem;
  background: var(--gray-light);
  border-radius: var(--radius);
  text-align: center;
}

.data-rights-contact p {
  margin: 0 0 0.5rem 0;
  font-size: 0.9rem;
  color: var(--text);
}

.data-rights-contact p:last-child {
  margin-bottom: 0;
}

.data-rights-contact a {
  color: var(--black);
  text-decoration: underline;
  font-weight: 500;
}

.data-rights-contact a:hover {
  text-decoration: none;
}

/* Button Variants for Privacy Section */
.btn.btn-outline-warning {
  color: #f59e0b;
  border-color: #f59e0b;
  background: transparent;
}

.btn.btn-outline-warning:hover {
  background: #f59e0b;
  color: white;
  border-color: #f59e0b;
}

.btn.btn-danger {
  background: #ef4444;
  border-color: #ef4444;
  color: white;
}

.btn.btn-danger:hover {
  background: #dc2626;
  border-color: #dc2626;
}

/* Responsive Design for Privacy Section */
@media (max-width: 768px) {
  .privacy-section {
    margin: 1.5rem 0;
    padding: 1rem 0;
  }

  .consent-status-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .consent-status-info {
    width: 100%;
  }

  .consent-status-actions {
    width: 100%;
    display: flex;
    justify-content: flex-end;
  }

  .data-summary-grid {
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 1rem;
  }

  .data-summary-item {
    padding: 0.75rem;
  }

  .data-summary-value {
    font-size: 1.25rem;
  }

  .privacy-control-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .privacy-control-action {
    width: 100%;
    display: flex;
    justify-content: flex-end;
  }

  .privacy-control-action .btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 576px) {
  .privacy-section-title {
    font-size: 1rem;
    gap: 0.5rem;
  }

  .consent-status-icon {
    width: 2.5rem;
    height: 2.5rem;
  }

  .consent-status-icon i {
    font-size: 1.25rem;
  }

  .data-summary-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .data-right-item {
    padding: 0.5rem;
    gap: 0.5rem;
  }

  .data-right-item i {
    font-size: 1rem;
  }

  .data-right-item span {
    font-size: 0.85rem;
  }
}

/* ─── Professional Connection Status Modal ───────────────────────────── */
.connection-status-modal .modal-content {
  border: none;
  border-radius: 12px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  background: var(--white);
}

.connection-status-modal .modal-header {
  border-bottom: 1px solid var(--border);
  padding: 1.5rem 1.5rem 1rem 1.5rem;
}

.connection-status-modal .service-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
}

.connection-status-modal .service-icon svg {
  width: 24px;
  height: 24px;
  display: none;
}

.connection-status-modal .service-icon.gmail {
  background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
  color: var(--text-primary);
}

.connection-status-modal .service-icon.gmail .gmail-icon {
  display: block;
}

.connection-status-modal .service-icon.bank {
  background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
  color: var(--text-primary);
}

.connection-status-modal .service-icon.bank .bank-icon {
  display: block;
}

.connection-status-modal .modal-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.connection-status-modal .modal-body {
  padding: 1rem 1.5rem 1.5rem 1.5rem;
}

.connection-status-modal .connection-status-display {
  background: var(--gray-light);
  border-radius: 8px;
  padding: 1rem;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.connection-status-modal .connection-status-display.connected {
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  border-color: #22c55e;
  border-width: 2px;
}

.connection-status-modal .connection-status-display.disconnected {
  background: var(--gray-light);
  border-color: var(--border);
}

.connection-status-modal .connection-status-display.error {
  background: linear-gradient(135deg, #fef2f2, #fee2e2);
  border-color: #ef4444;
  border-width: 2px;
}

.connection-status-modal .connection-details {
  font-size: 0.875rem;
  color: var(--text-muted);
  flex: 1;
}

.connection-status-modal .connection-details.connected {
  color: #16a34a;
  font-weight: 600;
}

.connection-status-modal .connection-details.error {
  color: #dc2626;
  font-weight: 600;
}

.connection-status-modal .status-indicator {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid transparent;
}

.connection-status-modal .status-indicator.connected {
  background: linear-gradient(135deg, #10b981, #059669);
  border-color: #d1fae5;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.connection-status-modal .status-indicator.connected::after {
  content: '✓';
  color: white;
  font-size: 10px;
  font-weight: bold;
  line-height: 1;
}

.connection-status-modal .status-indicator.disconnected {
  background: #f3f4f6;
  border-color: #d1d5db;
}

.connection-status-modal .status-indicator.disconnected::after {
  content: '';
  width: 6px;
  height: 6px;
  background: #6b7280;
  border-radius: 50%;
}

.connection-status-modal .status-indicator.error {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  border-color: #fecaca;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.connection-status-modal .status-indicator.error::after {
  content: '!';
  color: white;
  font-size: 10px;
  font-weight: bold;
  line-height: 1;
}

.connection-status-modal .connection-details {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.connection-status-modal .connection-message {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text);
}

.connection-status-modal .connection-message.reconnect {
  background: var(--gray-light);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  margin-top: 1rem;
}

.connection-status-modal .connection-message.reconnect .message-icon {
  color: var(--text);
  margin-right: 0.5rem;
}

.connection-status-modal .modal-footer {
  border-top: 1px solid var(--border);
  padding: 1rem 1.5rem;
  gap: 0.75rem;
}

.connection-status-modal .btn {
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  border-radius: 8px;
  font-size: 0.95rem;
  transition: all var(--transition);
}

.connection-status-modal .btn-outline-secondary {
  background: var(--white);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.connection-status-modal .btn-outline-secondary:hover {
  background: var(--gray-light);
  color: var(--text);
  border-color: var(--text-muted);
}

.connection-status-modal .btn-primary {
  background: var(--black);
  color: var(--white);
  border: 1px solid var(--black);
}

.connection-status-modal .btn-primary:hover {
  background: #111;
  border-color: #111;
  transform: translateY(-1px);
}

.connection-status-modal .btn-warning {
  background: var(--black);
  color: var(--white);
  border: 1px solid var(--black);
}

.connection-status-modal .btn-warning:hover {
  background: #111;
  border-color: #111;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Connection Status Text Styling */
.connection-status-modal .fw-medium {
  font-weight: 600;
}

.connection-status-modal .text-muted {
  color: var(--text-muted);
}

/* Responsive Design */
@media (max-width: 576px) {
  .connection-status-modal .modal-header,
  .connection-status-modal .modal-body,
  .connection-status-modal .modal-footer {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  .connection-status-modal .service-icon {
    width: 40px;
    height: 40px;
    font-size: 1.25rem;
  }
  
  .connection-status-modal .modal-title {
    font-size: 1.125rem;
  }
  
  .connection-status-modal .btn {
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
  }
}

/* Animation for modal appearance */
.connection-status-modal.fade .modal-dialog {
  transform: translate(0, -50px);
  transition: transform 0.3s ease-out;
}

.connection-status-modal.show .modal-dialog {
  transform: translate(0, 0);
}

/* Focus states for accessibility */
.connection-status-modal .btn:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

.connection-status-modal .btn-primary:focus {
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.2);
}

.connection-status-modal .btn-warning:focus {
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.2);
}

/* Old status indicator styles removed - replaced with cleaner connection display styling */

.connection-status-modal .connection-details {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.connection-status-modal .status-indicator {
  display: none !important;
}

/* Loading placeholders for metrics */
.loading-placeholder {
  color: var(--text-muted);
  font-style: italic;
  opacity: 0.7;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 0.7;
  }
  50% {
    opacity: 0.4;
  }
}

/* Ensure loading placeholders are styled consistently */
.compact-metric-value .loading-placeholder,
.breakdown-item-value:contains("Loading..."),
.breakdown-total:contains("Loading...") {
  color: var(--text-muted);
  font-style: italic;
  font-weight: normal;
}

.compact-metric-change .change-text:contains("Loading...") {
  color: var(--text-muted);
  font-style: italic;
}

.enhanced-metrics-section {}

/* ═══════════════════════════════════════════════════════════════════════════════
   ADMIN DASHBOARD STYLES
   ═══════════════════════════════════════════════════════════════════════════════ */

/* Admin Stats Grid */
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.admin-stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all var(--transition);
}

.admin-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.admin-stat-icon {
  width: 3rem;
  height: 3rem;
  background: var(--gray-light);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--text-muted);
}

.admin-stat-content {
  flex: 1;
}

.admin-stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

.admin-stat-label {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Admin Actions Grid */
.admin-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.admin-action-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: all var(--transition);
}

.admin-action-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.admin-action-header {
  margin-bottom: 1.5rem;
}

.admin-action-header h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 0.5rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.admin-action-header h3 i {
  font-size: 1rem;
  color: var(--text-muted);
}

.admin-action-header p {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.4;
}

.admin-action-buttons {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.admin-action-buttons .btn {
  flex: 1;
  min-width: 120px;
}

/* Admin Navigation Visibility */
#admin-nav-item {
  display: none;
}

body.admin-user #admin-nav-item {
  display: flex;
}

/* Responsive Design */
@media (max-width: 768px) {
  .admin-stats-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .admin-actions-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .admin-stat-card {
    padding: 1rem;
  }
  
  .admin-action-card {
    padding: 1rem;
  }
  
  .admin-action-buttons {
    flex-direction: column;
  }
  
  .admin-action-buttons .btn {
    flex: none;
    min-width: auto;
  }
}

@media (max-width: 576px) {
  .admin-stat-icon {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1.25rem;
  }
  
  .admin-stat-value {
    font-size: 1.5rem;
  }
  
  .admin-action-header h3 {
    font-size: 1rem;
  }
}

/* Security Page Improvements */
.session-action-btn,
.device-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius);
  transition: all var(--transition);
  text-decoration: none;
}

.session-action-btn i,
.device-action-btn i {
  font-size: 1rem;
  line-height: 1;
}

.session-action-btn .btn-text,
.device-action-btn .btn-text {
  line-height: 1;
}

/* Session and Device Items */
.session-item,
.device-item {
  padding: 1rem;
  background: var(--gray-light);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 0.75rem;
  transition: all var(--transition);
}

.session-item:hover,
.device-item:hover {
  background: #f5f5f5;
  border-color: #d0d0d0;
}

.session-item.current-session,
.device-item.current-device {
  background: #f8f9fa;
  border-color: var(--black);
  border-width: 1px;
}

.session-header,
.device-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.session-device,
.device-details {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
}

.session-device i,
.device-details i {
  font-size: 1.25rem;
  color: var(--black);
}

.session-type,
.device-name {
  font-weight: 600;
  color: var(--black);
}

.device-capabilities {
  margin-top: 0.5rem;
}

.device-capabilities .badge {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
}

/* Action buttons styling */
.session-actions,
.device-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.session-actions .btn,
.device-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius);
  transition: all var(--transition);
}

.session-actions .btn i,
.device-actions .btn i {
  font-size: 1rem;
  line-height: 1;
}

.session-actions .btn .btn-text,
.device-actions .btn .btn-text {
  line-height: 1;
}

/* Responsive improvements */
@media (max-width: 768px) {
  .session-header,
  .device-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }
  
  .session-device,
  .device-details {
    justify-content: center;
  }
  
  .session-action-btn,
  .device-action-btn {
    justify-content: center;
    width: 100%;
  }
  
  .session-actions,
  .device-actions {
    justify-content: center;
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .admin-stats-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .admin-actions-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .admin-stat-card {
    padding: 1rem;
  }
  
  .admin-action-card {
    padding: 1rem;
  }
  
  .admin-action-buttons {
    flex-direction: column;
  }
  
  .admin-action-buttons .btn {
    flex: none;
    min-width: auto;
  }
}

/* Vulnerability Monitoring Widget */
.admin-action-content {
  margin-bottom: 1rem;
}

.vulnerability-status-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
}

.vulnerability-stat {
  text-align: center;
  padding: 0.75rem;
  background: var(--gray-light);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.vulnerability-stat-value {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.vulnerability-stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.vulnerability-stat-value.status-idle {
  color: var(--text-muted);
}

.vulnerability-stat-value.status-running {
  color: #0066cc;
}

.vulnerability-stat-value.status-complete {
  color: #198754;
}

.vulnerability-stat-value.status-error {
  color: #dc3545;
}

.vulnerability-stat-value.alerts-none {
  color: #198754;
}

.vulnerability-stat-value.alerts-low {
  color: #ffc107;
}

.vulnerability-stat-value.alerts-high {
  color: #dc3545;
}

@media (max-width: 576px) {
  .admin-stat-icon {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1.25rem;
  }
  
  .admin-stat-value {
    font-size: 1.5rem;
  }
  
  .admin-action-header h3 {
    font-size: 1rem;
  }
  
  .vulnerability-status-grid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
  
  .vulnerability-stat {
    padding: 0.5rem;
  }
  
  .vulnerability-stat-value {
    font-size: 1rem;
  }
}

/* Support Ticket Creation Modal Styles */
.customer-search-container {
  position: relative;
}

.customer-search-results {
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background-color: var(--white);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.customer-search-result {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
  transition: background-color var(--transition);
}

.customer-search-result:last-child {
  border-bottom: none;
}

.customer-search-result:hover {
  background-color: var(--gray-light);
}

.customer-result-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.customer-result-info strong {
  font-weight: 600;
  color: var(--text);
}

.customer-result-info .text-muted {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.customer-id {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
}

.customer-result-meta {
  display: flex;
  align-items: center;
}

.selected-customer-display {
  margin-top: 0.5rem;
}

.selected-customer-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background-color: var(--gray-light);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
}

.selected-customer-card i {
  color: var(--text-muted);
}

.selected-customer-card button {
  margin-left: auto;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
}

/* Form styling for ticket creation */
.form-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.form-row .form-group {
  flex: 1;
  margin-bottom: 0;
}

.form-group.col-md-8 {
  flex: 2;
}

.form-group.col-md-4 {
  flex: 1;
}

/* Input group styling */
.input-group {
  display: flex;
  width: 100%;
}

.input-group .form-control {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  border-right: none;
}

.input-group .btn {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  border-left: 1px solid var(--border);
}

/* Badge styling */
.badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: 0.25rem;
}

.badge-secondary {
  background-color: var(--text-muted);
  color: var(--white);
}

/* Modal enhancements */
.modal-content {
  border: none;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.modal-header {
  border-bottom: 1px solid var(--border);
  padding: 1.5rem;
}

.modal-title {
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  border-top: 1px solid var(--border);
  padding: 1rem 1.5rem;
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

/* Alert styling */
.alert {
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 0.9rem;
}

.alert-danger {
  background-color: #fef2f2;
  border-color: #fecaca;
  color: #dc2626;
}

.alert-success {
  background-color: #f0fdf4;
  border-color: #bbf7d0;
  color: #16a34a;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .form-row {
    flex-direction: column;
    gap: 0;
  }
  
  .form-row .form-group {
    margin-bottom: 1rem;
  }
  
  .customer-search-result {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .customer-result-meta {
    align-self: flex-end;
  }
  
  .selected-customer-card {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  .modal-dialog {
    margin: 1rem;
  }
  
  .modal-header,
  .modal-body,
  .modal-footer {
    padding: 1rem;
  }
}

/* Button close styling for modal */
.btn-close {
  background: none;
  border: none;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1;
  color: var(--text);
  opacity: 0.5;
  cursor: pointer;
  padding: 0;
  margin: 0;
}

.btn-close:hover {
  opacity: 0.75;
}

/* Ensure proper spacing for form elements */
.form-group {
  margin-bottom: 1rem;
}

.form-group:last-child {
  margin-bottom: 0;
}

.mb-4 {
  margin-bottom: 1.5rem !important;
}

.mt-2 {
  margin-top: 0.5rem !important;
}

/* ═══════════════════════════════════════════════════════════════════════════════════════════════
   TENANT DASHBOARD STYLES
   ═══════════════════════════════════════════════════════════════════════════════════════════════ */

.tenant-dashboard-section {
    padding: 2rem 0;
}

.tenant-welcome {
    text-align: center;
    margin-bottom: 3rem;
}

.tenant-welcome .dashboard-main-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.tenant-welcome .dashboard-subtitle {
    font-size: 1.125rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Tenant Quick Actions */
.tenant-quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.quick-action-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    cursor: pointer;
    transition: all var(--transition);
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.quick-action-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: var(--black);
}

.quick-action-icon {
    width: 4rem;
    height: 4rem;
    background: var(--black);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem auto;
    font-size: 1.5rem;
    transition: all var(--transition);
}

.quick-action-card:hover .quick-action-icon {
    background: #111;
    transform: scale(1.05);
}

.quick-action-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.quick-action-content p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin: 0;
    line-height: 1.5;
}

/* Tenant Info Cards */
.tenant-info-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
}

.tenant-info-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.tenant-info-card h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tenant-info-card h4 i {
    color: var(--black);
    font-size: 1.25rem;
}

.tenant-info-card p {
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.tenant-info-card p strong {
    color: var(--text);
    font-weight: 600;
}

/* Recent Payment Items */
.recent-payment-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

.recent-payment-item:last-child {
    border-bottom: none;
}

.payment-status {
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.payment-status.completed {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

.payment-status.pending {
    background: #fffbeb;
    color: #d97706;
    border: 1px solid #fed7aa;
}

.payment-status.overdue {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

/* Tenant Dashboard Buttons */
.tenant-info-card .btn {
    margin-top: 1rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    background: var(--black);
    color: var(--white);
    border: 1px solid var(--black);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    display: inline-block;
}

.tenant-info-card .btn:hover {
    background: #111;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Responsive Design for Tenant Dashboard */
@media (max-width: 768px) {
    .tenant-welcome .dashboard-main-title {
        font-size: 2rem;
    }
    
    .tenant-welcome .dashboard-subtitle {
        font-size: 1rem;
    }
    
    .tenant-quick-actions {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .quick-action-card {
        padding: 1.5rem;
    }
    
    .quick-action-icon {
        width: 3rem;
        height: 3rem;
        font-size: 1.25rem;
        margin-bottom: 1rem;
    }
    
    .tenant-info-cards {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .tenant-info-card {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .tenant-dashboard-section {
        padding: 1rem 0;
    }
    
    .tenant-welcome {
        margin-bottom: 2rem;
    }
    
    .tenant-welcome .dashboard-main-title {
        font-size: 1.75rem;
    }
    
    .quick-action-card {
        padding: 1rem;
    }
    
    .recent-payment-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════════════════════════
   END TENANT DASHBOARD STYLES
   ═══════════════════════════════════════════════════════════════════════════════════════════════ */

/* Tenant Settings Styles */
.lease-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.lease-info-item {
  padding: 1rem;
  background-color: var(--gray-light);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.lease-info-item label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
  display: block;
}

.lease-info-value {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
}

.payment-methods-list {
  margin-bottom: 1rem;
}

.payment-method-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  background-color: var(--gray-light);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
  transition: var(--transition);
}

.payment-method-item:hover {
  background-color: #f0f0f0;
  transform: translateY(-1px);
}

.payment-method-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.payment-method-icon {
  width: 2.5rem;
  height: 2.5rem;
  background-color: var(--black);
  color: var(--white);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.payment-method-details h5 {
  margin: 0 0 0.25rem 0;
  font-size: 1rem;
  font-weight: 600;
}

.payment-method-details p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.payment-method-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.payment-method-actions .btn {
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
}

.payment-history-summary {
  margin-bottom: 1rem;
}

.payment-history-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.privacy-section {
  margin-bottom: 2rem;
}

.privacy-section:last-child {
  margin-bottom: 0;
}

.privacy-section-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.privacy-section-title i {
  color: var(--text-muted);
}

.privacy-control-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  background-color: var(--gray-light);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
  transition: var(--transition);
}

.privacy-control-item:hover {
  background-color: #f0f0f0;
}

.privacy-control-item.border-danger {
  border-color: #dc3545;
}

.privacy-control-item.border-danger:hover {
  background-color: #fdf2f2;
}

.privacy-control-info {
  flex: 1;
}

.privacy-control-info h5 {
  margin: 0 0 0.25rem 0;
  font-size: 1rem;
  font-weight: 600;
}

.privacy-control-info p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.privacy-control-action {
  margin-left: 1rem;
}

.data-rights-info {
  background-color: var(--gray-light);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.data-right-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.data-right-item:last-child {
  margin-bottom: 0;
}

.data-right-item i {
  color: var(--text-muted);
  font-size: 1.125rem;
}

.data-right-item span {
  font-size: 0.875rem;
  line-height: 1.4;
}

.data-rights-contact {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.data-rights-contact p {
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
}

.data-rights-contact p:last-child {
  margin-bottom: 0;
}

.data-rights-contact a {
  color: var(--black);
  text-decoration: underline;
}

.data-rights-contact a:hover {
  text-decoration: none;
}

/* Autopay configuration styles */
#autopay-configuration {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* Responsive adjustments for tenant settings */
@media (max-width: 768px) {
  .lease-info-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  
  .payment-method-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .payment-method-actions {
    width: 100%;
    justify-content: flex-end;
  }
  
  .privacy-control-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .privacy-control-action {
    margin-left: 0;
    width: 100%;
  }
  
  .payment-history-actions {
    flex-direction: column;
  }
  
  .payment-history-actions .btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .lease-info-item {
    padding: 0.75rem;
  }
  
  .payment-method-item {
    padding: 0.75rem;
  }
  
  .privacy-control-item {
    padding: 0.75rem;
  }
  
  .data-rights-info {
    padding: 1rem;
  }
}

/* AGGRESSIVE SETTINGS TAB CONTENT FIX - Added to resolve disappearing content issue */
/* Force settings tab content to be visible when active - override any conflicting styles */
.settings-tab-content.active {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
    overflow: visible !important;
    position: relative !important;
    z-index: 1 !important;
}

/* Ensure settings view itself is always visible when hash is settings */
#settings-view .settings-tab-content.active {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Force specific tab content to be visible when active */
#account-tab.active,
#security-tab.active, 
#payment-settings-tab.active,
#preferences-tab.active,
#notifications-tab.active,
#privacy-tab.active,
#connections-tab.active,
#data-tab.active {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    min-height: 200px !important;
}

/* Prevent any JavaScript from hiding active tab content */
#settings-view .settings-tab-content.active[style*="display: none"] {
    display: block !important;
}

/* Force visibility for settings page on refresh */
body[data-hash="settings"] #settings-view {
    display: block !important;
    visibility: visible !important;
}

body[data-hash="settings"] #settings-view .settings-tab-content.active {
    display: block !important;
    visibility: visible !important;
}

body[data-hash="settings"] #settings-view .settings-tab-content.active {
    display: block !important;
    visibility: visible !important;
}

/* Override Tailwind's .hidden class for settings content */
#settings-view .settings-tab-content.active.hidden,
#settings-view .settings-tab-content.active .hidden,
.settings-tab-content.active.hidden {
    display: block !important;
    visibility: visible !important;
}

/* Prevent any framework from hiding active settings tabs */
body[data-hash="settings"] .settings-tab-content.active,
body[data-hash="settings"] #settings-view .settings-tab-content.active {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Ultra-specific override for Tailwind CSS conflicts */
.settings-tab-content.active:not(.d-none):not(.visually-hidden) {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
    overflow: visible !important;
}

/* Force visibility for all settings tab content regardless of any other classes */
#account-tab.active,
#security-tab.active, 
#payment-settings-tab.active,
#preferences-tab.active,
#notifications-tab.active,
#privacy-tab.active,
#connections-tab.active,
#data-tab.active {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    min-height: 200px !important;
}

/* Ensure settings view itself is never hidden when hash is settings */
body[data-hash="settings"] #settings-view {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Override any potential Bootstrap or other framework hiding classes */
#settings-view .settings-tab-content.active.d-none,
#settings-view .settings-tab-content.active.visually-hidden,
#settings-view .settings-tab-content.active.collapse:not(.show) {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* CRITICAL FIX: Ensure only active tab content is visible - prevents multiple tabs showing */
/* Hide all tab content by default */
.settings-tab-content {
    display: none !important;
}

/* Show only active tab content */
.settings-tab-content.active {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    min-height: 200px !important;
}

/* Ensure settings view container is properly sized */
#settings-view {
    min-height: 600px;
    position: relative;
}

/* Force proper tab switching behavior - hide non-active tabs */
#settings-view .settings-tab-content:not(.active) {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

/* Fix for privacy policy button and other outline-secondary buttons */
.btn-outline-secondary {
  color: var(--black) !important;
  border: 2px solid var(--black) !important;
  background-color: transparent !important;
  font-weight: 500 !important;
  transition: all 0.2s ease !important;
}

.btn-outline-secondary:hover {
  color: var(--white) !important;
  background-color: var(--black) !important;
  border-color: var(--black) !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15) !important;
}

.btn-outline-secondary:focus {
  color: var(--white) !important;
  background-color: var(--black) !important;
  border-color: var(--black) !important;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1) !important;
}

.btn-outline-secondary:active {
  color: var(--white) !important;
  background-color: var(--black) !important;
  border-color: var(--black) !important;
}

/* Ensure privacy policy button specifically has good contrast */
a.btn-outline-secondary[href*="privacy-policy"] {
  color: var(--black) !important;
  border: 2px solid var(--black) !important;
  background-color: transparent !important;
}

a.btn-outline-secondary[href*="privacy-policy"]:hover {
  color: var(--white) !important;
  background-color: var(--black) !important;
  border-color: var(--black) !important;
}