:root {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 14px;
}

@media (min-width: 768px) {
  :root {
    font-size: 15px;
  }
}

/* Millores del Mode Fosc */
[data-bs-theme="dark"] {
  --bs-body-bg: #0b0f19;
  --bs-body-bg-rgb: 11, 15, 25;
  --bs-body-color: #cbd5e1;
  --bs-card-bg: #111827;
  --bs-border-color: rgba(255, 255, 255, 0.08);
  --bs-table-bg: transparent;
  --bs-table-striped-bg: rgba(255, 255, 255, 0.02);
  --bs-table-hover-bg: rgba(56, 189, 248, 0.06);

  --sidebar-bg: #0d1322;
  --sidebar-border: rgba(255, 255, 255, 0.08);
  --sidebar-link-color: #94a3b8;
  --sidebar-link-hover-bg: rgba(56, 189, 248, 0.08);
  --sidebar-link-hover-color: #f1f5f9;
  --sidebar-link-active-bg: rgba(56, 189, 248, 0.15);
  --sidebar-link-active-color: #38bdf8;
  --sidebar-user-header-bg: #111827;
}

[data-bs-theme="dark"] .card {
  background-color: #111827;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.5);
}

[data-bs-theme="dark"] .navbar {
  background-color: rgba(17, 24, 39, 0.95) !important;
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

[data-bs-theme="dark"] .card-header.bg-light,
[data-bs-theme="dark"] .card-footer.bg-white,
[data-bs-theme="dark"] .modal-header,
[data-bs-theme="dark"] .modal-footer {
  background-color: #161f30 !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}

[data-bs-theme="dark"] footer {
  background-color: #0d121d !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
  background-color: #0b0f19;
  border-color: rgba(255, 255, 255, 0.12);
  color: #f1f5f9;
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
  background-color: #0b0f19;
  border-color: #38bdf8;
  box-shadow: 0 0 0 0.2rem rgba(56, 189, 248, 0.25);
}

[data-bs-theme="dark"] .table thead th {
  background-color: #161f30;
  color: #94a3b8;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

[data-bs-theme="dark"] .badge-tipo {
  background-color: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
  font-weight: 600;
}

[data-bs-theme="dark"] .banner-inicio {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.08) 0%, rgba(13, 110, 253, 0.04) 100%);
  border-color: rgba(56, 189, 248, 0.15) !important;
}

/* Mode Clar refinat */
[data-bs-theme="light"] {
  --bs-body-bg: #f8fafc;
  --bs-card-bg: #ffffff;
  --bs-border-color: #e2e8f0;

  --sidebar-bg: #ffffff;
  --sidebar-border: #e2e8f0;
  --sidebar-link-color: #475569;
  --sidebar-link-hover-bg: #f1f5f9;
  --sidebar-link-hover-color: #0f172a;
  --sidebar-link-active-bg: #e0f2fe;
  --sidebar-link-active-color: #0284c7;
  --sidebar-user-header-bg: #f8fafc;
}

[data-bs-theme="light"] .navbar {
  background-color: #ffffff !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

[data-bs-theme="light"] .card {
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
}

[data-bs-theme="light"] .badge-tipo {
  background-color: #e0f2fe;
  color: #0284c7;
  border: 1px solid #bae6fd;
  font-weight: 600;
}

[data-bs-theme="light"] .banner-inicio {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.06) 0%, rgba(59, 130, 246, 0.03) 100%);
  border-color: #e2e8f0 !important;
}

/* Elements generals */
.brand-text {
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.table > :not(caption) > * > * {
  padding: 0.75rem 0.85rem;
}

/* Sidebar Responsive Styles */
.sidebar-wrapper {
  background-color: var(--sidebar-bg);
  border-color: var(--sidebar-border) !important;
}

@media (min-width: 992px) {
  .sidebar-wrapper {
    min-height: calc(100vh - 65px);
    position: sticky;
    top: 65px;
  }
}

.sidebar-user-header {
  background-color: var(--sidebar-user-header-bg);
}

.sidebar-link {
  color: var(--sidebar-link-color);
  padding: 0.6rem 0.85rem;
  border-radius: 0.5rem;
  margin: 0.15rem 0.5rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  text-decoration: none;
  transition: all 0.2s ease;
}

.sidebar-link:hover {
  background-color: var(--sidebar-link-hover-bg);
  color: var(--sidebar-link-hover-color);
}

.sidebar-link.active {
  background-color: var(--sidebar-link-active-bg);
  color: var(--sidebar-link-active-color);
  font-weight: 600;
}

.module-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.module-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15) !important;
}

/* Transicions suaus de tema */
body, .card, .navbar, .form-control, .form-select, .table, footer, .sidebar-wrapper {
  transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}