/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* Flash Message Styles */
.flash {
  padding: 1rem;
  margin: 1rem 0;
  border-radius: 8px;
  border-left: 4px solid;
  font-weight: 500;
}

.flash.notice {
  background-color: #d1fae5;
  border-color: #10b981;
  color: #065f46;
}

.flash.alert {
  background-color: #fee2e2;
  border-color: #ef4444;
  color: #991b1b;
}

.flash.error {
  background-color: #fee2e2;
  border-color: #ef4444;
  color: #991b1b;
}

.flash.warning {
  background-color: #fef3c7;
  border-color: #f59e0b;
  color: #92400e;
}
.login-link {
  position: absolute;
  top: 1rem;
  right: 1rem;
}

/* Account Table Styles */
.account-row td {
  padding: 12px;
  border-bottom: 1px solid #eee;
}

.account-row .account-name {
  font-weight: 500;
}

/* Status Badge Variants (global) */
.status-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 500;
  text-transform: capitalize;
  vertical-align: middle;
  line-height: 1.2;
}
.status-badge.connected {
  background: #d4edda;
  color: #155724;
}
.status-badge.disconnected {
  background: #f8d7da;
  color: #721c24;
}
.status-badge.error {
  background: #fff3cd;
  color: #856404;
}
.status-badge.pending {
  background: #e3f2fd;
  color: #1976d2;
}

/* Entity Badge (global pill) */
.entity-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f8f9fa;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 500;
  min-width: 0;
  height: 2rem;
  line-height: 1.2;
  white-space: nowrap;
  gap: 0.5rem;
}
.entity-badge span:first-child {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.status-badge.disconnected {
  background: #f3f4f6;
  color: #6b7280;
}

/* Disconnected account styling */
.disconnected-account {
  opacity: 0.7;
  background-color: #f9fafb;
}

.disconnected-account:hover {
  opacity: 1;
  background-color: #f3f4f6;
}

.disconnected-indicator {
  margin-left: 8px;
  font-size: 0.875rem;
  opacity: 0.7;
}

/* Admin nav styling */
.nav-admin-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  margin-left: 8px;
  border-left: 4px solid #b91c1c; /* red-700 */
  background: #fff1f2; /* rose-50 */
  border-radius: 14px;
}

.nav-admin-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #b91c1c; /* red-700 */
  letter-spacing: 0.03em;
}

.nav-admin-link {
  color: #7f1d1d; /* red-900 */
  font-weight: 600;
}

.nav-admin-link:hover {
  text-decoration: underline;
}

/* Bulk actions styling */
.bulk-actions {
  border-left: 4px solid #dc3545 !important;
}

.bulk-actions h5 {
  color: #dc3545;
  margin-bottom: 0.5rem;
}

/* Financial Institution Table Styles */
.financial-institution-row td {
  padding: 12px;
  border-bottom: 1px solid #eee;
}

.financial-institution-row .financial-institution-name {
  font-weight: 500;
}

.financial-institution-row .financial-institution-domain {
  font-family: monospace;
  color: #666;
}

.financial-institution-row .financial-institution-accounts-count {
  text-align: center;
}

/* Common table styles */
.financial-institutions-table,
.accounts-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 2rem;
}

.financial-institutions-table th,
.accounts-table th {
  text-align: left;
  padding: 12px;
  border-bottom: 2px solid #ddd;
  font-weight: 600;
}

.pagy {
  display: flex;
  font-family: sans-serif;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 600;
  color: rgb(107 114 128);
  & > :not([hidden]) ~ :not([hidden]) {
    --space-reverse: 0;
    margin-right: calc(0.25rem * var(--space-reverse));
    margin-left: calc(0.25rem * calc(1 - var(--space-reverse)));
  }

  a:not(.gap) {
    display: block;
    text-decoration: none;
    border-radius: 0.5rem;
    background-color: rgb(229 231 235);
    padding: 0.25rem 0.75rem;
    color: inherit;
    &:hover {
      background-color: rgb(209 213 219);
    }
    &:not([href]) { /* disabled links */
      cursor: default;
      background-color: rgb(243 244 246);
      color: rgb(209 213 219);
    }
    &.current {
      background-color: rgb(156 163 175);
      color: rgb(255 255 255);
    }
  }

  label {
    white-space: nowrap;
    display: inline-block;
    border-radius: 0.5rem;
    background-color: rgb(229 231 235);
    padding: 0.125rem 0.75rem;
    input {
      line-height: 1.5rem;
      border-radius: 0.375rem;
      border-style: none;
      background-color: rgb(243 244 246);
    }
  }
}