.alerts-launcher {
  position: fixed;
  right: 12px;
  bottom: 54px;
  z-index: 1400;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 0;
  border-radius: 999px;
  padding: 11px 16px;
  background: #0d4057;
  color: #fff;
  box-shadow: 0 3px 14px rgba(0,0,0,.28);
  font: 700 14px/1 system-ui, sans-serif;
  cursor: pointer;
}
.alerts-launcher:hover { background: #14617e; }
.alerts-count {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #f0aa3c;
  color: #16222b;
  font-size: 12px;
}
.alerts-panel {
  position: fixed;
  z-index: 1500;
  right: 12px;
  bottom: 104px;
  display: flex;
  flex-direction: column;
  width: min(410px, calc(100vw - 24px));
  max-height: min(76vh, 680px);
  overflow: hidden;
  border: 1px solid rgba(12,37,52,.18);
  border-radius: 15px;
  background: #f8fbfc;
  color: #17252d;
  box-shadow: 0 8px 32px rgba(0,0,0,.3);
  font: 14px/1.45 system-ui, sans-serif;
}
.alerts-panel[hidden], .alerts-form[hidden], .alert-suggestions[hidden] { display: none !important; }
.alerts-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 17px;
  background: #0d2735;
  color: #fff;
}
.alerts-panel-header h2 { margin: 0; font-size: 18px; }
.alerts-close {
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 25px;
  line-height: 1;
  cursor: pointer;
}
.alerts-toolbar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 12px;
  border-bottom: 1px solid #d9e2e6;
}
.alerts-toolbar select, .alerts-form input, .alerts-form textarea {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  border: 1px solid #bdcbd1;
  border-radius: 8px;
  padding: 9px 10px;
  background: #fff;
  color: #17252d;
  font: inherit;
}
.alerts-toolbar button, .alerts-primary, .alerts-secondary {
  border: 0;
  border-radius: 8px;
  padding: 10px 12px;
  font: 700 13px system-ui, sans-serif;
  cursor: pointer;
}
.alerts-toolbar button, .alerts-primary {
  background: #0d526d;
  color: #fff;
}
.alerts-secondary {
  background: #e4edf0;
  color: #17313e;
}
.alerts-toolbar .alerts-new { grid-column: 1 / -1; }
.alerts-message {
  margin: 12px;
  border-radius: 9px;
  padding: 10px 12px;
  background: #e7f0f3;
  color: #29434f;
}
.alerts-message[hidden] { display: none !important; }
.alerts-auth-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}
.alerts-signin, .alerts-retry {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  box-sizing: border-box;
  border: 0;
  border-radius: 8px;
  padding: 8px 12px;
  font: 700 13px system-ui, sans-serif;
  text-decoration: none;
  cursor: pointer;
}
.alerts-signin {
  background: #0d526d;
  color: #fff;
}
.alerts-signin:hover { background: #14617e; }
.alerts-retry {
  background: #dce8ec;
  color: #17313e;
}
.alerts-retry:hover { background: #cbdde3; }
.alerts-message[data-kind="error"] { background: #fff0ee; color: #8b2e25; }
.alerts-message[data-kind="success"] { background: #e7f5ed; color: #21623b; }
.alerts-list {
  display: grid;
  gap: 9px;
  overflow: auto;
  padding: 0 12px 12px;
}
.alert-card {
  border: 1px solid #d6e0e4;
  border-left: 4px solid #6c8794;
  border-radius: 10px;
  padding: 11px;
  background: #fff;
}
.alert-card[data-priority="Urgente"] { border-left-color: #c62828; }
.alert-card[data-priority="Alta"] { border-left-color: #ef6c00; }
.alert-card[data-priority="Media"] { border-left-color: #e5a400; }
.alert-card[data-priority="Baja"] { border-left-color: #35845d; }
.alert-card-title {
  margin: 0 0 4px;
  color: #17252d;
  font-size: 15px;
  line-height: 1.3;
}
.alert-card-meta {
  margin: 3px 0;
  color: #526771;
  font-size: 12px;
}
.alert-card-description {
  margin: 7px 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.alert-card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-top: 9px;
}
.alert-card-actions button, .alert-card-actions select {
  border: 1px solid #c5d2d7;
  border-radius: 7px;
  padding: 7px 9px;
  background: #f7fafb;
  color: #17313e;
  font: 600 12px system-ui, sans-serif;
  cursor: pointer;
}
.alert-card-photo { display: inline-block; margin-top: 5px; color: #075b80; }
.alerts-form {
  display: grid;
  gap: 9px;
  overflow: auto;
  padding: 12px;
  border-bottom: 1px solid #d9e2e6;
  background: #eef4f6;
}
.alerts-form label {
  display: grid;
  gap: 4px;
  color: #29434f;
  font-size: 12px;
  font-weight: 700;
}
.alerts-form textarea { min-height: 72px; resize: vertical; }
.alert-selected-asset {
  border-radius: 8px;
  padding: 8px 10px;
  background: #dfeef2;
  color: #123d4d;
  font-size: 12px;
}
.alert-suggestions {
  display: grid;
  gap: 4px;
  max-height: 170px;
  overflow: auto;
}
.alert-suggestion {
  width: 100%;
  border: 1px solid #d1dde1;
  border-radius: 7px;
  padding: 7px 9px;
  background: #fff;
  text-align: left;
  color: #17313e;
  cursor: pointer;
}
.alert-suggestion:hover { background: #e7f2f5; }
.alerts-form-buttons { display: flex; gap: 8px; }
.alerts-empty {
  padding: 18px 12px;
  color: #526771;
  text-align: center;
}
@media (max-width: 600px) {
  .alerts-launcher { right: 10px; bottom: 46px; padding: 10px 14px; }
  .alerts-panel {
    right: 8px;
    bottom: 94px;
    width: calc(100vw - 16px);
    max-height: min(74vh, 640px);
  }
}

.alert-card-actions .alert-delete {
  border-color: #e5aaa4;
  background: #fff4f2;
  color: #8b2e25;
}
.alert-card-actions .alert-delete:hover { background: #ffe2de; }
