*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --sidebar-width: 280px;
}

body {
  min-height: 100vh;
  font-family: 'Inter', sans-serif;
}

/* ========== LAYOUT ========== */
.main-wrapper {
  margin-left: var(--sidebar-width);
  padding-top: 64px;
  min-height: 100vh;
}

.main-content {
  padding: 32px;
  max-width: 1400px;
}

@media (max-width: 1023px) {
  .main-wrapper {
    margin-left: 0;
  }
  #sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }
  #sidebar.open {
    transform: translateX(0);
  }
}

/* ========== SIDEBAR ========== */
.sidebar-link {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-link.active {
  background-color: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border-left: 3px solid #3b82f6;
}

/* ========== DATA TABLE ========== */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  color: #94a3b8;
  padding: 14px 20px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
  white-space: nowrap;
}

.data-table th.sortable {
  cursor: pointer;
  user-select: none;
}

.data-table th.sortable:hover {
  color: #475569;
}

.sort-arrow {
  margin-left: 4px;
  font-size: 10px;
  display: inline-block;
}

.data-table td {
  padding: 12px 20px;
  font-size: 13px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.data-table tbody tr:hover {
  background-color: #f8fafc;
}

.data-table tbody tr.clickable {
  cursor: pointer;
}

.data-table tbody tr.clickable:hover {
  background-color: #eef2ff;
}

/* ========== STATUS BADGES ========== */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.status-badge.conciliada {
  background: #d1fae5;
  color: #065f46;
}

.status-badge.pendiente {
  background: #fef3c7;
  color: #92400e;
}

.status-badge.no-conciliada {
  background: #fee2e2;
  color: #991b1b;
}

/* ========== BUTTONS ========== */
.btn-primary {
  background: #0f172a;
  color: white;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
  border: none;
  cursor: pointer;
  text-decoration: none;
  line-height: 1;
}

.btn-primary:hover {
  background: #1e293b;
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-secondary {
  background: white;
  color: #0f172a;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
  border: 1px solid #e2e8f0;
  cursor: pointer;
  text-decoration: none;
  line-height: 1;
}

.btn-secondary:hover {
  background: #f8fafc;
}

.btn-danger {
  background: #dc2626;
  color: white;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
  border: none;
  cursor: pointer;
  text-decoration: none;
  line-height: 1;
}

.btn-danger:hover {
  background: #b91c1c;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

/* ========== FORMS ========== */
input, select, textarea {
  font-size: 13px;
  padding: 10px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: white;
  width: 100%;
  transition: border-color 0.2s;
}

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

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  margin-bottom: 6px;
}

.form-group {
  margin-bottom: 16px;
}

/* ========== MODAL ========== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}

.modal-content {
  background: white;
  border-radius: 16px;
  padding: 32px;
  max-width: 540px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
}

.modal-close {
  padding: 6px;
  border-radius: 8px;
  cursor: pointer;
  color: #94a3b8;
  transition: all 0.2s;
  background: none;
  border: none;
}

.modal-close:hover {
  background: #f1f5f9;
  color: #475569;
}

/* ========== STATS CARDS ========== */
.stat-card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px;
  transition: all 0.2s;
}

.stat-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* ========== PAGINATION ========== */
.pagination {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pagination button {
  padding: 6px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: white;
  font-size: 12px;
  cursor: pointer;
  color: #475569;
  transition: all 0.2s;
}

.pagination button:hover:not(:disabled):not(.active) {
  background: #f1f5f9;
}

.pagination button.active {
  background: #0f172a;
  color: white;
  border-color: #0f172a;
}

.pagination button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ========== ANIMATIONS ========== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

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

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

/* ========== MISC ========== */
.font-mono {
  font-family: 'JetBrains Mono', monospace;
}

.card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}

.card-header {
  padding: 20px 24px;
  border-bottom: 1px solid #e2e8f0;
}

.card-body {
  padding: 24px;
}
