* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: #f8fafc;
  color: #1f2937;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.auth-page {
  min-height: 100vh;
  background: #f8fafc;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 32px;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
}

.auth-logo {
  width: 64px;
  height: 64px;
  display: block;
  margin: 0 auto 20px;
}

.auth-card h1 {
  text-align: center;
  color: #1e3a8a;
  margin: 0 0 8px;
  font-size: 24px;
}

.auth-card p {
  text-align: center;
  color: #4b5563;
}

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

label {
  display: block;
  font-size: 14px;
  color: #4b5563;
  margin-bottom: 8px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px 14px;
  background: #ffffff;
  color: #1f2937;
}

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

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(37, 99, 235, 0.18);
  border-color: #2563eb;
}

.auth-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 8px 0 20px;
  color: #4b5563;
  font-size: 14px;
}

.auth-options button,
.auth-link button,
.link-btn {
  border: 0;
  background: transparent;
  color: #2563eb;
  padding: 0;
}

.primary-btn {
  width: 100%;
  border: 0;
  border-radius: 8px;
  padding: 13px 16px;
  background: #2563eb;
  color: #ffffff;
}

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

.secondary-btn {
  border: 1px solid #2563eb;
  border-radius: 8px;
  padding: 13px 16px;
  background: #ffffff;
  color: #2563eb;
}

.danger-btn {
  border: 0;
  background: transparent;
  color: #ef4444;
}

.message {
  margin-top: 12px;
  color: #dc2626;
  text-align: center;
  font-size: 14px;
}

.layout {
  min-height: 100vh;
  display: flex;
}

.sidebar {
  width: 256px;
  min-width: 256px;
  background: #1e3a8a;
  color: #ffffff;
  display: flex;
  flex-direction: column;
}

.sidebar-brand {
  padding: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.sidebar-brand h2 {
  margin: 0 0 6px;
  font-size: 24px;
}

.sidebar-brand p {
  margin: 0;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
}

.sidebar nav {
  flex: 1;
  padding: 16px;
  display: grid;
  align-content: start;
  gap: 8px;
}

.sidebar button {
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.82);
  border-radius: 8px;
  padding: 13px 14px;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar button.active {
  background: #2563eb;
  color: #ffffff;
}

.logout {
  margin: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.12) !important;
}

.main {
  flex: 1;
  min-width: 0;
}

.topbar {
  height: 64px;
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 0 24px;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #4b5563;
  font-size: 14px;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #2563eb;
  color: #ffffff;
  display: grid;
  place-items: center;
}

.notification {
  color: #4b5563;
  position: relative;
}

.notification::after {
  content: "";
  width: 8px;
  height: 8px;
  background: #ef4444;
  border-radius: 50%;
  position: absolute;
  top: -2px;
  right: -4px;
}

.content {
  padding: 24px;
}

.page-container {
  max-width: 1280px;
  margin: 0 auto;
}

h1 {
  margin: 0 0 24px;
  color: #1e3a8a;
  font-size: 24px;
}

.main h2,
.main h3,
.content h2,
.content h3 {
  color: #1e3a8a;
}

.cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-bottom: 28px;
}

.cards-three {
  grid-template-columns: repeat(3, 1fr);
}

.card,
.panel,
.summary-panel {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
}

.card {
  padding: 24px;
}

.card-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.card p {
  margin: 0 0 8px;
  color: #4b5563;
  font-size: 14px;
}

.card h2 {
  margin: 0;
  font-size: 30px;
}

.card-icon {
  width: 48px;
  height: 48px;
  background: rgba(37, 99, 235, 0.1);
  color: #2563eb;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 22px;
}

.trend {
  color: #10b981;
  font-size: 14px;
  margin-top: 8px;
}

.grid-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.panel {
  margin-bottom: 24px;
  overflow: hidden;
}

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

.panel-body {
  padding: 24px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 850px;
  border-collapse: collapse;
}

th {
  background: #f8fafc;
  color: #4b5563;
  font-size: 12px;
  font-weight: normal;
  text-align: left;
  padding: 14px 20px;
}

td {
  border-top: 1px solid #e5e7eb;
  padding: 16px 20px;
  font-size: 14px;
  vertical-align: top;
}

tr:hover td {
  background: #f8fafc;
}

.code {
  color: #2563eb;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  border: 1px solid transparent;
  white-space: nowrap;
}

.success,
.risk-bajo {
  color: #10b981;
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.2);
}

.warning,
.risk-medio {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.2);
}

.danger,
.risk-alto {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.2);
}

.neutral {
  color: #4b5563;
  background: #f3f4f6;
  border-color: #e5e7eb;
}

.filter-panel,
.form-grid {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 24px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 24px;
}

.filter-panel .full {
  grid-column: 1 / -1;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.detail-item {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px;
}

.detail-item strong,
.detail-item span {
  display: block;
}

.detail-item strong {
  color: #4b5563;
  font-size: 13px;
  margin-bottom: 6px;
}

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

.actions button {
  width: auto;
}

.list-item,
.alert-card,
.status-card {
  padding: 16px 0;
  border-bottom: 1px solid #e5e7eb;
}

.list-item:last-child,
.alert-card:last-child {
  border-bottom: 0;
}

.alert-card {
  display: grid;
  gap: 6px;
}

.status-card {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  margin-bottom: 12px;
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.summary-panel {
  padding: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.empty {
  color: #4b5563;
  padding: 16px 0;
}

.chart {
  height: 250px;
  display: flex;
  align-items: flex-end;
  gap: 18px;
  padding: 20px 0 0;
}

.chart-item {
  flex: 1;
  height: 210px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  color: #4b5563;
  font-size: 12px;
}

.chart-bar {
  width: 70%;
  min-height: 16px;
  background: #2563eb;
  border-radius: 4px 4px 0 0;
}

@media (max-width: 1024px) {
  .layout {
    display: block;
  }

  .sidebar {
    width: 100%;
    min-width: 100%;
  }

  .sidebar nav {
    grid-template-columns: repeat(2, 1fr);
  }

  .cards,
  .cards-three,
  .grid-two,
  .filter-panel,
  .form-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .sidebar svg,
  .card-icon svg,
  .notification svg,
  .avatar svg {
    display: block;
    width: 22px !important;
    height: 22px !important;
    max-width: 22px !important;
    max-height: 22px !important;
    fill: none !important;
    stroke: currentColor !important;
  }

  .card-icon svg {
    width: 28px !important;
    height: 28px !important;
    max-width: 28px !important;
    max-height: 28px !important;
  }

  .sidebar button {
    font-size: 16px;
  }

  .sidebar button svg {
    flex: 0 0 22px;
  }

  .card-icon {
    color: #2563eb;
    background: rgba(37, 99, 235, 0.1);
  }

  .recommendation-text {
    line-height: 1.5;
    margin-bottom: 22px;
  }

  .detail-page-header .secondary-btn {
    width: auto;
  }

  .alerts-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }

  .alert-form {
    display: grid;
    gap: 16px;
  }

  .alert-money-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .check-row {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .check-row input {
    width: auto;
  }

  .alert-item {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
  }

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

  .alert-item-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 24px;
    margin: 12px 0;
  }

  .alert-actions {
    display: flex;
    gap: 10px;
  }

  .alert-toggle {
    width: 42px;
    height: 24px;
    border: 0;
    border-radius: 999px;
    background: #d1d5db;
    padding: 3px;
  }

  .alert-toggle span {
    display: block;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: white;
  }

  .alert-toggle.active {
    background: #2563eb;
  }

  .alert-toggle.active span {
    margin-left: 18px;
  }

  @media (max-width: 1024px) {

    .alerts-layout,
    .alert-money-row,
    .alert-item-grid {
      grid-template-columns: 1fr;
    }
  }

  .alerts-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }

  .alert-form {
    display: grid;
    gap: 14px;
  }

  .alert-money-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }

  .alert-form-actions {
    display: flex;
    gap: 12px;
  }

  .alert-form-actions .primary-btn,
  .alert-form-actions .secondary-btn {
    width: auto;
    min-width: 160px;
  }

  .alert-item {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 14px;
    background: #ffffff;
  }

  .alert-item-title {
    color: #1e3a8a;
    font-weight: 700;
    margin-bottom: 12px;
  }

  .alert-item-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 24px;
    margin-bottom: 12px;
    color: #1f2937;
  }

  .alert-actions {
    display: flex;
    gap: 12px;
  }

  .alert-actions .danger-btn {
    color: #ef4444;
  }

  @media (max-width: 1024px) {

    .alerts-layout,
    .alert-money-row,
    .alert-item-grid {
      grid-template-columns: 1fr;
    }
  }

  .alerts-list {
    display: grid;
    gap: 16px;
  }

  .alert-card-item {
    border: 1px solid #dfe5ef;
    border-radius: 10px;
    padding: 18px;
    background: #ffffff;
  }

  .alert-card-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
  }

  .alert-card-header h3 {
    margin: 0 0 6px;
    color: #1e3a8a;
    font-size: 15px;
  }

  .alert-card-header p {
    margin: 0;
    color: #4b5563;
    font-size: 13px;
  }

  .alert-card-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 18px;
    padding: 12px 0;
    border-top: 1px solid #eef2f7;
    border-bottom: 1px solid #eef2f7;
  }

  .alert-card-grid span {
    display: block;
    color: #64748b;
    font-size: 12px;
    margin-bottom: 4px;
  }

  .alert-card-grid strong {
    color: #1f2937;
    font-size: 13px;
  }

  .alert-card-actions {
    display: flex;
    gap: 12px;
    margin-top: 12px;
  }

  .app-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
  }

  .app-modal {
    width: 420px;
    max-width: calc(100% - 32px);
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.25);
  }

  .app-modal h3 {
    margin: 0 0 10px;
    color: #1e3a8a;
  }

  .app-modal p {
    margin: 0;
    color: #4b5563;
    line-height: 1.5;
  }

  .app-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 22px;
  }

  .danger-solid-btn {
    border: 0;
    border-radius: 8px;
    padding: 12px 18px;
    background: #ef4444;
    color: #ffffff;
  }

  .alerts-list {
    display: grid !important;
    gap: 16px !important;
  }

  .alert-card-item {
    border: 1px solid #dfe5ef !important;
    border-radius: 10px !important;
    padding: 18px !important;
    background: #ffffff !important;
    margin-bottom: 16px !important;
  }

  .alert-card-header h3 {
    margin: 0 0 6px !important;
    color: #1e3a8a !important;
    font-size: 16px !important;
  }

  .alert-card-header p {
    margin: 0 0 12px !important;
    color: #4b5563 !important;
  }

  .alert-card-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 12px 24px !important;
    padding: 12px 0 !important;
    border-top: 1px solid #eef2f7 !important;
    border-bottom: 1px solid #eef2f7 !important;
  }

  .alert-card-grid span {
    display: block !important;
    color: #64748b !important;
    font-size: 12px !important;
    margin-bottom: 4px !important;
  }

  .alert-card-grid strong {
    display: block !important;
    color: #1f2937 !important;
    font-size: 14px !important;
  }

  .alert-card-actions {
    display: flex !important;
    gap: 12px !important;
    margin-top: 12px !important;
  }

  .saved-actions {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .trash-btn {
    border: 0;
    background: transparent;
    color: #ef4444;
    cursor: pointer;
    font-size: 16px;
    padding: 6px;
    border-radius: 6px;
  }

  .trash-btn:hover {
    background: rgba(239, 68, 68, 0.1);
  }

  .saved-actions {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .detail-action {
    font-size: 14px;
  }

  .icon-delete {
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 2px;
  }

  .icon-delete svg {
    transition: transform 0.15s ease, opacity 0.15s ease;
  }

  .icon-delete:hover svg {
    transform: scale(1.2);
    opacity: 0.8;
  }

  .saved-actions .trash-btn .icon-btn .icon-delete .saved-delete-btn .saved-detail-btn .sidebar-brand h2,
  .sidebar-brand p {
    color: #ffffff !important;
  }

  .sidebar nav button,
  .sidebar nav button span {
    color: rgba(255, 255, 255, 0.86) !important;
  }

  .sidebar nav button.active,
  .sidebar nav button.active span {
    color: #ffffff !important;
  }

  .sidebar nav button svg {
    color: currentColor !important;
  }

  .sidebar-brand h2 {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    color: #ffffff !important;
    background: transparent !important;
    font-size: 24px !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    margin: 0 0 6px !important;
    text-indent: 0 !important;
  }

  .sidebar-brand {
    min-height: 96px !important;
    padding: 24px !important;
    overflow: visible !important;
  }

}