/* ── Felanmälan & uppföljning ─────────────────────────────────────────────── */
:root { --fr-p1: #dc2626; --fr-p2: #f59e0b; --fr-p3: #64748b; }

/* Snabbknapp (maskinsida, /logga) */
.fr-quick { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fr-quick-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 52px; padding: 0 18px; border: none; border-radius: 10px;
  background: var(--fr-p1); color: #fff; font-weight: 800; font-size: .95rem; cursor: pointer; box-shadow: 0 6px 16px rgba(220,38,38,.28); }
.fr-quick-btn:hover { background: #b91c1c; }
.fr-quick-btn.compact { min-height: 40px; padding: 0 14px; font-size: .85rem; }
.fr-badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; background: #fff; color: #0f172a; font-weight: 700; font-size: .78rem;
  text-decoration: none; border: 1px solid rgba(15,23,42,.12); }
.fr-badge.p1 { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
.mskin-hero-cta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.logga-active-actions .fr-quick { margin-left: 2px; }

/* Dialog */
.fr-title { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; flex-wrap: wrap; }
.fr-machine { max-width: 280px; }
.fr-label { font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: #64748b; margin: 6px 0 8px; }
.fr-prio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.fr-prio-btn { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 92px; padding: 12px 14px; border-radius: 14px; cursor: pointer;
  background: #fff; border: 2px solid #e2e8f0; text-align: left; transition: border-color .12s, background .12s, transform .12s; }
.fr-prio-btn b { font-size: 1.6rem; line-height: 1; }
.fr-prio-btn span { font-weight: 800; font-size: 1rem; color: #0f172a; }
.fr-prio-btn small { color: #64748b; font-size: .78rem; }
.fr-prio-btn:hover { transform: translateY(-1px); }
.fr-p1 b { color: var(--fr-p1); } .fr-p2 b { color: var(--fr-p2); } .fr-p3 b { color: var(--fr-p3); }
.fr-p1.on { border-color: var(--fr-p1); background: #fef2f2; } .fr-p2.on { border-color: var(--fr-p2); background: #fffbeb; } .fr-p3.on { border-color: var(--fr-p3); background: #f8fafc; }
.fr-cats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.fr-cat { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 72px; padding: 8px 6px; border-radius: 12px; cursor: pointer;
  background: #fff; border: 2px solid #e2e8f0; font-weight: 700; font-size: .82rem; color: #0f172a; text-align: center; }
.fr-cat .mud-icon-root { color: #64748b; }
.fr-cat.on { border-color: #1d4ed8; background: #eff6ff; } .fr-cat.on .mud-icon-root { color: #1d4ed8; }
.fr-extra { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.fr-photo { position: relative; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border-radius: 10px; border: 1px dashed #94a3b8;
  font-weight: 700; color: #334155; cursor: pointer; overflow: hidden; }
.fr-photo input[type=file], .term-photo input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.fr-thumb { height: 56px; width: 56px; object-fit: cover; border-radius: 8px; border: 1px solid #e2e8f0; }
.fr-scrap { max-width: 200px; }
.fr-send { min-height: 52px; font-weight: 800 !important; padding: 0 22px !important; }
@media (max-width: 600px) { .fr-cats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .fr-prio-btn { min-height: 80px; } }

/* Terminal */
.term-fault-prio .term-chip { min-width: 150px; }
.term-chip.fr-tp1.on { background: #b91c1c; border-color: #f87171; }
.term-chip.fr-tp2.on { background: #b45309; border-color: #fbbf24; }
.term-chip.fr-tp3.on { background: #334155; border-color: #94a3b8; }
.term-photo { position: relative; display: inline-flex; align-items: center; gap: 8px; overflow: hidden; align-self: flex-start; }

/* Tavla */
.fb-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.fb-f { max-width: 240px; }
.fb-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.fb-chip { border: 1px solid #e2e8f0; background: #fff; border-radius: 999px; padding: 6px 12px; font-weight: 700; font-size: .8rem; color: #334155; cursor: pointer; }
.fb-chip.on { background: #0f172a; color: #fff; border-color: #0f172a; }
.fb-chip-p1.on { background: var(--fr-p1); border-color: var(--fr-p1); }
.fb-chip-p2.on { background: var(--fr-p2); border-color: var(--fr-p2); }
.fb-chip-late.on { background: #991b1b; border-color: #991b1b; }
.fb-board { display: grid; grid-template-columns: repeat(6, minmax(185px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.fb-col { background: #f1f5f9; border-radius: 14px; padding: 10px; min-height: 160px; display: flex; flex-direction: column; gap: 8px; }
.fb-col header { display: flex; justify-content: space-between; align-items: center; font-weight: 800; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: #475569; padding: 2px 4px; }
.fb-col header em { font-style: normal; background: #fff; border-radius: 999px; padding: 1px 9px; color: #0f172a; }
.fb-col-5 { background: #f0fdf4; }
.fb-empty { color: #94a3b8; text-align: center; padding: 14px 0; }
.fb-card { display: flex; flex-direction: column; gap: 6px; text-align: left; width: 100%; background: #fff; border: 1px solid #e2e8f0; border-left: 4px solid var(--fr-p3);
  border-radius: 10px; padding: 10px 12px; cursor: pointer; box-shadow: 0 1px 2px rgba(15,23,42,.05); transition: box-shadow .12s, transform .12s; color: inherit; font: inherit; }
.fb-card:hover { box-shadow: 0 8px 20px rgba(15,23,42,.08); transform: translateY(-1px); }
.fb-card-p1 { border-left-color: var(--fr-p1); } .fb-card-p2 { border-left-color: var(--fr-p2); }
.fb-card.late { background: #fff7f7; }
.fb-card-top { display: flex; gap: 6px; align-items: center; font-size: .78rem; color: #64748b; }
.fb-num { font-weight: 700; } .fb-mach { margin-left: auto; font-weight: 700; color: #334155; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60%; }
.fb-card-title { font-weight: 700; font-size: .9rem; color: #0f172a; line-height: 1.3; }
.fb-card-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: .75rem; color: #475569; }
.fb-card-foot { display: flex; justify-content: space-between; gap: 6px; font-size: .75rem; color: #475569; border-top: 1px solid #f1f5f9; padding-top: 6px; }
.fb-prio { display: inline-block; padding: 1px 7px; border-radius: 6px; font-weight: 800; font-size: .72rem; color: #fff; background: var(--fr-p3); }
.fb-p1 { background: var(--fr-p1); } .fb-p2 { background: var(--fr-p2); }
.fb-tag { display: inline-block; padding: 1px 7px; border-radius: 6px; font-weight: 700; font-size: .7rem; background: #e2e8f0; color: #334155; }
.fb-tag.rc { background: #fef3c7; color: #92400e; } .fb-tag.a3 { background: #dbeafe; color: #1e40af; }
.fb-a3sug { margin-left: 6px; font-size: .7rem; font-weight: 800; color: #1e40af; background: #dbeafe; border-radius: 6px; padding: 0 6px; }
.fb-status { font-weight: 700; font-size: .8rem; } .fb-status.rc { color: #92400e; }
.fb-late { color: #dc2626; font-weight: 700; } .fb-muted { color: #64748b; }
.fb-row { cursor: pointer; }
.fb-a3row { display: grid; grid-template-columns: 80px minmax(0, 1fr) 90px 150px 200px; gap: 10px; align-items: center; padding: 10px 6px; border-bottom: 1px solid #f1f5f9; color: inherit; text-decoration: none; }
.fb-a3row:hover { background: #f8fafc; }
.fb-a3title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fb-settings { padding: 16px; max-width: 980px; }
@media (max-width: 800px) { .fb-a3row { grid-template-columns: 70px 1fr; } .fb-a3row > :nth-child(n+3) { grid-column: 2; } }

.fb-card, .fb-card > * { text-align: left !important; }
.fb-card { align-items: stretch !important; justify-content: flex-start !important; }
.fb-card-meta, .fb-card-top { justify-content: flex-start !important; }

/* Detalj */
.fd { display: flex; flex-direction: column; gap: 10px; }
.fd-title { font-size: 1.15rem; font-weight: 800; margin: 0; color: #0f172a; }
.fd-meta { display: flex; flex-wrap: wrap; gap: 12px; color: #64748b; font-size: .8rem; align-items: center; }
.fd-meta span { display: inline-flex; align-items: center; gap: 4px; }
.fd-desc { margin: 0; white-space: pre-wrap; }
.fd-photo { max-width: 100%; max-height: 280px; object-fit: contain; border-radius: 10px; border: 1px solid #e2e8f0; align-self: flex-start; }
.fd-steps { display: flex; list-style: none; margin: 4px 0; padding: 0; gap: 4px; counter-reset: s; }
.fd-steps li { flex: 1; font-size: .68rem; font-weight: 700; color: #94a3b8; text-align: center; padding-top: 10px; border-top: 4px solid #e2e8f0; line-height: 1.2; }
.fd-steps li.done { color: #0f172a; border-top-color: #16a34a; }
.fd-steps li.cur { border-top-color: #1d4ed8; color: #1d4ed8; }
.fd-facts { display: flex; flex-direction: column; gap: 6px; }
.fd-fact { display: grid; grid-template-columns: 130px 1fr; gap: 4px 10px; font-size: .85rem; background: #f8fafc; border-radius: 8px; padding: 8px 10px; }
.fd-fact-l { font-weight: 700; color: #475569; } .fd-fact .fd-when { grid-column: 2; }
.fd-when { color: #94a3b8; font-size: .72rem; }
.fd-actions { display: flex; flex-direction: column; gap: 8px; border: 1px solid #e2e8f0; border-radius: 12px; padding: 12px; }
.fd-btnrow { display: flex; flex-wrap: wrap; gap: 8px; }
.fd-confirm { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; background: #f0fdf4; border-radius: 10px; padding: 10px; font-weight: 600; }
.fd-confirm span { flex: 1 1 200px; }
.fd-h { font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: #64748b; margin: 10px 0 0; }
.fd-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; align-items: center; }
.fd-links { display: flex; flex-direction: column; gap: 6px; }
.fd-links a { display: inline-flex; align-items: center; gap: 6px; color: #1d4ed8; text-decoration: none; font-weight: 600; font-size: .85rem; }
.fd-sub { font-size: .75rem; color: #64748b; font-weight: 700; }
.fd-tl, .fd-time { display: grid; grid-template-columns: 90px 70px 1fr 60px; gap: 6px; font-size: .8rem; padding: 4px 6px; border-radius: 6px; color: inherit; text-decoration: none; }
.fd-tl:hover { background: #f8fafc; } .fd-tl.linked { background: #eff6ff; }
.fd-log { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.fd-log li { display: flex; flex-direction: column; gap: 1px; font-size: .85rem; border-left: 3px solid #e2e8f0; padding: 2px 0 2px 10px; }
.fd-log li.status { border-left-color: #1d4ed8; }

/* KPI */
.fk-period { display: flex; gap: 6px; margin-bottom: 8px; }
.fk-h { font-size: .8rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: #64748b; margin: 18px 0 8px; }
.fk-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.fk-tile { display: flex; flex-direction: column; gap: 2px; background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 12px 14px; }
.fk-tile b { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; color: #0f172a; }
.fk-l { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #64748b; }
.fk-p1 { border-top: 3px solid var(--fr-p1); } .fk-p2 { border-top: 3px solid var(--fr-p2); } .fk-p3 { border-top: 3px solid var(--fr-p3); }
.fk-tile.warn { background: #fffbeb; border-color: #fde68a; }
.fk-rec { display: grid; grid-template-columns: minmax(160px, 2fr) 3fr 40px 110px; gap: 10px; align-items: center; padding: 6px 4px; color: inherit; text-decoration: none; font-size: .85rem; border-radius: 8px; }
.fk-rec:hover { background: #f8fafc; }
.fk-bar { height: 10px; background: #f1f5f9; border-radius: 99px; overflow: hidden; } .fk-bar i { display: block; height: 100%; background: #f59e0b; border-radius: 99px; }
.fk-trend { display: flex; align-items: flex-end; gap: 14px; height: 220px; padding: 10px 4px 0; }
.fk-trend-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; }
.fk-trend-bar { width: 100%; max-width: 64px; background: linear-gradient(180deg, #fdb912, #f59e0b); border-radius: 8px 8px 2px 2px; min-height: 2px; }
.fk-trend-val { font-size: .75rem; font-weight: 700; color: #334155; }
.fk-trend-lbl { font-size: .75rem; color: #475569; font-weight: 700; }
.fk-trend-sub { font-size: .68rem; color: #94a3b8; }

/* A3 */
.a3-back { color: inherit; text-decoration: none; }
.a3-title input { font-size: 1.6rem !important; font-weight: 800 !important; letter-spacing: -.02em; }
.a3-title { min-width: min(720px, 90vw); }
.a3-meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; font-size: .85rem; }
.a3-meta a { color: #1d4ed8; font-weight: 600; text-decoration: none; }
.a3-head { display: grid; grid-template-columns: 220px 220px 180px 1fr; gap: 10px; align-items: center; padding: 12px 16px; margin-bottom: 14px; }
.a3-sheet { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.a3-col { display: flex; flex-direction: column; gap: 14px; }
.a3-sec { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 12px 14px; }
.a3-sec h3 { margin: 0 0 8px; font-size: 1rem; font-weight: 800; display: flex; align-items: center; gap: 8px; color: #0f172a; }
.a3-sec h3 em { font-style: normal; display: inline-flex; width: 24px; height: 24px; align-items: center; justify-content: center; border-radius: 50%; background: #fdb912; color: #0f172a; font-size: .8rem; }
.a3-sub { font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: #64748b; margin: 8px 0 4px; }
.a3-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; }
.a3-whys { display: flex; flex-direction: column; gap: 2px; }
.a3-why { display: grid; grid-template-columns: 90px 1fr; gap: 8px; align-items: center; }
.a3-why span { font-weight: 800; color: #c2410c; font-size: .8rem; }
.a3-fish { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.a3-bone span { font-size: .72rem; font-weight: 800; color: #475569; text-transform: uppercase; }
.a3-spine { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; background: #0f172a; color: #fff; border-radius: 8px; padding: 8px 12px; position: relative; }
.a3-spine span { font-size: .7rem; font-weight: 800; text-transform: uppercase; color: #fdb912; }
.a3-spine::after { content: ""; position: absolute; right: -10px; top: 50%; transform: translateY(-50%); border: 12px solid transparent; border-left-color: #0f172a; border-right: 0; }
.a3-root { margin-top: 10px; }
.a3-actions { display: flex; flex-direction: column; gap: 4px; }
.a3-act { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 1.3fr) 150px 140px 36px; gap: 6px; align-items: center; }
.a3-act-h { font-size: .72rem; font-weight: 800; text-transform: uppercase; color: #64748b; }
.a3-act.done { opacity: .75; } .a3-act.late input { color: #dc2626; }
@media (max-width: 1100px) { .a3-sheet { grid-template-columns: 1fr; } .a3-head { grid-template-columns: 1fr 1fr; } .a3-act { grid-template-columns: 1fr 1fr; } .a3-act-h { display: none; } }
.term-fault-prio .term-chip b { margin-right: .45rem; }
