/* ============================================================
   VARIABLES GLOBALES (Tema Claro)
   ============================================================ */
:root {
  --primary: #3757e6;
  --primary-light: #e6f0ff;
  --primary-dark: #2a3f9e;
  --secondary: #5c6bc0;
  --secondary-dark: #e65c3a;
  --success: #34a853;
  --success-light: #e6f4ea;
  --warning: #ffb300;
  --error: #e54b4b;
  --error-light: #fee9e9;
  --info: #0096c7;
  --info-light: #e3f2fd;

  --surface: #ffffff;
  --surface-2: #f6f9fc;
  --background: #fafcfe;
  --text-primary: #1e2a2f;
  --text-secondary: #3d5a6c;
  --text-disabled: #8a9aa5;
  --border: #cbd5e0;
  --border-light: #e2e8f0;
  --border-dark: #9aa6b2;

  --shadow-1: 0 1px 3px rgba(15, 44, 63, 0.08), 0 1px 2px rgba(15, 44, 63, 0.12);
  --shadow-2: 0 4px 6px rgba(15, 44, 63, 0.05), 0 1px 3px rgba(15, 44, 63, 0.1);
  --shadow-3: 0 10px 20px rgba(15, 44, 63, 0.04), 0 6px 6px rgba(15, 44, 63, 0.1);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --transition: all 0.2s cubic-bezier(0.2, 0.9, 0.4, 1.1);
  --transition-fast: all 0.15s ease-out;

  --tag-critical: #f59e0b;
  --tag-warning: #fbbf24;
  --tag-upcoming: #a3d977;
  --tag-archived: var(--border);
}

/* ============================================================
   TEMA OSCURO
   ============================================================ */
.dark {
  --primary: #5c7cff;
  --primary-light: #1e2a3a;
  --primary-dark: #8aabff;
  --secondary: #7e8cd4;
  --secondary-dark: #ff7a5c;
  --success: #2e7d32;
  --success-light: #1e2a1e;
  --warning: #ffb74d;
  --error: #cf6679;
  --error-light: #3b1e2a;
  --info: #48cae4;
  --info-light: #1a2a36;

  --surface: #1e1e2f;
  --surface-2: #2a2a3c;
  --background: #12121c;
  --text-primary: #e0e0e0;
  --text-secondary: #b0b0c0;
  --text-disabled: #6e6e7e;
  --border: #3a3a4e;
  --border-light: #2a2a3c;
  --border-dark: #4a4a60;

  --shadow-1: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-2: 0 4px 6px rgba(0, 0, 0, 0.3), 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-3: 0 10px 20px rgba(0, 0, 0, 0.3), 0 6px 6px rgba(0, 0, 0, 0.4);

  --tag-critical: #f57c00;
  --tag-warning: #fbc02d;
  --tag-upcoming: #7cb342;
  --tag-archived: #5a5a6e;
}

/* ============================================================
   RESET Y BASE
   ============================================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  background: var(--background);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.material-icons {
  font-size: 20px;
  vertical-align: middle;
}

/* ============================================================
   UTILIDADES (Flex, gaps, márgenes, paddings, textos)
   ============================================================ */
.d-flex {
  display: flex;
}
.align-items-center {
  align-items: center;
}
.justify-start {
  justify-content: flex-start;
}
.justify-end {
  justify-content: flex-end;
}
.justify-between {
  justify-content: space-between;
}
.flex-wrap {
  flex-wrap: wrap;
}

.gap-4 {
  gap: 4px;
}
.gap-8 {
  gap: 8px;
}
.gap-12 {
  gap: 12px;
}
.gap-16 {
  gap: 16px;
}
.gap-24 {
  gap: 24px;
}

.mt-4 {
  margin-top: 4px;
}
.mt-8 {
  margin-top: 8px;
}
.mt-12 {
  margin-top: 12px;
}
.mt-16 {
  margin-top: 16px;
}
.mt-24 {
  margin-top: 24px;
}
.mb-4 {
  margin-bottom: 4px;
}
.mb-8 {
  margin-bottom: 8px;
}
.mb-12 {
  margin-bottom: 12px;
}
.mb-16 {
  margin-bottom: 16px;
}
.mb-24 {
  margin-bottom: 24px;
}
.ml-auto {
  margin-left: auto;
}
.mr-auto {
  margin-right: auto;
}

.p-8 {
  padding: 8px;
}
.p-12 {
  padding: 12px;
}
.p-16 {
  padding: 16px;
}
.p-20 {
  padding: 20px;
}
.p-24 {
  padding: 24px;
}
.px-12 {
  padding-left: 12px;
  padding-right: 12px;
}
.py-12 {
  padding-top: 12px;
  padding-bottom: 12px;
}

.text-center {
  text-align: center;
}
.text-secondary {
  color: var(--text-secondary);
}
.text-disabled {
  color: var(--text-disabled);
}
.bg-surface-2 {
  background: var(--surface-2);
}
.rounded-sm {
  border-radius: var(--radius-sm);
}
.rounded-md {
  border-radius: var(--radius-md);
}

.w-60 {
  width: 60%;
}
.w-80 {
  width: 80%;
}
.w-200 {
  width: 200px;
}
.h-90 {
  height: 90px;
}
.min-width-100 {
  min-width: 100px;
}
.icon-48 {
  font-size: 48px !important;
}

/* ============================================================
   ANIMACIONES GLOBALES
   ============================================================ */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes slideInUp {
  from {
    transform: translateY(10px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
@keyframes scaleIn {
  from {
    transform: scale(0.96);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}
@keyframes pulseLight {
  0% {
    opacity: 0.6;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.02);
  }
  100% {
    opacity: 0.6;
    transform: scale(1);
  }
}
@keyframes toastIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}
@keyframes toastOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}
@keyframes pulse {
  0% {
    opacity: 0.6;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0.6;
  }
}

.animate-fade-in {
  animation: fadeIn 0.2s ease-out forwards;
}
.animate-slide-up {
  animation: slideInUp 0.25s ease-out forwards;
}
.animate-scale-in {
  animation: scaleIn 0.2s cubic-bezier(0.2, 0.9, 0.4, 1.1) forwards;
}
.rotating {
  animation: spin 0.6s linear infinite;
}

/* ============================================================
   COMPONENTES COMUNES
   ============================================================ */
/* Botones */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}
.btn i {
  font-size: 18px;
}
.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}
.btn--block {
  width: 100%;
}
.btn--filled {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.btn--filled:hover,
.btn--outlined:hover,
.btn--text:hover {
  transform: translateY(-1px);
}
.btn--filled:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  box-shadow: var(--shadow-1);
}
.btn--filled:active {
  transform: translateY(1px);
}
.btn--outlined {
  background: white;
  border-color: var(--border);
}
.dark .btn--outlined {
  background: var(--surface);
}
.btn--outlined:hover {
  background: var(--surface-2);
  border-color: var(--border-dark);
}
.btn--text {
  border-color: transparent;
  color: var(--primary);
}
.btn--text:hover {
  background: rgba(84, 110, 122, 0.08);
}
.dark .btn--text:hover {
  background: rgba(255, 255, 255, 0.08);
}
.btn-error {
  color: var(--error);
  border-color: var(--error);
}
.btn-error:hover {
  background: var(--error-light);
  transform: translateY(-1px);
}
.btn:disabled {
  opacity: 0.6;
  pointer-events: none;
  transform: none;
}

/* Formularios */
.form-group,
.cases-form-group {
  margin-bottom: 16px;
}
.form-label,
.cases-form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text-secondary);
}
.form-control,
.form-select,
.cases-form-input,
.cases-form-select,
.cases-form-textarea {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: white;
  transition: var(--transition-fast);
}
.dark .form-control,
.dark .form-select,
.dark .cases-form-input,
.dark .cases-form-select,
.dark .cases-form-textarea {
  background: var(--surface);
  color: var(--text-primary);
  border-color: var(--border);
}
.form-control:focus,
.form-select:focus,
.cases-form-input:focus,
.cases-form-select:focus,
.cases-form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(84, 110, 122, 0.1);
}
.dark .form-control:focus,
.dark .form-select:focus,
.dark .cases-form-input:focus,
.dark .cases-form-select:focus,
.dark .cases-form-textarea:focus {
  box-shadow: 0 0 0 3px rgba(92, 124, 255, 0.2);
}
textarea.form-control,
.cases-form-textarea {
  min-height: 80px;
  resize: vertical;
}
.cases-form-label.required::after {
  content: '*';
  color: var(--error);
  margin-left: 4px;
}
.cases-label-with-date {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.cases-date-input {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}
.cases-date-small {
  width: auto;
  flex: 0 1 auto;
}
.cases-responsible-checkboxes {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
  padding: 4px;
}
.cases-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  cursor: pointer;
  color: var(--text-primary);
}
.cases-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}
.cases-form-checkboxes {
  display: flex;
  gap: 24px;
  margin-top: 16px;
}
.cases-form-group.full-width {
  grid-column: 1 / -1;
}

/* Switches */
.cases-switches {
  display: flex;
  gap: 32px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
}
.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.switch-slider {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  background-color: var(--border);
  border-radius: 24px;
  transition: var(--transition);
}
.switch-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  border-radius: 50%;
  transition: var(--transition);
  box-shadow: var(--shadow-1);
}
.switch input:checked + .switch-slider {
  background-color: var(--primary);
}
.switch input:checked + .switch-slider:before {
  transform: translateX(20px);
}
.switch input:disabled + .switch-slider {
  opacity: 0.5;
  cursor: not-allowed;
}
.switch-label {
  font-size: 14px;
  color: var(--text-primary);
}

/* Tarjetas */
.card {
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-1);
  transition: var(--transition);
}
.card:hover {
  box-shadow: var(--shadow-2);
  transform: translateY(-2px);
}

/* Modales */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}
.modal-backdrop.show {
  opacity: 1;
  visibility: visible;
}
.modal {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-3);
  width: 90%;
  max-width: 600px;
  max-height: 85vh;
  overflow-y: auto;
  transform: scale(0.95);
  transition: transform 0.25s cubic-bezier(0.2, 0.9, 0.4, 1.1), opacity 0.2s ease;
  opacity: 0;
}
.dark .modal {
  background: var(--surface);
}
.modal-backdrop.show .modal {
  transform: scale(1);
  opacity: 1;
}
.modal--large {
  max-width: 800px;
}
.modal--medium {
  max-width: 600px;
}
.modal-header {
  padding: 20px 24px 12px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}
.modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}
.modal-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}
.modal-close {
  background: transparent;
  border: none;
  padding: 6px;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: var(--transition);
}
.modal-close:hover {
  background: var(--surface-2);
  color: var(--text-primary);
  transform: rotate(90deg);
}
.modal-body {
  padding: 24px;
  max-height: 60vh;
  overflow-y: auto;
}
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Toasts */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 11000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 350px;
}
.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: white;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-2);
  color: var(--text-primary);
  animation: toastIn 0.2s ease, toastOut 0.2s ease 2.8s forwards;
  border-left: 4px solid;
}
.dark .toast {
  background: var(--surface);
}
.toast-success {
  border-left-color: var(--success);
}
.toast-error {
  border-left-color: var(--error);
}
.toast-info {
  border-left-color: var(--info);
}
.toast-icon {
  font-size: 20px;
}
.toast-success .toast-icon {
  color: var(--success);
}
.toast-error .toast-icon {
  color: var(--error);
}
.toast-info .toast-icon {
  color: var(--info);
}
.toast-message {
  flex: 1;
  font-size: 14px;
}
.toast-close {
  background: transparent;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: var(--text-secondary);
  border-radius: 4px;
}
.toast-close:hover {
  background: var(--surface-2);
}

/* Skeleton loaders */
.skeleton {
  background: var(--surface-2);
  animation: pulse 1.2s ease-in-out infinite;
  border-radius: var(--radius-sm);
}
.skeleton-card {
  height: 120px;
  background: var(--surface-2);
  border-radius: var(--radius-md);
  animation: pulse 1.2s ease-in-out infinite;
}
.skeleton-text {
  height: 16px;
  width: 100%;
  margin-bottom: 8px;
}
.skeleton-title {
  height: 24px;
  width: 60%;
  margin-bottom: 16px;
}

/* Paginación */
.cases-pagination-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.cases-pagination-info {
  font-size: 13px;
  color: var(--text-secondary);
}
.cases-pagination-controls {
  display: flex;
  gap: 8px;
}
.cases-pagination-btn {
  padding: 8px 12px;
  border: 1px solid var(--border);
  background: white;
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: var(--transition);
  color: var(--text-primary);
}
.dark .cases-pagination-btn {
  background: var(--surface);
  border-color: var(--border);
}
.cases-pagination-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.cases-pagination-btn.disabled {
  opacity: 0.5;
  pointer-events: none;
}
.cases-pagination-btn:not(.disabled):hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-1);
}
.dashboard-pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}
.pagination-info {
  padding: 6px 12px;
}

/* Alertas */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-top: 16px;
  text-align: left;
  border-left: 4px solid transparent;
  display: none;
  animation: slideInUp 0.2s ease-out;
}
.alert--error {
  background: var(--error-light);
  color: var(--error);
  border-left-color: var(--error);
}
.alert--success {
  background: var(--success-light);
  color: #166534;
  border-left-color: var(--success);
}
.dark .alert--success {
  color: #a5d6a5;
  background: #1e2a1e;
}
.alert--info {
  background: var(--info-light);
  color: #075985;
  border-left-color: var(--info);
}
.dark .alert--info {
  color: #90e0ef;
  background: #1a2a36;
}

/* Dialog */
.dialog-message {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-primary);
  margin-bottom: 20px;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* ============================================================
   LAYOUT
   ============================================================ */
.app-container {
  display: flex;
  height: 100vh;
  width: 100%;
  background: var(--background);
  overflow: hidden;
}

/* Page loader */
.page-loader {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--background);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20000;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}
.page-loader-inner {
  text-align: center;
  max-width: 320px;
  padding: 32px;
  animation: scaleIn 0.3s ease-out;
}
.page-loader-logo {
  width: 72px;
  height: 72px;
  background: var(--primary);
  color: white;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 700;
  margin: 0 auto 20px;
  box-shadow: var(--shadow-2);
  animation: pulseLight 1.5s infinite;
}
.page-loader-text h3 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-primary);
}
.page-loader-text p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 24px;
}
.page-loader-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-light);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin: 0 auto;
}
.page-loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Sidebar */
.sidebar {
  width: 260px;
  background: white;
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  transition: width 0.2s ease, transform 0.2s ease;
  overflow-y: auto;
  flex-shrink: 0;
  box-shadow: var(--shadow-1);
}
.dark .sidebar {
  background: var(--surface);
}
.sidebar.collapsed {
  width: 72px;
}
.brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 16px;
  border-bottom: 1px solid var(--border-light);
}
.brand-title {
  display: flex;
  align-items: center;
  gap: 12px;
}
.logo-icon {
  font-size: 28px;
  color: var(--primary);
}
.brand-text {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  transition: opacity 0.2s;
}
.sidebar.collapsed .brand-text {
  opacity: 0;
  width: 0;
  display: none;
}
.toggle-collapse {
  background: transparent;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}
.toggle-collapse:hover {
  background: var(--surface-2);
  color: var(--text-primary);
  transform: scale(1.05);
}
.sidebar.collapsed .toggle-collapse i {
  transform: rotate(180deg);
}
.nav-menu {
  flex: 1;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  transition: var(--transition);
  cursor: pointer;
  font-weight: 500;
}
.nav-item i {
  font-size: 20px;
}
.nav-item .label {
  flex: 1;
  white-space: nowrap;
  transition: opacity 0.2s;
}
.sidebar.collapsed .nav-item .label {
  opacity: 0;
  width: 0;
  display: none;
}
.nav-item:hover {
  background: var(--surface-2);
  color: var(--text-primary);
  transform: translateX(4px);
}
.nav-item.active {
  background: var(--primary-light);
  color: var(--primary-dark);
  font-weight: 600;
}
.nav-item.active i {
  color: var(--primary-dark);
}
.dark .nav-item.active {
  background: var(--primary-light);
  color: var(--primary-dark);
}
.dark .nav-item.active i {
  color: var(--primary-dark);
}

/* Main content */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--background);
}
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: white;
  border-bottom: 1px solid var(--border-light);
  height: 73px;
  flex-shrink: 0;
}
.dark .top-bar {
  background: var(--surface);
}
.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}
#mobile-menu-toggle {
  display: none;
}
#page-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}
.content-wrapper {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}
.content-area {
  min-height: 100%;
}

/* User menu */
.user-menu-wrapper {
  position: relative;
}
.user-avatar {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
}
.user-avatar:hover {
  background: var(--primary-dark);
  box-shadow: var(--shadow-1);
  transform: scale(1.02);
}
.user-menu {
  position: absolute;
  top: 56px;
  right: 0;
  width: 240px;
  background: white;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-3);
  border: 1px solid var(--border-light);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px) scale(0.96);
  transition: var(--transition);
  z-index: 1050;
}
.dark .user-menu {
  background: var(--surface);
}
.user-menu.active,
.user-menu[aria-hidden="false"] {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}
.user-menu-header {
  padding: 20px 16px;
  border-bottom: 1px solid var(--border-light);
}
.user-name {
  font-weight: 700;
  font-size: 16px;
  color: var(--text-primary);
}
.user-role {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}
.user-menu-actions {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.user-menu-actions .btn {
  justify-content: flex-start;
  padding: 10px 12px;
  width: 100%;
}
.user-menu-actions .btn i {
  margin-right: 8px;
}

/* Sidebar backdrop */
.sidebar-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1040;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}
.sidebar-backdrop.active {
  opacity: 1;
  visibility: visible;
}

/* ============================================================
   MÓDULOS
   ============================================================ */
/* Login */
.login-page {
  background: var(--background);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}
.login-overlay {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-card {
  max-width: 420px;
  width: 100%;
  padding: 32px 28px;
  text-align: center;
  border: 1px solid var(--border-light);
  animation: scaleIn 0.25s ease-out;
}
.login-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 20px;
  background: var(--primary);
  color: white;
  margin-bottom: 16px;
  box-shadow: var(--shadow-1);
}
.login-logo i {
  font-size: 32px;
}
.login-title {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.login-title span {
  color: var(--primary);
  font-weight: 600;
}
.login-subtitle {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 28px;
}
.remember-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
}
.form-check-input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}
.form-check-label {
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
}
.login-footer {
  margin-top: 28px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.6;
}
.login-footer strong {
  color: var(--text-primary);
}
.login-footer a {
  color: var(--primary);
  text-decoration: none;
}
.login-footer a:hover {
  text-decoration: underline;
}

/* Dashboard */
.dashboard-container {
  width: 100%;
}
.dashboard-header {
  margin-bottom: 24px;
}
.dashboard-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.dashboard-subtitle {
  font-size: 16px;
  color: var(--text-secondary);
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}
.stat-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-1);
  transition: var(--transition);
}
.stat-card:hover {
  box-shadow: var(--shadow-2);
  transform: translateY(-2px);
}
.stat-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
}
.stat-primary .stat-icon {
  background: var(--primary-light);
  color: var(--primary-dark);
}
.stat-danger .stat-icon {
  background: var(--error-light);
  color: var(--error);
}
.stat-warning .stat-icon {
  background: #fff3e0;
  color: #e65100;
}
.dark .stat-warning .stat-icon {
  background: #3e2a1f;
  color: #ffb74d;
}
.stat-secondary .stat-icon {
  background: var(--surface-2);
  color: var(--text-secondary);
}
.stat-content {
  flex: 1;
}
.stat-value {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
}
.stat-label {
  font-size: 13px;
  color: var(--text-secondary);
}
.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}
.quick-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 12px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-1);
  transition: var(--transition);
  cursor: pointer;
}
.quick-action-btn:hover {
  border-color: var(--border);
  box-shadow: var(--shadow-2);
  transform: translateY(-3px);
}
.action-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  color: var(--primary);
  transition: var(--transition);
}
.quick-action-btn:hover .action-icon {
  transform: scale(1.05);
}
.action-text {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.action-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border-radius: 12px;
  background: var(--primary);
  color: white;
  font-size: 12px;
  font-weight: 600;
}
.quick-action-btn.btn-primary .action-icon {
  background: var(--primary);
  color: white;
}
.quick-action-btn.btn-primary .action-badge {
  background: var(--primary-dark);
}
.dashboard-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.dashboard-column {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.dashboard-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-1);
  overflow: hidden;
}
.dashboard-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 12px;
  border-bottom: 1px solid var(--border-light);
}
.dashboard-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}
.dashboard-card-title i {
  font-size: 20px;
  color: var(--primary);
}
.dashboard-card-body {
  padding: 24px;
}
.dashboard-task-item,
.dashboard-action-item {
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  transition: var(--transition);
  cursor: pointer;
}
.dashboard-task-item:hover,
.dashboard-action-item:hover {
  border-color: var(--border);
  box-shadow: var(--shadow-1);
  transform: translateX(4px);
}
.task-header,
.action-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}
.task-title,
.action-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}
.task-date,
.action-date {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  margin-left: 8px;
}
.task-description,
.action-description {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  line-height: 1.5;
}
.task-case,
.action-meta {
  font-size: 12px;
  color: var(--text-disabled);
  display: flex;
  align-items: center;
  gap: 4px;
}
.updates-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.update-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.update-item.critical {
  background: var(--error-light);
  border-left: 4px solid var(--error);
}
.update-item i {
  font-size: 20px;
  color: var(--text-secondary);
}
.update-item.critical i {
  color: var(--error);
}
.update-content {
  flex: 1;
}
.update-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.update-description {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.update-date {
  font-size: 11px;
  color: var(--text-disabled);
}
.loading-updates {
  padding: 20px;
  text-align: center;
  color: var(--text-secondary);
}

/* Módulo Casos/Tareas */
.cases-module {
  width: 100%;
}
.cases-header {
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}
.cases-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.cases-subtitle {
  color: var(--text-secondary);
  font-size: 14px;
}
.cases-filters-card {
  background: white;
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-1);
}
.dark .cases-filters-card {
  background: var(--surface);
}
.cases-search-container {
  position: relative;
  margin-bottom: 16px;
}
.cases-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-disabled);
  font-size: 18px;
}
.cases-search-input {
  width: 100%;
  padding: 12px 12px 12px 44px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 14px;
}
.dark .cases-search-input {
  background: var(--surface);
  color: var(--text-primary);
}
.cases-clear-search {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
}
.cases-quick-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}
.btn-filter {
  background: white;
  border: 1px solid var(--border);
  border-radius: 30px;
  padding: 8px 16px;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  transition: var(--transition);
  position: relative;
}
.dark .btn-filter {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text-secondary);
}
.btn-filter-active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}
.btn-filter i {
  font-size: 18px;
}
.cases-badge {
  background: var(--error);
  color: white;
  border-radius: 12px;
  padding: 2px 8px;
  font-size: 11px;
  margin-left: 6px;
  font-weight: 600;
}
.btn-filter-active .cases-badge {
  background: white;
  color: var(--primary);
}
.cases-advanced-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  align-items: end;
}
.cases-filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cases-filter-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}
.cases-filter-select {
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: white;
}
.dark .cases-filter-select {
  background: var(--surface);
  color: var(--text-primary);
}
.cases-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) {
  .cases-grid {
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  }
}
@media (min-width: 1024px) {
  .cases-grid {
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  }
}
.case-card {
  background: white;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  padding: 20px;
  position: relative;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.dark .case-card {
  background: var(--surface);
  border-color: var(--border);
}
.case-card:hover {
  border-color: var(--border);
  box-shadow: var(--shadow-1);
  transform: translateY(-3px);
}
.case-card-archived {
  opacity: 0.8;
  background: var(--surface-2);
}
.case-priority-indicator {
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--priority-color, var(--primary));
  border-radius: var(--radius-md) 0 0 var(--radius-md);
}
.case-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-left: 8px;
}
.case-card-title-container {
  display: flex;
  gap: 12px;
  align-items: center;
}
.case-avatar {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 18px;
  flex-shrink: 0;
}
.case-card-title h4 {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 4px;
  color: var(--text-primary);
}
.case-rol,
.task-date {
  font-size: 12px;
  color: var(--text-secondary);
}
.task-date {
  white-space: nowrap;
}
.case-card-actions {
  display: flex;
  gap: 6px;
}
.case-action-btn {
  background: transparent;
  border: none;
  padding: 6px;
  border-radius: 6px;
  color: var(--text-secondary);
  cursor: pointer;
  position: relative;
  transition: var(--transition);
}
.case-action-btn:hover {
  background: var(--surface-2);
  color: var(--primary);
  transform: scale(1.05);
}
.case-comments-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--error);
  color: white;
  border-radius: 12px;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 600;
}
.case-tribunal {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  padding-left: 8px;
}
.case-owners-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding-left: 8px;
}
.case-owner-chip {
  display: inline-flex;
  align-items: center;
  background: var(--surface-2);
  border-radius: 20px;
  padding: 4px 10px;
  gap: 6px;
  font-size: 12px;
  color: var(--text-primary);
}
.case-owner-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
}
.case-owner-more {
  background: var(--border);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 12px;
  color: var(--text-primary);
}
.case-card-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-left: 8px;
}
.case-section {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 12px;
  cursor: pointer;
  transition: var(--transition);
}
.case-section:hover {
  background: var(--border-light);
  transform: translateX(3px);
}
.case-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.case-section-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}
.case-section-date {
  font-size: 11px;
  color: var(--text-secondary);
}
.case-section-content p {
  margin: 0;
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.5;
}
.case-section-hint {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 6px;
  font-style: italic;
}
.case-card-footer {
  padding-left: 8px;
}
.case-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.case-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 16px;
  font-size: 11px;
  font-weight: 500;
  background: var(--surface-2);
  color: var(--text-secondary);
}
.case-tag i {
  font-size: 14px;
}
.case-tag-priority {
  background: var(--priority-color, var(--primary));
  color: white;
}
.case-tag-expired,
.case-tag-critical {
  background: var(--tag-critical);
  color: white;
}
.case-tag-warning {
  background: var(--tag-warning);
  color: var(--text-primary);
}
.case-tag-upcoming {
  background: var(--tag-upcoming);
  color: var(--text-primary);
}
.case-tag-normal {
  background: var(--success);
  color: white;
}
.case-tag-notification {
  background: var(--error);
  color: white;
}
.case-tag-archived {
  background: var(--tag-archived);
  color: var(--text-secondary);
}
.case-extrajudicial-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding-left: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}
.case-extrajudicial-fields div {
  display: flex;
  align-items: center;
  gap: 4px;
}
.case-extrajudicial-fields i {
  font-size: 16px;
  color: var(--primary);
}
.cases-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: stretch;
}
.cases-form-column {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.cases-responsible-split {
  display: flex;
  flex-direction: column;
  gap: 20px;
  background: var(--surface-2);
  border-radius: var(--radius-md);
  padding: 16px;
}
.cases-responsible-group {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.dark .cases-responsible-group {
  border-color: var(--border);
}
.cases-responsible-group-title {
  background: var(--surface);
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-light);
}
.dark .cases-responsible-group-title {
  background: var(--surface-2);
  border-bottom-color: var(--border);
}
.cases-responsible-list {
  max-height: 200px;
  overflow-y: auto;
}
.cases-responsible-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-light);
  transition: var(--transition-fast);
}
.cases-responsible-item:last-child {
  border-bottom: none;
}
.cases-responsible-item:hover {
  background: var(--surface-2);
}
.dark .cases-responsible-item {
  border-bottom-color: var(--border);
}
.dark .cases-responsible-item:hover {
  background: var(--surface);
}
.cases-responsible-info {
  display: flex;
  align-items: center;
  gap: 12px;
}
.cases-responsible-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
}
.cases-responsible-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}
.cases-responsible-action {
  background: transparent;
  border: none;
  padding: 6px;
  border-radius: 50%;
  cursor: pointer;
  color: var(--text-secondary);
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}
.cases-responsible-action:hover {
  background: rgba(0, 0, 0, 0.08);
  color: var(--primary);
  transform: scale(1.1);
}
.dark .cases-responsible-action:hover {
  background: rgba(255, 255, 255, 0.1);
}
.cases-responsible-empty {
  padding: 16px;
  text-align: center;
  font-size: 13px;
  color: var(--text-disabled);
}
.cases-comments-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.cases-comments-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.cases-comment {
  background: var(--surface-2);
  border-radius: var(--radius-md);
  padding: 16px;
  border: 1px solid var(--border-light);
  transition: var(--transition);
}
.dark .cases-comment {
  border-color: var(--border);
}
.cases-comment:hover {
  border-color: var(--border);
}
.dark .cases-comment:hover {
  border-color: var(--border-dark);
}
.cases-comment-header {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
  position: relative;
}
.cases-comment-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
}
.cases-comment-info {
  flex: 1;
}
.cases-comment-author {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
}
.cases-comment-meta {
  display: flex;
  gap: 8px;
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}
.cases-comment-time {
  font-weight: 500;
}
.cases-comment-actions {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  gap: 4px;
}
.cases-comment-actions button {
  background: transparent;
  border: none;
  padding: 4px;
  border-radius: 4px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}
.cases-comment-actions button:hover {
  background: var(--border-light);
  color: var(--primary);
  transform: scale(1.05);
}
.dark .cases-comment-actions button:hover {
  background: var(--border);
}
.cases-comment-text {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
  margin-left: 48px;
}
.cases-empty-comments {
  text-align: center;
  padding: 32px;
  color: var(--text-secondary);
}
.cases-empty-comments i {
  font-size: 48px;
  color: var(--border);
  margin-bottom: 16px;
}
.cases-empty-comments h4 {
  font-size: 16px;
  margin-bottom: 8px;
  color: var(--text-primary);
}
.cases-empty-comments p {
  font-size: 13px;
}
.cases-comment-form {
  margin-top: 24px;
  border-top: 1px solid var(--border-light);
  padding-top: 24px;
}
.cases-history-timeline {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.cases-history-item {
  display: flex;
  gap: 16px;
  position: relative;
}
.cases-history-marker {
  flex-shrink: 0;
  color: var(--primary);
}
.cases-history-content {
  flex: 1;
  background: var(--surface-2);
  border-radius: var(--radius-md);
  padding: 16px;
}
.dark .cases-history-content {
  background: var(--surface-2);
}
.cases-history-current .cases-history-marker i {
  font-size: 20px;
  color: var(--primary);
}
.cases-history-header {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}
.cases-history-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
}
.cases-history-info {
  flex: 1;
}
.cases-history-name {
  font-weight: 600;
  font-size: 14px;
}
.cases-history-date {
  font-size: 11px;
  color: var(--text-secondary);
}
.cases-history-text {
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
}
.cases-empty-state,
.cases-error-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-secondary);
  font-size: 15px;
}
.cases-error-state {
  background: var(--error-light);
  border: 1px solid var(--error);
  border-radius: var(--radius-md);
  color: var(--error);
}
.dark .cases-error-state {
  background: var(--error-light);
  color: #ffb3b3;
}
.cases-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
  gap: 16px;
}
.cases-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-light);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
.task-group {
  margin-bottom: 30px;
}
.section-header {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
/* Edición rápida de campos */
.case-edit-field-btn {
  background: none;
  border: none;
  padding: 4px;
  margin: 0;
  cursor: pointer;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: background-color 0.2s, color 0.2s, transform 0.1s;
}
.case-edit-field-btn:hover {
  background-color: rgba(0, 0, 0, 0.08);
  color: var(--primary);
  transform: scale(1.05);
}
.dark .case-edit-field-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
}
.case-edit-field-btn i.material-icons {
  font-size: 18px;
}
.case-section-header > div:last-child {
  display: flex;
  align-items: center;
  gap: 8px;
}
#cases-field-edit-modal .modal {
  max-width: 500px;
}
#cases-field-edit-modal .form-group {
  margin-bottom: 1.5rem;
}
#cases-field-edit-modal .form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text-primary);
}
#cases-field-edit-modal .form-hint {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}
#cases-field-edit-modal .form-control {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.95rem;
  resize: vertical;
  background-color: var(--surface);
  color: var(--text-primary);
}
#cases-field-edit-modal .form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(55, 87, 230, 0.2);
}
#cases-field-edit-modal .modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 24px;
  border-top: 1px solid var(--border-light);
}

/* Módulo Calendario */
.calendar-content {
  min-height: 500px;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.legend-color-indicator {
  width: 14px;
  height: 14px;
  border-radius: 4px;
}
.event-detail-container {
  padding: 8px 0;
}
.event-detail-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}
.event-type-badge {
  padding: 6px 14px;
  border-radius: 30px;
  font-size: 12px;
  font-weight: 600;
  color: white;
}
.event-detail-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}
.event-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  background: var(--surface-2);
  padding: 16px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
}
.event-detail-meta div {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}
.event-detail-content {
  margin-bottom: 20px;
}
.event-detail-field {
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 14px;
}
.event-detail-notes {
  background: var(--surface-2);
  padding: 16px;
  border-radius: var(--radius-md);
  margin-top: 16px;
  font-size: 14px;
  line-height: 1.6;
}
.event-detail-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}
.case-search-results {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  max-height: 250px;
  overflow-y: auto;
  box-shadow: var(--shadow-1);
}
.dark .case-search-results {
  background: var(--surface);
  border-color: var(--border);
}
.case-search-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: var(--transition);
}
.case-search-item:hover {
  background: var(--surface-2);
}
.case-search-title {
  font-weight: 600;
  margin-bottom: 4px;
}
.case-search-meta {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--text-secondary);
  align-items: center;
}
.case-search-empty {
  padding: 20px;
  text-align: center;
  color: var(--text-secondary);
}
.print-modal-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.date-range-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.print-preview-container {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  background: var(--surface-2);
}
.print-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.print-preview-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.stat-item {
  text-align: center;
  background: white;
  padding: 12px;
  border-radius: var(--radius-sm);
}
.dark .stat-item {
  background: var(--surface);
}
.stat-number {
  font-size: 24px;
  font-weight: 700;
  display: block;
}
.stat-label {
  font-size: 11px;
  color: var(--text-secondary);
}

/* Informe profesional */
.report-filters {
  background: #f8fafc;
  padding: 16px 40px;
  border-bottom: 1px solid #e2e8f0;
  font-size: 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 12px;
}
.dark .report-filters {
  background: var(--surface-2);
  border-bottom-color: var(--border);
}
.filter-badge {
  background: #e2e8f0;
  padding: 4px 12px;
  border-radius: 30px;
  font-size: 12px;
  font-weight: 500;
  color: #1e2a2f;
}
.dark .filter-badge {
  background: var(--border);
  color: var(--text-primary);
}
.report-summary {
  display: flex;
  gap: 24px;
  padding: 24px 40px;
  background: white;
  border-bottom: 1px solid #e2e8f0;
}
.dark .report-summary {
  background: var(--surface);
  border-bottom-color: var(--border);
}
.summary-card {
  background: #f1f5f9;
  border-radius: 16px;
  padding: 16px 24px;
  text-align: center;
  flex: 1;
}
.dark .summary-card {
  background: var(--surface-2);
}
.summary-number {
  font-size: 32px;
  font-weight: 800;
  color: #2a5298;
}
.dark .summary-number {
  color: var(--primary);
}
.summary-label {
  font-size: 13px;
  color: #5f6c72;
  margin-top: 4px;
}
.report-table-wrapper {
  overflow-x: auto;
  padding: 0 24px 24px 24px;
}
.report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: white;
}
.report-table th {
  text-align: left;
  padding: 14px 8px;
  background: #f1f5f9;
  font-weight: 600;
  color: #1e2a2f;
  border-bottom: 2px solid #cbd5e0;
}
.dark .report-table th {
  background: var(--surface-2);
  color: var(--text-primary);
  border-bottom-color: var(--border);
}
.report-table td {
  padding: 12px 8px;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: top;
}
.dark .report-table td {
  border-bottom-color: var(--border-light);
}
.dias-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 30px;
  font-weight: 600;
  font-size: 12px;
}
.dias-expired {
  background: #fee9e9;
  color: #c2410c;
}
.dias-critical {
  background: #ffedea;
  color: #b91c1c;
}
.dias-warning {
  background: #fff3e0;
  color: #e65100;
}
.report-footer {
  background: #f8fafc;
  padding: 20px 40px;
  text-align: center;
  font-size: 12px;
  color: #8a9aa5;
  border-top: 1px solid #e2e8f0;
}
.dark .report-footer {
  background: var(--surface-2);
  border-top-color: var(--border);
  color: var(--text-secondary);
}

/* ============================================================
   ESTILOS PARA EDITOR QUILL (CORREGIDO)
   ============================================================ */
.ql-toolbar.ql-snow {
  border-radius: 8px 8px 0 0;
  background-color: #f9fafb;
  border: 1px solid #e5e7eb;
  border-bottom: none;
  padding: 8px;
}
.ql-container.ql-snow {
  border-radius: 0 0 8px 8px;
  border: 1px solid #e5e7eb;
  border-top: none;
  font-family: var(--font-family);
  font-size: 14px;
  background-color: white;
  min-height: 180px;
  height: auto;
  max-height: 300px;
  overflow-y: auto;
}
.ql-editor {
  min-height: 150px;
  font-size: 14px;
  line-height: 1.5;
  background-color: white;
  color: #1e2a2f;
  padding: 12px;
  outline: none;
}
.ql-editor.ql-blank::before {
  color: #8a9aa5;
  font-style: normal;
  left: 12px;
  right: auto;
}
.dark .ql-toolbar.ql-snow {
  background-color: var(--surface-2);
  border-color: var(--border);
}
.dark .ql-container.ql-snow {
  background-color: var(--surface);
  border-color: var(--border);
}
.dark .ql-editor {
  background-color: var(--surface);
  color: var(--text-primary);
}
.dark .ql-editor.ql-blank::before {
  color: var(--text-disabled);
}
.dark .ql-snow .ql-stroke {
  stroke: var(--text-primary);
}
.dark .ql-snow .ql-fill {
  fill: var(--text-primary);
}
.dark .ql-snow .ql-picker {
  color: var(--text-primary);
}
.dark .ql-snow .ql-picker-options {
  background-color: var(--surface);
  border-color: var(--border);
}
.dark .ql-snow .ql-tooltip {
  background-color: var(--surface);
  border-color: var(--border);
  color: var(--text-primary);
}
.dark .ql-snow .ql-tooltip input {
  background-color: var(--surface-2);
  border-color: var(--border);
  color: var(--text-primary);
}
.modal-body .ql-container {
  max-height: 250px;
}
.cases-form-group .ql-container {
  max-height: 280px;
}
.quill-content {
  margin-top: 8px;
  padding: 8px;
  background: #f9fafb;
  border-radius: 8px;
  line-height: 1.5;
}
.dark .quill-content {
  background: var(--surface-2);
  color: var(--text-primary);
}
.quill-content p {
  margin: 0 0 8px 0;
}
.quill-content ul,
.quill-content ol {
  margin: 0 0 8px 20px;
  padding: 0;
}
.quill-content strong {
  font-weight: 600;
}
.quill-content em {
  font-style: italic;
}
.quill-content u {
  text-decoration: underline;
}
.quill-content blockquote {
  border-left: 4px solid var(--border);
  margin: 0;
  padding-left: 12px;
  color: var(--text-secondary);
}

/* ============================================================
   FULLCALENDAR ESTILOS (Tema claro/oscuro)
   ============================================================ */
.fc {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 16px;
  color: var(--text-primary);
  font-family: var(--font-family);
}
.fc .fc-toolbar {
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}
.fc .fc-toolbar-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
}
.fc .fc-button-primary {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-primary);
  transition: var(--transition);
  text-transform: capitalize;
  font-weight: 500;
}
.fc .fc-button-primary:not(:disabled):hover {
  background: var(--border-light);
  border-color: var(--border-dark);
  transform: translateY(-1px);
}
.fc .fc-button-primary:not(:disabled):active,
.fc .fc-button-primary.fc-button-active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}
.fc .fc-button-primary:focus {
  box-shadow: 0 0 0 2px rgba(55, 87, 230, 0.3);
}
.fc .fc-col-header-cell {
  background: var(--surface-2);
  padding: 8px 0;
}
.fc .fc-col-header-cell-cushion {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.fc .fc-daygrid-day {
  transition: background 0.1s ease;
}
.fc .fc-daygrid-day:hover {
  background: var(--surface-2);
}
.fc .fc-daygrid-day-number {
  color: var(--text-primary);
  font-weight: 500;
  padding: 6px 8px;
  font-size: 0.85rem;
}
.fc .fc-day-today {
  background: var(--info-light) !important;
}
.fc .fc-day-today .fc-daygrid-day-number {
  background: var(--primary);
  color: white;
  border-radius: 20px;
  min-width: 28px;
  text-align: center;
  display: inline-block;
}
.fc .fc-event {
  border-radius: 6px;
  padding: 3px 6px;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  margin: 2px 4px;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.fc .fc-event:hover {
  transform: scale(1.01);
  box-shadow: var(--shadow-1);
}
.fc .fc-event-title {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fc .fc-daygrid-event {
  white-space: normal;
}
.fc .fc-list-table {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
}
.fc .fc-list-day-cushion {
  background: var(--surface-2);
  color: var(--text-primary);
  font-weight: 600;
  padding: 10px 16px;
}
.fc .fc-list-event:hover td {
  background: var(--surface-2);
}
.fc .fc-list-event-dot {
  border: 4px solid;
}
.fc .fc-list-event-title {
  font-weight: 500;
  color: var(--text-primary);
}
.fc .fc-list-event-time {
  font-weight: 500;
  color: var(--text-secondary);
}
.fc .fc-timegrid-slot {
  height: 2.8em;
}
.fc .fc-timegrid-slot-label {
  color: var(--text-secondary);
  font-size: 0.75rem;
}
.fc .fc-timegrid-axis {
  background: var(--surface-2);
}
.fc .fc-timegrid-now-indicator-line {
  border-color: var(--error);
}
.fc .fc-timegrid-now-indicator-arrow {
  border-color: var(--error);
  color: var(--error);
}
.fc .fc-popover {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-2);
}
.fc .fc-popover-header {
  background: var(--surface-2);
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-light);
}
.fc .fc-popover-title {
  color: var(--text-primary);
  font-weight: 600;
}
.fc .fc-popover-body {
  color: var(--text-primary);
  padding: 12px;
}
.fc .fc-tooltip {
  background: var(--surface);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-1);
  font-size: 0.75rem;
  padding: 6px 10px;
}
.fc .fc-button {
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 0.85rem;
}
.fc .fc-icon {
  font-size: 1.2em;
}
.dark .fc {
  background: var(--surface);
  border-color: var(--border);
}
.dark .fc .fc-button-primary {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--text-primary);
}
.dark .fc .fc-button-primary:not(:disabled):hover {
  background: var(--border);
  border-color: var(--border-dark);
}
.dark .fc .fc-button-primary:not(:disabled):active,
.dark .fc .fc-button-primary.fc-button-active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}
.dark .fc .fc-col-header-cell {
  background: var(--surface-2);
}
.dark .fc .fc-col-header-cell-cushion {
  color: var(--text-primary);
}
.dark .fc .fc-daygrid-day:hover {
  background: var(--surface-2);
}
.dark .fc .fc-day-today {
  background: var(--info-light) !important;
}
.dark .fc .fc-day-today .fc-daygrid-day-number {
  background: var(--primary);
  color: white;
}
.dark .fc .fc-list-table {
  border-color: var(--border);
}
.dark .fc .fc-list-day-cushion {
  background: var(--surface-2);
  color: var(--text-primary);
}
.dark .fc .fc-list-event:hover td {
  background: var(--surface-2);
}
.dark .fc .fc-list-event-title {
  color: var(--text-primary);
}
.dark .fc .fc-list-event-time {
  color: var(--text-secondary);
}
.dark .fc .fc-timegrid-axis {
  background: var(--surface-2);
}
.dark .fc .fc-timegrid-slot-label {
  color: var(--text-secondary);
}
.dark .fc .fc-popover {
  background: var(--surface);
  border-color: var(--border);
}
.dark .fc .fc-popover-header {
  background: var(--surface-2);
  border-bottom-color: var(--border-light);
}
.dark .fc .fc-popover-title {
  color: var(--text-primary);
}
.dark .fc .fc-popover-body {
  color: var(--text-primary);
}
.dark .fc .fc-tooltip {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text-primary);
}

/* ============================================================
   TERMINOS MODAL
   ============================================================ */
.modal--large {
  width: 90%;
  max-width: 1000px;
  height: auto;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}
.modal--large .modal-body {
  flex: 1;
  overflow: auto;
  padding: 20px;
  background: #fff;
  border-radius: 0 0 12px 12px;
}
.dark .modal--large .modal-body {
  background: var(--surface);
}
.terms-modal-body {
  min-height: 400px;
  max-height: 70vh;
}
.terms-notice {
  font-size: 0.8rem;
  text-align: center;
  margin-top: 20px;
  margin-bottom: 10px;
  color: #5f6c72;
  line-height: 1.4;
}
.dark .terms-notice {
  color: #b0b0c0;
}
.terms-link {
  color: #2c7da0;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s;
}
.dark .terms-link {
  color: #5c7cff;
}
.terms-link:hover {
  color: #1f5068;
  text-decoration: underline;
}
.dark .terms-link:hover {
  color: #8aabff;
}
.terms-loading {
  text-align: center;
  padding: 40px;
  color: #6c7a7f;
}
.dark .terms-loading {
  color: #b0b0c0;
}
.modal-backdrop.show {
  display: flex !important;
  align-items: center;
  justify-content: center;
}

/* ============================================================
   SCROLLBAR PERSONALIZADA (unificada)
   ============================================================ */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: var(--surface-2);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb {
  background: var(--border-dark);
  border-radius: 10px;
  transition: var(--transition-fast);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}
::-webkit-scrollbar-corner {
  background: var(--surface-2);
}
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-dark) var(--surface-2);
}
.modal-body::-webkit-scrollbar,
.cases-responsible-list::-webkit-scrollbar {
  width: 8px;
}
.modal-body::-webkit-scrollbar-track,
.cases-responsible-list::-webkit-scrollbar-track {
  background: var(--surface-2);
  border-radius: 8px;
}
.modal-body::-webkit-scrollbar-thumb,
.cases-responsible-list::-webkit-scrollbar-thumb {
  background: var(--border-dark);
  border-radius: 8px;
}
.dark ::-webkit-scrollbar-track {
  background: var(--surface);
}
.dark ::-webkit-scrollbar-thumb {
  background: var(--border);
}
.dark ::-webkit-scrollbar-thumb:hover {
  background: var(--text-disabled);
}
.dark * {
  scrollbar-color: var(--border) var(--surface);
}
.dark .modal-body::-webkit-scrollbar-track,
.dark .cases-responsible-list::-webkit-scrollbar-track {
  background: var(--surface);
}
.dark .modal-body::-webkit-scrollbar-thumb,
.dark .cases-responsible-list::-webkit-scrollbar-thumb {
  background: var(--border);
}

/* ============================================================
   STANDALONE MODE
   ============================================================ */
[data-display-mode="standalone"] .sidebar {
  padding-top: env(safe-area-inset-top, 0);
}
[data-display-mode="standalone"] .top-bar {
  padding-top: env(safe-area-inset-top, 12px);
}

/* ============================================================
   MEDIA QUERIES (unificadas)
   ============================================================ */
@media (max-width: 1024px) {
  .stats-grid {
    gap: 16px;
  }
}
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 1050;
    transform: translateX(-100%);
    width: 280px;
  }
  .sidebar.sidebar-open {
    transform: translateX(0);
  }
  .sidebar.collapsed {
    width: 280px;
  }
  .sidebar.collapsed .brand-text,
  .sidebar.collapsed .nav-item .label {
    opacity: 1;
    width: auto;
    display: inline;
  }
  .sidebar.collapsed .toggle-collapse i {
    transform: none;
  }
  #mobile-menu-toggle {
    display: flex;
  }
  .main-content {
    width: 100%;
  }
  .top-bar {
    padding: 12px 16px;
  }
  .content-wrapper {
    padding: 16px;
  }
  .dashboard-content {
    grid-template-columns: 1fr;
  }
  .toggle-collapse {
    display: none !important;
  }
  .cases-form-grid {
    gap: 16px;
  }
  .cases-form-group {
    margin-bottom: 10px;
  }
  #unified-responsables-container {
    min-height: 280px;
    flex: 0 0 auto;
  }
  .cases-responsible-group {
    flex: 0 0 auto;
    max-height: 200px;
  }
  .modal--large {
    width: 95%;
    max-height: 95vh;
  }
  .terms-modal-body {
    max-height: 60vh;
    padding: 16px;
  }
}
@media (max-width: 640px) {
  .content-wrapper {
    padding: 12px;
  }
  .cases-filters-card {
    padding: 16px;
  }
  .cases-quick-filters {
    gap: 8px;
  }
  .btn-filter {
    padding: 6px 12px;
    font-size: 12px;
  }
  .cases-advanced-filters {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .cases-form-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .cases-pagination-container {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }
  .cases-pagination-info {
    text-align: center;
  }
  .cases-pagination-controls {
    justify-content: center;
    flex-wrap: wrap;
  }
  .case-card {
    padding: 16px;
  }
  .case-card-header {
    flex-wrap: wrap;
    gap: 8px;
  }
  .case-card-actions {
    margin-left: auto;
  }
  .dashboard-title {
    font-size: 24px;
  }
  .dashboard-subtitle {
    font-size: 14px;
  }
  .stat-card {
    padding: 16px;
  }
  .stat-value {
    font-size: 24px;
  }
  .quick-actions {
    grid-template-columns: repeat(2, 1fr);
  }
  .quick-action-btn {
    padding: 16px 8px;
  }
  .quick-action-btn .action-icon {
    width: 40px;
    height: 40px;
    font-size: 20px;
  }
  .dashboard-card-header {
    padding: 16px 16px 8px;
  }
  .dashboard-card-body {
    padding: 16px;
  }
  .modal-header {
    padding: 16px 16px 8px;
  }
  .modal-body {
    padding: 16px;
  }
  .modal-footer {
    padding: 12px 16px;
    flex-wrap: wrap;
    justify-content: center;
  }
  .fc .fc-toolbar {
    flex-direction: column;
    gap: 12px;
  }
  .fc .fc-toolbar-title {
    font-size: 16px;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .cases-switches {
    flex-direction: column;
    gap: 16px;
  }
}
@media (max-width: 480px) {
  .cases-title {
    font-size: 20px;
  }
  .cases-subtitle {
    font-size: 13px;
  }
  .case-card-title h4 {
    font-size: 15px;
  }
  .case-avatar {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }
  .case-section {
    padding: 10px;
  }
  .case-section-title {
    font-size: 12px;
  }
  .case-section-content p {
    font-size: 12px;
  }
  .cases-pagination-btn {
    padding: 6px 10px;
    font-size: 12px;
  }
  .login-card {
    padding: 24px 20px;
  }
  .login-title {
    font-size: 22px;
  }
  .user-avatar {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }
  #page-title {
    font-size: 18px;
  }
  .btn {
    padding: 6px 12px;
    font-size: 13px;
  }
  .btn-sm {
    padding: 4px 8px;
    font-size: 12px;
  }
  .form-control,
  .form-select,
  .cases-form-input {
    padding: 8px 10px;
    font-size: 13px;
  }
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .quick-actions {
    grid-template-columns: 1fr;
  }
  .cases-quick-filters {
    flex-direction: column;
    align-items: stretch;
  }
  .btn-filter {
    justify-content: center;
  }
}
@media (max-width: 360px) {
  .cases-pagination-controls {
    gap: 4px;
  }
  .cases-pagination-btn {
    padding: 4px 8px;
  }
  .case-owners-list {
    flex-direction: column;
    align-items: flex-start;
  }
}
@media print {
  .cases-responsible-split,
  .cases-responsible-group,
  .cases-responsible-list {
    break-inside: avoid;
  }
}
