/* ─────────────────────────────────────────────────────────────
   agent-search.css — Hafenagent-Suche Modal
   ───────────────────────────────────────────────────────────── */

.as-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 2100;
  align-items: flex-start;
  justify-content: center;
  padding: 5vh 20px 20px;
  overflow-y: auto;
}
.as-backdrop.visible { display: flex; }

.as-modal {
  background: white;
  border-radius: 10px;
  max-width: 720px;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

.as-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: linear-gradient(135deg, var(--theme-bg-dark, #0d2840) 0%, var(--theme-primary, #1565a8) 100%);
  color: white;
  flex-shrink: 0;
}
.as-header h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
}
.as-close {
  background: rgba(255, 255, 255, 0.15);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.as-close:hover { background: rgba(255, 255, 255, 0.25); }

/* Suchfeld */
.as-search {
  padding: 14px 20px 10px;
  background: #f4f6f8;
  border-bottom: 1px solid #e4e8ee;
  flex-shrink: 0;
}
.as-search input {
  width: 100%;
  padding: 11px 14px;
  font-size: 15px;
  border: 1px solid #d8dee5;
  border-radius: 6px;
  background: white;
  font-family: inherit;
}
.as-search input:focus {
  outline: none;
  border-color: var(--theme-primary, #0d2840);
  box-shadow: 0 0 0 2px rgba(13, 40, 64, 0.12);
}
.as-hint {
  margin-top: 6px;
  font-size: 11px;
  color: #6b7785;
  font-style: italic;
}

/* Body */
.as-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 20px 20px;
  min-height: 200px;
}

/* Empty state */
.as-empty {
  text-align: center;
  padding: 40px 20px;
  color: #6b7785;
}
.as-empty-icon {
  font-size: 36px;
  margin-bottom: 10px;
  opacity: 0.6;
}
.as-empty p {
  margin: 0;
  font-size: 13px;
}

/* Loading */
.as-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 40px 20px;
  color: #6b7785;
  font-size: 13px;
}
.as-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid #d8dee5;
  border-top-color: var(--theme-primary, #0d2840);
  border-radius: 50%;
  animation: as-spin 0.8s linear infinite;
}
@keyframes as-spin { to { transform: rotate(360deg); } }

.as-error {
  background: #f8d7da;
  color: #721c24;
  padding: 12px 14px;
  border-radius: 5px;
  font-size: 13px;
  margin: 12px 0;
  border-left: 3px solid #c44b1c;
}

/* Trefferliste */
.as-results {
  padding-top: 6px;
}

.as-port {
  background: white;
  border: 1px solid #e4e8ee;
  border-radius: 7px;
  padding: 10px 12px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.15s;
}
.as-port:hover {
  border-color: var(--theme-primary, #0d2840);
  box-shadow: 0 2px 8px rgba(13, 40, 64, 0.08);
}

.as-port-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.as-port-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--theme-primary, #0d2840);
}
.as-port-country {
  font-weight: 500;
  color: #6b7785;
}

/* Badges */
.as-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.3px;
  padding: 2px 8px;
  border-radius: 10px;
}
.as-badge-calls    { background: #d4edda; color: #155724; }
.as-badge-no-calls { background: #f4f6f8; color: #6b7785; }
.as-badge-info     { background: #d1ecf1; color: #0c5460; }

/* Agent-Items */
.as-no-agent {
  padding: 8px 10px;
  background: #f4f6f8;
  border-radius: 5px;
  font-size: 12px;
  color: #6b7785;
  font-style: italic;
}

.as-agent {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: #fafbfc;
  border: 1px solid #eef0f3;
  border-radius: 5px;
  margin-top: 6px;
  cursor: pointer;
  transition: all 0.15s;
}
.as-agent:hover {
  background: #f0f7ff;
  border-color: var(--theme-primary, #0d2840);
}
.as-agent:focus { outline: 2px solid var(--theme-primary, #0d2840); outline-offset: 1px; }

.as-agent-main { flex: 1; min-width: 0; }
.as-agent-name {
  font-size: 13px;
  font-weight: 600;
  color: #1a2332;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.as-agent-contact {
  font-size: 11px;
  color: #6b7785;
  margin-top: 1px;
}
.as-agent-quick {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  margin-left: 12px;
}

/* Source-Badge (TUIC / HLC / MS) */
.as-source {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.4px;
  padding: 2px 7px;
  border-radius: 9px;
  background: #e9ecef;
  color: #4a5664;
  margin-left: 4px;
}
.as-source-tuic   { background: #cfe2f3; color: #0d2840; }
.as-source-hlc    { background: #fce5cd; color: #7d3c00; }
.as-source-ms     { background: #d9ead3; color: #275928; }
.as-source-manual { background: #e2d5f0; color: #4a2868; }

/* Detail-Panel (Visitenkarte) */
.as-detail {
  padding: 6px 0;
}
.as-detail-back {
  background: white;
  border: 1px solid #d8dee5;
  color: var(--theme-primary, #0d2840);
  padding: 6px 12px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 12px;
}
.as-detail-back:hover {
  background: #f0f7ff;
  border-color: var(--theme-primary, #0d2840);
}

.as-card {
  background: white;
  border: 1px solid #d8dee5;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}
.as-card-header {
  padding: 14px 18px;
  background: #f4f6f8;
  border-bottom: 1px solid #e4e8ee;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.as-card-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--theme-primary, #0d2840);
}
.as-card-body {
  padding: 14px 18px;
}
.as-card-footer {
  padding: 12px 18px;
  background: #fafbfc;
  border-top: 1px solid #e4e8ee;
}

.as-detail-row {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px solid #f0f2f5;
  align-items: baseline;
}
.as-detail-row:last-child { border-bottom: none; }
.as-detail-label {
  font-size: 11px;
  font-weight: 700;
  color: #6b7785;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.as-detail-value {
  font-size: 13px;
  color: #1a2332;
  word-break: break-word;
}
.as-detail-value a {
  color: var(--theme-primary, #0d2840);
  text-decoration: none;
  font-weight: 600;
}
.as-detail-value a:hover { text-decoration: underline; }

.as-detail-notes {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #f0f2f5;
}
.as-detail-notes-text {
  margin-top: 5px;
  padding: 8px 10px;
  background: #fafbfc;
  border-radius: 5px;
  white-space: pre-wrap;
  font-size: 12px;
  line-height: 1.45;
}

.as-detail-ports {
  margin-top: 8px;
}
.as-detail-port {
  padding: 6px 10px;
  background: white;
  border: 1px solid #e4e8ee;
  border-radius: 5px;
  margin-top: 4px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}
.as-detail-port:hover {
  background: #f0f7ff;
  border-color: var(--theme-primary, #0d2840);
}

/* Anlauf-Liste */
.as-calls {
  padding: 6px 0;
}
.as-call {
  display: grid;
  grid-template-columns: 90px 1fr auto;
  gap: 10px;
  padding: 8px 14px;
  border-bottom: 1px solid #f0f2f5;
  align-items: center;
}
.as-call:last-child { border-bottom: none; }
.as-call-date {
  font-size: 11px;
  font-weight: 600;
  color: #4a5664;
  font-variant-numeric: tabular-nums;
}
.as-call-ship {
  padding-left: 8px;
  border-left: 3px solid #d8dee5;
  font-size: 13px;
}
.as-call-ship strong { color: #1a2332; }
.as-call-label {
  font-size: 10px;
  color: #6b7785;
  background: #f4f6f8;
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 4px;
}
.as-call-times {
  font-size: 11px;
  color: #6b7785;
  font-variant-numeric: tabular-nums;
}
.as-call-turn {
  display: inline-block;
  background: #d1ecf1;
  color: #0c5460;
  padding: 1px 6px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 600;
  margin-left: 4px;
}

/* Mobile */
@media (max-width: 600px) {
  .as-backdrop { padding: 0; }
  .as-modal { max-width: 100%; max-height: 100vh; border-radius: 0; }
  .as-detail-row { grid-template-columns: 1fr; gap: 2px; }
  .as-call { grid-template-columns: 1fr; }
}

/* Header-Button */
.as-trigger-btn {
  background: rgba(255, 255, 255, 0.12);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 6px 12px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.as-trigger-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}
