/* Prevent flash of unstyled content */
html.theme-loading body {
  visibility: hidden;
}

/* Global font family */
* {
  font-family: "Poppins", sans-serif;
}

/* Logo Switching */
.logo-light {
  display: block;
}
.logo-dark {
  display: none;
}
.dark-mode .logo-light {
  display: none;
}
.dark-mode .logo-dark {
  display: block;
}

/* Light Mode */
body.light-mode {
  --bg-color: #f9fafb;
  --text-color: #1f2937;
  --nav-bg-color: #ffffff;
  --nav-text-color: #4b5563;
  --nav-hover-color: #4f46e5;
  --link-color: #4f46e5;
  --sidebar-bg: #ffffff;
  --sidebar-text: #1f2937;
  --sidebar-border: #e5e7eb;
  --sidebar-active-bg: #e0e7ff;
  --sidebar-active-text: #4f46e5;
}

/* Dark Mode */
body.dark-mode {
  --bg-color: #1f2937;
  --text-color: #f9fafb;
  --nav-bg-color: #111827;
  --nav-text-color: #d1d5db;
  --nav-hover-color: #6366f1;
  --link-color: #6366f1;
  --sidebar-bg: #111827;
  --sidebar-text: #f9fafb;
  --sidebar-border: #374151;
  --sidebar-active-bg: #312e81;
  --sidebar-active-text: #c7d2fe;
}

/* Make layout a grid for sidebar + content */
html,
body {
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background-color: var(--bg-color);
  color: var(--text-color);
}

/* Main content with sidebar offset */
.main-content {
  flex: 1 0 auto;
  margin-left: 260px;
  padding: 0;
}

/* Full width main content for non-authenticated users */
.main-content-full {
  flex: 1 0 auto;
  padding: 0;
}

/* ===== MOBILE HEADER STYLES ===== */
.mobile-header {
  background-color: var(--nav-bg-color);
  border-bottom: 1px solid var(--sidebar-border);
}

.mobile-header a {
  color: var(--nav-text-color);
  transition: color 0.2s ease;
}

.mobile-header a:hover {
  color: var(--nav-hover-color);
}

.mobile-header a[title] img {
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.mobile-header a[title]:hover img {
  opacity: 1;
}

/* Ensure mobile header 'Hubbify' matches sidebar color */
.mobile-header .font-bold.text-xl {
  color: var(--link-color);
}

/* Add padding to body on mobile to account for fixed header */
@media (max-width: 768px) {
  body {
    padding-top: 64px; /* Height of mobile header (h-16 = 4rem = 64px) */
  }
}

/* Mobile menu dropdown - fixed position to prevent scrolling issues */
.mobile-menu-dropdown {
  position: fixed;
  top: 64px; /* Height of mobile header (h-16 = 4rem = 64px) */
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.85);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  overflow-y: auto;
  z-index: 40;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Dark mode background for mobile menu */
.dark-mode .mobile-menu-dropdown {
  background-color: rgba(17, 24, 39, 0.85);
}

/* ===== SIDEBAR STYLES ===== */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: 260px;
  height: 100vh;
  background-color: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  z-index: 40;
  box-shadow: 2px 0 4px rgba(0, 0, 0, 0.05);
}

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

.sidebar-logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--link-color);
  text-decoration: none;
  display: block;
  line-height: 1.5;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0;
  display: flex;
  flex-direction: column;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  color: var(--sidebar-text);
  text-decoration: none;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
}

.sidebar-nav-item img {
  width: 1.25rem;
  height: 1.25rem;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.sidebar-nav-item:hover {
  background-color: rgba(79, 70, 229, 0.08);
  border-left-color: var(--link-color);
}

.sidebar-nav-item.active {
  background-color: var(--sidebar-active-bg);
  color: var(--sidebar-active-text);
  border-left-color: var(--link-color);
  font-weight: 600;
}

.sidebar-nav-item.active img {
  opacity: 1;
}

/* SVG icon colors in dark mode */
.dark-mode .sidebar-nav-item img {
  filter: brightness(0) invert(1);
}

.dark-mode .action-button img {
  filter: brightness(0) invert(1);
}

.dark-mode .mobile-header a[title] img {
  filter: brightness(0) invert(1);
}

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--sidebar-border);
}

.sidebar-logout {
  display: block;
  width: 100%;
  padding: 0.75rem;
  background-color: transparent;
  color: var(--sidebar-text);
  border: 1px solid var(--sidebar-border);
  border-radius: 0.375rem;
  text-align: center;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
  cursor: pointer;
}

.sidebar-logout:hover {
  background-color: #ef4444;
  color: white;
  border-color: #ef4444;
}

/* ===== TOP ACTION BUTTONS ===== */
.top-action-buttons {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  display: flex;
  gap: 1rem;
  z-index: 30;
}

.action-button {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background-color: var(--nav-bg-color);
  border: 2px solid var(--sidebar-border);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.action-button img {
  width: 1.5rem;
  height: 1.5rem;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.action-button:hover {
  background-color: var(--link-color);
  border-color: var(--link-color);
  box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.2),
    0 4px 6px -2px rgba(79, 70, 229, 0.1);
}

.action-button:hover img {
  opacity: 1;
  filter: brightness(0) invert(1);
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
  .sidebar {
    display: none;
  }

  .main-content {
    margin-left: 0;
    padding: 0;
  }

  .top-action-buttons {
    display: none;
  }

  .site-footer {
    margin-left: 0;
  }

  /* Hide table view on mobile */
  .hidden-on-mobile {
    display: none !important;
  }

  /* Show card view on mobile */
  .hidden-on-desktop {
    display: block !important;
  }
}

/* Show table view on desktop/tablet, hide card view */
@media (min-width: 769px) {
  .hidden-on-mobile {
    display: block !important;
  }

  .hidden-on-desktop {
    display: none !important;
  }
}

/* Scrollbar styling for sidebar */
.sidebar-nav::-webkit-scrollbar {
  height: 6px;
}

.sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3);
}

.dark-mode .sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
}

.dark-mode .sidebar-nav::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* ===== EXISTING STYLES (PRESERVED) ===== */

nav {
  background-color: var(--nav-bg-color);
  /* keep header visible when scrolling */
  position: sticky;
  top: 0;
  z-index: 50;
}

nav a {
  color: var(--nav-text-color);
}

nav a:hover {
  color: var(--nav-hover-color);
}

/* Active navigation link */
.nav-link-active {
  color: #6366f1 !important;
}

a {
  color: var(--link-color);
}

.bg-gray-100 {
  background-color: var(--bg-color);
}
.text-gray-800 {
  color: var(--text-color);
}
.bg-white {
  background-color: var(--nav-bg-color);
}
.text-gray-600 {
  color: var(--nav-text-color);
}
.hover\:text-indigo-600:hover {
  color: var(--nav-hover-color);
}
.text-indigo-600 {
  color: var(--link-color);
}

/* Form elements */
input:not([type="submit"]),
select,
textarea {
  padding: 0.5rem 0.75rem;
}

/* Dark mode specific overrides */
.dark-mode .bg-gray-50 {
  background-color: #1f2937 !important; /* gray-800 */
}
.dark-mode .bg-gray-100 {
  background-color: #1f2937;
}
.dark-mode .text-gray-800 {
  color: #f9fafb;
}
.dark-mode .bg-white {
  background-color: #111827;
}
.dark-mode .text-gray-600 {
  color: #d1d5db;
}
.dark-mode .text-gray-700 {
  color: #d1d5db;
}
.dark-mode .bg-gray-700 {
  background-color: #374151;
}
.dark-mode .hover\:bg-gray-50:hover {
  background-color: #4b5563 !important; /* gray-600 */
}
.dark-mode .hover\:bg-gray-600:hover {
  background-color: #4b5563;
}
.dark-mode .border-gray-300 {
  border-color: #4b5563;
}
.dark-mode .border-gray-600 {
  border-color: #4b5563;
}
.dark-mode .hover\:text-indigo-600:hover {
  color: #6366f1;
}
.dark-mode .text-indigo-600 {
  color: #6366f1;
}

.dark-mode .bg-red-100 {
  background-color: #450a0a;
}
.dark-mode .text-red-700 {
  color: #fca5a5;
}
.dark-mode .bg-green-100 {
  background-color: #064e3b;
}
.dark-mode .text-green-700 {
  color: #6ee7b7;
}
.dark-mode .bg-blue-100 {
  background-color: #1e40af;
}
.dark-mode .text-blue-700 {
  color: #93c5fd;
}

/* Dark mode form styles */
.dark-mode input:not([type="submit"]),
.dark-mode select,
.dark-mode textarea {
  background-color: #374151 !important;
  color: #f9fafb !important;
  border-color: #4b5563 !important;
}

/* ===== FORM STYLES ===== */
/* Client details page heading */
.client-details h3 {
  color: #0f172a;
}

.dark-mode .client-details h3 {
  color: #e5e7eb;
}

/* Reusable contrast styles for forms */
.form-contrast input:not([type="submit"]),
.form-contrast select,
.form-contrast textarea,
.client-form input:not([type="submit"]),
.client-form select,
.client-form textarea,
.time-log input:not([type="submit"]),
.time-log select,
.time-log textarea,
.invoice-form input:not([type="submit"]),
.invoice-form select,
.invoice-form textarea {
  background-color: #ffffff;
  border: 1px solid #cbd5e1;
  color: #0f172a;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.06);
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
}

.form-contrast input:not([type="submit"]):focus,
.form-contrast select:focus,
.form-contrast textarea:focus,
.client-form input:not([type="submit"]):focus,
.client-form select:focus,
.client-form textarea:focus,
.time-log input:not([type="submit"]):focus,
.time-log select:focus,
.time-log textarea:focus,
.invoice-form input:not([type="submit"]):focus,
.invoice-form select:focus,
.invoice-form textarea:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.dark-mode .form-contrast input:not([type="submit"]),
.dark-mode .form-contrast select,
.dark-mode .form-contrast textarea,
.dark-mode .client-form input:not([type="submit"]),
.dark-mode .client-form select,
.dark-mode .client-form textarea,
.dark-mode .time-log input:not([type="submit"]),
.dark-mode .time-log select,
.dark-mode .time-log textarea,
.dark-mode .invoice-form input:not([type="submit"]),
.dark-mode .invoice-form select,
.dark-mode .invoice-form textarea {
  background-color: #374151 !important;
  border: 1px solid #6b7280;
  color: #e5e7eb !important;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35);
}

.dark-mode .form-contrast input:not([type="submit"]):focus,
.dark-mode .form-contrast select:focus,
.dark-mode .form-contrast textarea:focus,
.dark-mode .client-form input:not([type="submit"]):focus,
.dark-mode .client-form select:focus,
.dark-mode .client-form textarea:focus,
.dark-mode .time-log input:not([type="submit"]):focus,
.dark-mode .time-log select:focus,
.dark-mode .time-log textarea:focus,
.dark-mode .invoice-form input:not([type="submit"]):focus,
.dark-mode .invoice-form select:focus,
.dark-mode .invoice-form textarea:focus {
  border-color: #8b5cf6;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.12);
}

/* Special padding for invoice form */
.invoice-form input:not([type="submit"]),
.invoice-form select,
.invoice-form textarea {
  padding: 0.75rem 0.875rem;
}

.invoice-notes {
  padding: 1rem !important;
}

/* Site-wide footer */
.site-footer {
  padding: 1rem 0;
  text-align: center;
  font-size: 0.875rem; /* small */
  color: var(--text-color);
  background-color: transparent;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
  /* ensure footer stays at the bottom when content is short */
  margin-top: auto;
}

.site-footer-full {
  margin-left: 0;
}

.site-footer a {
  color: var(--link-color);
  text-decoration: underline;
}

/* Dark mode adjustments for footer */
.dark-mode .site-footer {
  color: var(--text-color);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

@media (max-width: 768px) {
  .site-footer {
    margin-left: 0;
  }
}

/* ===== DASHBOARD STYLES ===== */
.dashboard {
  width: 100%;
}

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

/* Desktop: 2x2 grid for larger screens */
@media (min-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Tablet: 2 columns */
@media (min-width: 768px) and (max-width: 1023px) {
  .dashboard-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Mobile: 1 column */
@media (max-width: 767px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-card {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
      0 4px 6px -2px rgba(0, 0, 0, 0.05) !important;
  }

  .dashboard-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
      0 4px 6px -2px rgba(0, 0, 0, 0.05) !important;
  }

  .dark-mode .dashboard-card {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3),
      0 4px 6px -2px rgba(0, 0, 0, 0.15) !important;
  }

  .dark-mode .dashboard-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3),
      0 4px 6px -2px rgba(0, 0, 0, 0.15) !important;
  }
}

/* Dashboard Card */
.dashboard-card {
  background-color: var(--nav-bg-color);
  border-radius: 0.5rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  transition: box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.dashboard-card:hover {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.dark-mode .dashboard-card {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3),
    0 4px 6px -2px rgba(0, 0, 0, 0.15);
}

.dark-mode .dashboard-card:hover {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3),
    0 4px 6px -2px rgba(0, 0, 0, 0.15);
}

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

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

.dashboard-card-body {
  padding: 1.25rem;
  flex: 1;
  overflow: auto;
}

/* Earnings Period Tabs */
.earnings-period-tabs {
  display: flex;
  gap: 0.5rem;
}

.period-tab {
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0.25rem;
  background-color: rgba(79, 70, 229, 0.1);
  color: var(--link-color);
  text-decoration: none;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.period-tab:hover {
  background-color: rgba(79, 70, 229, 0.2);
}

.period-tab.active {
  background-color: var(--link-color);
  color: white;
}

/* Earnings Display */
.earnings-display {
  margin-bottom: 0.75rem;
}

.earnings-amount {
  display: block;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--link-color);
  line-height: 1;
}

.earnings-period-label {
  font-size: 0.875rem;
  color: var(--nav-text-color);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Recent Work Table */
.recent-work-table {
  width: 100%;
  overflow-x: auto;
}

.recent-work-table table {
  width: 100%;
  border-collapse: collapse;
}

.recent-work-table thead {
  background-color: rgba(79, 70, 229, 0.05);
}

.recent-work-table th {
  padding: 0.75rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--nav-text-color);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--sidebar-border);
}

.recent-work-table tbody tr {
  border-bottom: 1px solid var(--sidebar-border);
  transition: background-color 0.2s ease;
}

.recent-work-table tbody tr:hover {
  background-color: rgba(79, 70, 229, 0.03);
}

.recent-work-table tbody td {
  padding: 0.75rem;
  font-size: 0.875rem;
  color: var(--text-color);
}

.recent-work-table .amount-cell {
  text-align: left;
}

.date-cell {
  color: var(--nav-text-color);
  font-weight: 500;
}

.client-cell {
  font-weight: 500;
}

.amount-cell {
  color: var(--link-color);
  font-weight: 600;
}

/* Mobile table adjustments */
@media (max-width: 640px) {
  .recent-work-table th,
  .recent-work-table td {
    padding: 0.5rem 0.25rem;
    font-size: 0.75rem;
  }

  .recent-work-table th {
    padding: 0.5rem 0.25rem;
  }

  /* Hide "Date" column header text but keep column */
  .recent-work-table th:first-child {
    font-size: 0;
  }

  .recent-work-table th:first-child::before {
    content: "Date";
    font-size: 0.75rem;
  }
}

/* Outstanding Invoices List */
.invoices-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.invoice-item {
  padding: 1rem;
  background-color: rgba(79, 70, 229, 0.03);
  border-radius: 0.375rem;
  border-left: 3px solid var(--link-color);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
}

@media (max-width: 640px) {
  .invoice-item {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  .invoice-amount {
    text-align: right;
    align-self: center;
  }
}

.invoice-client {
  font-weight: 600;
  color: var(--text-color);
  font-size: 1rem;
  grid-column: 1;
}

.invoice-reference {
  font-size: 0.875rem;
  color: var(--nav-text-color);
  grid-column: 1;
  margin-top: -0.25rem;
}

.invoice-amount {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--link-color);
  grid-column: 2;
  grid-row: 1 / 3;
  text-align: right;
  align-self: center;
}

@media (max-width: 640px) {
  .invoice-amount {
    grid-column: auto;
    grid-row: auto;
    text-align: left;
  }
}

/* Current Clients List */
.clients-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.client-item {
  padding: 1rem;
  background-color: rgba(79, 70, 229, 0.03);
  border-radius: 0.375rem;
  border-left: 3px solid var(--link-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

@media (max-width: 640px) {
  .client-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .client-rate {
    align-self: center;
    margin-left: auto;
  }
}

.client-name {
  font-weight: 600;
  color: var(--text-color);
  font-size: 1rem;
}

.client-rate {
  font-size: 0.875rem;
  color: var(--nav-text-color);
  background-color: rgba(79, 70, 229, 0.1);
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
}

@media (max-width: 640px) {
  .client-rate {
    align-self: flex-start;
  }
}

/* No Data Message */
.no-data-message {
  text-align: center;
  color: var(--nav-text-color);
  font-style: italic;
  padding: 2rem 0;
  margin: 0;
}

/* Dark mode specific dashboard adjustments */
.dark-mode .earnings-amount {
  color: #6366f1;
}

.dark-mode .period-tab {
  background-color: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
}

.dark-mode .period-tab:hover {
  background-color: rgba(99, 102, 241, 0.25);
}

.dark-mode .period-tab.active {
  background-color: #6366f1;
  color: white;
}

.dark-mode .recent-work-table thead {
  background-color: rgba(99, 102, 241, 0.1);
}

.dark-mode .recent-work-table tbody tr:hover {
  background-color: rgba(99, 102, 241, 0.08);
}

.dark-mode .invoice-item,
.dark-mode .client-item {
  background-color: rgba(99, 102, 241, 0.08);
  border-left-color: #6366f1;
}

.dark-mode .client-rate {
  background-color: rgba(99, 102, 241, 0.15);
}

/* Mobile Clients List - Simple Card Design */
.mobile-clients-list {
  display: flex;
  flex-direction: column;
  gap: 1.'5rem;
}

.mobile-client-card {
  padding: 1.5rem;
  background-color: rgba(79, 70, 229, 0.03);
  border: none;
  border-radius: 0.625rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  margin-bottom: 1.5rem;
}

.mobile-client-card:last-child {
  margin-bottom: 0;
}

.mobile-client-name {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text-color);
  letter-spacing: -0.01em;
}

.mobile-client-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.mobile-client-actions a,
.mobile-client-actions button {
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.mobile-client-actions a {
  background: linear-gradient(
    135deg,
    rgba(79, 70, 229, 0.1) 0%,
    rgba(99, 102, 241, 0.08) 100%
  );
  color: var(--link-color);
  border: 1px solid rgba(79, 70, 229, 0.2);
}

.mobile-client-actions button {
  background: linear-gradient(
    135deg,
    rgba(239, 68, 68, 0.1) 0%,
    rgba(220, 38, 38, 0.08) 100%
  );
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.dark-mode .mobile-client-card {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  background-color: rgba(99, 102, 241, 0.08);
}

.dark-mode .mobile-client-actions a {
  background: linear-gradient(
    135deg,
    rgba(99, 102, 241, 0.15) 0%,
    rgba(129, 115, 255, 0.12) 100%
  );
  border-color: rgba(99, 102, 241, 0.3);
}

.dark-mode .mobile-client-actions button {
  background: linear-gradient(
    135deg,
    rgba(239, 68, 68, 0.15) 0%,
    rgba(220, 38, 38, 0.12) 100%
  );
  border-color: rgba(239, 68, 68, 0.3);
}

/* Responsive adjustments for very small screens */
@media (max-width: 480px) {
  .dashboard-card-header {
    padding: 1rem;
  }

  .dashboard-card-body {
    padding: 1rem;
  }

  .earnings-amount {
    font-size: 2rem;
  }

  .dashboard-card-title {
    font-size: 1rem;
  }

  .invoice-item,
  .client-item {
    padding: 0.75rem;
  }
}

/* ===== LOGS TABLE STYLES ===== */
/* Log table row hover */
.log-row {
  transition: background-color 0.2s ease;
}

.log-row:hover {
  background-color: #f9fafb; /* hover:bg-gray-50 */
}

.dark-mode .log-row:hover {
  background-color: #374151; /* gray-700 */
}

/* Log timestamp text color */
.log-timestamp {
  color: #6b7280; /* text-gray-500 */
}

.dark-mode .log-timestamp {
  color: #9ca3af; /* text-gray-400 */
}

/* Log message text color */
.log-message {
  color: #111827; /* text-gray-900 */
}

.dark-mode .log-message {
  color: #f3f4f6; /* text-gray-100 */
}

/* Log level badges */
.log-level-error {
  background-color: #fee2e2; /* bg-red-100 */
  color: #991b1b; /* text-red-800 */
}

.dark-mode .log-level-error {
  background-color: #7f1d1d; /* bg-red-900 */
  color: #fecaca; /* text-red-200 */
}

.log-level-warning {
  background-color: #fef3c7; /* bg-yellow-100 */
  color: #92400e; /* text-yellow-800 */
}

.dark-mode .log-level-warning {
  background-color: #713f12; /* bg-yellow-900 */
  color: #fef08a; /* text-yellow-200 */
}

.log-level-info {
  background-color: #dbeafe; /* bg-blue-100 */
  color: #1e40af; /* text-blue-800 */
}

/* ===== HUBBIFY DESIGN SYSTEM (SEMANTIC CLASSES) ===== */

/* 1. TYPOGRAPHY */
.heading-xl {
  font-size: 1.875rem; /* 30px */
  font-weight: 700;
  color: #111827; /* gray-900 */
}
.dark-mode .heading-xl { color: #f9fafb; /* gray-50 */ }

.heading-lg {
  font-size: 1.5rem; /* 24px */
  font-weight: 600;
  color: #1f2937; /* gray-800 */
}
.dark-mode .heading-lg { color: #f3f4f6; /* gray-100 */ }

.heading-md {
  font-size: 1.125rem; /* 18px */
  font-weight: 600;
  color: #374151; /* gray-700 */
}
.dark-mode .heading-md { color: #e5e7eb; /* gray-200 */ }

.text-body {
  color: #374151; /* gray-700 */
}
.dark-mode .text-body { color: #d1d5db; /* gray-300 */ }

.text-muted {
  color: #6b7280; /* gray-500 */
}
.dark-mode .text-muted { color: #9ca3af; /* gray-400 */ }

.text-link {color: #4f46e5; /* indigo-600 */}
.text-link:hover { color: #818cf8; /* indigo-400 */ }

.text-link-warning {color: #facc15; /* yellow-400 */}
.text-link-warning:hover { color: #ffe374; /* yellow-900 */ }

.text-link-danger {color: #f87171; /* red-600 */}
.text-link-danger:hover { color: #feb2b2; /* red-900 */ }

/* 2. CARDS */
.card {
  background-color: var(--nav-bg-color);
  border-radius: 0.5rem;
  border: none;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}
.dark-mode .card {
  background-color: var(--nav-bg-color);
  border: none;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.15);
}

/* 3. BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0.375rem;
  transition: all 0.2s;
  cursor: pointer;
}

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

/* Secondary */
.btn-secondary {
  background-color: #ffffff;
  border: 1px solid #d1d5db;
  color: #374151;
}
.btn-secondary:hover { background-color: #f9fafb; }
.dark-mode .btn-secondary {
  background-color: #374151;
  border-color: #4b5563;
  color: #e5e7eb;
}
.dark-mode .btn-secondary:hover { background-color: #4b5563; }

/* Primary (Indigo) */
.btn-primary {
  background-color: #4f46e5; /* indigo-600 */
  border: 1px solid transparent;
  color: #ffffff;
}
.btn-primary:hover { background-color: #4338ca; /* indigo-700 */ }
/* Primary creates its own contrast, usually fine in dark mode too, but can tweak if needed */

/* Danger (Red) */
.btn-danger {
  background-color: #dc2626; /* red-600 */
  border: 1px solid transparent;
  color: #ffffff;
}
.btn-danger:hover { background-color: #b91c1c; /* red-700 */ }

/* Ghost */
.btn-ghost {
  background-color: transparent;
  color: #4b5563;
}
.btn-ghost:hover { background-color: #f3f4f6; }
.dark-mode .btn-ghost { color: #d1d5db; }
.dark-mode .btn-ghost:hover { background-color: #374151; }


/* 4. TABLES */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.table-header {
  background-color: #f9fafb; /* gray-50 */
  border-bottom: 1px solid #e5e7eb;
}
.table-header th {
  color: #6b7280; /* gray-500 */
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}
.dark-mode .table-header {
  background-color: #374151; /* gray-700 */
  border-color: #4b5563;
}
.dark-mode .table-header th { color: #d1d5db; }

.table-row {
  border-bottom: 1px solid #e5e7eb;
  transition: background-color 0.15s;
}
.table-row:hover { background-color: #f9fafb; }
.dark-mode .table-row {
  border-color: #374151;
  /* background-color: #1f2937; */
}
.dark-mode .table-row:hover { background-color: #374151; /* slightly lighter in practice or separate hover color */ }

/* 5. FORMS */
.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151; /* gray-700 */
  margin-bottom: 0.25rem;
}
.dark-mode .form-label { color: #e5e7eb; }

.form-control {
  width: 100%;
  border-radius: 0.375rem;
  border: 1px solid #d1d5db; /* gray-300 */
  background-color: #ffffff;
  padding: 0.5rem 0.75rem;
  color: #111827; /* gray-900 */
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-control:focus {
  outline: none;
  border-color: #6366f1; /* indigo-500 */
  box-shadow: 0 0 0 1px #6366f1;
}

.dark-mode .form-control {
  background-color: #374151; /* gray-700 */
  border-color: #4b5563; /* gray-600 */
  color: #ffffff;
}
.dark-mode .form-control:focus {
  border-color: #818cf8; /* indigo-400 */
}

/* Select Input: More right padding for arrow */
select.form-control {
  padding-right: 2.5rem; /* Space for the dropdown arrow */
  background-position: right 0.5rem center; /* Ensure arrow position if custom */
}

/* Textarea: Disable resize */
textarea.form-control {
  resize: none;
}

/* 6. STATUS BADGES */
.status-badge {
  display: inline-flex;
  padding: 0.2rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 9999px;
  line-height: 1.25rem;
  text-transform: uppercase;
}
.status-success { background-color: #d1fae5; color: #065f46; } /* green-100/800 */
.dark-mode .status-success { background-color: #064e3b; color: #d1fae5; } /* green-900/100 */

.status-warning { background-color: #fef3c7; color: #92400e; } /* yellow-100/800 */
.dark-mode .status-warning { background-color: #78350f; color: #fef3c7; }

.status-danger { background-color: #7f1d1d; color: #fee2e2; } /* red-100/800 */
.dark-mode .status-danger { background-color: #7f1d1d; color: #fee2e2; }

.status-app { background-color: #dbeafe; color: #1e40af; } /* blue-100/800 */
.dark-mode .status-app { background-color: #1e3a8a; color: #bfdbfe; } /* blue-900/200 */

.status-activity { background-color: #d1fae5; color: #065f46; } /* green-100/800 */
.dark-mode .status-activity { background-color: #064e3b; color: #a7f3d0; } /* green-900/300 */

/* 7. ALERTS (Flash Messages) */
.alert {
  padding: 1rem;
  border-radius: 0.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(4px);
  transition: opacity 0.5s;
}

.alert-danger {
  background-color: rgba(127, 29, 29, 0.95); /* red-900 */
  color: #fecaca; /* red-200 */
}

.alert-success {
  background-color: rgba(6, 78, 59, 0.95); /* green-900 */
  color: #d1fae5; /* green-200 */
}

.alert-info {
  background-color: rgba(30, 58, 138, 0.95); /* blue-900 */
  color: #bfdbfe; /* blue-200 */
}

/* ===== MODAL DIALOG STYLES ===== */
/* Modal backdrop */
#customModal {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1rem;
  opacity: 0;
  transition: opacity 0.2s ease;
}

#customModal.modal-visible {
  opacity: 1;
}

#customModal.modal-hidden {
  opacity: 0;
}

/* Modal container */
.modal-container {
  background-color: var(--nav-bg-color);
  border-radius: 0.5rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  max-width: 500px;
  width: 100%;
  overflow: hidden;
  transform: scale(0.95);
  transition: transform 0.2s ease;
}

#customModal.modal-visible .modal-container {
  transform: scale(1);
}

#customModal.modal-hidden .modal-container {
  transform: scale(0.95);
}

.dark-mode .modal-container {
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
}

/* Modal header */
.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--sidebar-border);
}

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

/* Modal body */
.modal-body {
  padding: 1.5rem;
  color: var(--text-color);
  line-height: 1.6;
}

/* Modal footer */
.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--sidebar-border);
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

/* Modal buttons */
.modal-btn {
  padding: 0.625rem 1.25rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 80px;
}

.modal-btn:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.modal-btn-cancel {
  background-color: #6b7280;
  color: white;
}

.modal-btn-cancel:hover {
  background-color: #4b5563;
}

.dark-mode .modal-btn-cancel {
  background-color: #4b5563;
}

.dark-mode .modal-btn-cancel:hover {
  background-color: #374151;
}

.modal-btn-confirm {
  background-color: var(--link-color);
  color: white;
}

.modal-btn-confirm:hover {
  background-color: #4338ca;
}

.dark-mode .modal-btn-confirm:hover {
  background-color: #5b21b6;
}

/* Responsive modal on mobile */
@media (max-width: 640px) {
  .modal-container {
    margin: 1rem;
    max-width: calc(100vw - 2rem);
  }
  
  .modal-footer {
    flex-direction: column-reverse;
  }
  
  .modal-btn {
    width: 100%;
  }
}
