/* css/components.css */

/* ===== Stats grid (cards) ===== */
.stats-grid{
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

@media (max-width: 991.98px){
  .stats-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.stat-card{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 14px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.stat-icon{
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 1.15rem;
  border: 1px solid rgba(0,0,0,.06);
}

.stat-icon.blue  { background: rgba(37,99,235,.10); color: #1d4ed8; }
.stat-icon.amber { background: rgba(245,158,11,.14); color: #b45309; }
.stat-icon.green { background: rgba(34,197,94,.12); color: #15803d; }
.stat-icon.slate { background: rgba(100,116,139,.14); color: #334155; }
.stat-icon.red   { background: rgba(239,68,68,.12);  color: #b91c1c; }

.stat-value{
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.stat-label{
  font-size: .9rem;
  color: rgba(15,23,42,.62);
  font-weight: 600;
}

/* ===== Filter bar ===== */
.filter-bar{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 12px;
  display: grid;
  grid-template-columns: 1.4fr .8fr .7fr auto;
  gap: 10px;
  align-items: center;
  margin: 12px 0 14px 0;
}

@media (max-width: 991.98px){
  .filter-bar{
    grid-template-columns: 1fr;
  }
}

.search-input{
  position: relative;
}
.search-input i{
  position: absolute;
  top: 50%;
  left: 12px;
  transform: translateY(-50%);
  color: rgba(15,23,42,.55);
  font-size: 1.05rem;
}
.search-input .form-control{
  padding-left: 38px;
  border-radius: 12px;
}

.filter-select{
  width: 100%;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  padding: 0 12px;
  font-weight: 600;
  color: rgba(15,23,42,.85);
}

/* ===== Table container ===== */
.table-container{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.table-container .table{
  margin: 0;
}

.table thead th{
  background: rgba(15,23,42,.03);
  font-weight: 800;
  font-size: .85rem;
  color: rgba(15,23,42,.72);
  border-bottom: 1px solid var(--border);
  padding: 12px 14px;
}

.table tbody td{
  padding: 14px 14px;
  border-bottom: 1px solid rgba(15,23,42,.06);
  vertical-align: middle;
}

.table tbody tr{
  cursor: pointer;
  transition: background .12s ease;
}
.table tbody tr:hover{
  background: rgba(37,99,235,.04);
}

.portierung-id{
  font-weight: 800;
  letter-spacing: .02em;
  font-size: .9rem;
}

.kunde-info{
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.kunde-name{
  font-weight: 800;
}
.kunde-adresse{
  font-size: .85rem;
  color: rgba(15,23,42,.62);
}

.provider-flow{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: rgba(15,23,42,.78);
}
.provider-flow i{
  color: rgba(15,23,42,.35);
}

.rufnummern-badge{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(15,23,42,.05);
  border: 1px solid rgba(15,23,42,.08);
  padding: 3px 10px;
  border-radius: 10px;
  font-weight: 600;
  font-size: .75rem;
  color: rgba(15,23,42,.78);
}

/* ===== Status badge system ===== */
.status-info{
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.status-badge{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 3px 10px;
  border-radius: 10px;
  font-weight: 600;
  font-size: .75rem;
  border: 1px solid rgba(0,0,0,.08);
}
.status-timestamp{
  font-size: .75rem;
  color: rgba(15,23,42,.55);
  font-weight: 600;
}

.status-badge .dot{
  width: 8px;
  height: 8px;
  border-radius: 999px;
  display: inline-block;
}

/* map statuses -> colors */
.status-bearbeitung{
  background: rgba(37,99,235,.10);
  color: #1d4ed8;
}
.status-bearbeitung .dot{ background: #1d4ed8; }

.status-eingereicht{
  background: rgba(99,102,241,.12);
  color: #4f46e5;
}
.status-eingereicht .dot{ background: #4f46e5; }

.status-rueckfrage{
  background: rgba(245,158,11,.16);
  color: #b45309;
}
.status-rueckfrage .dot{ background: #b45309; }

.status-abgeschlossen{
  background: rgba(34,197,94,.12);
  color: #15803d;
}
.status-abgeschlossen .dot{ background: #15803d; }

.status-fehlgeschlagen{
  background: rgba(239,68,68,.12);
  color: #b91c1c;
}
.status-fehlgeschlagen .dot{ background: #b91c1c; }

.status-storniert{
  background: rgba(100,116,139,.18);
  color: #334155;
}
.status-storniert .dot{ background: #334155; }

/* ===== Termine cell ===== */
.termine-cell{
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 700;
}
.termine-cell span{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .86rem;
  color: rgba(15,23,42,.72);
}
.termine-cell .pending{
  color: rgba(15,23,42,.45);
  font-weight: 800;
}

.kein-termin{
  color: rgba(15,23,42,.45);
  font-weight: 800;
}

/* ===== Notiz indicator ===== */
.notiz-indicator{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: rgba(15,23,42,.68);
  font-weight: 700;
}
.notiz-indicator i{
  color: rgba(37,99,235,.65);
}
.notiz-indicator span{
  font-size: .75rem;
  color: rgba(15,23,42,.55);
  font-weight: 600;
}

/* ===== Actions dropdown button ===== */
.action-btn{
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid rgba(15,23,42,.12);
  background: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 3px 10px rgba(16,24,40,.06);
}
.action-btn:hover{
  background: rgba(15,23,42,.03);
}

/* ===== Pagination container ===== */
.pagination-container{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-top: 1px solid rgba(15,23,42,.08);
  background: rgba(15,23,42,.015);
}
.pagination-info{
  font-size: .85rem;
  color: rgba(15,23,42,.6);
  font-weight: 600;
}

/* ===== Mobile cards (dashboard) ===== */
.mobile-card{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 12px;
  cursor: pointer;
}
.mobile-card-header{
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 10px;
}
.mobile-card-body{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 575.98px){
  .mobile-card-body{
    grid-template-columns: 1fr;
  }
}
.mobile-card-label{
  font-size: .78rem;
  color: rgba(15,23,42,.55);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.mobile-card-footer{
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed rgba(15,23,42,.12);
}

/* --- Rufnummern-Spalte (Dashboard) --- */
.rufnummern-cell{
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rufnummern-list{
  font-size: .7rem; /* ✅ kleine Schriftart */
  line-height: 1.25;
  color: rgba(15,23,42,.62);
  font-weight: 700;
}

.rn-label{
  color: rgba(15,23,42,.52);
  font-weight: 800;
  margin-right: 6px;
}

.rn-more{
  letter-spacing: .12em;
  color: rgba(15,23,42,.42);
  font-weight: 900;
}

/* Anlagenanschluss: Hinweis auf weitere Blöcke */
/* rn-extra soll "interaktiv" wirken */
.rn-extra{
  margin-top: 2px;
  color: rgba(37,99,235,.75);
  font-weight: 700;
  cursor: help;
  width: fit-content;
  text-decoration: underline;
  text-decoration-color: rgba(37,99,235,.25);
  text-underline-offset: 3px;
}
.rn-extra:hover{
  color: rgba(37,99,235,.95);
}

/* “...” bei MSN bleibt wie gehabt */
.rn-more{
  letter-spacing: .12em;
  color: rgba(15,23,42,.42);
  font-weight: 900;
}

/* ===== Provider Flow (Text-Variante) ===== */

.provider-flow-pills{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .75rem;
}

.provider-pill{
  padding: 4px 10px;
  border-radius: 8px;
  font-weight: 600;
  border: 1px solid rgba(15,23,42,.10);
  background: rgba(15,23,42,.04);
  color: rgba(15,23,42,.85);
}

/* Optional: visuelle Differenzierung von "von" und "zu" */
.provider-from{
  background: rgba(15,23,42,.05);
}

.provider-to{
  background: rgba(37,99,235,.08);
  color: #1d4ed8;
  border-color: rgba(37,99,235,.15);
}

.provider-flow-pills i{
  font-size: .75rem;
  color: rgba(15,23,42,.45);
}