/* =========================
   Base + Layout (no overlap)
   ========================= */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: -apple-system, system-ui, Segoe UI, Roboto, Arial, sans-serif;
  background: #f6f7f9;
  color: #111;
}

.container { max-width: 980px; margin: 14px auto; padding: 0 12px; }
.card {
  background: #fff;
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: 0 6px 18px rgba(0,0,0,.06);
  overflow: hidden;
}

h2, h3 { margin: 0 0 10px 0; }
.muted { font-size: 13px; opacity: .75; line-height: 1.4; }

/* =============
   Top navigation
   ============= */
.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  background: #111;
  color: #fff;
}
.right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.link { color: #fff; text-decoration: none; font-size: 14px; opacity: .9; }
.link:hover { opacity: 1; }

/* =========
   Forms/UI
   ========= */
label { display: block; font-size: 12px; opacity: .8; margin: 0 0 4px 0; }

input, select, textarea, button {
  width: 100%;
  max-width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 10px;
  font-size: 16px;
  background: #fff;
  color: #111;
}
textarea { min-height: 110px; resize: vertical; }

button[type="submit"]{
  padding: 12px;
  border: 0;
  border-radius: 12px;
  background: #111;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
}
button[type="submit"]:hover { opacity: .95; }

/* Grid: Desktop 2 cols, mobile 1 col */
.grid {
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(0,1fr);
  gap: 12px;
  align-items: start;
}
.grid .full { grid-column: 1 / -1; }
@media (max-width: 760px){
  .grid { grid-template-columns: 1fr; }
}

/* ============
   Notices/alerts
   ============ */
.error { background:#ffe3e3; padding:10px; border-radius:10px; }
.notice { background:#e8f5e9; padding:10px; border-radius:10px; }

/* =====
   Pills
   ===== */
.pill {
  display: inline-block;
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid #ddd;
  text-decoration: none;
  font-size: 13px;
  color: #111;
  background: #fff;
  cursor: pointer;
}
.pill:hover { background:#f3f4f6; }
.pill.danger { border-color:#f0b4b4; }
.pill.danger:hover { background:#ffecec; }
.pill.primary { border-color:#cfd8ff; }
.pill.primary:hover { background:#eef2ff; }

.badge {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid #ddd;
  margin-left: 6px;
  opacity: .85;
}

/* ==========
   Lookup list
   ========== */
.lookup {
  margin-top: 8px;
  border: 1px solid #eee;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}
.lookup-item {
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: 0;
  border-top: 1px solid #f1f1f1;
  background: #fff !important;
  cursor: pointer;
  font-size: 15px;
  color: #111 !important;
}
.lookup-item:first-child { border-top: 0; }
.lookup-item:hover { background: #f6f7f9 !important; }
.lookup-phone { margin-left: 8px; opacity: .7; font-size: 13px; color: rgba(17,17,17,.7) !important; }
.lookup-empty { padding:10px 12px; opacity:.7; font-size:14px; }

/* ==========
   Price box
   ========== */
.pricebox {
  border: 1px dashed #e5e7eb;
  border-radius: 12px;
  padding: 10px;
  background: #fafafa;
}
.pricebox .total { margin-top: 6px; font-size: 18px; font-weight: 800; }

/* ======================
   Upcoming calendar list
   ====================== */
.dayhdr { margin-top: 10px; padding-top: 10px; border-top: 1px solid #eee; font-weight: 800; }

.calrow { display:flex; gap: 10px; padding: 10px 0; border-top: 1px dashed #eee; }
.calleft { width: 230px; font-variant-numeric: tabular-nums; opacity: .92; }
.calright { flex: 1; min-width: 0; }

@media (max-width: 760px){
  .calrow { flex-direction: column; }
  .calleft { width: auto; }
}

.cal-actions { margin-top: 8px; display:flex; gap:8px; align-items:center; flex-wrap: wrap; }

.badge.cancelled {
  border-color: #f0b4b4;
  background: #ffecec;
  color: #b00020;
}

/* Cancelled styling */
.is-cancelled { opacity: 0.82; }
.is-cancelled .calleft,
.is-cancelled .calright { text-decoration: line-through; }
.is-cancelled .calright strong { color:#b00020; }

/* ==========
   Tables-ish
   ========== */
.listrow { padding: 12px 0; border-top: 1px solid #eee; }
.listrow:first-child { border-top: 0; }
.listtitle { font-weight: 800; }
.listsub { margin-top: 4px; font-size: 13px; opacity: .8; line-height: 1.35; }

/* More spacing for machines.php rows */
.row { padding: 16px 0; border-top: 1px solid #eee; }
.row:first-child { border-top: 0; }
.row + .row { margin-top: 10px; }

/* Hard override: never strike through action area in cancelled rows */
.is-cancelled .cal-actions,
.is-cancelled .cal-actions * {
  text-decoration: none !important;
}

.is-cancelled .cal-actions a,
.is-cancelled .cal-actions a.pill {
  text-decoration: none !important;
  display: inline-block;
  color: #111 !important;
}

/* Star rating widget */
.stars {
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 12px;
  background: #fff;
  width: fit-content;
}

.star {
  border: 0;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  padding: 4px 2px;
  cursor: pointer;
  opacity: 0.35;
  color: #111;
}

.star:hover { opacity: 0.9; }

/* active stars (left-to-right) */
.stars .star { opacity: 0.35; }
.stars[data-value="0"] .star { opacity: 0.35; }

.stars[data-value="1"] .star[data-star="1"] { opacity: 1; }
.stars[data-value="2"] .star[data-star="1"],
.stars[data-value="2"] .star[data-star="2"] { opacity: 1; }
.stars[data-value="3"] .star[data-star="1"],
.stars[data-value="3"] .star[data-star="2"],
.stars[data-value="3"] .star[data-star="3"] { opacity: 1; }
.stars[data-value="4"] .star[data-star="1"],
.stars[data-value="4"] .star[data-star="2"],
.stars[data-value="4"] .star[data-star="3"],
.stars[data-value="4"] .star[data-star="4"] { opacity: 1; }
.stars[data-value="5"] .star[data-star="1"],
.stars[data-value="5"] .star[data-star="2"],
.stars[data-value="5"] .star[data-star="3"],
.stars[data-value="5"] .star[data-star="4"],
.stars[data-value="5"] .star[data-star="5"] { opacity: 1; }

/* Color scale: 1 red -> 5 green */
.stars[data-value="1"] .star { color: #b00020; }
.stars[data-value="2"] .star { color: #b85c00; }
.stars[data-value="3"] .star { color: #7a6b00; }
.stars[data-value="4"] .star { color: #0a5a22; }
.stars[data-value="5"] .star { color: #0a5a22; }

.star-clear {
  margin-left: 6px;
  font-size: 16px;
  opacity: 0.6;
}
.star-clear:hover { opacity: 1; }

/* machines.php: more spacing within each machine block */
.rowhead { gap: 14px; }
.row-title { line-height: 1.25; }
.row-actions { gap: 10px; margin-top: 4px; }

.row-sub { margin-top: 10px; }        /* Abstand Kategorie/Puffer/Preis */
.row form.grid { margin-top: 14px !important; }  /* Abstand zur Edit-Form */