/* ============================================================
   Page Layout
============================================================ */

.content{
  margin: 18px auto 40px auto;
  display: block;
  gap: 16px;
}

.card{
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 10px 28px rgba(0,0,0,0.06);
}

.card h2{
  margin: 0 0 6px 0;
  font-size: 18px;
  letter-spacing: .2px;
}

.muted{
  color:#667085;
}

/* ============================================================
   Header Card
============================================================ */

.card-header{
  padding: 14px 16px 16px 16px;
}

.header-row{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 14px;
}

.header-left p{
  margin: 0;
}

.header-right{
  display:flex;
  align-items:center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content:flex-end;
}

/* Select kompakt im Header */
.select-compact{
  justify-content:flex-end;
}

.select-compact .ts-wrapper,
.select-compact #stationSelectUploads{
  width: 360px;
  max-width: 100%;
}

/* Hinweiszeilen */
.hint{
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f6f7f9;
  border: 1px solid #eceff3;
  color: #111;
}

/* ============================================================
   KPI Grid v2 (deine gewünschte Struktur)
============================================================ */

.kpi-grid.v2{
  margin-top: 12px;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.kpi-wide{
  grid-column: auto;
  background: #ffffff;
  border: 1px solid #ececec;
  border-radius: 8px;
  padding: 14px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.05);
}

.kpi-top{
  display:flex;
  align-items:center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 10px;
}

/* ✅ NEU: KPI-Top split (Titel links, Status rechts) */
.kpi-top.kpi-top-split{
  justify-content: space-between;
}

.kpi-title{
  font-weight: 900;
  letter-spacing: .2px;
  color: #111;
  padding: 8px;
}

.kpi-split{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.kpi-col{
  background: #fafafa;
  border: 1px solid #f0f0f0;
  border-radius: 8px;
  padding: 12px;
}

.kpi-mini{
  font-size: 12px;
  color: #667085;
  margin-bottom: 6px;
}

.kpi-num{
  font-size: 20px;
  font-weight: 900;
  color:#111;
  line-height: 1;
}

.kpi-subline{
  margin-top: 8px;
  font-size: 12px;
  color:#667085;
}

.kpi-foot{
  margin-top: 10px;
  display:flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.kpi-foot-label{
  color:#667085;
  font-size: 12px;
}

.kpi-foot-value{
  font-weight: 900;
  font-size: 14px;
  color:#111;
}

.kpi-foot-muted{
  color:#98a2b3;
  font-size: 12px;
}

@media (max-width: 700px){
  .header-row{ flex-direction: column; }
  .header-right{ justify-content:flex-start; }
}

/* ============================================================
   Chip
============================================================ */

.chip{
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 12px;
  border: 1px solid transparent;
  white-space: nowrap;
}

.chip-neutral{ background:#f6f7f9; border-color:#eceff3; color:#111; }
.chip-ok{ background:#e9f8ee; border-color:#bfe9cc; color:#116b2c; }
.chip-warn{ background:#fff6e5; border-color:#ffe2a8; color:#7a4b00; }
.chip-bad{ background:#ffe9ea; border-color:#ffb7bc; color:#8a0f17; }

/* ✅ NEU: Chip im KPI-Header kompakter */
.chip.chip-compact{
  padding: 5px 8px;
  line-height: 1;
}

/* Optional: Chip nicht zu breit */
#kpi_queue_status_chip{
	width: 150px;
	text-align: center;
	padding: 10px;
}

/* ============================================================
   Upload Main Window
============================================================ */

.upload-main{
  padding: 18px;
}

.upload-main-head{
  margin-bottom: 12px;
  text-align: center;
}

.upload-placeholder{
  margin-top: 10px;
  padding: 18px;
  border-radius: 8px;
  border: 1px dashed #d6d6d6;
  background: linear-gradient(180deg, #fcfcfd, #fafafa);
  display:flex;
  gap: 12px;
  align-items:center;
}

.upload-placeholder i{
  font-size: 22px;
  color:#667085;
}

.upload-placeholder-title{
  font-weight: 900;
  margin-bottom: 2px;
}

.upload-placeholder-sub{
  color:#667085;
  font-size: 13px;
}

/* ============================================================
   KPI Loader Icon
============================================================ */
.kpi-loading .kpi-num{
  display:flex;
  align-items:center;
  gap: 8px;
  justify-content:flex-start;
}
.kpi-loading .kpi-num::before{
  content: "\f013"; /* fa-gear */
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  display:inline-block;
  animation: uSpin 1.1s linear infinite;
  opacity: .75;
}

/* ============================================================
   Mobile Safety: niemals horizontal scrollen
============================================================ */

html, body{ max-width: 100%; overflow-x: hidden; }
img, video, canvas{ max-width: 100%; height: auto; }

/* ============================================================
   MOBILE (<= 768px): Layout kompakt + block statt grid
============================================================ */
@media (max-width: 768px){
  *{
    box-sizing: border-box;
  }

  .content{
    display: block;
    width: 100%;
    margin: 12px 0 24px 0;
  }

  .card{
    width: 100%;
    padding: 12px;
    border-radius: 10px;
  }

  .header-row{
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .header-right{
    width: 100%;
    justify-content: flex-start;
    gap: 10px;
  }

  .select-container{
    justify-content: flex-start;
  }

  .select-compact .ts-wrapper,
  .select-compact #stationSelectUploads{
    width: 100%;
    max-width: 100%;
  }

  /* Diese Regel war für den alten Header-Chip ok,
     bleibt drin – aber wir überschreiben gezielt für KPI-Chip unten */
  .chip{
    width: 100%;
    border-radius: 5px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .hint{
    border-radius: 10px;
    font-size: 13px;
  }

  /* ✅ NEU: KPI-Status-Chip soll auf Mobile NICHT full-width/full-height sein */
  #kpi_queue_status_chip {
    width: 170px;
    height: auto;
    display: inline-flex;
    padding: 4px 8px;
    border-radius: 8px;
    justify-content: center;
    max-width: 60%;
    padding: 10px;
  }

  .kpi-top.kpi-top-split{
    /* justify-content: center; */
    gap: 10px;
  }
}

/* ============================================================
   MOBILE (<= 768px): KPI stark reduziert
============================================================ */
@media (max-width: 768px){
  .header-left{
    display: none !important;
  }

  .kpi-grid.v2{
    display: block;
    margin-top: 10px;
  }

  .kpi-wide{
    width: 100%;
    padding: 12px;
    margin-top: 10px;
  }

  .kpi-num{ font-size: 22px; }
  .kpi-col{ padding: 10px; }
  .kpi-split{ gap: 8px; }
}
.file-name .name-artist::after { content: " – "; }

@media (max-width: 520px) {
  .file-name .name-artist,
  .file-name .name-title { display: block; }
  .file-name .name-artist::after { content: ""; }
}

@media (max-width: 350px) {
	.kpi-split{
		grid-template-columns: 1fr;
	}
	
	#kpi_queue_status_chip {
		width: 100%;
		max-width: 100%;
		margin-bottom: 5px;
	}
	.kpi-top {
		display: inline;
	}
}

