:root{
  --mz:#ff5901;
  --bg0:#070a10;
  --bg1:#0b1220;
  --line: rgba(140, 170, 210, .18);
  --line2: rgba(140, 170, 210, .12);
  --text:#eaf1fb;
  --muted:#a8b7cd;
  --good:#25c37a;
  --warn:#ffb020;
  --bad:#ff4d4d;
  --off:#73829a;
  --r:18px;
  --shadow: 0 14px 40px rgba(0,0,0,.38);
  --cardH: 486px; /* fast kort-højde */
}

*{ box-sizing:border-box; }

body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color:var(--text);
  background:
    radial-gradient(900px 420px at 12% 0%, rgba(255,89,1,.14), rgba(255,89,1,0) 62%),
    radial-gradient(900px 420px at 88% 0%, rgba(140,180,255,.10), rgba(140,180,255,0) 62%),
    linear-gradient(180deg, var(--bg0), var(--bg1));
  overflow-x:hidden;
}

header{
  position:sticky; top:0; z-index:20;
  background: rgba(7,10,16,.74);
  backdrop-filter: blur(10px);
  border-bottom:1px solid var(--line);
}

.top{
  max-width:1400px; margin:0 auto; padding:12px 16px;
  display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap;
}

.brand{ display:flex; align-items:center; gap:12px; min-width:320px; }

.logoWrap{
  width:46px; height:46px; border-radius:14px;
  border:1px solid rgba(255,89,1,.22);
  background: linear-gradient(180deg, rgba(255,89,1,.10), rgba(255,89,1,.03));
  box-shadow: 0 10px 26px rgba(255,89,1,.10);
  display:grid; place-items:center; overflow:hidden;
}

.logoWrap img{
  width:38px; height:auto; display:block;
  filter: drop-shadow(0 6px 10px rgba(0,0,0,.25));
}

.titles{ line-height:1.12; }

.titles h1{
  margin:0;
  font-size:14px;
  letter-spacing:.7px;
  text-transform:uppercase;
  font-weight:1000;
}

.titles .sub{
  margin-top:3px;
  font-size:11px;
  color:var(--muted);
  letter-spacing:1.1px;
}

.titles .sub b{ color:var(--text); }

.chips{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; justify-content:flex-end; }

.chip{
  display:flex; align-items:center; gap:8px;
  padding:8px 10px; border-radius:999px;
  border:1px solid var(--line2);
  background: rgba(0,0,0,.14);
  color:var(--muted); font-size:12px;
}

.chip b{ color:var(--text); font-weight:900; }

.dot{
  width:9px; height:9px; border-radius:50%;
  background: var(--good);
  box-shadow: 0 0 0 4px rgba(37,195,122,.10);
}

.dot.bad{
  background: var(--bad);
  box-shadow: 0 0 0 4px rgba(255,77,77,.10);
}

main{ max-width:1400px; margin:0 auto; padding:16px; }

.grid{ display:grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap:14px; }

.card{
  height:var(--cardH);
  border-radius:var(--r);
  border:1px solid var(--line);
  background: linear-gradient(180deg, rgba(15,23,38,.86), rgba(12,20,34,.86));
  box-shadow: var(--shadow);
  overflow:hidden;
  display:flex; flex-direction:column;
  min-width:0;
}

.cardTop{
  padding:14px 14px 12px 14px;
  border-bottom:1px solid var(--line2);
  display:flex; align-items:flex-start; justify-content:space-between; gap:12px;
  min-height:96px;
}

.left{ display:flex; align-items:flex-start; gap:10px; min-width:0; }

.lamp{
  width:12px; height:12px; border-radius:50%; margin-top:6px;
  background: var(--off); box-shadow: 0 0 0 4px rgba(115,130,154,.09);
  flex:0 0 auto;
}

.lamp.good{ background:var(--good); box-shadow:0 0 0 4px rgba(37,195,122,.10); }
.lamp.warn{ background:var(--warn); box-shadow:0 0 0 4px rgba(255,176,32,.10); }
.lamp.bad { background:var(--bad);  box-shadow:0 0 0 4px rgba(255,77,77,.10); }

.name{
  font-weight:1000; font-size:14px; letter-spacing:.2px;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}

.customerLine{
  margin-top:6px; font-size:16px; font-weight:1100;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}

.caseLine{
  margin-top:3px; font-size:13px; font-weight:950; color: var(--mz);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}

.caseLine span{ color: var(--muted); font-weight:850; }

.meta{
  margin-top:4px; font-size:12px; color: var(--muted);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}

.meta b{ color: var(--text); font-weight:900; }

.status{
  padding:7px 12px; border-radius:999px;
  font-size:12px; font-weight:1000; letter-spacing:.6px;
  border:1px solid var(--line2);
  background: rgba(0,0,0,.14);
  color: var(--muted);
  white-space:nowrap;
}

.status.good{ color: var(--good); border-color: rgba(37,195,122,.22); }
.status.warn{ color: var(--warn); border-color: rgba(255,176,32,.22); }
.status.bad { color: var(--bad);  border-color: rgba(255,77,77,.22); }

.body{ padding:14px; display:flex; flex-direction:column; gap:12px; flex:1 1 auto; min-height:0; }
.row2{ display:grid; grid-template-columns: 1fr 1fr; gap:10px; }

.block{
  border:1px solid var(--line2);
  border-radius:16px;
  background: rgba(0,0,0,.12);
  padding:12px;
  min-width:0;
}

.k{ font-size:11px; color: var(--muted); letter-spacing:.9px; text-transform:uppercase; }
.v{ margin-top:6px; font-size:14px; font-weight:950; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

.prodTop{ display:flex; justify-content:space-between; align-items:baseline; gap:10px; }
.prodVal{ font-size:16px; font-weight:1100; }

.bar{
  margin-top:9px;
  height:9px;
  border-radius:999px;
  background: rgba(255,255,255,.06);
  border:1px solid var(--line2);
  overflow:hidden;
}

.fill{
  height:100%;
  width:0%;
  background: linear-gradient(90deg, rgba(255,89,1,.85), rgba(255,89,1,.55));
  transition: width .35s ease;
}

.barMeta{
  margin-top:8px;
  display:flex;
  justify-content:space-between;
  gap:10px;
  font-size:12px;
  color: var(--muted);
}

.barMeta b{ color: var(--text); font-weight:900; }

.etaLine{
  margin-top:8px;
  display:flex;
  justify-content:space-between;
  gap:10px;
  font-size:12px;
  color: var(--muted);
}

.etaLine b{ color: var(--text); font-weight:900; }

.effTop{ display:flex; justify-content:space-between; align-items:baseline; gap:10px; }
.effPct{ font-size:18px; font-weight:1100; }

.note{
  margin-top:auto;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  min-height:56px;
}

.noteText{
  min-width:0;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  font-weight:850;
  font-size:13px;
  opacity:.92;
}

.tag{
  padding:6px 12px;
  border-radius:999px;
  font-size:12px;
  font-weight:1000;
  border:1px solid var(--line2);
  background: rgba(0,0,0,.10);
  color: var(--muted);
  white-space:nowrap;
}

.tag.alarm{ color: var(--bad); border-color: rgba(255,77,77,.24); }
.tag.obs{ color: var(--warn); border-color: rgba(255,176,32,.24); }

@media (max-width:1100px){
  .grid{ grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width:820px){
  .grid{ grid-template-columns: 1fr; }
  .row2{ grid-template-columns: 1fr; }
  :root{ --cardH: 520px; }
}

/* =========================================================
   Work UI (only affects /work pages – does not change dashboard)
   ========================================================= */

.work-wrap{
  min-height: calc(100vh - 40px);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 30px 16px;
}

.work-container{
  width: 100%;
  max-width: 1500px;
}

.work-title{
  margin: 0 0 14px 0;
  text-align: center;
  font-size: 20px;
  letter-spacing: .2px;
}

.work-card{
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(0,0,0,0.25);
  box-shadow: 0 14px 36px rgba(0,0,0,.35);
  backdrop-filter: blur(4px);
  padding: 12px;
}

.work-row{ margin-top: 10px; }

.work-muted{
  color: rgba(255,255,255,.70);
  font-size: 13px;
}

.work-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
  margin-top:10px;
}

.work-input, .work-select{
  width: min(560px, 100%);
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(7,10,16,.55);
  color: rgba(255,255,255,.92);
  outline: none;
}

.work-input::placeholder{ color: rgba(255,255,255,.45); }

.work-btn{
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.16);
  background: linear-gradient(180deg, rgba(255,89,1,.95), rgba(255,89,1,.72));
  color: #120a02;
  font-weight: 700;
  letter-spacing: .2px;
  cursor: pointer;
  text-decoration: none;
  display:inline-block;
}

.work-btn:active{ transform: translateY(1px); }

.work-link{
  display: inline-block;
  margin-top: 18px;
  color: rgba(200,220,255,.92);
  text-decoration: none;
}

.work-link:hover{ text-decoration: underline; }

/* ===== Machine grid: 4 columns ===== */
.machine-grid{
  display: grid;
  grid-template-columns: repeat(4, minmax(240px, 1fr));
  gap: 16px;
  align-items: stretch;
}

.work-card.machine-card{
  display: flex;
  gap: 10px;
  align-items: center;
}

.machine-img{
  width: 84px;
  height: 64px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(0,0,0,0.25);
  flex: 0 0 auto;
}

.machine-meta{ flex: 1 1 auto; min-width: 0; }
.machine-title{ margin: 0; font-size: 1rem; }
.machine-sub{ margin-top: 6px; font-size: .9rem; line-height: 1.3; }

@media (max-width: 1200px){
  .machine-grid{ grid-template-columns: repeat(3, minmax(240px, 1fr)); }
}
@media (max-width: 900px){
  .machine-grid{ grid-template-columns: repeat(2, minmax(240px, 1fr)); }
}
@media (max-width: 560px){
  .machine-grid{ grid-template-columns: 1fr; }
  .work-actions{ flex-direction:column; align-items:stretch; }
  .work-btn{ width:100%; text-align:center; }
}

/* ===== Dashboard: brug mere af skærmen (override) ===== */

/* bredere header-område */
.top{
  max-width: 2900px;
}

/* bredere main */
main{
  max-width: 2200px;
}

/* lidt mere luft når der er mange kort */
.grid{
  gap: 16px;
}

/* valgfrit: hvis du vil have 4 kort pr række på store skærme */
@media (min-width: 1700px){
  .grid{
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

.btn-primary {
  background: transparent;
  color: #ff7a00;
  border: 1px solid #ff7a00;
  padding: 10px 18px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary:hover {
  background: #ff7a00;
  color: #000;
}
