/* ── Design System: Environmental Records (er-) ── */

/* ── Toolbar con breadcrumb ── */
.er-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 18px;
  background: #fff;
  border-radius: 10px;
  box-shadow: var(--shadow-default, 0 1px 3px rgba(0,0,0,0.08));
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.er-toolbar .er-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  color: var(--secondary, #4e5e6a);
  margin: 0;
  white-space: nowrap;
}
.er-toolbar .er-breadcrumb a {
  color: var(--secondary, #4e5e6a);
  text-decoration: none;
  transition: color .2s;
}
.er-toolbar .er-breadcrumb a:hover { color: var(--primary, #00b393); }
.er-toolbar .er-breadcrumb .er-breadcrumb-current {
  font-weight: 700;
  color: var(--dark, #1d2632);
}

/* ── Grid de cards ── */
.er-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

/* ── Card item ── */
.er-card {
  display: block;
  background: #fff;
  border: 1px solid #e9ecef;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  transition: box-shadow .2s, border-color .2s, transform .2s;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  position: relative;
}
.er-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  border-color: #dee2e6;
  transform: translateY(-2px);
  text-decoration: none;
  color: inherit;
}
.er-card:focus {
  text-decoration: none;
  color: inherit;
}
.er-card-link {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: 12px;
}
.er-card-body {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
}
.er-card-icon {
  width: 48px;
  height: 48px;
  min-width: 48px;
  border-radius: 50%;
  background: var(--light, #f2f4f6);
  border: 1px solid #e9ecef;
  display: flex;
  align-items: center;
  justify-content: center;
}
.er-card-icon img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}
.er-card-content {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.er-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--dark, #1d2632);
  line-height: 1.3;
}
.er-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.er-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
}
.er-badge--code {
  background: #e9ecef;
  color: #495057;
}
.er-badge--flow {
  background: #e8f5e9;
  color: #2e7d32;
}

/* ── Info card (vista detalle) ── */
.er-info-card {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--shadow-default, 0 1px 3px rgba(0,0,0,0.08));
  padding: 20px 24px;
  margin-bottom: 24px;
}
.er-info-icon {
  width: 64px;
  height: 64px;
  min-width: 64px;
  border-radius: 50%;
  background: var(--light, #f2f4f6);
  border: 1px solid #e9ecef;
  display: flex;
  align-items: center;
  justify-content: center;
}
.er-info-icon img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}
.er-info-content {
  flex: 1;
  min-width: 0;
}
.er-info-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--dark, #1d2632);
  margin: 0 0 8px 0;
}
.er-info-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  margin-bottom: 0;
}
.er-info-meta-item {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
}
.er-meta-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .3px;
  color: #999;
}
.er-meta-value {
  font-size: 13px;
  color: var(--dark, #1d2632);
  font-weight: 500;
}
.er-info-desc {
  margin-top: 10px;
  font-size: 13px;
  color: #666;
  line-height: 1.6;
  border-left: 3px solid var(--primary, #00b393);
  padding-left: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.er-info-desc.expanded {
  -webkit-line-clamp: unset;
}
.er-info-desc-toggle {
  font-size: 11px;
  color: var(--primary, #00b393);
  cursor: pointer;
  margin-top: 4px;
  display: inline-block;
}
.er-info-desc-toggle:hover {
  text-decoration: underline;
}

/* ── Action toolbar (vista detalle) ── */
.er-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 18px;
  background: #fff;
  border-radius: 10px;
  box-shadow: var(--shadow-default, 0 1px 3px rgba(0,0,0,0.08));
  margin-bottom: 16px;
}
.er-action-bar h2 {
  font-size: 16px;
  font-weight: 600;
  color: var(--dark, #1d2632);
  margin: 0;
  white-space: nowrap;
}
.er-btn-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ── Botones ── */
.er-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .2s, box-shadow .2s;
  text-decoration: none;
  line-height: 1.4;
}
.er-btn i { font-size: 13px; }
.er-btn--success {
  background: var(--primary, #00b393);
  color: #fff;
  border-color: var(--primary, #00b393);
}
.er-btn--success:hover {
  background: #009e82;
  box-shadow: 0 2px 6px rgba(0,179,147,0.3);
}
.er-btn--danger {
  background: #f05050;
  color: #fff;
  border-color: #f05050;
}
.er-btn--danger:hover {
  background: #e04040;
  box-shadow: 0 2px 6px rgba(240,80,80,0.3);
}
.er-btn--default {
  background: #fff;
  color: var(--dark, #1d2632);
  border-color: #dee2e6;
}
.er-btn--default:hover {
  background: var(--light, #f2f4f6);
  box-shadow: 0 2px 4px rgba(0,0,0,0.06);
}

/* ── Responsive ── */
@media (max-width: 767px) {
  .er-grid { grid-template-columns: 1fr; }
  .er-toolbar { flex-direction: column; align-items: flex-start; }
  .er-action-bar { flex-direction: column; gap: 12px; align-items: flex-start; }
  .er-info-card { flex-direction: column; align-items: center; text-align: center; }
  .er-info-desc { border-left: none; border-top: 3px solid var(--primary, #00b393); padding-left: 0; padding-top: 10px; }
  .er-info-meta { justify-content: center; }
  .er-btn-group { width: 100%; justify-content: flex-start; }
}

/* ── Print ── */
@media print {
  .er-card { box-shadow: none; border: 1px solid #dee2e6; break-inside: avoid; }
  .er-toolbar, .er-action-bar { box-shadow: none; border-bottom: 2px solid #000; border-radius: 0; }
  .er-info-card { box-shadow: none; }
}
