/* =====================================================
   STANDARDIZED PAGE HEADER - USED ON ALL PAGES
   ===================================================== */

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 16px;
}

.page-header h1 {
    margin-bottom: 4px;
}

.page-header p {
    margin: 0;
}

/* =====================================================
   STANDARDIZED FILTER CARD STYLES - USED ON ALL PAGES
   ===================================================== */

.filter-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 0;
    margin-bottom: 24px;
    border: 1px solid var(--border-dark);
}

.sidebar-header {
    display: flex;
    align-items: center;
    padding: 20px 24px 16px;
}

.filter-card .sidebar-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-white);
    margin: 0;
    display: flex;
    align-items: center;
}

.sidebar-icon {
    margin-right: 8px;
    color: var(--light-purple);
}

.separator-line {
    height: 1px;
    background: var(--border-dark);
    margin: 0 24px;
}

.filter-bar {
    display: flex;
    gap: 16px;
    padding: 16px 24px;
    flex-wrap: wrap;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 140px;
}

.filter-group label {
    font-size: 0.85rem;
    color: var(--text-gray);
    font-weight: 500;
}

.filter-actions {
    display: flex;
    gap: 8px;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px 20px;
    flex-wrap: wrap;
}

.active-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.status-badge {
    background: var(--light-purple);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

.status-badge i.fas.fa-times {
    cursor: pointer;
    margin-left: 4px;
}

.status-badge i.fas.fa-times:hover {
    opacity: 0.7;
}

/* Filter input standardization - ensures all filter inputs look identical */
.filter-card .input,
.filter-bar .filter-group .input,
.filter-group .input {
    padding: 6px 10px;
    height: 32px;
    font-size: 0.9rem;
    width: 100%;
}

/* =====================================================
   END FILTER CARD STYLES
   ===================================================== */

/* ========================================
   UI COMPONENTS
   ======================================== */

/* ========================================
   BUTTONS
   ======================================== */
.btn, button {
  background: var(--light-purple);
  color: #FFFFFF !important; /* Force white text */
  border: none;
  padding: 6px 14px; /* Compact design - reduced from 10px 18px */
  border-radius: var(--border-radius);
  cursor: pointer;
  font-size: var(--font-size-sm);
  font-weight: 500;
  transition: background-color 0.2s ease; /* Simplified transition - only background color */
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  font-family: inherit;
}

.btn i, button i {
  color: #FFFFFF !important; /* Force white icons */
}

/* Remove ripple effect */
.btn::before {
  display: none; /* Remove ripple animation */
}

.btn:active {
  transform: scale(0.98);
}

.btn:hover {
  background: var(--dark-purple); /* Light pink buttons go to dark purple on hover */
  color: #FFFFFF !important; /* Force white text on hover */
  /* Removed transform: translateY(-2px) lift animation */
}

.btn:hover i {
  color: #FFFFFF !important; /* Force white icons on hover */
}

/* Button Variants */
.btn-primary {
  background-color: var(--light-purple);
  color: #FFFFFF !important;
}

.btn-primary:hover {
  background-color: var(--dark-purple); /* Light purple to dark purple */
  color: #FFFFFF !important;
}

.btn-primary i {
  color: #FFFFFF !important;
}

.btn-primary:hover i {
  color: #FFFFFF !important;
}

.btn-primary:active {
  background-color: var(--light-purple) !important;
  color: #FFFFFF !important;
  transform: scale(0.98);
}

.btn-dark {
  background: var(--dark-purple);
  color: #FFFFFF !important;
}

.btn-dark:hover {
  background: var(--light-purple); /* Dark purple to light purple (dashboard behavior) */
  color: #FFFFFF !important;
}

.btn-dark i {
  color: #FFFFFF !important;
}

.btn-dark:hover i {
  color: #FFFFFF !important;
}

.btn-light {
  background: var(--light-purple);
  color: #FFFFFF !important;
}

.btn-light:hover {
  background: var(--dark-purple); /* Light purple to dark purple (dashboard behavior) */
  color: #FFFFFF !important;
}

.btn-light i {
  color: #FFFFFF !important;
}

.btn-light:hover i {
  color: #FFFFFF !important;
}

.btn-light:active {
  background-color: var(--light-purple) !important;
  color: #FFFFFF !important;
  transform: scale(0.98);
}

/* Specific styling for PDF download buttons */
[data-pdf-download]:active,
button[data-pdf-download]:active {
  background-color: var(--light-purple) !important;
  color: #FFFFFF !important;
  transform: scale(0.98);
}

.btn-danger {
  background-color: #dc2626;
  color: #FFFFFF !important;
}

.btn-danger:hover {
  background-color: #b91c1c;
  color: #FFFFFF !important;
}

.btn-danger i {
  color: #FFFFFF !important;
}

.btn-danger:hover i {
  color: #FFFFFF !important;
}

.btn-success {
  background-color: #22c55e;
  color: #FFFFFF !important;
}

.btn-success:hover {
  background-color: #16a34a;
  color: #FFFFFF !important;
}

.btn-success i {
  color: #FFFFFF !important;
}

.btn-success:hover i {
  color: #FFFFFF !important;
}

.btn-secondary {
  background: var(--table-hover-bg);
  border: 1px solid var(--border-light);
  color: #FFFFFF !important;
}

.btn-secondary:hover {
  background: var(--border-light);
  color: #FFFFFF !important;
}

.btn-secondary i {
  color: #FFFFFF !important;
}

.btn-secondary:hover i {
  color: #FFFFFF !important;
}

/* Button Sizes */
.btn-sm {
  padding: 6px 12px;
  font-size: 0.875rem;
}

.btn-lg {
  padding: 14px 24px;
  font-size: 1.125rem;
}

.btn-full {
  width: 100%;
}

/* Button States */
.btn:disabled, button:disabled {
  background: var(--table-hover-bg) !important;
  color: var(--text-gray) !important;
  cursor: not-allowed;
  transform: none !important;
}

/* Exception for success buttons that should stay green when disabled - NO visual changes */
.btn.btn-success:disabled {
  background: #22c55e !important;
  color: #ffffff !important;
  opacity: 1 !important;
  cursor: not-allowed;
  transform: none !important;
}

/* Ensure disabled success buttons are green in light mode too - NO visual changes */
[data-theme="light"] .btn.btn-success:disabled {
  background: #16a34a !important;
  color: #ffffff !important;
  opacity: 1 !important;
  cursor: not-allowed;
  transform: none !important;
}

/* Exception for primary buttons that should stay purple when disabled - NO visual changes */
.btn.btn-primary:disabled {
  background: var(--light-purple) !important;
  color: #ffffff !important;
  opacity: 1 !important;
  cursor: not-allowed;
  transform: none !important;
}

.btn.btn-primary:disabled i {
  color: #ffffff !important;
}

/* Exception for secondary buttons that should stay visible when disabled */
.btn.btn-secondary:disabled {
  background: var(--table-hover-bg) !important;
  border: 1px solid var(--border-light) !important;
  color: #ffffff !important;
  opacity: 0.8;
  cursor: not-allowed;
  transform: none !important;
}

.btn.btn-secondary:disabled i {
  color: #ffffff !important;
}


/* Icon Buttons */
.btn-icon-small {
  background: var(--light-purple);
  border: 1px solid var(--light-purple);
  color: #FFFFFF !important;
  padding: 6px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
  /* ⚡ PERFORMANCE: Specific transitions only */
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.btn-icon-small:hover {
  background: var(--dark-purple);
  color: #FFFFFF !important;
  border-color: var(--dark-purple);
}

.btn-icon-small i {
  color: #FFFFFF !important;
}

.btn-icon-small:hover i {
  color: #FFFFFF !important;
}

/* ========================================
   CARDS
   ======================================== */
.card {
  background-color: var(--table-bg);
  border-radius: var(--border-radius);
  padding: 12px;
  margin-bottom: var(--spacing-md);
  border: 1px solid var(--border-dark);
  overflow: visible;
  transition: none; /* Remove transitions */
  max-width: 100%;
  box-sizing: border-box;
}

/* Remove hover effects */
.card:hover {
  box-shadow: none;
}

.card-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-dark);
  background-color: var(--table-hover-bg);
  border-radius: var(--border-radius) var(--border-radius) 0 0;
  margin: -12px -12px 12px -12px;
}

.card-header h4 {
  margin: 0;
  font-size: 1.125rem;
  color: var(--text-white);
}

.card-body {
  padding: 16px;
}

/* ========================================
   FORMS
   ======================================== */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-white);
  font-weight: 500;
  font-size: 0.9rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="url"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border-light);
  border-radius: var(--border-radius);
  background-color: var(--table-bg);
  color: var(--text-white);
  font-size: 1rem;
  transition: all 0.2s ease;
  font-family: inherit;
  box-sizing: border-box;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--light-purple);
  box-shadow: 0 0 0 3px rgba(166, 77, 121, 0.2);
  background-color: var(--table-hover-bg);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-gray);
  opacity: 0.7;
}

textarea {
  min-height: 100px;
  resize: vertical;
}

/* Search Input */
.search-container {
  position: relative;
  display: inline-block;
}

.search-container i {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-gray);
  font-size: 0.9rem;
  z-index: 2;
}

.search-container input[type="text"] {
  padding-left: 44px;
}

/* ========================================
   TABLES
   ======================================== */
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--table-bg);
  border-radius: var(--border-radius);
  overflow: hidden;
}

th, td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--table-hover-bg);
}

th {
  background: var(--table-hover-bg);
  font-weight: 600;
  color: var(--text-white);
}

tr:hover td {
  background-color: var(--table-hover-bg);
}

/* ========================================
   SIDEBAR & MENU
   ======================================== */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 240px;
  background: #171820;
  padding: 24px;
  border-right: 1px solid #2B2A32;
  box-sizing: border-box;
  z-index: 100;
  border-radius: 0 var(--border-radius) var(--border-radius) 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.sidebar > div:first-child > .sidebar-title {
  font-size: 1.5em;
  font-weight: 700;
  color: #FFFFFF;
  margin-bottom: 32px;
  letter-spacing: 1px;
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
}

.sidebar > div:first-child > .sidebar-title .sidebar-logo {
  max-width: 100%;
  height: auto;
  max-height: 28px;
  object-fit: contain;
}

.sidebar-menu {
  list-style: none;
  padding: 0;
  margin: 0;
  flex: 1;
}

.sidebar-menu a {
  display: flex;
  align-items: center;
  gap: 16px;
  color: #989898;
  text-decoration: none;
  font-size: 1.1em;
  font-weight: 500;
  transition: all 0.2s;
  padding: 12px 16px;
  border-radius: var(--border-radius);
  margin-bottom: 8px;
}

.sidebar-menu a:hover {
  background: #2B2A32;
  color: #FFFFFF;
}

.sidebar-menu a.active {
  background: #741C47;
  color: #FFFFFF;
}

.sidebar-menu a i {
  width: 20px;
  text-align: center;
  font-size: 1.1em;
}

/* Logout Link in Menu */
.sidebar-menu a.logout-link {
  margin-top: 16px;
  border-top: 1px solid #2B2A32;
  padding-top: 20px;
  color: #dc2626 !important; /* Red color for logout */
}

.sidebar-menu a.logout-link:hover {
  background: #dc2626 !important;
  color: #FFFFFF !important;
}

/* Company Selector Styles */
.company-selector {
  padding: 0;
  margin: 0 0 16px 0;
  border-bottom: 1px solid #2B2A32;
  position: relative;
}

.company-dropdown {
  position: relative;
}

.company-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: #2B2A32;
  border: 1px solid #3D3D3D;
  border-radius: 8px;
  color: #FFFFFF;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 8px;
  overflow: hidden;
}

.company-btn:hover {
  background: #3D3D3D;
  border-color: #741C47;
}

.company-btn.company-selected {
  background: rgba(116, 28, 71, 0.2);
  border-color: #741C47;
  color: #741C47;
}

.company-btn.dropdown-open {
  border-color: #741C47;
}

.company-btn #selected-company-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.9rem;
}

.company-btn .dropdown-arrow {
  margin-left: auto;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.company-btn.dropdown-open .dropdown-arrow {
  transform: rotate(180deg);
}

.company-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #2B2A32;
  border: 1px solid #3D3D3D;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  margin-top: 4px;
  max-height: 300px;
  overflow: hidden;
  display: none;
  /* Match sidebar menu button width */
  width: 100%;
  box-sizing: border-box;
}

.company-dropdown-menu.dropdown-open {
  display: block;
}

.company-search-container {
  position: relative;
  padding: 12px;
  border-bottom: 1px solid #3D3D3D;
}

.company-search-container .fas {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: #989898;
}

.company-search-container input[type="text"] {
  width: 100%;
  padding: 8px 12px 8px 32px;
  border: 1px solid #3D3D3D;
  border-radius: 4px;
  background: #171820 !important;
  color: #FFFFFF !important;
  font-size: 0.9rem;
}

.company-search-container input[type="text"]::placeholder {
  color: #989898 !important;
}

.company-search-container input[type="text"]:focus {
  outline: none;
  border-color: #741C47;
  color: #FFFFFF !important;
}

.company-options {
  max-height: 200px;
  overflow-y: auto;
}

.company-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  cursor: pointer;
  color: #FFFFFF;
  transition: background-color 0.2s ease;
  font-size: 0.9rem;
}

.company-option:hover {
  background: #3D3D3D;
}

.company-option-all {
  border-bottom: 1px solid #3D3D3D;
  font-weight: 500;
}

.company-option .fas {
  color: #989898;
  width: 16px;
  text-align: center;
}

/* ========================================
   BADGES & TAGS
   ======================================== */
.badge {
  display: inline-block;
  padding: 4px 12px;
  font-size: 0.8rem;
  font-weight: 500;
  border-radius: 12px;
  background: var(--badge-bg);
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-success {
  background: #22c55e;
}

.badge-danger {
  background: #dc2626;
}

.badge-warning {
  background: #f59e0b;
}

.badge-info {
  background: #3b82f6;
}

/* ========================================
   LOADING & SPINNERS
   ======================================== */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

/* Inline loading overlay for content areas */
.loading-overlay.inline {
  position: relative;
  background: var(--bg-secondary);
  min-height: 200px;
  opacity: 1;
  visibility: visible;
}

.loading-overlay.show {
  opacity: 1;
  visibility: visible;
}

.loading-spinner {
  text-align: center;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 3px solid var(--border-dark);
  border-top: 3px solid var(--light-purple);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 16px;
}

/* ⚡ PERFORMANCE: Page transitions disabled for instant display */
.main-content {
  /* transition: opacity 0.2s ease; */ /* Disabled - causes fade-in animation */
}

.page-transition-enter {
  opacity: 0;
  transform: translateY(10px);
}

.page-transition-enter-active {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Mini loading spinner for progressive loading */
.mini-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border-light);
  border-top: 2px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

.loading-stat {
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.6;
}

/* Progressive loading indicators */
.section-loading {
  opacity: 0.7;
  pointer-events: none;
}

.section-loaded {
  opacity: 1;
  pointer-events: auto;
  transition: opacity 0.3s ease;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ========================================
   MODALS
   ======================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal {
  background: var(--main-bg);
  border: 1px solid var(--border-dark);
  border-radius: var(--border-radius-lg);
  padding: 24px;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-dark);
}

.modal-title {
  margin: 0;
  color: var(--text-white);
  font-size: 1.25rem;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-gray);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ========================================
   FILE PREVIEW MODAL
   ======================================== */
.file-preview-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  animation: fadeIn 0.2s ease-in-out;
}

.file-preview-modal {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  background: var(--main-bg);
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.file-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border-dark);
}

.file-preview-title {
  color: var(--text-white);
  font-size: 1rem;
  font-weight: 500;
  max-width: 70%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-preview-actions {
  display: flex;
  gap: 8px;
}

.file-preview-close {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(0, 0, 0, 0.1);
  color: #000000 !important;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  border-radius: var(--border-radius);
}

.file-preview-close i {
  color: #000000 !important;
}

.file-preview-close:hover {
  background: rgba(255, 255, 255, 1);
  border-color: rgba(0, 0, 0, 0.2);
}

.file-preview-close:hover i {
  color: #000000 !important;
}

.file-preview-content {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  max-height: calc(90vh - 180px);
  overflow: auto;
  flex: 1;
}

.file-preview-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--border-radius);
}

.file-preview-document {
  width: 100%;
  height: 100%;
  min-height: 500px;
  border: none;
}

.file-preview-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px 24px;
  background: var(--card-bg);
  border-top: 1px solid var(--border-dark);
}

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

/* ========================================
   ALERTS & NOTIFICATIONS
   ======================================== */
.alert {
  padding: 12px 16px;
  border-radius: var(--border-radius);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.alert-success {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid #22c55e;
  color: #22c55e;
}

.alert-error {
  background: rgba(220, 38, 38, 0.1);
  border: 1px solid #dc2626;
  color: #dc2626;
}

.alert-warning {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid #f59e0b;
  color: #f59e0b;
}

.alert-info {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid #3b82f6;
  color: #3b82f6;
}

/* ========================================
   LIGHT MODE BUTTON FIXES
   ======================================== */
[data-theme="light"] .btn-primary,
[data-theme="light"] .btn-dark,
[data-theme="light"] .btn-light {
  color: #FFFFFF !important;
}

[data-theme="light"] .btn-primary:hover,
[data-theme="light"] .btn-dark:hover,
[data-theme="light"] .btn-light:hover {
  color: #FFFFFF !important;
}

[data-theme="light"] .btn-primary i,
[data-theme="light"] .btn-dark i,
[data-theme="light"] .btn-light i {
  color: #FFFFFF !important;
}

[data-theme="light"] .btn-primary:hover i,
[data-theme="light"] .btn-dark:hover i,
[data-theme="light"] .btn-light:hover i {
  color: #FFFFFF !important;
}

/* ========================================
   ACTION BUTTONS (used across multiple pages)
   ======================================== */
.btn-action {
    background: var(--light-purple);
    border: 1px solid var(--light-purple);
    color: #FFFFFF !important;
    padding: 6px 14px;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    /* ⚡ PERFORMANCE: Specific transitions only */
    transition: background-color 0.2s ease, border-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-action:hover {
    background: var(--dark-purple);
    color: #FFFFFF !important;
    border-color: var(--dark-purple);
}

.btn-action i {
    color: #FFFFFF !important;
}

.btn-action:hover i {
    color: #FFFFFF !important;
}

.btn-action.danger:hover {
    background: #dc2626;
    border-color: #dc2626;
}

/* Light mode overrides for action buttons */
[data-theme="light"] .btn-action {
    background: var(--light-purple);
    color: #FFFFFF !important;
    border-color: var(--light-purple);
}

[data-theme="light"] .btn-action:hover {
    background: var(--dark-purple);
    color: #FFFFFF !important;
    border-color: var(--dark-purple);
}

[data-theme="light"] .btn-action i {
    color: #FFFFFF !important;
}

[data-theme="light"] .btn-action:hover i {
    color: #FFFFFF !important;
}

[data-theme="light"] .btn-action.danger {
    color: #d32f2f;
}

[data-theme="light"] .btn-action.danger:hover {
    background: #d32f2f;
    color: #fff;
    border-color: #d32f2f;
} 

/* ========================================
   TOAST NOTIFICATIONS
   ======================================== */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 380px;
    max-width: 90vw;
    /* Ensure clicks pass through container but not toasts */
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 20px;
    border-radius: 20px; /* --radius-md */
    box-shadow: none;
    animation: slideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); /* iOS spring */
    cursor: pointer;
    position: relative;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(0,0,0,0.08);
    color: var(--text-primary);
    min-height: auto;
    /* Reset transform for animation */
    transform: translateX(0);
    opacity: 1;
    transition: all 0.3s ease-in-out;
}

/* Dark Mode Toast */
[data-theme="dark"] .toast {
    background: rgba(28, 28, 30, 0.95);
    border: 1px solid rgba(255,255,255,0.15);
    color: #ffffff;
}

/* Animations */
@keyframes slideIn {
    from { transform: translateX(100%) scale(0.95); opacity: 0; }
    to { transform: translateX(0) scale(1); opacity: 1; }
}

.toast.show {
    /* No longer needed with keyframes, but kept for JS compatibility if needed */
    opacity: 1;
    transform: translateX(0);
}

.toast.hide {
    opacity: 0;
    transform: translateX(100%) scale(0.95);
}

.toast-icon {
    font-size: 1.4rem;
    flex-shrink: 0;
    margin-top: 1px;
}

.toast-content {
    flex: 1;
    font-size: 0.95rem;
    line-height: 1.5;
    font-weight: 500;
}

.toast-title {
    display: block;
    font-weight: 600;
    margin-bottom: 2px;
}

.toast-message {
    color: inherit;
    font-size: inherit;
    line-height: inherit;
}

.toast-close {
    opacity: 0.4;
    cursor: pointer;
    padding: 4px;
    margin-top: 1px;
    transition: opacity 0.2s;
    font-size: 1rem;
}

.toast-close:hover {
    opacity: 1;
}

[data-theme="dark"] .toast-close {
    color: rgba(255,255,255,0.8);
}

/* Toast variants (Colors apply to icons) */
.toast.success .toast-icon { color: #34C759; } /* --color-positive */
.toast.error .toast-icon { color: #FF3B30; } /* --color-danger */
.toast.warning .toast-icon { color: #FF9500; } /* --color-warning */
.toast.info .toast-icon { color: #007AFF; } /* --color-info */

/* Remove old border-left styles */
.toast.success, .toast.error, .toast.warning, .toast.info {
    border-left: none;
}

/* Light mode adjustments override - ensure consistent text color */
[data-theme="light"] .toast {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(0,0,0,0.08);
}

[data-theme="light"] .toast-title,
[data-theme="light"] .toast-message {
    color: #1c1c1e;
}

/* ========================================
   UTILITY CLASSES FOR STEG 2 CLEANUP
   ======================================== */

/* Error State Utilities */
.error-container {
    text-align: center;
    padding: 32px;
}

.error-icon {
    font-size: 3rem;
    color: #f59e0b;
    margin-bottom: 16px;
    display: block;
}

/* Stats Display Utilities */
.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-white);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-gray);
    font-weight: 500;
}

/* Chart Subtitle Utility */
.chart-subtitle {
    margin-top: 0;
    margin-bottom: 32px;
    font-size: 0.9rem;
    opacity: 0.8;
}

/* ========================================
   ADDITIONAL UTILITY CLASSES
   ======================================== */

/* Color Utilities */
.text-green {
    color: #22c55e !important;
}

.text-blue {
    color: #3b82f6 !important;
}

.text-orange {
    color: #f59e0b !important;
}

/* Font Size Utilities */
.fs-0-7 { font-size: 0.7rem; }
.fs-0-75 { font-size: 0.75rem; }
.fs-0-8 { font-size: 0.8rem; }
.fs-0-85 { font-size: 0.85rem; }
.fs-0-9 { font-size: 0.9rem; }
.fs-1-15 { font-size: 1.15rem; }
.fs-1-25 { font-size: 1.25rem; }
.fs-1-5 { font-size: 1.5rem; }

/* Additional Margin Utilities */
.mb-12 { margin-bottom: 12px; }

/* Display Utilities */
.hidden {
    display: none !important;
}

/* Empty State Utility */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-gray);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 16px;
    color: var(--light-purple);
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.25rem;
    margin: 16px 0 8px;
    color: var(--text-white);
}

.empty-state h4 {
    margin-bottom: 8px;
    color: var(--text-white);
}

.empty-state p {
    margin-bottom: 16px;
}

/* =====================================================
   SKELETON LOADING - PERFORMANCE OPTIMIZATION
   ===================================================== */

/* Base skeleton animation */
@keyframes skeleton-loading {
    0% { 
        background-position: -200% 0; 
    }
    100% { 
        background-position: 200% 0; 
    }
}

.skeleton-screen {
    padding: 0;
    animation: fadeIn 0.3s ease-in;
}

/* Common skeleton element */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--card-bg) 25%,
        rgba(255, 255, 255, 0.05) 50%,
        var(--card-bg) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

/* Skeleton Header (for page titles) */
.skeleton-header {
    margin-bottom: 32px;
}

.skeleton-title {
    height: 36px;
    width: 300px;
    margin-bottom: 16px;
}

.skeleton-subtitle {
    height: 20px;
    width: 200px;
}

.skeleton-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.skeleton-btn {
    height: 40px;
    width: 120px;
    border-radius: 8px;
}

/* Skeleton Info Card (for client details) */
.skeleton-info-card {
    background: var(--card-bg);
    border: 1px solid var(--border-dark);
    border-radius: var(--border-radius);
    padding: 24px;
    margin-bottom: 24px;
}

.skeleton-info-item {
    margin-bottom: 20px;
}

.skeleton-info-label {
    height: 14px;
    width: 80px;
    margin-bottom: 8px;
}

.skeleton-info-value {
    height: 20px;
    width: 100%;
    max-width: 250px;
}

/* Skeleton List/Table */
.skeleton-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.skeleton-item {
    background: var(--card-bg);
    border: 1px solid var(--border-dark);
    border-radius: var(--border-radius);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.skeleton-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.skeleton-item-title {
    height: 20px;
    width: 60%;
}

.skeleton-item-meta {
    height: 16px;
    width: 100px;
}

.skeleton-item-content {
    height: 16px;
    width: 80%;
}

/* Skeleton Grid (for quotes/products) */
.skeleton-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.skeleton-card {
    background: var(--card-bg);
    border: 1px solid var(--border-dark);
    border-radius: var(--border-radius);
    padding: 20px;
    min-height: 150px;
}

.skeleton-card-title {
    height: 20px;
    width: 70%;
    margin-bottom: 12px;
}

.skeleton-card-text {
    height: 16px;
    width: 100%;
    margin-bottom: 8px;
}

.skeleton-card-text:last-child {
    width: 60%;
}

/* Skeleton Comments */
.skeleton-comment {
    background: var(--card-bg);
    border: 1px solid var(--border-dark);
    border-radius: var(--border-radius);
    padding: 16px;
    margin-bottom: 16px;
}

.skeleton-comment-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.skeleton-avatar {
    height: 40px;
    width: 40px;
    border-radius: 50%;
}

.skeleton-comment-author {
    height: 16px;
    width: 120px;
}

.skeleton-comment-text {
    height: 16px;
    width: 100%;
    margin-bottom: 8px;
}

.skeleton-comment-text:last-child {
    width: 75%;
}

/* Skeleton Filters */
.skeleton-filters {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.skeleton-filter {
    height: 40px;
    width: 180px;
    border-radius: 8px;
}

/* Skeleton Table Row */
.skeleton-table-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    padding: 16px;
    background: var(--card-bg);
    border: 1px solid var(--border-dark);
    border-radius: var(--border-radius);
    margin-bottom: 8px;
}

.skeleton-table-cell {
    height: 20px;
}

/* Skeleton Stats (for dashboard) */
.skeleton-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.skeleton-stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border-dark);
    border-radius: var(--border-radius);
    padding: 20px;
}

.skeleton-stat-value {
    height: 32px;
    width: 80px;
    margin-bottom: 8px;
}

.skeleton-stat-label {
    height: 16px;
    width: 120px;
}

/* Responsive skeleton adjustments */
@media (max-width: 768px) {
    .skeleton-title {
        width: 200px;
    }
    
    .skeleton-grid {
        grid-template-columns: 1fr;
    }
    
    .skeleton-filters {
        flex-direction: column;
    }
    
    .skeleton-filter {
        width: 100%;
    }
} 