/* ── Print helpers ─────────────────────────────────────────────────────── */
.no-print { }
.print-only { display: none !important; }

@media print {
    /* Dölj navigation, appbar, knappar */
    .mud-appbar,
    .mud-drawer,
    .mud-overlay,
    .no-print { display: none !important; }

    /* Visa print-header */
    .print-only { display: block !important; }

    /* Nollställ marginaler */
    body { background: #fff !important; margin: 0 !important; }
    .mud-main-content { padding: 0 !important; }

    /* Diagram – tillåt sidbrytning */
    .mud-paper { break-inside: avoid; box-shadow: none !important; border: 1px solid #eee !important; }
    .mud-grid { break-inside: avoid; }

    /* KPI-kort mer kompakta */
    .rpt-kpi { padding: 8px 12px !important; }

    /* Tabeller – visa fulla utan scroll */
    .mud-table-container { overflow: visible !important; max-height: none !important; height: auto !important; }
}

/* ── Reset ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body {
    margin: 0; padding: 0;
    font-family: 'Roboto', Arial, 'Segoe UI', sans-serif;
    font-size: 14px;
    background: #f4f4f4;
}

/* ── MudBlazor layout fixes ───────────────────────────────────────────── */
.mud-main-content { overflow-y: auto; }

/* ── AppBar – guldton shadow ─────────────────────────────────────────── */
.mud-appbar {
    box-shadow: 0 2px 8px rgba(0,0,0,.18) !important;
    border-bottom: 2px solid hsl(43,98%,38%) !important;
}
.mud-appbar .mud-button-root:hover {
    background: rgba(0,0,0,.1) !important;
    border-radius: 4px;
}

/* ── Mobile Navigation Toggle ───────────────────────────────────────────── */
/* Desktop - visa bara desktop-nav */
.mobile-menu-btn {
    display: none !important;
}
.desktop-nav {
    display: flex !important;
    align-items: center;
    gap: 2px;
}
.desktop-emoji {
    display: inline-block !important;
    font-size: 2rem;
    line-height: 1;
}
.app-title {
    display: flex;
    align-items: center;
    gap: 12px;
}
.title-wrapper {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}
.title-main {
    font-family: 'Roboto', Arial, sans-serif;
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: 0.8px;
    color: #1a1a1a;
}
.title-sub {
    font-family: 'Roboto', Arial, sans-serif;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 1.4px;
    color: #3a3a3a;
    text-transform: uppercase;
}
.main-appbar {
    min-height: 64px !important;
}
.nav-btn {
    font-family: 'Roboto', Arial, sans-serif !important;
    font-weight: 700 !important;
    font-size: 0.88rem !important;
    letter-spacing: 0.5px !important;
    color: #1a1a1a !important;
    min-width: 0 !important;
    padding: 6px 14px !important;
}
.nav-divider {
    width: 1px;
    height: 28px;
    background: rgba(0, 0, 0, 0.25);
    margin: 0 6px;
}
.mobile-drawer {
    width: 280px;
}

/* ══════════════════════════════════════════════════════════════════════════
   MACHINE PANEL – omdesignad maskinväljare
══════════════════════════════════════════════════════════════════════════ */

/* Yttre panel-behållare */
.machine-panel {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
}

/* Status-strip överst i panelen */
.msel-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    font-size: 0.84rem;
    border-bottom: 1px solid #f0f4f8;
    min-height: 36px;
}
.msel-idle {
    background: #f8f9fb;
    color: #8a94a6;
}
.msel-idle-icon { font-size: 0.9rem; opacity: 0.6; }
.msel-idle-text { font-size: 0.83rem; color: #8a94a6; letter-spacing: 0.01em; }
.msel-active {
    background: #f0f7ff;
    border-bottom-color: #d0e8ff;
}
.msel-pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    flex-shrink: 0;
    box-shadow: 0 0 0 0 rgba(34,197,94,.5);
    animation: msel-pulse-anim 2.2s ease-in-out infinite;
}
@keyframes msel-pulse-anim {
    0%   { box-shadow: 0 0 0 0 rgba(34,197,94,.5); }
    60%  { box-shadow: 0 0 0 6px rgba(34,197,94,0); }
    100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}
.msel-text { color: #1e3a5f; font-size: 0.85rem; }
.msel-grp {
    padding: 2px 9px;
    border-radius: 20px;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.3px;
}
.msel-hint {
    margin-left: auto;
    font-size: 0.72rem;
    color: #b0bac8;
    font-style: italic;
    white-space: nowrap;
}

/* Maskinlist */
.machine-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 14px 12px;
    background: #fff;
    border-bottom: none;
}

/* Maskingrupp-kort – slank vänsterborderlinje */
.machine-cluster {
    display: flex;
    flex-direction: column;
    background: #fafbfc;
    border-radius: 10px;
    border: 1.5px solid color-mix(in srgb, var(--grp, #9e9e9e) 28%, #e0e4ea);
    border-left: 3px solid var(--grp, #9e9e9e);
    box-shadow: 0 1px 3px rgba(0,0,0,.05);
    overflow: hidden;
    transition: border-color .18s, box-shadow .18s, transform .18s;
}
.machine-cluster.cluster-active {
    background: color-mix(in srgb, var(--grp, #9e9e9e) 6%, #fff);
    border-color: var(--grp, #9e9e9e);
    border-left-color: var(--grp, #9e9e9e);
    border-left-width: 4px;
    box-shadow: 0 4px 14px color-mix(in srgb, var(--grp, #9e9e9e) 22%, transparent);
    transform: translateY(-1px);
}

/* Grupprubrik – liten textlabel, ingen fylld bakgrund */
.cluster-label {
    background: none !important;
    color: var(--grp, #666) !important;
    font-size: 0.68rem !important;
    font-weight: 800;
    text-align: left;
    padding: 6px 10px 2px 11px;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    opacity: 0.85;
    line-height: 1;
}

/* Knapphållare */
.cluster-btns {
    display: flex;
    gap: 5px;
    padding: 6px 8px 8px;
}

/* Maskinknapp */
.mbtn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    width: 136px;
    height: 158px;
    border-radius: 12px;
    border: 1.5px solid color-mix(in srgb, var(--grp, #9e9e9e) 22%, #e0e0e0);
    background: #fff;
    cursor: pointer;
    transition: all .14s ease;
    position: relative;
    padding: 5px 4px 6px;
    box-shadow: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* Maskinbild */
.mbtn-img {
    width: 100%;
    flex: 1;
    background: #f2f4f6;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: background .14s;
}
.mbtn-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
    display: block;
    transition: transform .2s;
}
.mbtn:hover .mbtn-img img { transform: scale(1.05); }

/* Maskinnummer */
.mbtn-num {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--grp, #444);
    line-height: 1;
    padding-bottom: 1px;
}

/* Hover */
.mbtn:hover {
    background: color-mix(in srgb, var(--grp, #9e9e9e) 7%, #fff);
    border-color: color-mix(in srgb, var(--grp, #9e9e9e) 60%, #e0e0e0);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.10);
}
.mbtn:hover .mbtn-img {
    background: color-mix(in srgb, var(--grp, #9e9e9e) 14%, #f0f0f0);
}

/* Vald maskin */
.mbtn.mbtn-selected {
    background: var(--grp, #1976d2);
    border-color: var(--grp, #1565c0);
    box-shadow: 0 4px 14px color-mix(in srgb, var(--grp, #1976d2) 45%, transparent);
    transform: translateY(-1px);
}
.mbtn.mbtn-selected .mbtn-num { color: #fff; }
.mbtn.mbtn-selected .mbtn-img {
    background: color-mix(in srgb, var(--grp, #1976d2) 65%, #000);
}
.mbtn.mbtn-selected .mbtn-img img { filter: brightness(0.82) saturate(0.85); }

/* Checkmark-badge */
.mbtn.mbtn-selected::after {
    content: '✓';
    position: absolute;
    top: -6px;
    right: -6px;
    width: 18px;
    height: 18px;
    background: #fff;
    color: var(--grp, #1976d2);
    border-radius: 50%;
    font-size: 11px;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--grp, #1976d2);
    box-shadow: 0 1px 4px rgba(0,0,0,0.18);
    line-height: 1;
}

/* Bakåtkompatibilitet */
.active-machine-bar { display: none; }
.active-57  { background: #4caf50; color: #fff; border-color: #388e3c; }
.active-58  { background: #1976d2; color: #fff; border-color: #0d47a1; }
.inactive   { background: #fff; color: #555; }
.machine-label { margin-left: 8px; color: #444; font-size: .95rem; }

/* ══════════════════════════════════════════════════════════════════════════
   EXCEL FORM TABLE (top entry row)
══════════════════════════════════════════════════════════════════════════ */
.excel-form-wrap {
    padding: 10px 16px 0;
    background: #fff;
}
.excel-form {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #b0b0b0;
    table-layout: fixed;
}
.excel-form th {
    background: #dce6f1;
    border: 1px solid #b0b0b0;
    padding: 5px 6px;
    font-size: .82rem;
    font-weight: 700;
    text-align: left;
    color: #1a1a1a;
}
.excel-form th:nth-child(1) { width: 100px; }
.excel-form th:nth-child(2) { width: 70px; }
.excel-form th:nth-child(3) { width: 120px; }
.excel-form th:nth-child(4) { width: auto; }
.excel-form th:nth-child(5) { width: 90px; }
.excel-form th:nth-child(6) { width: 180px; }
.excel-form th:nth-child(7) { width: 180px; }
.excel-form th:nth-child(8) { width: 180px; }
.excel-form th:nth-child(9) { width: 100px; }

.form-row td {
    border: 1px solid #b0b0b0;
    padding: 4px 5px;
    vertical-align: middle;
}
.cell-auto {
    background: #f2f2f2;
    font-weight: 600;
    color: #333;
    padding-left: 8px !important;
}
.cell-input {
    width: 100%;
    border: none;
    outline: none;
    font: inherit;
    padding: 3px 5px;
    background: transparent;
}
.cell-input:focus { background: #fffde7; }
.cell-select {
    width: 100%;
    border: none;
    outline: none;
    font: inherit;
    padding: 3px 4px;
    background: transparent;
    cursor: pointer;
}
.cell-desc { color: #333; padding-left: 8px !important; font-style: italic; }
.cell-save { text-align: center; padding: 4px !important; }

.save-btn {
    background: #4caf50;
    color: #fff;
    border: none;
    border-radius: 3px;
    padding: 7px 16px;
    font-size: .95rem;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
}
.save-btn:hover:not(:disabled) { background: #388e3c; }
.save-btn:disabled { background: #aaa; cursor: not-allowed; }

/* ── T-nr autocomplete dropdown ──────────────────────────────────────── */
.ac-wrap { position: relative; }
.ac-list {
    position: absolute;
    z-index: 9999;
    top: 100%;
    left: 0;
    min-width: 400px;
    background: #fff;
    border: 2px solid #1976d2;
    border-top: none;
    margin: 0;
    padding: 0;
    list-style: none;
    box-shadow: 0 6px 16px rgba(0,0,0,.22);
    max-height: 280px;
    overflow-y: auto;
    border-radius: 0 0 4px 4px;
}
.ac-list li {
    padding: 8px 12px;
    cursor: pointer;
    font-size: .92rem;
    border-bottom: 1px solid #eee;
    transition: background .1s;
}
.ac-list li:hover {
    background: #e3f2fd;
}
.ac-list li:hover, .ac-active { background: #e3f2fd !important; }

/* ══════════════════════════════════════════════════════════════════════════
   LOG TABLE SECTION
══════════════════════════════════════════════════════════════════════════ */
.log-section {
    margin: 10px 16px 24px;
    border: 1px solid #b0b0b0;
    border-radius: 2px;
    background: #fff;
}
.log-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 12px;
    background: #dce6f1;
    border-bottom: 1px solid #b0b0b0;
}
.log-title { font-weight: 700; font-size: .95rem; color: #1a3a5e; }
.log-btns  { display: flex; gap: 6px; }
.tbtn {
    padding: 4px 14px;
    border: 1px solid #aaa;
    border-radius: 3px;
    background: #fff;
    font-size: .82rem;
    cursor: pointer;
    font-weight: 600;
}
.tbtn.active { background: #1976d2; color: #fff; border-color: #1976d2; }
.tbtn:hover:not(.active) { background: #e3e3e3; }

.table-scroll { overflow-x: auto; }
.excel-log {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    min-width: 700px;
}
.excel-log th {
    background: #dce6f1;
    border: 1px solid #b0b0b0;
    padding: 5px 7px;
    font-size: .82rem;
    font-weight: 700;
    text-align: left;
    position: sticky;
    top: 0;
}
/* ── Log-tabellen: alla kolumner ── */
/* Kolumn 1: Dag (100px), 2: Tid (60px), 3: T-nr (70px), 4: Beskrivning (auto), 5: Operatör (90px), 
   6: Avvikelse (150px), 7: Kommentar (auto), 8: Maskin (35px!), 9: Actions (110px) */
.excel-log { table-layout: fixed; }
.excel-log th:nth-child(1) { width: 100px; }
.excel-log th:nth-child(2) { width: 60px; }
.excel-log th:nth-child(3) { width: 70px; }
.excel-log th:nth-child(4) { width: auto; }
.excel-log th:nth-child(5) { width: 90px; }
.excel-log th:nth-child(6) { width: 150px; }
.excel-log th:nth-child(7) { width: auto; min-width: 120px; }
.excel-log th:nth-child(8) { width: 35px; text-align: center; }
.excel-log th:nth-child(9) { width: 110px; }

.excel-log td {
    border: 1px solid #d0d0d0;
    padding: 5px 8px;
    font-size: .89rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background .12s;
}

/* Färgkodning per maskingrupp */
.log-57 { background: #e8f5e9; }
.log-58 { background: #e3f2fd; }
.log-grp1 { background: #fff8e1; }   /* 49/50 – gul */
.log-grp2 { background: #fce4ec; }   /* 51/54 – rosa */
.log-grp4 { background: #e8eaf6; }   /* 59/60 – lila */
.log-grp5 { background: #e0f2f1; }   /* 45 – teal */
.log-grp6 { background: #f3e5f5; }   /* 47 – lila */
.log-grp7 { background: #fafafa; }   /* 55 – grå */

/* Hover-effekter */
.excel-log tbody tr:hover td {
    background: rgba(0,0,0,.05) !important;
    cursor: pointer;
}

.tnr-col { font-weight: 700; color: #1a237e; }
.dev-col { color: #c62828; font-weight: 600; }

/* ── Rader med avvikelse = rödaktiga (ljust läge) ── */
.excel-log tr.has-dev td { background: #fdecea; border-color: #f2c5c0; }
.excel-log tr.has-dev td:first-child { box-shadow: inset 4px 0 0 #e53935; }
.excel-log tr.has-dev .dev-col { color: #b71c1c; font-weight: 700; }
.excel-log tbody tr.has-dev:hover td { background: #f9d8d4 !important; }

/* ══════════════════════════════════════════════════════════════════════════
   HISTORIK - KOMPAKT TABELL MED FÖRBÄTTRINGAR
══════════════════════════════════════════════════════════════════════════ */

/* Kompaktare tabell-layout */
.compact-table .mud-table-cell {
    padding: 6px 8px !important;
    font-size: 0.875rem !important;
}

.compact-table .mud-table-head .mud-table-cell {
    font-weight: 700 !important;
    background-color: #f5f5f5 !important;
    border-bottom: 2px solid #e0e0e0 !important;
}

/* Zebra-striping (redan på via Striped="true", men säkerställ) */
.compact-table .mud-table-row:nth-of-type(even) {
    background-color: #fafafa;
}

/* Hover-effekt */
.compact-table .mud-table-row:hover {
    background-color: #e3f2fd !important;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

/* Sticky header */
.compact-table .mud-table-head {
    position: sticky !important;
    top: 0 !important;
    z-index: 10 !important;
    background-color: #f5f5f5 !important;
}

/* Sort-pilar mer synliga */
.compact-table .mud-table-sort-label {
    font-weight: 700 !important;
}

.compact-table .mud-table-sort-label:hover {
    color: #fdb912 !important;
}

/* Quick filter chips */
.mud-chip.mud-chip-size-small {
    cursor: pointer;
    transition: all 0.2s ease;
}

.mud-chip.mud-chip-size-small:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* ══════════════════════════════════════════════════════════════════════════
   STATISTIK - KPI CARDS & GRAFER
══════════════════════════════════════════════════════════════════════════ */

.kpi-card {
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
    border-left: 4px solid transparent;
}

.kpi-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.15) !important;
}

.kpi-card:nth-child(1) { border-left-color: #1976d2; } /* Primary */
.kpi-card:nth-child(2) { border-left-color: #f44336; } /* Error */
.kpi-card:nth-child(3) { border-left-color: #2196f3; } /* Info */
.kpi-card:nth-child(4) { border-left-color: #ff9800; } /* Warning */

.kpi-card .font-weight-bold {
    font-weight: 700 !important;
    line-height: 1.2 !important;
}

/* ══════════════════════════════════════════════════════════════════════════
   RESPONSIVE DESIGN - MOBILE/TABLET
══════════════════════════════════════════════════════════════════════════ */

/* Tablets och mindre (≤1024px) */
@media (max-width: 1024px) {
    html, body {
        font-size: 13px;
    }
    
    .excel-form-wrap, .log-section {
        margin: 8px;
        padding: 8px;
    }
    
    .ac-list {
        min-width: 300px;
        max-height: 200px;
    }
}

/* Mobiler och små tablets (≤768px) */
@media (max-width: 768px) {
    html, body {
        font-size: 12px;
    }
    
    /* ── Mobile Navigation ────────────────────────────────────────────── */
    .mobile-menu-btn {
        display: inline-flex !important; /* Visa på mobil */
        visibility: visible !important;
        pointer-events: auto !important; /* Säkerställ att knappen är klickbar */
        z-index: 1300 !important; /* Högre än drawer och overlay */
        position: relative !important;
    }
    .desktop-nav,
    nav.desktop-nav,
    .mud-appbar .desktop-nav {
        display: none !important; /* Dölj desktop-nav på mobil */
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }
    .desktop-emoji {
        display: none !important; /* Dölj emojin på mobil */
    }
    .mobile-drawer {
        width: 280px !important;
        max-width: 85vw !important;
    }
    
    /* ── Drawer - dölj helt när stängd ────────────────────────── */
    .mud-drawer.mud-drawer--closed {
        transform: translateX(100%) !important;
        visibility: hidden !important;
    }
    .mud-drawer.mud-drawer--open {
        transform: translateX(0) !important;
        visibility: visible !important;
    }
    
    /* ── AppBar - mobilanpassad layout ────────────────────────────────── */
    .main-appbar {
        min-height: 56px !important;
    }
    .mud-appbar {
        min-height: 56px !important;
        padding: 0 8px !important;
    }
    
    /* ── AppBar Title - kompakt layout ────────────────────────────────── */
    .app-title {
        gap: 0 !important;
    }
    .title-main {
        font-size: 0.9rem !important;
        font-weight: 700 !important;
        letter-spacing: 0.3px !important;
    }
    .title-sub {
        font-size: 0.55rem !important;
        letter-spacing: 0.5px !important;
    }
    
    /* Machine panel - mobil */
    .msel-bar { padding: 6px 10px; }
    .msel-hint { display: none; }
    .machine-bar {
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 6px;
        padding: 8px 10px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .machine-bar::-webkit-scrollbar { display: none; }
    .machine-cluster { flex-shrink: 0; }
    .mbtn { width: 90px; height: 108px; }
    .mbtn-num { font-size: 0.9rem !important; }
    
    /* Excel form - scrollbar horisontellt */
    .excel-form-wrap {
        padding: 8px;
        overflow-x: auto;
    }
    .excel-form {
        min-width: 600px;
        font-size: .85rem;
    }
    .excel-form th {
        padding: 6px 4px;
        font-size: .8rem;
    }
    .excel-form td {
        padding: 4px 3px;
    }
    .cell-input, .cell-select {
        font-size: .85rem;
        padding: 4px;
    }
    .save-btn {
        padding: 10px 12px;
        font-size: 1rem;
    }
    
    /* Autocomplete dropdown - mindre bredd */
    .ac-list {
        min-width: calc(100vw - 40px);
        max-width: calc(100vw - 40px);
        left: 50%;
        transform: translateX(-50%);
        max-height: 180px;
        font-size: .85rem;
    }
    .ac-list li {
        padding: 10px 8px;
        white-space: normal;
        word-wrap: break-word;
    }
    
    /* Log section */
    .log-section {
        margin: 10px 8px 16px;
    }
    .log-header {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 10px;
    }
    .log-title {
        font-size: 1rem;
        text-align: center;
    }
    .log-btns {
        justify-content: center;
        flex-wrap: wrap;
    }
    .tbtn {
        padding: 8px 14px;
        font-size: .9rem;
        flex: 1;
        min-width: 80px;
    }
    
    /* Log table - horisontell scroll */
    .table-scroll {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .excel-log {
        min-width: 600px;
        font-size: .8rem;
    }
    .excel-log th {
        padding: 6px 5px;
        font-size: .75rem;
        position: sticky;
        top: 0;
        z-index: 10;
    }
    .excel-log td {
        padding: 6px 5px;
        font-size: .8rem;
    }
    
    /* MudBlazor components - mobilanpassning */
    .mud-table {
        font-size: .85rem !important;
    }
    .mud-table-cell {
        padding: 8px 6px !important;
    }
    .mud-button-root {
        padding: 8px 12px !important;
        font-size: .9rem !important;
    }
    .mud-input {
        font-size: .9rem !important;
    }
    .mud-card {
        margin: 8px !important;
    }
    .mud-card-content {
        padding: 12px !important;
    }
}

/* Små mobiler (≤480px) */
@media (max-width: 480px) {
    html, body {
        font-size: 11px;
    }
    
    /* Machine buttons - ännu större på små skärmar */
    .mbtn {
        padding: 14px 10px;
        font-size: 1.1rem;
    }
    
    /* Excel tables - extra kompakta */
    .excel-form, .excel-log {
        font-size: .75rem;
    }
    .excel-form th, .excel-log th {
        padding: 4px 3px;
        font-size: .7rem;
    }
    .excel-form td, .excel-log td {
        padding: 4px 3px;
    }
    
    /* Buttons - större touch targets */
    .save-btn, .tbtn {
        padding: 12px 16px;
        font-size: 1rem;
        min-height: 44px; /* Apple rekommendation för touch targets */
    }
    
    /* Autocomplete */
    .ac-list {
        max-height: 150px;
        font-size: .8rem;
    }
    
    /* MudBlazor - extra kompakt */
    .mud-table-cell {
        padding: 6px 4px !important;
        font-size: .75rem !important;
    }
    .mud-button-root {
        min-height: 44px !important;
    }
}
.mnr-cell { text-align: center; font-weight: 800; font-size: .95rem; color: #333; }
.mnr-cell-small { text-align: center; font-weight: 800; font-size: .85rem; color: #333; min-width: 30px; width: 30px; max-width: 30px; overflow: hidden; }
  
/* ── Maskinnummer i tabellens th och td (kolumn 8) ── */
.excel-log td:nth-child(8),
.excel-log td.mnr-cell,
.excel-log td.mnr-cell-small { text-align: center; font-weight: 800; width: 60px !important; min-width: 60px !important; max-width: 60px !important; overflow: hidden; padding: 5px 2px !important; }
.excel-log th:nth-child(8),
.excel-log th.mnr-head { text-align: center; width: 60px !important; min-width: 60px !important; max-width: 60px !important; }
.excel-log td.mnr-cell-small b,
.excel-log td:nth-child(8) b { font-size: .85rem; }
  
/* ── Kommentar-kolumn (kolumn 7) bredare ── */
.excel-log td:nth-child(7) { width: auto; min-width: 120px; white-space: normal; word-wrap: break-word; }
  
/* ── Avvikelse-kolumn (kolumn 6) ── */
.excel-log td:nth-child(6) { width: 150px; min-width: 100px; white-space: normal; word-wrap: break-word; }
.mnr-57 { text-align: center; color: #2e7d32; font-weight: 800; font-size: 1rem; }
.mnr-58 { text-align: center; color: #1565c0; font-weight: 800; font-size: 1rem; }
.no-rows { text-align: center; color: #888; padding: 16px; font-style: italic; }

/* ══════════════════════════════════════════════════════════════════════════
   OPERATÖRER - KORT, LEADERBOARD & PROFIL
══════════════════════════════════════════════════════════════════════════ */
.operator-card {
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    height: 100%;
}
.operator-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15) !important;
}

.leaderboard-row {
    border-radius: 8px;
    transition: background-color 0.15s ease;
}
.leaderboard-row:hover {
    background-color: #f5f5f5;
}

.avatar-swatch {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid transparent;
    transition: transform 0.15s ease, border-color 0.15s ease;
}
.avatar-swatch:hover {
    transform: scale(1.15);
}
.avatar-swatch.selected {
    border-color: #333;
    transform: scale(1.15);
}

.kpi-card {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    height: 100%;
}
.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12) !important;
}

/* ── Logga: klickbara rader med edit/delete ── */
.log-clickable { cursor: pointer; }
.log-clickable:hover td { filter: brightness(0.96); }
.log-row-selected td {
    outline: 2px solid #1976d2;
    outline-offset: -2px;
}
.row-actions {
    white-space: nowrap;
    text-align: right;
    padding: 2px 6px !important;
}
.row-btn {
    border: 1px solid #ccc;
    background: #fff;
    border-radius: 4px;
    padding: 2px 8px;
    margin-left: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    line-height: 1.4;
}
.row-btn:hover { background: #f0f0f0; }
.rb-save   { border-color: #2e7d32; }
.rb-cancel { border-color: #999; }
.rb-edit   { border-color: #1976d2; }
.rb-delete { border-color: #c62828; }
.rb-confirm {
    border-color: #c62828;
    background: #c62828;
    color: #fff;
    font-weight: 700;
}
.rb-confirm:hover { background: #a51f1f; }
.log-edit-row td { background: #fff8e1 !important; }
.edit-input {
    border: 1px solid #1976d2 !important;
    border-radius: 3px;
    padding: 2px 6px;
    width: 100%;
    box-sizing: border-box;
}

/* ════════════════════════════════════════════════════════════
   VISNINGSINSTÄLLNINGAR (kugghjulet nere till höger)
   ════════════════════════════════════════════════════════════ */
.app-root { --fs: 1; --pady: 5px; }
.app-root.fs-large  { --fs: 1.18; }
.app-root.fs-xlarge { --fs: 1.38; }
.app-root.density-compact { --pady: 3px; }
.app-root.density-airy    { --pady: 12px; }

/* ── Logga: tabell & formulär skalar ── */
.app-root .excel-log td {
    font-size: calc(.89rem * var(--fs));
    padding: var(--pady) 8px;
}
.app-root .excel-log th {
    font-size: calc(.82rem * var(--fs));
    padding: var(--pady) 7px;
}
.app-root .excel-form th { font-size: calc(.8rem * var(--fs)); }
.app-root .excel-form td { font-size: calc(.9rem * var(--fs)); }
.app-root .cell-input    { font-size: calc(.9rem * var(--fs)); padding: calc(var(--pady) * .8) 8px; }
.app-root .cell-auto     { font-size: calc(.88rem * var(--fs)); }
.app-root .desc-text     { font-size: calc(.9rem * var(--fs)); }
.app-root .save-btn      { font-size: calc(.9rem * var(--fs)); padding: calc(var(--pady) + 3px) 16px; }
.app-root .ac-list li    { font-size: calc(.88rem * var(--fs)); padding: calc(var(--pady) + 2px) 10px; }
.app-root .mbtn          { font-size: calc(1rem * var(--fs)); }
.app-root .log-title     { font-size: calc(.95rem * var(--fs)); }
.app-root .tbtn          { font-size: calc(.82rem * var(--fs)); }
.app-root .row-btn       { font-size: calc(.85rem * var(--fs)); }
.app-root .active-machine-bar { font-size: calc(.9rem * var(--fs)); }

/* Luftig = radbryt långa texter så ALLT syns */
.app-root.density-airy .excel-log td {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    line-height: 1.45;
}

/* ── MudBlazor-tabeller & text skalar (Historik, Verktyg, Statistik…) ── */
.app-root .mud-table-cell {
    font-size: calc(.875rem * var(--fs)) !important;
    padding: calc(var(--pady) + 2px) 12px !important;
}
.app-root .mud-table-cell .mud-typography,
.app-root .mud-typography-body1 { font-size: calc(1rem * var(--fs)); }
.app-root .mud-typography-body2 { font-size: calc(.875rem * var(--fs)); }
.app-root .mud-typography-caption { font-size: calc(.75rem * var(--fs)); }
.app-root .mud-chip { font-size: calc(.8125rem * var(--fs)); }

/* ── Hög kontrast ── */
.app-root.high-contrast .excel-log td {
    border-color: #555;
    color: #000;
    font-weight: 600;
}
.app-root.high-contrast .excel-log th {
    background: #1a3a5e;
    color: #fff;
    border-color: #555;
}
.app-root.high-contrast .log-57   { background: #c8e6c9; }
.app-root.high-contrast .log-58   { background: #bbdefb; }
.app-root.high-contrast .log-grp1 { background: #ffecb3; }
.app-root.high-contrast .log-grp2 { background: #f8bbd0; }
.app-root.high-contrast .log-grp4 { background: #c5cae9; }
.app-root.high-contrast .log-grp5 { background: #b2dfdb; }
.app-root.high-contrast .log-grp6 { background: #e1bee7; }
.app-root.high-contrast .tnr-col  { color: #0d1442; }
.app-root.high-contrast .dev-col  { color: #8e0000; font-weight: 800; }
.app-root.high-contrast .mud-table-cell { color: #000 !important; font-weight: 600; }

/* ── Kugghjul (FAB) ── */
.settings-fab {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 1450;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #1a1a1a;
    font-size: 26px;
    line-height: 1;
    border: 2px solid #fdb912;
    box-shadow: 0 4px 16px rgba(0,0,0,.4);
    cursor: pointer;
    transition: transform .25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
.settings-fab:hover { transform: rotate(45deg) scale(1.06); }
.settings-fab.fab-open { transform: rotate(90deg); }

.settings-overlay {
    position: fixed;
    inset: 0;
    z-index: 1440;
    background: rgba(0,0,0,.18);
}
.settings-panel {
    position: fixed;
    right: 18px;
    bottom: 86px;
    z-index: 1450;
    width: 320px;
    max-width: calc(100vw - 36px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0,0,0,.32);
    padding: 16px 18px 18px;
    animation: panelUp .18s ease;
}
@keyframes panelUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
.sp-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 800;
    font-size: 1.05rem;
    margin-bottom: 12px;
}
.sp-close {
    border: none;
    background: #eee;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: .9rem;
}
.sp-close:hover { background: #ddd; }
.sp-group { margin-bottom: 14px; }
.sp-label {
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #777;
    margin-bottom: 6px;
}
.seg { display: flex; gap: 6px; }
.seg-btn {
    flex: 1;
    padding: 9px 4px;
    border: 1.5px solid #ccc;
    background: #fff;
    border-radius: 9px;
    cursor: pointer;
    font-weight: 600;
    font-size: .85rem;
    transition: all .12s;
}
.seg-btn:hover { border-color: #999; }
.seg-btn.on {
    background: #fdb912;
    border-color: #1a1a1a;
    color: #1a1a1a;
    font-weight: 800;
}
.sp-reset {
    width: 100%;
    padding: 9px;
    border: 1.5px dashed #bbb;
    background: #fafafa;
    border-radius: 9px;
    cursor: pointer;
    font-weight: 600;
    color: #666;
}
.sp-reset:hover { background: #f0f0f0; }

/* Mobil: panelen tar nästan hela bredden, FAB något mindre */
@media (max-width: 600px) {
    .settings-fab { width: 50px; height: 50px; font-size: 23px; right: 14px; bottom: 14px; }
    .settings-panel { right: 14px; left: 14px; width: auto; bottom: 76px; }
}

/* ════════════════════════════════════════════════════════════
   MASKINGRUPPER: grupfärger (49/50, 51/54, 57/58, 59/60, 45, 47, 55)
   ════════════════════════════════════════════════════════════ */
.grp-1 { --grp: #f9a825; }  /* 49/50 gul */
.grp-2 { --grp: #d81b60; }  /* 51/54 rosa */
.grp-3 { --grp: #2e7d32; }  /* 57/58 grön */
.grp-4 { --grp: #5e35b1; }  /* 59/60 lila */
.grp-5 { --grp: #00897b; }  /* 45 teal */
.grp-6 { --grp: #8e24aa; }  /* 47 violett */
.grp-7 { --grp: #546e7a; }  /* 55 blågrå */
.grp-8 { --grp: #0277bd; }  /* P70 blå */
.grp-9 { --grp: #e64a19; }  /* Stora Ventiler orange */

/* Idag / Hela månaden — STÖRRE knappar */
.tbtn {
    padding: 10px 22px !important;
    font-size: 1rem !important;
    border-radius: 8px !important;
    border-width: 2px !important;
}
.log-title { font-size: 1.05rem !important; }

/* ── Sorterbara kolumnhuvuden (Verktyg) ── */
.sort-head { cursor: pointer; user-select: none; font-weight: 700; white-space: nowrap; }
.sort-head:hover { color: #1976d2; text-decoration: underline; }

/* ════════════════════════════════════════════════════════════
   FAB: pill med text "Inställningar"
   ════════════════════════════════════════════════════════════ */
.settings-fab {
    width: auto !important;
    height: auto !important;
    border-radius: 28px !important;
    padding: 12px 20px 12px 16px;
    gap: 8px;
    color: #fdb912;
    font-weight: 800;
    font-size: 1rem !important;
}
.settings-fab .fab-gear { font-size: 22px; line-height: 1; }
.settings-fab .fab-label { color: #fff; font-size: .95rem; letter-spacing: .02em; }
.settings-fab:hover { transform: scale(1.05); }
.settings-fab.fab-open { transform: none; }

/* Innehållet får luft i botten så FAB aldrig täcker sista raden.
   Endast autentiserad shell (MudLayout) — annars blir det en vit/grå gap under landningssidan. */
.mud-layout > .mud-main-content { padding-bottom: 96px !important; }

@media (max-width: 600px) {
    .settings-fab { padding: 10px 16px 10px 13px; }
    .settings-fab .fab-label { font-size: .85rem; }
    .mbtn { width: 90px !important; height: 108px !important; padding: 4px 3px 5px !important; }
}

/* ════════════════════════════════════════════════════════════
   MÖRKT LÄGE (nightmode) — egna tabeller & paneler
   ════════════════════════════════════════════════════════════ */
.app-root.dark-mode { background: #121212; color: #e0e0e0; min-height: calc(100vh - 64px); }

.app-root.dark-mode .machine-panel { background: #1a1a1a; border-bottom-color: #333; }
.app-root.dark-mode .msel-bar { background: #1d1d1d; border-bottom-color: #2a2a2a; }
.app-root.dark-mode .msel-active { background: #162030; border-bottom-color: #1e3a52; }
.app-root.dark-mode .msel-idle { background: #1a1a1a; }
.app-root.dark-mode .msel-idle-text { color: #6a7585; }
.app-root.dark-mode .msel-text { color: #90caf9; }
.app-root.dark-mode .msel-grp { background: #1e3252; color: #64b5f6; }
.app-root.dark-mode .msel-hint { color: #4a5568; }
.app-root.dark-mode .machine-bar { background: #1a1a1a; }
.app-root.dark-mode .machine-cluster { background: #222; border-color: color-mix(in srgb, var(--grp) 30%, #333); border-left-color: var(--grp); }
.app-root.dark-mode .machine-cluster .mbtn { background: #262626; }
.app-root.dark-mode .machine-cluster .mbtn.mbtn-selected { color: #fff; }
.app-root.dark-mode .machine-cluster.cluster-active { background: color-mix(in srgb, var(--grp) 14%, #1d1d1d); }

.app-root.dark-mode .excel-form-wrap,
.app-root.dark-mode .log-section { background: #1d1d1d; border-color: #444; }
.app-root.dark-mode .excel-form th,
.app-root.dark-mode .excel-log th { background: #263238; color: #eceff1; border-color: #444; }
.app-root.dark-mode .excel-form td,
.app-root.dark-mode .excel-log td { border-color: #3a3a3a; color: #e0e0e0; }
.app-root.dark-mode .log-header { background: #263238; border-color: #444; }
.app-root.dark-mode .log-title { color: #90caf9; }
.app-root.dark-mode .tbtn { background: #262626; color: #e0e0e0; border-color: #555; }
.app-root.dark-mode .tbtn.active { background: #1976d2; color: #fff; }
.app-root.dark-mode .cell-input { background: #262626; color: #fff; border-color: #555; }
.app-root.dark-mode .cell-input:focus { background: #30301f; }
.app-root.dark-mode .cell-auto { background: #2a2a2a; color: #b0b0b0; }
.app-root.dark-mode .form-row td { border-color: #444; }
.app-root.dark-mode .excel-form { border-color: #444; }
.app-root.dark-mode .cell-desc { color: #ccc; }
.app-root.dark-mode .cell-measure { background: #3a3520 !important; }
.app-root.dark-mode .save-btn:disabled { background: #3a3a3a; color: #777; }
.app-root.dark-mode .desc-text { color: #e0e0e0; }
.app-root.dark-mode .ac-list { background: #262626; border-color: #555; }
.app-root.dark-mode .ac-list li { color: #e0e0e0; }
.app-root.dark-mode .ac-list li.ac-active,
.app-root.dark-mode .ac-list li:hover { background: #37474f; }

/* Mörka radfärger per grupp */
.app-root.dark-mode .log-57   { background: #1b3320; }
.app-root.dark-mode .log-58   { background: #14283d; }
.app-root.dark-mode .log-grp1 { background: #332b10; }
.app-root.dark-mode .log-grp2 { background: #3a1722; }
.app-root.dark-mode .log-grp4 { background: #221a3a; }
.app-root.dark-mode .log-grp5 { background: #103330; }
.app-root.dark-mode .log-grp6 { background: #2d1633; }
.app-root.dark-mode .log-grp7 { background: #232323; }
.app-root.dark-mode .tnr-col { color: #90caf9; }
.app-root.dark-mode .dev-col { color: #ef9a9a; }

/* ── Rader med avvikelse = rödaktiga (mörkt läge) ── */
.app-root.dark-mode .excel-log tr.has-dev td { background: #3b1512; border-color: #5d2723; }
.app-root.dark-mode .excel-log tr.has-dev td:first-child { box-shadow: inset 4px 0 0 #ef5350; }
.app-root.dark-mode .excel-log tr.has-dev .dev-col { color: #ff8a80; font-weight: 700; }
.app-root.dark-mode .excel-log tbody tr.has-dev:hover td { background: #4a1c18 !important; }

/* Hover i mörkt läge: ljusare istället för mörkare */
.app-root.dark-mode .excel-log tbody tr:hover td { background: rgba(255,255,255,.07) !important; }
.app-root.dark-mode .log-row-selected td { outline-color: #64b5f6; }
.app-root.dark-mode .no-rows { color: #888; }
.app-root.dark-mode .row-btn { background: #262626; color: #e0e0e0; border-color: #555; }
.app-root.dark-mode .log-edit-row td { background: #33301d !important; }

/* MudBlazor-ytor i mörkt läge */
.app-root.dark-mode .mud-paper { background: #1d1d1d; color: #e0e0e0; }
.app-root.dark-mode .mud-table { background: #1d1d1d; color: #e0e0e0; }
.app-root.dark-mode .mud-table-cell { color: #e0e0e0 !important; border-color: #3a3a3a; }
.app-root.dark-mode th.mud-table-cell { background: #263238 !important; color: #eceff1 !important; }
.app-root.dark-mode .mud-typography { color: #e0e0e0; }
.app-root.dark-mode .mud-input,
.app-root.dark-mode .mud-input-slot { color: #fff !important; }
.app-root.dark-mode .mud-alert { background: #263238; color: #e0e0e0; }

/* ════════════════════════════════════════════════════════════
   MOBILFORMULÄR för /logga
   ════════════════════════════════════════════════════════════ */
.mobile-form {
    display: none !important;
}

/* Tvinga desktop-formuläret att visas på skärmar över 768px */
@media (min-width: 769px) {
    .excel-form {
        display: table !important;
    }
    .mobile-form {
        display: none !important;
    }
}

.measure-error {
    color: #c62828;
    font-size: .78rem;
    font-weight: 700;
    margin-top: 4px;
}
.measure-hint {
    color: #666;
    font-size: .75rem;
    margin-top: 3px;
}
.dev-cat-badge {
    display: inline-block;
    background: #ffebee;
    color: #c62828;
    font-weight: 700;
    font-size: .8rem;
    padding: 2px 8px;
    border-radius: 4px;
}


@media (max-width: 600px) {
    .excel-form-wrap {
        padding: 10px;
    }
    .excel-form {
        display: none !important;
    }
    .mobile-form {
        display: block !important;
    }
    .mobile-entry {
        display: flex;
        flex-direction: column;
        gap: 14px;
        background: #fff;
        border: 1px solid #b0b0b0;
        border-radius: 8px;
        padding: 14px;
    }
    .mf-meta {
        display: flex;
        justify-content: space-between;
        font-weight: 700;
        color: #555;
        font-size: 1rem;
        padding-bottom: 8px;
        border-bottom: 1px solid #e0e0e0;
    }
    .mf-field {
        display: flex;
        flex-direction: column;
        gap: 6px;
    }
    .mf-field label {
        font-size: .9rem;
        font-weight: 700;
        color: #1a3a5e;
    }
    .mf-input {
        width: 100%;
        padding: 12px 14px;
        font-size: 1.05rem;
        border: 2px solid #bbb;
        border-radius: 8px;
        outline: none;
        min-height: 48px;
        background: #fff;
    }
    .mf-input:focus {
        border-color: #1976d2;
        background: #fffde7;
    }
    .mf-select {
        cursor: pointer;
        appearance: auto;
    }
    .mf-desc {
        font-style: italic;
        color: #555;
        font-size: .9rem;
    }
    .mf-measure {
        background: #fffacd;
        padding: 12px;
        border-radius: 8px;
        border: 1px solid #fbc02d;
    }
    .mf-measure-input {
        font-weight: 800;
        color: #d84315;
        border-color: #f57f17;
    }
    .mobile-save-btn {
        width: 100%;
        padding: 16px;
        font-size: 1.25rem;
        font-weight: 800;
        color: #fff;
        background: #4caf50;
        border: none;
        border-radius: 10px;
        margin-top: 8px;
        min-height: 56px;
        cursor: pointer;
        box-shadow: 0 4px 12px rgba(76,175,80,.35);
    }
    .mobile-save-btn:disabled {
        background: #aaa;
        box-shadow: none;
        cursor: not-allowed;
    }
    .mobile-save-btn:active:not(:disabled) {
        transform: scale(.98);
    }

    /* Autocomplete på mobil */
    .mobile-ac-list {
        position: fixed;
        top: auto;
        left: 16px;
        right: 16px;
        bottom: 16px;
        min-width: auto;
        max-width: none;
        transform: none;
        max-height: 240px;
        border-radius: 12px;
        box-shadow: 0 8px 24px rgba(0,0,0,.3);
        z-index: 2000;
    }
    .mobile-ac-list li {
        padding: 16px 14px;
        font-size: 1.05rem;
        border-bottom: 1px solid #eee;
    }

    /* Maskinväljaren ännu större på mobil */
    .machine-bar {
        gap: 12px;
        padding: 14px 10px;
    }
    .machine-cluster {
        padding: 10px;
        border-radius: 10px;
    }
    .cluster-btns {
        gap: 10px;
    }
    .mbtn {
        padding: 16px 10px !important;
        font-size: 1.25rem !important;
        min-height: 56px;
        border-radius: 10px !important;
    }

    /* Aktivt tillstånd tydligare */
    .mbtn.mbtn-selected {
        transform: scale(1.02);
        box-shadow: 0 4px 12px rgba(21,101,192,.5);
    }

    /* Logglistan mer kompakt */
    .log-section {
        margin: 10px;
    }
    .log-header {
        padding: 10px;
    }
    .tbtn {
        padding: 10px 14px !important;
        font-size: .95rem !important;
    }
}

@media (max-width: 480px) {
    .mobile-form {
        padding: 12px;
        gap: 12px;
    }
    .mf-input {
        padding: 14px;
        font-size: 1.1rem;
        min-height: 52px;
    }
    .mobile-save-btn {
        padding: 18px;
        font-size: 1.3rem;
        min-height: 60px;
    }
    .mbtn {
        padding: 18px 10px !important;
        font-size: 1.35rem !important;
        min-height: 60px;
    }
    .cluster-label {
        font-size: .85rem !important;
    }
}


/* ══════════════════════════════════════════════════════════════════════════
   AI-VARNING OCH ANALYS-POPUP
══════════════════════════════════════════════════════════════════════════ */

.ai-warning-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
}

.ai-warning-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px 10px;
    border: 2px solid #ccc;
    border-radius: 20px;
    background: #f5f5f5;
    color: #444;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all .2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
    min-width: 40px;
    height: 34px;
}

.ai-warning-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0,0,0,.15);
}

.ai-warning-btn.warning {
    border-color: #f9a825;
    background: #fff8e1;
    color: #7c4d03;
    animation: ai-pulse-warning 2s infinite;
}

.ai-warning-btn.critical {
    border-color: #d32f2f;
    background: #ffebee;
    color: #b71c1c;
    animation: ai-pulse-critical 1.4s infinite;
}

.ai-warning-btn.ok {
    border-color: #388e3c;
    background: #e8f5e9;
    color: #1b5e20;
}

@keyframes ai-pulse-warning {
    0%, 100% { box-shadow: 0 0 0 0 rgba(249, 168, 37, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(249, 168, 37, 0); }
}

@keyframes ai-pulse-critical {
    0%, 100% { box-shadow: 0 0 0 0 rgba(211, 47, 47, 0.5); }
    50% { box-shadow: 0 0 0 10px rgba(211, 47, 47, 0); }
}

.ai-lamp { font-size: 1.1rem; }

.ai-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: #d32f2f;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 800;
}

.ai-hint {
    font-size: 0.82rem;
    color: #666;
}

/* Modal / popup */
.ai-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.55);
    padding: 16px;
}

.ai-modal {
    width: 100%;
    max-width: 680px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,.35);
    overflow: hidden;
}

.ai-modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #1a3a5e 0%, #0d1f33 100%);
    color: #fff;
}

.ai-modal-icon { font-size: 1.6rem; }

.ai-modal-title-wrap { flex: 1; }

.ai-modal-title-wrap h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 800;
}

.ai-modal-subtitle {
    font-size: 0.78rem;
    opacity: 0.85;
}

.ai-modal-close {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,.15);
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background .15s;
}

.ai-modal-close:hover { background: rgba(255,255,255,.3); }

.ai-days-select select {
    padding: 5px 8px;
    border: 1px solid rgba(255,255,255,.4);
    border-radius: 5px;
    background: rgba(0,0,0,.25);
    color: #fff;
    font-size: 0.8rem;
    cursor: pointer;
}

.ai-days-select select option {
    background: #1a3a5e;
    color: #fff;
}

.ai-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f9f9f9;
}

.ai-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 30px;
    color: #555;
}

.ai-spinner { font-size: 2rem; animation: ai-spin 1.2s linear infinite; }

@keyframes ai-spin { 100% { transform: rotate(360deg); } }

.ai-empty {
    padding: 24px;
    text-align: center;
    color: #2e7d32;
    background: #e8f5e9;
    border-radius: 8px;
    font-weight: 600;
}

.ai-insight {
    margin-bottom: 14px;
    padding: 14px;
    border-radius: 8px;
    border-left: 5px solid #999;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
}

.ai-insight:last-child { margin-bottom: 0; }

.ai-insight-critical { border-left-color: #d32f2f; }
.ai-insight-warning { border-left-color: #f9a825; }
.ai-insight-info { border-left-color: #1976d2; }

.ai-insight-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.ai-insight-icon { font-size: 1.1rem; }

.ai-insight-title {
    flex: 1;
    font-weight: 800;
    font-size: 1rem;
    color: #1a1a1a;
}

.ai-insight-count {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    background: #f0f0f0;
    color: #555;
}

.ai-insight-message {
    margin: 0 0 8px 0;
    color: #333;
    line-height: 1.45;
}

.ai-insight-details {
    margin: 8px 0 0 0;
    padding-left: 18px;
    font-size: 0.88rem;
    color: #444;
}

.ai-insight-details li { margin-bottom: 3px; }

.ai-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px;
    background: #fff;
    border-top: 1px solid #e0e0e0;
}

.ai-modal-action {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    background: #1976d2;
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s;
}

.ai-modal-action:hover { background: #1565c0; }

.ai-modal-action.secondary {
    background: #e0e0e0;
    color: #333;
}

.ai-modal-action.secondary:hover { background: #d0d0d0; }

@media (max-width: 600px) {
    .ai-modal { max-height: 92vh; border-radius: 10px; }
    .ai-modal-header { padding: 12px 14px; }
    .ai-modal-body { padding: 14px; }
    .ai-warning-bar { flex-wrap: wrap; gap: 6px; }
    .ai-hint { width: 100%; font-size: 0.75rem; }
}


/* ══════════════════════════════════════════════════════════════════════════
   NOTISKLOCKA
══════════════════════════════════════════════════════════════════════════ */

.notification-bell-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.notification-bell-btn {
    color: #1a1a1a !important;
}

.notification-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: #d32f2f;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    box-shadow: 0 1px 3px rgba(0,0,0,.25);
}

.notification-menu {
    position: absolute;
    top: 46px;
    right: -8px;
    width: 360px;
    max-width: 92vw;
    max-height: 70vh;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,.25);
    z-index: 1100;
    overflow: hidden;
}

.notification-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    background: #1a3a5e;
    color: #fff;
    font-weight: 700;
}

.notification-mark-all {
    border: none;
    background: rgba(255,255,255,.15);
    color: #fff;
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
}

.notification-mark-all:hover { background: rgba(255,255,255,.3); }

.notification-menu-body {
    flex: 1;
    overflow-y: auto;
    padding: 6px;
}

.notification-loading,
.notification-empty {
    padding: 20px;
    text-align: center;
    color: #666;
}

.notification-item {
    padding: 10px 12px;
    border-radius: 6px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: background .15s;
    border-left: 3px solid #999;
}

.notification-item:last-child { margin-bottom: 0; }

.notification-item:hover { background: #f5f5f5; }

.notification-item.unread { background: #f0f7ff; }
.notification-item.unread:hover { background: #e3f2fd; }

.notification-item.severity-critical { border-left-color: #d32f2f; }
.notification-item.severity-warning { border-left-color: #f9a825; }
.notification-item.severity-info { border-left-color: #1976d2; }

.notification-item-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 0.9rem;
    color: #1a1a1a;
}

.notification-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #d32f2f;
    flex-shrink: 0;
}

.notification-item.unread .notification-dot { display: inline-block; }
.notification-item:not(.unread) .notification-dot { display: none; }

.notification-item-message {
    font-size: 0.82rem;
    color: #444;
    margin-top: 3px;
    line-height: 1.35;
}

.notification-item-meta {
    font-size: 0.72rem;
    color: #888;
    margin-top: 4px;
}

.notification-menu-footer {
    padding: 10px 14px;
    border-top: 1px solid #e0e0e0;
    text-align: right;
}

.notification-menu-footer a {
    color: #1976d2;
    font-weight: 700;
    font-size: 0.85rem;
    text-decoration: none;
}

.notification-menu-footer a:hover { text-decoration: underline; }

@media (max-width: 600px) {
    .notification-menu {
        width: 320px;
        right: -50px;
    }
}

/* ══════════════════════════════════════════════════════════════════════════
   AI-ASSISTENT SIDAN
══════════════════════════════════════════════════════════════════════════ */

.ai-assistant-page {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 84px);
    max-width: 900px;
    margin: 0 auto;
    padding: 16px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
}

.ai-assistant-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-bottom: 16px;
    border-bottom: 2px solid #f0f0f0;
    margin-bottom: 16px;
}

.ai-assistant-icon { font-size: 2.2rem; }

.ai-assistant-header h3 {
    margin: 0;
    font-size: 1.4rem;
    color: #1a3a5e;
}

.ai-assistant-header p {
    margin: 4px 0 0;
    color: #666;
    font-size: 0.9rem;
}

.ai-assistant-chat {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 8px;
    background: #fafafa;
    border-radius: 10px;
    margin-bottom: 12px;
}

.ai-chat-message {
    display: flex;
    gap: 10px;
    max-width: 85%;
}

.ai-chat-message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.ai-chat-message.assistant {
    align-self: flex-start;
}

.ai-chat-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e0e0e0;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.ai-chat-content {
    background: #fff;
    padding: 10px 14px;
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
    line-height: 1.45;
}

.ai-chat-message.user .ai-chat-content {
    background: #e3f2fd;
}

.ai-chat-text {
    white-space: pre-wrap;
    color: #222;
}

.ai-chat-data {
    margin-top: 10px;
    border-top: 1px solid #eee;
    padding-top: 8px;
}

.ai-chat-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 5px 0;
    font-size: 0.88rem;
    border-bottom: 1px dashed #f0f0f0;
}

.ai-chat-row:last-child { border-bottom: none; }

.ai-chat-label { font-weight: 700; color: #444; }
.ai-chat-value { color: #1976d2; font-weight: 600; }
.ai-chat-detail { color: #888; font-size: 0.8rem; }

.ai-chat-followup {
    margin-top: 10px;
    padding: 6px 12px;
    border: 1px solid #1976d2;
    border-radius: 16px;
    background: #fff;
    color: #1976d2;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all .15s;
}

.ai-chat-followup:hover {
    background: #1976d2;
    color: #fff;
}

.ai-chat-error {
    margin-top: 8px;
    padding: 8px;
    border-radius: 6px;
    background: #ffebee;
    color: #c62828;
    font-size: 0.85rem;
}

.ai-chat-typing {
    display: flex;
    gap: 4px;
    padding: 8px 0;
}

.ai-chat-typing span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #90caf9;
    animation: ai-typing 1.2s infinite ease-in-out;
}

.ai-chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.ai-chat-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes ai-typing {
    0%, 100% { transform: translateY(0); opacity: .4; }
    50% { transform: translateY(-6px); opacity: 1; }
}

.ai-assistant-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 12px;
}

.ai-assistant-suggestions span {
    font-size: 0.85rem;
    color: #666;
    font-weight: 700;
}

.ai-assistant-suggestions button {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 16px;
    background: #f5f5f5;
    color: #444;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all .15s;
}

.ai-assistant-suggestions button:hover {
    background: #e3f2fd;
    border-color: #1976d2;
    color: #1565c0;
}

.ai-assistant-input {
    display: flex;
    gap: 10px;
}

.ai-assistant-input input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #ddd;
    border-radius: 24px;
    font-size: 1rem;
    outline: none;
    transition: border-color .15s;
}

.ai-assistant-input input:focus {
    border-color: #1976d2;
}

.ai-assistant-input button {
    padding: 12px 24px;
    border: none;
    border-radius: 24px;
    background: #1976d2;
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s;
}

.ai-assistant-input button:hover:not(:disabled) { background: #1565c0; }
.ai-assistant-input button:disabled { background: #bbb; cursor: not-allowed; }

@media (max-width: 600px) {
    .ai-assistant-page {
        height: calc(100vh - 70px);
        padding: 10px;
        border-radius: 0;
    }
    .ai-chat-message { max-width: 95%; }
    .ai-assistant-suggestions button { font-size: 0.75rem; padding: 5px 10px; }
}

/* ── Rapport-sida ────────────────────────────────────────────────────────── */
.rpt-print-header { margin-bottom: 20px; }

.rpt-period-badge {
    display: inline-block;
    background: #1976d2;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 700;
    padding: 6px 18px;
    border-radius: 20px;
    margin-bottom: 16px;
    letter-spacing: 0.4px;
}

/* KPI-kort */
.rpt-kpi {
    background: #fff;
    border-radius: 8px;
    padding: 14px 16px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
    height: 100%;
}
.rpt-kpi-val {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.1;
}
.rpt-kpi-tool {
    font-size: 1.1rem;
    font-weight: 700;
    word-break: break-all;
}
.rpt-kpi-lbl {
    font-size: 0.72rem;
    color: #666;
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Donut-legend */
.rpt-donut-legend { border-top: 1px solid #eee; padding-top: 8px; }
.rpt-legend-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px 0;
    font-size: 0.78rem;
}
.rpt-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.rpt-legend-lbl { flex: 1; color: #444; }
.rpt-legend-val { font-weight: 700; color: #222; }

/* Avvikelsekategori-chip */
.rpt-cat-chip {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}
.rpt-cat-critical { background: #ffebee; color: #c62828; border: 1px solid #ef9a9a; }
.rpt-cat-warning  { background: #fff3e0; color: #e65100; border: 1px solid #ffcc80; }
.rpt-cat-normal   { background: #f3e5f5; color: #6a1b9a; border: 1px solid #ce93d8; }

/* Verktyg-barcharts */
.rpt-tool-grid { display: flex; flex-direction: column; gap: 6px; }
.rpt-tool-row {
    display: grid;
    grid-template-columns: 80px 1fr 120px 48px;
    align-items: center;
    gap: 10px;
    font-size: 0.82rem;
}
.rpt-tool-tnr  { font-weight: 700; color: #1976d2; }
.rpt-tool-desc { color: #555; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rpt-tool-bar-wrap { background: #f0f0f0; border-radius: 4px; height: 8px; overflow: hidden; }
.rpt-tool-bar  { background: #d32f2f; height: 8px; border-radius: 4px; transition: width .3s; min-width: 4px; }
.rpt-tool-count { text-align: right; font-weight: 700; color: #d32f2f; font-size: 0.78rem; }

@media (max-width: 600px) {
    .rpt-tool-row { grid-template-columns: 70px 1fr 60px 40px; }
    .rpt-kpi-val  { font-size: 1.5rem; }
}

/* ══════════════════════════════════════════════════════════════════════════
   MASKIN-FÖRHANDSVISNING (dubbelklick modal i /logga)
══════════════════════════════════════════════════════════════════════════ */
.mpreview-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9000;
    padding: 16px;
}
.mpreview-modal {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.35);
    width: 100%;
    max-width: 420px;
    padding: 24px;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.mpreview-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #555;
    line-height: 1;
}
.mpreview-close:hover { color: #000; }
.mpreview-img-wrap {
    width: 100%;
    height: 200px;
    border-radius: 10px;
    overflow: hidden;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.mpreview-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.mpreview-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.mpreview-nr {
    font-size: 1.6rem;
    font-weight: 900;
    color: #1a3a5e;
    line-height: 1.1;
}
.mpreview-name {
    font-size: 1rem;
    color: #444;
    font-weight: 500;
}
.mpreview-group {
    font-size: 0.82rem;
    color: #888;
}
.mpreview-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.mpreview-btn-go {
    flex: 1;
    padding: 12px 16px;
    background: #1976d2;
    color: #fff;
    border: none;
    border-radius: 9px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s;
}
.mpreview-btn-go:hover { background: #1565c0; }
.mpreview-btn-log {
    flex: 1;
    padding: 12px 16px;
    background: #f0f4ff;
    color: #1a3a5e;
    border: 2px solid #1976d2;
    border-radius: 9px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s;
}
.mpreview-btn-log:hover { background: #e3ecff; }

/* ══════════════════════════════════════════════════════════════════════════
   MASKIN-SIDA (/maskin/{nr})
══════════════════════════════════════════════════════════════════════════ */
.maskin-page {
    padding: 16px;
    max-width: 860px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.maskin-loading {
    text-align: center;
    padding: 40px;
    color: #888;
    font-size: 1.1rem;
}
.maskin-back-btn {
    background: none;
    border: none;
    color: #1976d2;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 0;
}
.maskin-back-btn:hover { text-decoration: underline; }

/* Header */
.maskin-header {
    display: flex;
    align-items: center;
    gap: 20px;
    background: #fff;
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    flex-wrap: wrap;
}
.maskin-img-wrap {
    width: 120px;
    height: 90px;
    border-radius: 10px;
    overflow: hidden;
    background: #f0f0f0;
    flex-shrink: 0;
}
.maskin-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.maskin-title-block {
    flex: 1;
    min-width: 140px;
}
.maskin-title {
    font-size: 2rem;
    font-weight: 900;
    color: #1a3a5e;
    margin: 0 0 4px;
    line-height: 1.1;
}
.maskin-subtitle {
    font-size: 1rem;
    color: #444;
}
.maskin-group-badge {
    display: inline-block;
    margin-top: 6px;
    padding: 2px 10px;
    border-radius: 20px;
    background: #e8f4fd;
    color: #1565c0;
    font-size: 0.78rem;
    font-weight: 700;
}

/* Spindelstatus badge */
.spindle-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}
.spindle-badge.spindle-on  { background: #e8f5e9; color: #2e7d32; border: 2px solid #a5d6a7; }
.spindle-badge.spindle-off { background: #ffebee; color: #c62828; border: 2px solid #ef9a9a; }
.spindle-badge.spindle-unknown { background: #f5f5f5; color: #757575; border: 2px solid #e0e0e0; }
.spindle-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}
.spindle-on .spindle-dot    { background: #2e7d32; box-shadow: 0 0 6px #4caf50; }
.spindle-off .spindle-dot   { background: #c62828; }
.spindle-unknown .spindle-dot { background: #bdbdbd; }

/* Sektion */
.maskin-section {
    background: #fff;
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.07);
}
.section-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: #1a3a5e;
    margin: 0 0 14px;
}

/* Spindel-knappar */
.spindle-controls {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.spindle-btn {
    padding: 10px 22px;
    border-radius: 8px;
    border: 2px solid transparent;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all .15s;
}
.spindle-btn.spindle-on  { background: #e8f5e9; color: #2e7d32; border-color: #a5d6a7; }
.spindle-btn.spindle-on:hover  { background: #c8e6c9; }
.spindle-btn.spindle-on.active  { background: #2e7d32; color: #fff; border-color: #1b5e20; }
.spindle-btn.spindle-off { background: #ffebee; color: #c62828; border-color: #ef9a9a; }
.spindle-btn.spindle-off:hover { background: #ffcdd2; }
.spindle-btn.spindle-off.active { background: #c62828; color: #fff; border-color: #b71c1c; }
.spindle-since { font-size: 0.8rem; color: #888; margin-top: 4px; }

/* Händelse/körning-formulär */
.event-form, .run-start-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.ef-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.ef-row label {
    width: 130px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #444;
    flex-shrink: 0;
}
.ef-input {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color .15s;
}
.ef-input:focus { border-color: #1976d2; box-shadow: 0 0 0 2px rgba(25,118,210,0.12); }
.ef-save-btn, .ef-start-btn {
    align-self: flex-start;
    padding: 10px 22px;
    background: #1976d2;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s;
    margin-top: 4px;
}
.ef-save-btn:hover, .ef-start-btn:hover { background: #1565c0; }
.ef-save-btn:disabled, .ef-start-btn:disabled { background: #bbb; cursor: not-allowed; }
.ef-stop-btn {
    padding: 10px 22px;
    background: #d32f2f;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s;
}
.ef-stop-btn:hover { background: #b71c1c; }

/* Aktiv körning */
.run-active-card {
    background: #fff8e1;
    border: 2px solid #ffd54f;
    border-radius: 10px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.run-active-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    color: #e65100;
    font-size: 0.95rem;
}
.run-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ff6f00;
    animation: run-pulse 1.4s ease-in-out infinite;
    flex-shrink: 0;
}
@keyframes run-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50%       { transform: scale(1.4); opacity: 0.7; }
}
.run-article, .run-op { font-size: 0.85rem; color: #555; }
.run-stop-form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 6px;
}
.run-stop-form .ef-input { min-width: 120px; flex: none; }

/* Händelselogg */
.event-log {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.event-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 7px;
    background: #fafafa;
    border: 1px solid #eeee;
    font-size: 0.85rem;
    flex-wrap: wrap;
}
.event-row.etype-stop   { background: #fff8f8; border-color: #ffcdd2; }
.event-row.etype-start  { background: #f0fff4; border-color: #c8e6c9; }
.event-row.etype-spindleon  { background: #f0fff4; border-color: #a5d6a7; }
.event-row.etype-spindleoff { background: #fff8f8; border-color: #ef9a9a; }
.event-icon { font-size: 1rem; flex-shrink: 0; }
.event-time { color: #888; font-size: 0.78rem; white-space: nowrap; }
.event-type { font-weight: 700; color: #333; min-width: 80px; }
.event-op   { background: #e3ecff; color: #1a3a5e; border-radius: 4px; padding: 1px 6px; font-weight: 700; font-size: 0.78rem; }
.event-comment { color: #666; font-style: italic; }

/* Körningshistorik */
.runs-table-wrap { overflow-x: auto; }
.runs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.runs-table th {
    background: #dce6f1;
    padding: 7px 10px;
    text-align: left;
    font-weight: 700;
    border-bottom: 2px solid #90caf9;
    white-space: nowrap;
}
.runs-table td {
    padding: 7px 10px;
    border-bottom: 1px solid #f0f0f0;
}
.runs-table tr:hover td { background: #f8faff; }
.run-row-active td { background: #fff8e1 !important; font-weight: 600; }
.runs-parts { font-weight: 800; color: #1976d2; }
.maskin-empty { color: #aaa; font-style: italic; font-size: 0.9rem; }

@media (max-width: 600px) {
    .maskin-header { gap: 12px; }
    .maskin-img-wrap { width: 80px; height: 60px; }
    .maskin-title { font-size: 1.5rem; }
    .ef-row { flex-direction: column; align-items: flex-start; }
    .ef-row label { width: auto; }
    .spindle-badge { font-size: 0.8rem; padding: 6px 12px; }
}

/* ══════════════════════════════════════════════════════════════════════════
   MASKIN DETALJ-SIDA (/maskin/{MachineNr}) - HERO & LAYOUT
══════════════════════════════════════════════════════════════════════════ */

.mskin-hero {
    position: relative;
    height: 280px;
    background: linear-gradient(135deg, #1a3a5e 0%, #0d1f33 100%);
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 24px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}

.mskin-hero-img {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0.5;
}

.mskin-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(26,58,94,0.85) 0%, rgba(13,31,51,0.9) 100%);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px;
    z-index: 1;
    color: #fff;
}

.mskin-hero-top {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.mskin-group-chip {
    background: rgba(255,255,255,0.15);
    color: #fff;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.2);
}

.mskin-spindle-chip {
    background: rgba(255,255,255,0.15);
    color: #fff;
    padding: 8px 16px;
    border-radius: 24px;
    font-size: 0.85rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.2);
}

.mskin-spindle-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #4caf50;
    box-shadow: 0 0 8px rgba(76,175,80,0.6);
}

.mskin-spindle-on .mskin-spindle-dot { background: #4caf50; box-shadow: 0 0 8px rgba(76,175,80,0.6); }
.mskin-spindle-off .mskin-spindle-dot { background: #ef5350; box-shadow: 0 0 8px rgba(239,83,80,0.4); }

.mskin-spindle-label {
    color: #fff;
}

.mskin-hero-content {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 8px;
}

.mskin-hero-title {
    font-size: 2.8rem;
    font-weight: 900;
    margin: 0;
    line-height: 1;
    letter-spacing: -0.5px;
}

.mskin-hero-sub {
    font-size: 1.05rem;
    margin: 0;
    opacity: 0.95;
    font-weight: 300;
}

.mskin-back-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 2;
    background: rgba(255,255,255,0.2);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 1.5rem;
    backdrop-filter: blur(8px);
}

.mskin-back-btn:hover {
    background: rgba(255,255,255,0.3);
}

/* KPI-rad under hero */
.mskin-kpi-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.mskin-kpi {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid #f0f0f0;
    transition: transform 0.2s, box-shadow 0.2s;
}

.mskin-kpi:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.mskin-kpi-val {
    font-size: 1.8rem;
    font-weight: 800;
    color: #1976d2;
    line-height: 1.1;
    margin-bottom: 4px;
}

.mskin-kpi-val.mskin-kpi-dev {
    color: #d32f2f;
}

.mskin-kpi-lbl {
    font-size: 0.72rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

/* ══════════════════════════════════════════════════════════════════════════
   MASKIN-KORT GRID (Index.razor) - Större bilder & dubbelklick
══════════════════════════════════════════════════════════════════════════ */

.machine-card {
    position: relative;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s, cursor 0.1s;
    cursor: pointer;
    user-select: none;
}

.machine-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.15);
}

.machine-card:active {
    cursor: grab;
}

.machine-card-image {
    position: relative;
    width: 100%;
    padding-bottom: 100%;
    background: linear-gradient(135deg, #e0e0e0 0%, #f5f5f5 100%);
    overflow: hidden;
}

.machine-card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.machine-card:hover .machine-card-image img {
    transform: scale(1.05);
}

.machine-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, transparent 60%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 12px;
    opacity: 1;
    transition: opacity 0.2s;
}

.machine-status-badge {
    color: #fff;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
    width: fit-content;
}

.machine-card-content {
    padding: 16px;
}

.machine-card-info {
    margin: 8px 0;
    padding: 8px 0;
    border-top: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
}

/* ── VerktygsDetalj (/verktyg/{tnr}/{nr}) ────────────────────────────── */
.vd-hero {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 0 18px;
    border-bottom: 2px solid #e3eaf5;
    margin-bottom: 18px;
}
.vd-back { flex-shrink: 0; }
.vd-hero-info { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.vd-tnr-badge {
    background: #1565c0;
    color: #fff;
    font-weight: 800;
    font-size: 1.2rem;
    border-radius: 8px;
    padding: 4px 14px;
    letter-spacing: 0.03em;
}
.vd-desc { font-size: 1rem; color: #444; }
.vd-machine-chip { font-size: 0.8rem !important; }

.vd-kpi-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}
.vd-kpi {
    flex: 1 1 100px;
    background: #f5f7fb;
    border-radius: 10px;
    padding: 12px 16px;
    text-align: center;
    border: 1px solid #e0e8f5;
}
.vd-kpi-warn { background: #fff8e1; border-color: #ffe082; }
.vd-kpi-val { display: block; font-size: 1.6rem; font-weight: 800; color: #1565c0; line-height: 1.1; }
.vd-kpi-val small { font-size: 1rem; font-weight: 600; }
.vd-kpi-lbl { display: block; font-size: 0.72rem; color: #888; margin-top: 3px; text-transform: uppercase; letter-spacing: 0.04em; }
.vd-kpi-warn .vd-kpi-val { color: #e65100; }

.vd-table-wrap { overflow-x: auto; }
.vd-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.vd-table th {
    padding: 9px 12px;
    text-align: left;
    background: #f0f4fb;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #555;
    border-bottom: 2px solid #dde5f4;
    white-space: nowrap;
}
.vd-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}
.vd-table tr:hover td { background: #f8faff; }
.vd-row-dev td { background: #fff8f0 !important; }
.vd-row-dev:hover td { background: #fff3e0 !important; }
.vd-time { color: #888; font-size: 0.85rem; }
.vd-comment { color: #555; font-size: 0.85rem; max-width: 240px; }
.vd-interval-col { font-weight: 700; color: #1565c0; white-space: nowrap; }
.vd-short-life { color: #c62828 !important; }
.vd-first { color: #aaa; font-style: italic; font-weight: 400; }

/* Underhålls-lista */
.maintenance-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.maintenance-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 8px;
    border-radius: 8px;
    background: rgba(0,0,0,0.02);
}

.maintenance-item > div {
    flex: 1;
}

/* ============================================================
   Landing page (public marketing) — scoped under .lp-page
   Does not affect authenticated app shell styles.
   ============================================================ */
/* Kill page chrome so landing is full-bleed (no white Mud strip / FAB gap). */
.landing-shell {
    min-height: 100vh;
    margin: 0;
    padding: 0;
    background: #0b1220;
}
html:has(.lp-page),
body:has(.lp-page) {
    background: #0b1220 !important;
}

.lp-page {
    --lp-bg: #0b1220;
    --lp-bg-elevated: #111827;
    --lp-bg-card: #151d2e;
    --lp-border: rgba(148, 163, 184, 0.14);
    --lp-text: #f1f5f9;
    --lp-muted: #94a3b8;
    --lp-accent: #fdb912;
    --lp-accent-dim: rgba(253, 185, 18, 0.14);
    --lp-accent-strong: #e5a40f;
    --lp-gold: #fdb912;
    --lp-teal: #2dd4bf;
    --lp-light: #f8fafc;
    --lp-light-text: #0f172a;
    --lp-light-muted: #475569;
    font-family: 'Roboto', system-ui, -apple-system, sans-serif;
    color: var(--lp-text);
    background: var(--lp-bg);
    overflow-x: hidden;
    min-height: 100vh;
    width: 100%;
    max-width: 100vw;
}

.lp-page * { box-sizing: border-box; }

.lp-nav {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 28px;
    background: rgba(11, 18, 32, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--lp-border);
}

.lp-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--lp-accent);
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
}

.lp-brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: linear-gradient(145deg, rgba(253, 185, 18, 0.22), rgba(45, 212, 191, 0.1));
    border: 1px solid rgba(253, 185, 18, 0.4);
    color: var(--lp-gold);
}

.lp-nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.lp-nav-link {
    color: var(--lp-muted) !important;
    font-weight: 500 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
}

.lp-nav-link:hover { color: var(--lp-text) !important; }

.lp-btn-primary {
    background: var(--lp-gold) !important;
    color: #1a1a1a !important;
    font-weight: 700 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    border-radius: 8px !important;
    box-shadow: 0 8px 24px rgba(253, 185, 18, 0.28) !important;
}

.lp-btn-primary:hover {
    background: var(--lp-accent-strong) !important;
}

.lp-btn-ghost {
    color: var(--lp-text) !important;
    border: 1px solid rgba(255, 255, 255, 0.22) !important;
    background: rgba(255, 255, 255, 0.04) !important;
    font-weight: 600 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    border-radius: 8px !important;
}

.lp-btn-ghost:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(255, 255, 255, 0.35) !important;
}

.lp-btn-dark {
    background: var(--lp-light-text) !important;
    color: #fff !important;
    font-weight: 700 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    border-radius: 8px !important;
}

.lp-hero {
    position: relative;
    min-height: min(88vh, 820px);
    display: flex;
    align-items: center;
    padding: 64px 28px 80px;
    overflow: hidden;
}

.lp-hero-media {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.lp-hero-media video,
.lp-hero-media .lp-hero-fallback {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.lp-hero-media video { z-index: 1; }
.lp-hero-media .lp-hero-fallback { z-index: 0; }

.lp-hero-fallback {
    background:
        radial-gradient(ellipse 80% 60% at 70% 20%, rgba(253, 185, 18, 0.16), transparent 55%),
        radial-gradient(ellipse 60% 50% at 15% 80%, rgba(45, 212, 191, 0.1), transparent 50%),
        linear-gradient(160deg, #0b1220 0%, #0f1a2e 45%, #0a1624 100%);
}

.lp-hero-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(105deg, rgba(11, 18, 32, 0.92) 0%, rgba(11, 18, 32, 0.78) 48%, rgba(11, 18, 32, 0.55) 100%),
        linear-gradient(to top, rgba(11, 18, 32, 0.95) 0%, transparent 40%);
    z-index: 1;
}

.lp-hero-inner {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
}

.lp-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--lp-accent-dim);
    border: 1px solid rgba(253, 185, 18, 0.35);
    color: var(--lp-gold);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 22px;
}

.lp-hero h1 {
    margin: 0 0 20px;
    font-size: clamp(2.2rem, 5vw, 3.55rem);
    font-weight: 800;
    line-height: 1.12;
    letter-spacing: -0.02em;
    color: #fff;
    max-width: 16ch;
}

.lp-hero-lead {
    margin: 0 0 32px;
    font-size: clamp(1.05rem, 2vw, 1.2rem);
    line-height: 1.65;
    color: rgba(226, 232, 240, 0.88);
    max-width: 540px;
}

.lp-hero-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 40px;
}

.lp-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 18px 28px;
    padding-top: 8px;
    border-top: 1px solid rgba(148, 163, 184, 0.18);
    max-width: 560px;
}

.lp-hero-meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--lp-muted);
    font-size: 0.88rem;
}

.lp-hero-meta-item strong {
    color: var(--lp-text);
    font-weight: 600;
}

.lp-section {
    padding: 88px 28px;
}

.lp-section-inner {
    max-width: 1120px;
    margin: 0 auto;
}

.lp-section-head {
    text-align: center;
    max-width: 640px;
    margin: 0 auto 52px;
}

.lp-eyebrow {
    display: inline-block;
    color: var(--lp-accent);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.lp-section-head h2 {
    margin: 0 0 14px;
    font-size: clamp(1.75rem, 3.5vw, 2.35rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--lp-text);
    line-height: 1.2;
}

.lp-section-head p {
    margin: 0;
    color: var(--lp-muted);
    font-size: 1.05rem;
    line-height: 1.65;
}

.lp-section--light {
    background: var(--lp-light);
    color: var(--lp-light-text);
}

.lp-section--light .lp-section-head h2 { color: var(--lp-light-text); }
.lp-section--light .lp-section-head p { color: var(--lp-light-muted); }
.lp-section--light .lp-eyebrow { color: #b45309; }

.lp-section--elevated {
    background: var(--lp-bg-elevated);
}

.lp-proof {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: -36px;
    position: relative;
    z-index: 3;
    padding: 0 28px 8px;
    max-width: 1120px;
    margin-left: auto;
    margin-right: auto;
}

.lp-proof-card {
    background: var(--lp-bg-card);
    border: 1px solid var(--lp-border);
    border-radius: 12px;
    padding: 22px 20px;
    text-align: center;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.lp-proof-card .lp-proof-label {
    display: block;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--lp-muted);
    margin-bottom: 6px;
}

.lp-proof-card .lp-proof-value {
    display: block;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--lp-text);
}

.lp-features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.lp-feature {
    background: var(--lp-bg-card);
    border: 1px solid var(--lp-border);
    border-radius: 14px;
    padding: 26px 22px;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.lp-feature:hover {
    border-color: rgba(253, 185, 18, 0.4);
    transform: translateY(-2px);
}

.lp-feature-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: var(--lp-accent-dim);
    color: var(--lp-accent);
    margin-bottom: 16px;
}

.lp-feature h3 {
    margin: 0 0 8px;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--lp-text);
}

.lp-feature p {
    margin: 0;
    color: var(--lp-muted);
    font-size: 0.95rem;
    line-height: 1.55;
}

.lp-steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    counter-reset: lp-step;
}

.lp-step {
    position: relative;
    padding: 28px 24px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.04);
}

.lp-step::before {
    counter-increment: lp-step;
    content: counter(lp-step);
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #0f172a;
    color: #fff;
    font-weight: 800;
    font-size: 0.9rem;
    margin-bottom: 16px;
}

.lp-step h3 {
    margin: 0 0 8px;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--lp-light-text);
}

.lp-step p {
    margin: 0;
    color: var(--lp-light-muted);
    font-size: 0.95rem;
    line-height: 1.55;
}

.lp-showcase {
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: 40px;
    align-items: center;
}

.lp-showcase.reverse {
    grid-template-columns: 0.95fr 1.05fr;
}

.lp-showcase.reverse .lp-showcase-copy { order: 2; }
.lp-showcase.reverse .lp-showcase-visual { order: 1; }

.lp-showcase-copy h3 {
    margin: 0 0 12px;
    font-size: clamp(1.4rem, 2.5vw, 1.85rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--lp-text);
}

.lp-showcase-copy p {
    margin: 0 0 18px;
    color: var(--lp-muted);
    font-size: 1.02rem;
    line-height: 1.65;
}

.lp-checklist {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px;
}

.lp-checklist li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: rgba(226, 232, 240, 0.9);
    font-size: 0.95rem;
    line-height: 1.45;
}

.lp-checklist li .mud-icon-root {
    color: var(--lp-accent);
    margin-top: 2px;
    flex-shrink: 0;
}

.lp-frame {
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--lp-border);
    background: #020617;
    box-shadow:
        0 24px 60px rgba(0, 0, 0, 0.35),
        0 0 0 1px rgba(253, 185, 18, 0.1);
}

.lp-frame img {
    display: block;
    width: 100%;
    height: auto;
}

.lp-frame-caption {
    padding: 14px 16px;
    background: rgba(15, 23, 42, 0.95);
    border-top: 1px solid var(--lp-border);
    color: var(--lp-muted);
    font-size: 0.85rem;
}

.lp-cta {
    text-align: center;
    padding: 64px 32px;
    border-radius: 18px;
    background:
        radial-gradient(ellipse 70% 80% at 50% 0%, rgba(253, 185, 18, 0.14), transparent 60%),
        var(--lp-bg-card);
    border: 1px solid var(--lp-border);
}

.lp-cta h2 {
    margin: 0 0 12px;
    font-size: clamp(1.6rem, 3vw, 2.1rem);
    font-weight: 800;
    color: #fff;
}

.lp-cta p {
    margin: 0 auto 28px;
    max-width: 520px;
    color: var(--lp-muted);
    font-size: 1.05rem;
    line-height: 1.6;
}

.lp-cta-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

.lp-showcase-stack {
    display: grid;
    gap: 72px;
}

.lp-footer {
    padding: 40px 28px 48px;
    border-top: 1px solid var(--lp-border);
    text-align: center;
    color: rgba(148, 163, 184, 0.75);
    font-size: 0.85rem;
    background: #080e18;
}

.lp-footer-inner {
    max-width: 560px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.lp-footer-brand {
    display: inline-flex;
    text-decoration: none;
    margin-bottom: 4px;
}

.lp-footer-tagline {
    margin: 0;
    color: var(--lp-muted);
    font-size: 0.92rem;
    line-height: 1.45;
}

.lp-footer-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 6px 8px;
    color: rgba(148, 163, 184, 0.65);
    font-size: 0.8rem;
}

.lp-footer-dot { opacity: 0.6; }

@media (max-width: 960px) {
    .lp-proof,
    .lp-features,
    .lp-steps,
    .lp-showcase,
    .lp-showcase.reverse {
        grid-template-columns: 1fr;
    }

    .lp-showcase.reverse .lp-showcase-copy,
    .lp-showcase.reverse .lp-showcase-visual {
        order: unset;
    }

    .lp-hero h1 { max-width: none; }
    .lp-showcase-stack { gap: 48px; }

    .lp-nav { padding: 12px 16px; }
    .lp-section { padding: 64px 16px; }
    .lp-proof { padding: 0 16px; margin-top: -24px; }
}

@media (max-width: 600px) {
    .lp-nav {
        padding: 10px 14px;
        gap: 10px;
    }
    .lp-brand-logo { height: 28px; }
    .lp-nav-links {
        gap: 4px;
        flex-wrap: nowrap;
    }
    .lp-nav-links .lp-nav-desktop { display: none !important; }
    .lp-nav-links .lp-btn-primary {
        padding-left: 12px !important;
        padding-right: 12px !important;
        font-size: 0.82rem !important;
        min-height: 36px;
    }

    .lp-proof { grid-template-columns: 1fr; }
    .lp-hero {
        padding: 36px 16px 56px;
        min-height: auto;
    }
    .lp-hero h1 {
        font-size: clamp(1.75rem, 8vw, 2.35rem);
        line-height: 1.15;
    }
    .lp-hero-lead {
        font-size: 1rem;
        margin-bottom: 24px;
    }
    .lp-hero-cta,
    .lp-cta-actions {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }
    .lp-hero-cta .mud-button-root,
    .lp-cta-actions .mud-button-root {
        width: 100%;
        justify-content: center;
    }
    .lp-hero-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        max-width: none;
    }
    .lp-section { padding: 48px 16px; }
    .lp-section-head { margin-bottom: 32px; }
    .lp-cta { padding: 40px 20px; border-radius: 14px; }
    .lp-showcase-stack { gap: 40px; }
    .lp-footer { padding: 32px 16px 40px; }
}


/* ══════════════════════════════════════════════════════════════════════════
   LOGG A / MASKIN — shop-floor operator UX (industrial, touch-first)
══════════════════════════════════════════════════════════════════════════ */

.logga-page {
    --shop-ink: #0f172a;
    --shop-muted: #64748b;
    --shop-border: #e2e8f0;
    --shop-panel: #ffffff;
    --shop-bg: #f1f5f9;
    --shop-accent: #0f766e;
    --shop-accent-soft: #ccfbf1;
    --shop-gold: #fdb912;
    background: var(--shop-bg);
    min-height: 100%;
    padding-bottom: 32px;
}

.logga-hero {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: stretch;
    justify-content: space-between;
    padding: 18px 16px 8px;
    background: linear-gradient(135deg, #0b1220 0%, #152238 55%, #0f766e 140%);
    color: #f8fafc;
    border-bottom: 3px solid var(--shop-gold);
}

.logga-kicker {
    margin: 0 0 4px;
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #94a3b8;
    font-weight: 700;
}
.logga-title {
    margin: 0;
    font-size: clamp(1.45rem, 3.5vw, 2rem);
    font-weight: 900;
    letter-spacing: -0.02em;
    line-height: 1.15;
}
.logga-lead {
    margin: 6px 0 0;
    color: #cbd5e1;
    font-size: 0.95rem;
    max-width: 42rem;
}

.logga-active-card {
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 14px;
    padding: 14px 16px;
    min-width: min(100%, 280px);
    display: flex;
    flex-direction: column;
    gap: 12px;
    backdrop-filter: blur(8px);
}
.logga-active-top { display: flex; gap: 12px; align-items: center; }
.logga-active-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: #94a3b8; font-weight: 700; }
.logga-active-name { font-size: 1.25rem; font-weight: 800; }
.logga-active-meta { font-size: 0.8rem; color: #99f6e4; }
.logga-active-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.logga-cta-primary,
.logga-cta-ghost,
.msel-open-btn {
    border: none;
    border-radius: 10px;
    font-weight: 800;
    font-size: 0.9rem;
    padding: 12px 16px;
    min-height: 48px;
    cursor: pointer;
    touch-action: manipulation;
}
.logga-cta-primary {
    background: var(--shop-gold);
    color: #0f172a;
    flex: 1;
}
.logga-cta-primary:hover { filter: brightness(1.05); }
.logga-cta-ghost {
    background: transparent;
    color: #e2e8f0;
    border: 1px solid rgba(226,232,240,0.35);
}
.msel-open-btn {
    margin-left: auto;
    background: #0f766e;
    color: #fff;
    padding: 8px 14px;
    min-height: 40px;
    font-size: 0.82rem;
}
.msel-open-btn:hover { background: #0d9488; }

.logga-form-section {
    background: var(--shop-panel);
    border-bottom: 1px solid var(--shop-border);
}
.logga-step-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 12px 16px 0;
}
.logga-step {
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #94a3b8;
    padding: 6px 10px;
    border-radius: 999px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}
.logga-step.current {
    color: #0f766e;
    background: #ccfbf1;
    border-color: #99f6e4;
}
.logga-step.done {
    color: #166534;
    background: #dcfce7;
    border-color: #bbf7d0;
}
.logga-step-sep { color: #cbd5e1; font-weight: 700; }

.mbtn-open {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    background: rgba(255,255,255,0.92);
    color: #0f172a;
    font-size: 1rem;
    font-weight: 900;
    cursor: pointer;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    touch-action: manipulation;
}
.mbtn-open:hover { background: #0f766e; color: #fff; border-color: #0f766e; }
.mbtn.mbtn-selected .mbtn-open {
    background: rgba(255,255,255,0.95);
    color: #0f172a;
}

/* Larger save button on shop floor */
.logga-page .save-btn,
.logga-page .mobile-save-btn {
    min-height: 52px !important;
    font-size: 1.05rem !important;
    font-weight: 800 !important;
    border-radius: 10px !important;
}
.logga-page .mf-input,
.logga-page .cell-input {
    min-height: 44px;
    font-size: 1rem;
}

/* Maskin detail page */
.mskin-page {
    --shop-ink: #0f172a;
    --shop-muted: #64748b;
    --shop-border: #e2e8f0;
    --shop-accent: #0f766e;
    --shop-gold: #fdb912;
    padding: 12px 12px 40px;
    background: #f1f5f9;
    min-height: 100%;
}
.mskin-page .mskin-hero {
    height: auto;
    min-height: 240px;
    border-radius: 16px;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #0b1220 0%, #152238 60%, #0f766e 130%);
    border: 1px solid rgba(15, 23, 42, 0.35);
}
.mskin-hero-cta { margin-top: 10px; }
.mskin-log-cta {
    font-weight: 800 !important;
    min-height: 52px !important;
    background: var(--shop-gold) !important;
    color: #0f172a !important;
}
.mskin-panel {
    background: #fff;
    border: 1px solid var(--shop-border);
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.mskin-panel-title {
    font-weight: 800 !important;
    color: #0f172a !important;
    letter-spacing: -0.01em;
}
.mskin-page .mskin-kpi {
    border: 1px solid var(--shop-border);
    border-radius: 14px;
    background: #fff;
    box-shadow: none;
}
.mskin-page .mskin-kpi-val { color: #0f766e; }
.mskin-tnr-link { color: #0f766e; text-decoration: none; font-weight: 800; }
.mskin-tnr-link:hover { text-decoration: underline; }

.mskin-tool-list, .mskin-op-list { display: flex; flex-direction: column; gap: 6px; }
.mskin-tool-row, .mskin-op-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    text-decoration: none;
    color: inherit;
    min-height: 48px;
}
.mskin-tool-row span, .mskin-op-name {
    color: #64748b;
    font-size: 0.85rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.mskin-tool-row:hover, .mskin-op-hot {
    border-color: #99f6e4;
    background: #f0fdfa;
}
.mskin-op-ini {
    font-weight: 900;
    min-width: 2.4rem;
    color: #0f172a;
}

.machine-card-actions { margin-top: 8px; }

@media (max-width: 768px) {
    .logga-hero { padding: 14px 12px 10px; }
    .msel-hint { display: none; }
    .mbtn { width: 112px; height: 136px; }
    .mbtn-open { width: 34px; height: 34px; }
    .logga-active-card { width: 100%; }
    .mskin-page { padding: 8px 8px 32px; }
    .mskin-page .mskin-hero { min-height: 220px; border-radius: 12px; }
    .mskin-hero-title { font-size: 2rem !important; }
}



/* ── EdgeOpsys / tenant branding ─────────────────────────────────────────── */
.app-company-logo {
    height: 36px;
    width: auto;
    max-width: 140px;
    object-fit: contain;
    border-radius: 6px;
    background: rgba(255,255,255,0.55);
    padding: 2px 4px;
}
.app-company-logo-sm {
    height: 28px;
    width: auto;
    max-width: 100px;
    object-fit: contain;
    border-radius: 4px;
    background: rgba(255,255,255,0.55);
    padding: 2px;
}
.app-powered-by {
    text-align: center;
    padding: 18px 12px 28px;
    font-size: 0.78rem;
    color: #94a3b8;
    letter-spacing: 0.02em;
}
.app-powered-by a {
    color: #0f766e;
    font-weight: 700;
    text-decoration: none;
}
.app-powered-by a:hover { text-decoration: underline; }
.lp-brand-logo {
    display: block;
    height: 34px;
    width: auto;
}
.app-root.dark-mode .app-powered-by { color: #64748b; }
.app-root.dark-mode .app-powered-by a { color: #5eead4; }

/* ══════════════════════════════════════════════════════════════════════════
   2026 Command Center — shell, dashboard, admin
══════════════════════════════════════════════════════════════════════════ */
:root {
  --cc-up: #16a34a;
  --cc-down: #dc2626;
  --cc-surface: #ffffff;
  --cc-bg: #f4f6f9;
  --cc-border: rgba(15, 23, 42, 0.08);
  --cc-radius: 16px;
  --cc-shadow: 0 1px 2px rgba(15,23,42,.04), 0 8px 24px rgba(15,23,42,.06);
}

.app-root.dark-mode {
  --cc-surface: #111827;
  --cc-bg: #0b1220;
  --cc-border: rgba(148, 163, 184, 0.12);
  --cc-shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35);
}

.cc-shell .mud-main-content.cc-main,
.cc-main {
  background: var(--cc-bg);
  min-height: 100vh;
  padding-bottom: 88px;
}
@media (min-width: 960px) {
  .cc-main { padding-bottom: 24px; }
}

.cc-appbar {
  border-bottom: 1px solid rgba(0,0,0,.06);
  backdrop-filter: blur(8px);
}
.cc-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}
.cc-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 0;
}
.cc-brand-name {
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}
.cc-brand-sub {
  font-size: 0.68rem;
  opacity: 0.75;
  white-space: nowrap;
}
.cc-search-btn {
  border-color: rgba(0,0,0,.18) !important;
  color: inherit !important;
  text-transform: none !important;
  margin-right: 6px;
  background: rgba(255,255,255,.35) !important;
}
.cc-search-kbd {
  margin-left: 8px;
  font-size: 0.68rem;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(0,0,0,.08);
  font-family: ui-monospace, monospace;
}
@media (max-width: 600px) {
  .cc-search-label, .cc-search-kbd, .cc-brand-sub, .cc-hide-mobile { display: none !important; }
  .cc-brand-name { max-width: 120px; font-size: 0.85rem; }
}

.cc-drawer {
  background: #0f172a !important;
}
.cc-drawer .mud-nav-link {
  color: #cbd5e1 !important;
  border-radius: 10px !important;
  margin: 2px 8px !important;
  font-weight: 600 !important;
}
.cc-drawer .mud-nav-link.active, .cc-drawer .mud-nav-link:hover {
  background: rgba(253, 185, 18, 0.16) !important;
  color: #fdb912 !important;
}
.cc-drawer .mud-nav-link .mud-icon-root { color: inherit !important; }

.cc-content { padding: 12px 12px 24px; max-width: 1600px; margin: 0 auto; }
@media (min-width: 960px) {
  .cc-content { padding: 20px 24px 40px; }
}

/* Bottom nav (mobile) */
.cc-bottom-nav {
  display: none;
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 1200;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--cc-border);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
}
.app-root.dark-mode ~ .cc-bottom-nav,
.cc-shell .cc-bottom-nav { /* keep light glass */ }
@media (max-width: 959px) {
  .cc-bottom-nav { display: grid; }
}
.cc-bn-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-decoration: none;
  color: #64748b;
  font-size: 0.65rem;
  font-weight: 700;
  background: none;
  border: none;
  padding: 6px 2px;
  border-radius: 12px;
}
.cc-bn-item.cc-bn-primary {
  color: #1a1a1a;
}
.cc-bn-item.cc-bn-primary .mud-icon-root {
  color: #fdb912;
  font-size: 1.75rem !important;
}

/* Page */
.cc-page { width: 100%; }
.cc-loading {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 50vh;
}
.cc-hero {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: 16px; margin-bottom: 20px;
}
.cc-eyebrow {
  color: #64748b !important; letter-spacing: 0.08em !important; font-weight: 700 !important;
}
.cc-title { font-weight: 800 !important; letter-spacing: -0.02em; margin: 2px 0 4px !important; }
.cc-hero-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.cc-kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
@media (min-width: 700px) {
  .cc-kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1100px) {
  .cc-kpi-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .admin-kpi { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.cc-kpi {
  background: var(--cc-surface);
  border: 1px solid var(--cc-border);
  border-radius: var(--cc-radius);
  box-shadow: var(--cc-shadow);
  padding: 14px 16px;
  min-height: 110px;
  display: flex; flex-direction: column; gap: 4px;
}
.cc-kpi-click { cursor: pointer; transition: transform .15s, box-shadow .15s; }
.cc-kpi-click:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(15,23,42,.1); }
.cc-kpi-warn { border-color: rgba(239, 83, 80, 0.25); }
.cc-kpi-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.cc-kpi-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #64748b; }
.cc-kpi-value { font-size: 1.85rem; font-weight: 800; line-height: 1.1; letter-spacing: -0.03em; }
.cc-kpi-of { font-size: 1rem; font-weight: 600; color: #94a3b8; }
.cc-kpi-sub { font-size: 0.75rem; color: #64748b; }
.cc-trend { font-size: 0.72rem; font-weight: 800; }

.cc-spark {
  display: flex; align-items: flex-end; gap: 2px; height: 28px; margin-top: 6px;
}
.cc-spark-bar {
  flex: 1; min-width: 3px; background: #fdb912; border-radius: 2px 2px 0 0; opacity: .85;
}
.cc-spark-dev .cc-spark-bar { background: #ef5350; }

.cc-quick, .admin-shortcuts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}
@media (min-width: 800px) {
  .cc-quick, .admin-shortcuts { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
.cc-quick-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  padding: 14px 8px;
  background: var(--cc-surface);
  border: 1px solid var(--cc-border);
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  font-weight: 700; font-size: 0.78rem;
  box-shadow: var(--cc-shadow);
  transition: transform .15s, border-color .15s;
  min-height: 72px;
}
.cc-quick-card:hover {
  transform: translateY(-2px);
  border-color: #fdb912;
  color: inherit;
}
.cc-quick-card .mud-icon-root { color: #fdb912; }

.cc-card {
  background: var(--cc-surface) !important;
  border: 1px solid var(--cc-border) !important;
  border-radius: var(--cc-radius) !important;
  box-shadow: var(--cc-shadow) !important;
}
.cc-card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px;
}
.cc-section-head {
  display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  margin: 8px 0 12px;
}

.cc-machine-grid {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 14px;
}
@media (min-width: 600px) { .cc-machine-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 960px) { .cc-machine-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1280px) { .cc-machine-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.cc-machine {
  background: var(--cc-surface);
  border: 1px solid var(--cc-border);
  border-radius: var(--cc-radius);
  overflow: hidden;
  box-shadow: var(--cc-shadow);
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}
.cc-machine:hover { transform: translateY(-3px); box-shadow: 0 14px 32px rgba(15,23,42,.12); }
.cc-machine-img {
  position: relative; aspect-ratio: 16/10;
  background: linear-gradient(135deg, #e2e8f0, #f8fafc);
}
.cc-machine-img img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.cc-machine-badge {
  position: absolute; left: 10px; bottom: 10px;
  color: #fff; font-size: 0.7rem; font-weight: 800;
  padding: 4px 10px; border-radius: 999px; text-transform: uppercase; letter-spacing: .04em;
}
.cc-machine-body { padding: 12px 14px 14px; }
.cc-machine-actions { display: flex; gap: 6px; margin-top: 10px; }

.cc-rank-row {
  display: grid; grid-template-columns: 72px 1fr 36px; gap: 10px; align-items: center;
}
.cc-rank-key { font-weight: 800; font-size: 0.85rem; }
.cc-rank-val { font-weight: 700; font-size: 0.8rem; text-align: right; color: #64748b; }

/* Command palette */
.cmdk-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  display: flex; justify-content: center; padding: 12vh 16px 16px;
}
.cmdk-panel {
  width: min(640px, 100%);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0,0,0,.35);
  overflow: hidden;
  display: flex; flex-direction: column;
  max-height: 70vh;
}
.app-root.dark-mode .cmdk-panel { background: #111827; color: #e2e8f0; }
.cmdk-input-row {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; border-bottom: 1px solid var(--cc-border);
}
.cmdk-search-icon { color: #94a3b8; }
.cmdk-input {
  flex: 1; border: none; outline: none; background: transparent;
  font-size: 1.05rem; font-weight: 600;
}
.cmdk-kbd {
  font-size: 0.7rem; padding: 2px 6px; border-radius: 4px;
  background: #f1f5f9; color: #64748b; font-family: ui-monospace, monospace;
}
.cmdk-results { overflow: auto; padding: 8px; }
.cmdk-cat {
  font-size: 0.68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em;
  color: #94a3b8; padding: 8px 10px 4px;
}
.cmdk-item {
  width: 100%; display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border: none; background: transparent;
  border-radius: 10px; cursor: pointer; text-align: left; color: inherit;
}
.cmdk-item.active, .cmdk-item:hover { background: rgba(253,185,18,.15); }
.cmdk-item-text { display: flex; flex-direction: column; min-width: 0; }
.cmdk-item-title { font-weight: 700; }
.cmdk-item-sub { font-size: 0.75rem; color: #64748b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmdk-empty { padding: 24px; text-align: center; color: #94a3b8; }
.cmdk-footer {
  display: flex; gap: 16px; padding: 8px 14px; border-top: 1px solid var(--cc-border);
  font-size: 0.72rem; color: #94a3b8;
}
.cmdk-footer kbd {
  background: #f1f5f9; padding: 1px 4px; border-radius: 3px; font-family: ui-monospace, monospace;
}

/* Admin nested shell */
.admin-shell {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 960px) {
  .admin-shell { grid-template-columns: 220px 1fr; align-items: start; }
}
.admin-side {
  background: var(--cc-surface);
  border: 1px solid var(--cc-border);
  border-radius: var(--cc-radius);
  box-shadow: var(--cc-shadow);
  padding: 12px 8px 16px;
  position: sticky; top: 72px;
}
.admin-side-head {
  display: flex; align-items: center; gap: 8px;
  font-weight: 800; padding: 8px 12px 12px; color: #0f172a;
}
.app-root.dark-mode .admin-side-head { color: #e2e8f0; }
.admin-nav .mud-nav-link { border-radius: 10px !important; margin: 2px 4px !important; font-weight: 600 !important; }
.admin-main { min-width: 0; }
.admin-audit-row {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 8px;
  padding: 8px 0; border-bottom: 1px solid var(--cc-border);
}
.admin-audit-row:last-child { border-bottom: none; }

/* Settings FAB above bottom nav on mobile */
@media (max-width: 959px) {
  .settings-fab { bottom: 72px !important; }
}

/* Dark mode cards */
.app-root.dark-mode .cc-kpi,
.app-root.dark-mode .cc-quick-card,
.app-root.dark-mode .cc-machine,
.app-root.dark-mode .admin-side {
  background: var(--cc-surface);
}
.app-root.dark-mode .cc-bottom-nav {
  background: rgba(17, 24, 39, 0.94);
  border-top-color: rgba(148,163,184,.15);
}

/* ═══════════ v3 polish: page titles, admin tabs, compact machine cards ═══════════ */
.page-title {
  font-size: 1.6rem; font-weight: 700; letter-spacing: -0.02em;
  line-height: 1.2; margin: 0 0 4px; color: inherit;
}
.adm-shell { display: flex; flex-direction: column; gap: 20px; }
.adm-header {
  position: sticky; top: 48px; z-index: 5;
  background: var(--cc-surface); border: 1px solid var(--cc-border);
  border-radius: var(--cc-radius); box-shadow: var(--cc-shadow);
  padding: 10px 12px 0;
}
.adm-header-title {
  display: flex; align-items: center; gap: 8px; padding: 0 6px 6px;
  font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; opacity: .6;
}
.adm-tabs {
  display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.adm-tabs::-webkit-scrollbar { display: none; }
.adm-tab {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  padding: 10px 14px; font-size: .875rem; font-weight: 500; color: inherit; opacity: .7;
  text-decoration: none; border-bottom: 2px solid transparent; border-radius: 8px 8px 0 0;
  transition: background .15s, opacity .15s, border-color .15s;
}
.adm-tab:hover { opacity: 1; background: rgba(148,163,184,.12); }
.adm-tab.active { opacity: 1; font-weight: 600; border-bottom-color: var(--mud-palette-primary); }
.adm-body { min-width: 0; }
@media (max-width: 599px) { .adm-tab span { display: none; } .adm-tab { padding: 10px 12px; } }

/* KPI grid – robust defaults */
.cc-hero { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.cc-hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cc-title { font-weight: 700 !important; letter-spacing: -0.02em; }
.cc-eyebrow { opacity: .6; letter-spacing: .1em !important; }
.cc-kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 20px; }
.cc-kpi {
  background: var(--cc-surface); border: 1px solid var(--cc-border); border-radius: var(--cc-radius);
  box-shadow: var(--cc-shadow); padding: 16px 18px; display: flex; flex-direction: column; gap: 6px;
  cursor: pointer; transition: transform .15s, box-shadow .15s; min-height: 128px;
}
.cc-kpi:hover { transform: translateY(-2px); }
.cc-kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cc-kpi-label { font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; opacity: .65; }
.cc-kpi-value { font-size: 2rem; font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.cc-kpi-of { font-size: 1rem; font-weight: 500; opacity: .5; }
.cc-kpi-sub { font-size: .78rem; opacity: .6; }
.cc-kpi-warn .cc-kpi-value { color: var(--cc-down); }
.cc-spark { display: flex; align-items: flex-end; gap: 3px; height: 32px; margin-top: auto; }
.cc-spark-bar { flex: 1; min-height: 2px; border-radius: 2px; background: var(--mud-palette-primary); opacity: .75; }
.cc-spark-dev .cc-spark-bar { background: var(--cc-down); }
.cc-card { background: var(--cc-surface) !important; border: 1px solid var(--cc-border); border-radius: var(--cc-radius) !important; box-shadow: var(--cc-shadow) !important; }
.cc-card-head, .cc-section-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.cc-section-head { margin-top: 8px; }

.cc-machine-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.cc-machine {
  background: var(--cc-surface); border: 1px solid var(--cc-border); border-radius: 14px;
  box-shadow: var(--cc-shadow); cursor: pointer; transition: transform .15s, border-color .15s; overflow: hidden;
}
.cc-machine:hover { transform: translateY(-2px); border-color: var(--mud-palette-primary); }
.cc-machine-img { display: none !important; }
.cc-machine-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.cc-machine-head { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; }
.cc-machine-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; box-shadow: 0 0 0 3px rgba(148,163,184,.15); }
.cc-machine-name { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-machine-badge2 { font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; opacity: .6; }
.cc-machine-actions { display: flex; gap: 6px; margin-top: 8px; }
@media (max-width: 599px) {
  .cc-kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .cc-kpi { padding: 12px 14px; min-height: 108px; }
  .cc-kpi-value { font-size: 1.6rem; }
  .cc-machine-grid { grid-template-columns: 1fr; }
  .adm-header { top: 48px; }
}

/* ═══════════ Maskinsignaler / Live ═══════════ */
.sig-chip { display:inline-flex; align-items:center; gap:6px; padding:3px 10px; border-radius:999px; font-size:.75rem; font-weight:600;
  color: var(--sig); background: color-mix(in srgb, var(--sig) 12%, transparent); border:1px solid color-mix(in srgb, var(--sig) 30%, transparent); white-space:nowrap; }
.sig-chip i { width:8px; height:8px; border-radius:50%; background: var(--sig); display:inline-block; }
.sig-chip i.sig-pulse { animation: sigPulse 1.6s infinite; }
@keyframes sigPulse { 0% { box-shadow:0 0 0 0 color-mix(in srgb, var(--sig) 60%, transparent);} 70% { box-shadow:0 0 0 7px transparent;} 100% { box-shadow:0 0 0 0 transparent;} }
.sig-summary { display:flex; flex-wrap:wrap; gap:8px; }
.sig-summary span { display:inline-flex; align-items:center; gap:6px; padding:6px 12px; border-radius:10px; background:var(--cc-surface); border:1px solid var(--cc-border); font-size:.8rem; }
.sig-summary i, .sig-legend i { width:10px; height:10px; border-radius:3px; display:inline-block; }
.sig-board { display:grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap:14px; }
.sig-card { position:relative; background:var(--cc-surface); border:1px solid var(--cc-border); border-radius:16px; box-shadow:var(--cc-shadow);
  padding:16px 16px 14px; cursor:pointer; overflow:hidden; transition: transform .15s, border-color .15s; display:flex; flex-direction:column; gap:10px; }
.sig-card::before { content:""; position:absolute; left:0; top:0; bottom:0; width:4px; background:var(--sig); }
.sig-card:hover { transform: translateY(-2px); border-color: var(--sig); }
.sig-card-top { display:flex; justify-content:space-between; align-items:flex-start; gap:8px; }
.sig-card-title { display:flex; align-items:center; gap:10px; min-width:0; }
.sig-card-nr { font-weight:700; font-size:.8rem; padding:4px 8px; border-radius:8px; background: rgba(148,163,184,.15); font-variant-numeric: tabular-nums; }
.sig-card-name { font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.sig-card-since { font-size:.75rem; opacity:.6; }
.sig-gauge { height:8px; border-radius:999px; background: rgba(148,163,184,.18); overflow:hidden; }
.sig-gauge-sm { height:5px; margin:6px 0 2px; }
.sig-gauge-fill { height:100%; border-radius:999px; background: var(--sig, var(--mud-palette-primary)); transition: width .6s ease; }
.sig-card-metrics { display:grid; grid-template-columns: repeat(4, 1fr); gap:6px; }
.sig-card-metrics div, .sig-metrics div { display:flex; flex-direction:column; min-width:0; }
.sig-card-metrics span, .sig-metrics span { font-size:.68rem; text-transform:uppercase; letter-spacing:.05em; opacity:.55; }
.sig-card-metrics b { font-size:1.05rem; font-variant-numeric: tabular-nums; }
.sig-card-alarm { font-size:.78rem; font-weight:600; color:#9333ea; background: rgba(147,51,234,.08); padding:6px 10px; border-radius:8px; }
.sig-card-prog { font-size:.75rem; opacity:.65; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.sig-mono, .sig-mono input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace !important; }
.sig-timeline { width:100%; }
.sig-tl-bar { position:relative; height:26px; border-radius:8px; background: rgba(148,163,184,.14); overflow:hidden; }
.sig-timeline-compact .sig-tl-bar { height:10px; border-radius:5px; }
.sig-tl-seg { position:absolute; top:0; bottom:0; }
.sig-tl-axis { position:relative; height:16px; font-size:.65rem; opacity:.55; margin-top:2px; }
.sig-tl-axis span { position:absolute; transform: translateX(-50%); }
.sig-tl-axis span:first-child { transform:none; } .sig-tl-axis span:last-child { transform: translateX(-100%); }
.sig-legend { display:flex; gap:14px; flex-wrap:wrap; font-size:.75rem; opacity:.75; margin-top:6px; }
.sig-legend span { display:inline-flex; align-items:center; gap:6px; }
.sig-metrics { display:grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap:12px; }
.sig-metrics b { font-size:1.35rem; font-weight:700; font-variant-numeric: tabular-nums; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.sig-metrics small { font-size:.75rem; font-weight:500; opacity:.6; margin-left:2px; }
.sig-metrics .sig-alarm b { color:#9333ea; font-size:1rem; }
.sig-stops { display:flex; flex-direction:column; }
.sig-stop-row { display:grid; grid-template-columns: 110px 110px 90px 1fr; align-items:center; gap:8px; padding:7px 0; border-bottom:1px solid var(--cc-border); font-size:.85rem; }
.sig-stop-row:last-child { border-bottom:none; }
.sig-muted { opacity:.6; } .sig-reason { opacity:.8; font-style: italic; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.sig-steps { padding-left: 18px; margin: 0 0 12px; font-size:.875rem; line-height:1.6; }
@media (max-width: 599px) {
  .sig-stop-row { grid-template-columns: 1fr 1fr; }
  .sig-board { grid-template-columns: 1fr; }
}

/* ═══════════ Stopp-klassning (tablet-vänlig) ═══════════ */
.sp-backdrop { position:fixed; inset:0; background:rgba(15,23,42,.45); backdrop-filter: blur(2px); z-index:1400; }
.sp-panel { position:fixed; z-index:1401; right:0; top:0; bottom:0; width:min(760px, 100vw); background:var(--cc-surface, #fff);
  box-shadow:-12px 0 40px rgba(0,0,0,.2); display:flex; flex-direction:column; animation: spIn .18s ease-out; }
@keyframes spIn { from { transform: translateX(24px); opacity:.6 } to { transform:none; opacity:1 } }
.sp-head { display:flex; justify-content:space-between; align-items:center; padding:18px 20px 10px; border-bottom:1px solid var(--cc-border); }
.sp-title { font-size:1.35rem; font-weight:700; letter-spacing:-.01em; }
.sp-sub { font-size:.85rem; opacity:.6; }
.sp-stops { display:flex; flex-direction:column; gap:6px; padding:12px 20px; max-height:30vh; overflow:auto; border-bottom:1px solid var(--cc-border); }
.sp-stop { display:grid; grid-template-columns: 14px 110px 90px 1fr 24px; align-items:center; gap:10px; padding:10px 12px; min-height:48px;
  border-radius:12px; border:1px solid var(--cc-border); background:transparent; color:inherit; font:inherit; text-align:left; cursor:pointer; }
.sp-stop.sp-sel { border-color: var(--mud-palette-primary); background: rgba(253,185,18,.10); }
.sp-dot { width:12px; height:12px; border-radius:50%; }
.sp-time { font-variant-numeric: tabular-nums; font-weight:600; }
.sp-dur { opacity:.7; font-variant-numeric: tabular-nums; }
.sp-cur { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; opacity:.75; font-style:italic; }
.sp-tools { display:flex; align-items:center; gap:12px; padding:10px 20px; border-bottom:1px solid var(--cc-border); flex-wrap:wrap; font-size:.9rem; }
.sp-slider { flex:1; min-width:160px; }
.sp-reasons { flex:1; overflow:auto; padding:14px 20px; display:flex; flex-direction:column; gap:16px; }
.sp-group-title { font-size:.75rem; font-weight:700; text-transform:uppercase; letter-spacing:.08em; margin-bottom:8px; }
.sp-grid { display:grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap:10px; }
.sp-reason { min-height:64px; padding:12px 14px; border-radius:14px; border:2px solid color-mix(in srgb, var(--rc) 45%, transparent);
  background: color-mix(in srgb, var(--rc) 10%, transparent); color:inherit; font:inherit; font-weight:600; font-size:1rem; text-align:left;
  cursor:pointer; transition: transform .1s, background .15s; touch-action: manipulation; }
.sp-reason:hover:not(:disabled) { background: color-mix(in srgb, var(--rc) 22%, transparent); }
.sp-reason:active:not(:disabled) { transform: scale(.97); }
.sp-reason:disabled { opacity:.4; cursor:not-allowed; }
.sp-foot { padding:12px 20px 18px; border-top:1px solid var(--cc-border); }
.sig-unclass { display:inline-flex; align-items:center; gap:6px; padding:6px 10px; border-radius:10px; border:1px dashed #f59e0b; color:#b45309;
  background: rgba(245,158,11,.08); font-size:.78rem; font-weight:600; cursor:pointer; font-family:inherit; }
.sig-stop-row.sig-clickable { cursor:pointer; border-radius:8px; }
.sig-stop-row.sig-clickable:hover { background: rgba(148,163,184,.10); }
@media (max-width: 599px) { .sp-stop { grid-template-columns: 12px 1fr auto 24px; } .sp-cur { display:none; } .sp-grid { grid-template-columns: 1fr 1fr; } }

/* ═══════════ OEE ═══════════ */
.oee-filters { display:grid; grid-template-columns: repeat(auto-fit, minmax(200px, 260px)); gap:12px; margin-bottom:18px; }
.oee-kpis { display:grid; grid-template-columns: 1.3fr repeat(3, 1fr) 2fr; gap:14px; margin-bottom:14px; align-items:stretch; }
.oee-gauge, .oee-facts { background:var(--cc-surface); border:1px solid var(--cc-border); border-radius:16px; box-shadow:var(--cc-shadow); padding:16px; }
.oee-gauge { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:10px; }
.oee-ring { --size:104px; width:var(--size); height:var(--size); border-radius:50%; display:grid; place-items:center;
  background: conic-gradient(var(--c) calc(var(--v) * 1%), rgba(148,163,184,.18) 0); position:relative; }
.oee-ring::before { content:""; position:absolute; inset:10px; border-radius:50%; background:var(--cc-surface); }
.oee-ring span { position:relative; font-weight:700; font-size:1.05rem; font-variant-numeric: tabular-nums; }
.oee-gauge-big .oee-ring { --size:140px; } .oee-gauge-big .oee-ring span { font-size:1.6rem; }
.oee-gauge-label { font-size:.78rem; font-weight:700; text-transform:uppercase; letter-spacing:.06em; opacity:.65; }
.oee-facts { display:grid; grid-template-columns: repeat(2, 1fr); gap:10px 16px; align-content:center; }
.oee-facts div { display:flex; flex-direction:column; } .oee-facts span { font-size:.72rem; text-transform:uppercase; letter-spacing:.05em; opacity:.55; }
.oee-facts b { font-size:1.15rem; font-variant-numeric: tabular-nums; }
.oee-waterfall { display:flex; flex-direction:column; gap:8px; }
.wf-row { display:grid; grid-template-columns: 140px 1fr 90px; gap:10px; align-items:center; font-size:.85rem; }
.wf-row b { text-align:right; font-variant-numeric: tabular-nums; font-weight:600; }
.wf-track { position:relative; height:16px; border-radius:4px; background: rgba(148,163,184,.12); }
.wf-track i { position:absolute; top:0; bottom:0; border-radius:4px; }
.wf-total { font-weight:700; border-top:1px solid var(--cc-border); padding-top:8px; }
.oee-bar { margin-bottom:12px; } .oee-bar-label { display:flex; justify-content:space-between; font-size:.85rem; margin-bottom:4px; }
.oee-bar-track, .pareto-track { height:10px; border-radius:999px; background: rgba(148,163,184,.14); overflow:hidden; }
.oee-bar-track i, .pareto-track i { display:block; height:100%; border-radius:999px; }
.pareto-row { display:grid; grid-template-columns: minmax(120px, 190px) 1fr 120px 44px; gap:10px; align-items:center; padding:5px 0; font-size:.85rem; }
.pareto-label { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-weight:500; }
.pareto-val { opacity:.7; font-variant-numeric: tabular-nums; text-align:right; } .pareto-cum { font-weight:700; text-align:right; font-variant-numeric: tabular-nums; }
.oee-pill { display:inline-block; padding:3px 10px; border-radius:999px; font-weight:700; color:var(--c); background: color-mix(in srgb, var(--c) 12%, transparent); }
.oee-shifts { display:grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap:12px; }
.oee-shift { border:1px solid var(--cc-border); border-radius:12px; padding:14px; display:flex; flex-direction:column; gap:4px; }
.oee-shift b { font-size:1.6rem; } .oee-shift small { opacity:.6; }
@media (max-width: 1199px) { .oee-kpis { grid-template-columns: repeat(2, 1fr); } .oee-facts { grid-column: 1 / -1; grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 599px) { .pareto-row { grid-template-columns: 1fr 70px; } .pareto-track, .pareto-cum { display:none; } .wf-row { grid-template-columns: 110px 1fr 70px; font-size:.78rem; } .oee-facts { grid-template-columns: repeat(2, 1fr); } }

/* ── Fas 3: order, planering, skiftöverlämning ─────────────────────── */
.ord-row { cursor: pointer; }
.ord-op { color: var(--mud-palette-text-secondary); font-weight: 400; }
.ord-sub { display: block; font-size: .75rem; color: var(--mud-palette-text-secondary); }
.ord-late { color: #dc2626; font-weight: 600; }
.ord-err { font-size: .8rem; }
.ord-empty { display: flex; flex-direction: column; align-items: center; gap: .5rem; padding: 3rem 1rem; text-align: center; }
.ord-toolbar { display: flex; justify-content: flex-end; margin-bottom: .75rem; }
.ord-control { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; padding: 1rem; margin-bottom: 1rem; }
.ord-control .mud-input-control { max-width: 240px; }
.ord-scrap { display: grid; grid-template-columns: 110px 1fr auto; gap: .75rem; align-items: center; }
.plan-board { display: flex; gap: .75rem; overflow-x: auto; padding-bottom: .5rem; align-items: flex-start; }
.plan-col { flex: 0 0 260px; background: var(--mud-palette-background-gray, #f1f5f9); border-radius: 12px; padding: .5rem; }
.plan-col-unplanned { background: #fff7ed; }
.plan-col-head { display: flex; flex-direction: column; padding: .25rem .5rem .5rem; font-size: .85rem; }
.plan-col-head span { color: var(--mud-palette-text-secondary); font-size: .75rem; }
.plan-zone { min-height: 120px; display: flex; flex-direction: column; gap: .5rem; }
.plan-card { background: var(--mud-palette-surface); border: 1px solid var(--mud-palette-lines-default); border-radius: 10px; padding: .55rem .7rem; cursor: grab; box-shadow: 0 1px 2px rgba(15,23,42,.05); }
.plan-card.plan-running { border-left: 4px solid #16a34a; cursor: default; }
.plan-card.plan-late { border-color: #fca5a5; }
.plan-card-top { display: flex; justify-content: space-between; align-items: center; font-weight: 600; font-size: .85rem; }
.plan-card-top a { color: inherit; text-decoration: none; }
.plan-dot { width: 9px; height: 9px; border-radius: 50%; }
.plan-card-art { font-size: .78rem; color: var(--mud-palette-text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plan-card-meta { display: flex; gap: .6rem; font-size: .72rem; color: var(--mud-palette-text-secondary); margin-top: .2rem; }
.plan-card-warn { font-size: .72rem; color: #dc2626; margin-top: .2rem; }
.plan-tl { padding: .75rem; overflow-x: auto; }
.plan-tl-row { display: flex; align-items: center; min-height: 36px; border-bottom: 1px solid var(--mud-palette-lines-default); min-width: 900px; }
.plan-tl-head { min-height: 28px; }
.plan-tl-label { flex: 0 0 170px; font-size: .8rem; font-weight: 600; padding-right: .5rem; }
.plan-tl-track { position: relative; flex: 1; height: 28px; }
.plan-tl-tick { position: absolute; top: 4px; font-size: .68rem; color: var(--mud-palette-text-secondary); transform: translateX(-50%); white-space: nowrap; }
.plan-tl-now { position: absolute; top: 0; bottom: 0; width: 2px; background: #dc2626; }
.plan-tl-bar { position: absolute; top: 4px; height: 20px; border-radius: 5px; color: #fff; font-size: .7rem; padding: 0 .35rem; overflow: hidden; white-space: nowrap; text-decoration: none; line-height: 20px; opacity: .9; }
.plan-tl-bar.plan-late { outline: 2px solid #dc2626; }
.ho-stop { display: flex; justify-content: space-between; padding: .35rem 0; border-bottom: 1px dashed var(--mud-palette-lines-default); font-size: .85rem; }
.ho-hist { padding: .6rem 0; border-bottom: 1px solid var(--mud-palette-lines-default); }
.ho-hist-head { display: flex; gap: .75rem; align-items: center; font-size: .85rem; }
.ho-hist-head span { color: var(--mud-palette-text-secondary); flex: 1; }
.ho-note { font-size: .82rem; margin-top: .25rem; white-space: pre-wrap; }
.sig-order { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; padding: .5rem .75rem; margin-bottom: .75rem; border-radius: 8px; background: #eff6ff; color: #1e3a8a; text-decoration: none; font-size: .85rem; }
.sig-card-order { display: flex; align-items: center; gap: .3rem; font-size: .75rem; color: #1e40af; margin: .15rem 0; }
@media (max-width: 700px) { .ord-scrap { grid-template-columns: 1fr; } }

/* ── Fas 4: kiosk, terminal, TV, andon ─────────────────────────────── */
.kiosk-root { min-height: 100vh; background: #0b1120; color: #f1f5f9; font-family: Inter, "Segoe UI", Roboto, sans-serif; -webkit-user-select: none; user-select: none; touch-action: manipulation; }
.kiosk-center { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .75rem; text-align: center; padding: 2rem; }
.kiosk-h1 { font-size: 2.2rem; font-weight: 700; margin: .5rem 0; }
.kiosk-muted { color: #94a3b8; font-size: 1.1rem; }
.kiosk-error { color: #f87171; font-size: 1.2rem; font-weight: 600; }
.kiosk-btn-lg { min-height: 64px; min-width: 260px; font-size: 1.2rem !important; border-radius: 14px !important; }
.kiosk-code { font-size: 2.6rem; letter-spacing: .3em; text-align: center; width: min(90vw, 460px); padding: .6rem; border-radius: 14px; border: 2px solid #334155; background: #111827; color: #f1f5f9; text-transform: uppercase; -webkit-user-select: text; user-select: text; }
.kiosk-admin-code { font-family: ui-monospace, monospace; font-size: 1.4rem; font-weight: 700; letter-spacing: .15em; }

.term { min-height: 100vh; display: flex; flex-direction: column; }
.term-head { display: flex; align-items: center; gap: 1rem; padding: .75rem 1.25rem; background: #111827; border-bottom: 4px solid var(--brand, #3b82f6); }
.term-brand { display: flex; align-items: center; gap: .75rem; flex: 1; min-width: 0; }
.term-brand img { height: 44px; max-width: 120px; object-fit: contain; background: #fff; border-radius: 8px; padding: 3px; }
.term-brand b { display: block; font-size: 1.5rem; }
.term-brand span { color: #94a3b8; font-size: .9rem; }
.term-state { font-size: 1.4rem; font-weight: 800; padding: .5rem 1.1rem; border-radius: 12px; text-transform: uppercase; background: #334155; }
.term-state small { display: block; font-size: .8rem; font-weight: 500; text-transform: none; opacity: .85; }
.term-state-running { background: #15803d; } .term-state-idle { background: #b45309; } .term-state-stopped { background: #b91c1c; }
.term-state-alarm { background: #dc2626; animation: kblink 1s steps(2) infinite; }
.term-clock { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.term-op { display: flex; align-items: center; gap: .4rem; font-size: 1.2rem; font-weight: 700; color: #f1f5f9; background: #1f2937; border: 0; border-radius: 12px; padding: .7rem 1rem; }
.term-login { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .6rem; padding: 1.5rem; }
.term-login h1 { font-size: 2.4rem; margin: 0; }
.term-pin-dots { display: flex; gap: .8rem; margin: .5rem 0; }
.term-pin-dots span { width: 22px; height: 22px; border-radius: 50%; border: 3px solid #475569; }
.term-pin-dots span.on { background: #3b82f6; border-color: #3b82f6; }
.term-keypad { display: grid; grid-template-columns: repeat(3, 110px); gap: .8rem; }
.term-key { height: 90px; min-width: 90px; font-size: 2.2rem; font-weight: 700; color: #f1f5f9; background: #1f2937; border: 0; border-radius: 18px; }
.term-key:active { background: #334155; }
.term-key.ok { background: #2563eb; font-size: 1.6rem; }
.term-badge { margin-top: 1rem; width: 300px; padding: .7rem; font-size: 1.1rem; text-align: center; border-radius: 12px; border: 1px dashed #475569; background: transparent; color: #94a3b8; }
.term-body { flex: 1; display: grid; grid-template-columns: 1.3fr 1fr; gap: 1.25rem; padding: 1.25rem; align-content: start; }
.term-order { background: #111827; border-radius: 20px; padding: 1.4rem; display: flex; flex-direction: column; gap: .9rem; grid-row: span 2; }
.term-label { text-transform: uppercase; letter-spacing: .08em; font-size: .85rem; color: #94a3b8; }
.term-order h2 { font-size: 2.2rem; margin: .2rem 0; }
.term-order-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.term-big-num { font-size: 3.6rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; }
.term-big-num small { font-size: 1.4rem; color: #94a3b8; margin-left: .3rem; }
.term-bar { height: 22px; background: #1f2937; border-radius: 11px; overflow: hidden; }
.term-bar div { height: 100%; background: linear-gradient(90deg, #2563eb, #22c55e); }
.term-order-meta { display: flex; flex-wrap: wrap; gap: 1.2rem; font-size: 1.15rem; color: #cbd5e1; }
.term-actions { display: flex; gap: .9rem; margin-top: auto; flex-wrap: wrap; }
.term-btn { flex: 1; min-height: 76px; display: flex; align-items: center; justify-content: center; gap: .6rem; font-size: 1.4rem; font-weight: 700; color: #fff; background: #334155; border: 0; border-radius: 16px; padding: 0 1.25rem; }
.term-btn.primary { background: #2563eb; } .term-btn.ok { background: #16a34a; } .term-btn.warn { background: #d97706; } .term-btn.danger { background: #dc2626; }
.term-btn.wide { min-height: 120px; font-size: 1.8rem; }
.term-btn.sm { min-height: 48px; flex: 0 0 auto; font-size: 1rem; }
.term-btn:disabled { opacity: .45; }
.term-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.term-tile { position: relative; min-height: 130px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .5rem; font-size: 1.3rem; font-weight: 700; color: #f1f5f9; background: #1f2937; border: 0; border-radius: 20px; }
.term-tile .mud-icon-root { font-size: 2.6rem; }
.term-tile em { position: absolute; top: 10px; right: 14px; font-style: normal; background: #dc2626; border-radius: 999px; padding: .1rem .6rem; font-size: 1rem; }
.term-tile.attn { box-shadow: inset 0 0 0 3px #f59e0b; }
.term-tile.andon-on { background: #7f1d1d; animation: kpulse 1.4s ease-in-out infinite; }
.term-andons { display: flex; flex-direction: column; gap: .6rem; }
.term-andon-row { display: flex; align-items: center; gap: .8rem; padding: .7rem 1rem; border-radius: 14px; background: #111827; border-left: 8px solid var(--c); font-size: 1.15rem; }
.term-andon-row span { flex: 1; color: #94a3b8; }
.term-modal-bg { position: fixed; inset: 0; background: rgba(2,6,23,.78); display: flex; align-items: center; justify-content: center; z-index: 2000; padding: 1rem; }
.term-modal { background: #111827; border-radius: 22px; padding: 1.6rem; width: min(960px, 96vw); max-height: 92vh; overflow-y: auto; display: flex; flex-direction: column; gap: 1rem; }
.term-modal h2 { font-size: 1.9rem; margin: 0; }
.term-list { display: flex; flex-direction: column; gap: .7rem; }
.term-list-item { display: grid; grid-template-columns: 1fr 1.4fr auto; gap: 1rem; align-items: center; text-align: left; min-height: 74px; padding: .7rem 1.1rem; font-size: 1.2rem; color: #f1f5f9; background: #1f2937; border: 0; border-radius: 14px; }
.term-list-item span { color: #94a3b8; }
.term-stepper { display: flex; align-items: center; gap: 1rem; justify-content: center; }
.term-stepper .term-big-num { min-width: 140px; text-align: center; }
.term-chips { display: flex; flex-wrap: wrap; gap: .6rem; }
.term-chip { min-height: 60px; padding: 0 1.2rem; font-size: 1.15rem; font-weight: 600; color: #f1f5f9; background: #1f2937; border: 2px solid #334155; border-radius: 14px; }
.term-chip.on { background: #1d4ed8; border-color: #60a5fa; }
.term-input { font-size: 1.6rem; padding: .8rem 1rem; border-radius: 14px; border: 2px solid #334155; background: #0b1120; color: #f1f5f9; -webkit-user-select: text; user-select: text; }
.term-reasons { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .8rem; }
.term-reason { min-height: 96px; font-size: 1.25rem; font-weight: 700; color: #fff; background: #1f2937; border: 0; border-left: 10px solid var(--c); border-radius: 16px; padding: .5rem 1rem; text-align: left; }
.term-andon-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1rem; }
.term-andon-btn { min-height: 170px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .5rem; font-size: 1.4rem; color: #fff; background: var(--c); border: 0; border-radius: 20px; opacity: .92; }
.term-andon-btn .mud-icon-root { font-size: 3rem; }
.term-andon-btn.active { box-shadow: 0 0 0 5px #fff inset; animation: kpulse 1.4s ease-in-out infinite; }
.term-toast { position: fixed; bottom: 2rem; left: 50%; transform: translateX(-50%); background: #1e293b; color: #fff; padding: 1rem 2rem; border-radius: 14px; font-size: 1.3rem; z-index: 3000; box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.term-pick { padding: 2rem; }
.term-pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; margin-top: 1rem; }
.term-pick-btn { display: flex; flex-direction: column; gap: .3rem; padding: 1.5rem; background: #1f2937; border-radius: 18px; color: #f1f5f9; text-decoration: none; }
.term-pick-btn b { font-size: 2.4rem; } .term-pick-btn span { color: #94a3b8; font-size: 1.1rem; }
@media (max-width: 900px) { .term-body { grid-template-columns: 1fr; } .term-list-item { grid-template-columns: 1fr; } }

.tv { min-height: 100vh; display: flex; flex-direction: column; background: #030712; }
.tv-head { display: flex; align-items: center; gap: 2rem; padding: 1rem 2rem; border-bottom: 1px solid #1f2937; }
.tv-brand { display: flex; align-items: center; gap: 1rem; font-size: 1.8rem; }
.tv-brand img { height: 48px; background: #fff; border-radius: 8px; padding: 3px; }
.tv-tabs { flex: 1; display: flex; gap: .5rem; }
.tv-tabs span { padding: .35rem 1rem; border-radius: 999px; color: #64748b; font-size: 1.1rem; }
.tv-tabs span.on { background: #1e293b; color: #f1f5f9; }
.tv-clock { font-size: 2.6rem; font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; line-height: 1; }
.tv-clock small { display: block; font-size: 1rem; font-weight: 500; color: #94a3b8; text-transform: capitalize; }
.tv-andon-bar { display: flex; flex-wrap: wrap; gap: .75rem; padding: .75rem 2rem; background: #111827; }
.tv-andon { display: flex; align-items: center; gap: .7rem; padding: .6rem 1.1rem; border-radius: 12px; background: var(--c); font-size: 1.3rem; }
.tv-andon span { opacity: .9; }
.blink { animation: kblink 1s steps(2) infinite; }
.tv-main { flex: 1; padding: 1.5rem 2rem; }
.tv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.2rem; }
.tv-card { border-radius: 18px; padding: 1.2rem 1.4rem; background: #1f2937; border-top: 10px solid #475569; display: flex; flex-direction: column; gap: .3rem; }
.tv-card-top { display: flex; gap: .7rem; align-items: baseline; } .tv-card-top b { font-size: 2.2rem; } .tv-card-top span { font-size: 1.2rem; color: #cbd5e1; }
.tv-card-state { font-size: 2rem; font-weight: 900; letter-spacing: .04em; }
.tv-card-sub, .tv-card-order, .tv-card-oee { font-size: 1.15rem; color: #cbd5e1; }
.tv-running { border-top-color: #22c55e; } .tv-running .tv-card-state { color: #4ade80; }
.tv-idle { border-top-color: #f59e0b; } .tv-idle .tv-card-state { color: #fbbf24; }
.tv-stopped { border-top-color: #ef4444; } .tv-stopped .tv-card-state { color: #f87171; }
.tv-alarm { border-top-color: #ef4444; background: #450a0a; } .tv-alarm .tv-card-state { color: #fca5a5; animation: kblink 1s steps(2) infinite; }
.tv-offline { opacity: .55; }
.tv-oee-total { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
.tv-oee-total div { background: #111827; border-radius: 18px; padding: 1.2rem; display: flex; flex-direction: column; }
.tv-oee-total span { color: #94a3b8; font-size: 1.2rem; } .tv-oee-total b { font-size: 3.4rem; font-weight: 800; }
.tv-oee-rows { display: flex; flex-direction: column; gap: .7rem; }
.tv-oee-row { display: grid; grid-template-columns: 260px 1fr 90px; align-items: center; gap: 1rem; font-size: 1.4rem; }
.tv-oee-bar { height: 30px; background: #1f2937; border-radius: 10px; overflow: hidden; } .tv-oee-bar div { height: 100%; }
.good { color: #4ade80; } .mid { color: #fbbf24; } .bad { color: #f87171; }
.tv-oee-bar .good { background: #16a34a; } .tv-oee-bar .mid { background: #d97706; } .tv-oee-bar .bad { background: #dc2626; }
.tv-orders { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 1.2rem; }
.tv-order { background: #111827; border-radius: 18px; padding: 1.2rem 1.4rem; }
.tv-order-top { display: flex; justify-content: space-between; font-size: 1.4rem; } .tv-order-top b { font-size: 1.8rem; } .tv-order-top span { color: #94a3b8; }
.tv-order-bar { height: 26px; background: #1f2937; border-radius: 13px; overflow: hidden; margin: .7rem 0; } .tv-order-bar div { height: 100%; background: linear-gradient(90deg, #2563eb, #22c55e); }
.tv-order-meta { display: flex; justify-content: space-between; font-size: 1.3rem; color: #cbd5e1; }
.tv-empty { font-size: 1.6rem; color: #64748b; padding: 3rem; }
.tv-andon-list { display: flex; flex-direction: column; gap: 1rem; }
.tv-andon-big { display: flex; align-items: center; gap: 1.5rem; padding: 1.5rem 2rem; border-radius: 20px; background: var(--c); }
.tv-andon-big .mud-icon-root { font-size: 4rem; } .tv-andon-big b { display: block; font-size: 2.2rem; } .tv-andon-big span { font-size: 1.4rem; opacity: .9; }
@keyframes kblink { 50% { opacity: .35; } }
@keyframes kpulse { 50% { filter: brightness(1.35); } }

.andon-open { display: flex; flex-direction: column; gap: .6rem; margin-top: 1rem; }
.andon-card { display: flex; align-items: center; gap: 1rem; padding: .9rem 1.1rem; border-left: 6px solid var(--c); }
.andon-card > .mud-icon-root { color: var(--c); }
.andon-card-body { flex: 1; display: flex; flex-direction: column; font-size: .9rem; }
.andon-card-body span { color: var(--mud-palette-text-secondary); }
.andon-blink { animation: kpulse 1.4s ease-in-out infinite; }
.andon-empty { display: flex; align-items: center; gap: .6rem; padding: 1rem; }
.andon-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: .4rem; }
.oee-andon { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; padding: .7rem 1rem; margin-bottom: 1rem; border-radius: 10px; background: #fef2f2; color: #7f1d1d; text-decoration: none; font-size: .88rem; }
.adm-inline-input { width: 130px; padding: .35rem .5rem; border: 1px solid var(--mud-palette-lines-default); border-radius: 6px; background: transparent; color: inherit; }

/* ── Fas 5: underhåll & kvalitet ───────────────────────────────────── */
.mt-plan { padding: .55rem 0; border-bottom: 1px dashed var(--mud-palette-lines-default); }
.mt-plan-head { display: flex; justify-content: space-between; gap: 1rem; font-size: .88rem; margin-bottom: .3rem; }
.q-plan { display: grid; grid-template-columns: 1fr auto; align-items: center; padding: .5rem .6rem; border-radius: 8px; cursor: pointer; font-size: .88rem; }
.q-plan span { grid-column: 1; color: var(--mud-palette-text-secondary); font-size: .78rem; }
.q-plan > span:last-child { grid-column: 2; grid-row: 1 / span 2; }
.q-plan.on, .q-plan:hover { background: var(--mud-palette-action-default-hover); }
.spc-chart { width: 100%; }
.spc-label { font-size: .75rem; color: var(--mud-palette-text-secondary); margin: .3rem 0 .1rem; }
.spc-svg { width: 100%; height: 260px; display: block; }
.spc-svg-r { height: 120px; }
.spc-line { fill: none; stroke: #2563eb; stroke-width: 2; vector-effect: non-scaling-stroke; }
.spc-pt { fill: #2563eb; } .spc-pt-ooc { fill: #f59e0b; } .spc-pt-oot { fill: #dc2626; }
.spc-center { stroke: #16a34a; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.spc-cl { stroke: #f59e0b; stroke-width: 1.5; stroke-dasharray: 6 4; vector-effect: non-scaling-stroke; }
.spc-tol { stroke: #dc2626; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.spc-txt { font-size: 13px; fill: var(--mud-palette-text-secondary); }
.spc-empty { padding: 2rem; text-align: center; color: var(--mud-palette-text-secondary); }
.spc-stats { display: flex; flex-direction: column; gap: .6rem; }
.spc-stats div { display: flex; flex-direction: column; }
.spc-stats span { font-size: .75rem; color: var(--mud-palette-text-secondary); text-transform: uppercase; letter-spacing: .04em; }
.spc-stats b { font-size: 1.25rem; } .spc-stats div:first-child b { font-size: 2rem; }
.spc-stats small { color: var(--mud-palette-text-secondary); }
b.good { color: #16a34a; } b.mid { color: #d97706; } b.bad { color: #dc2626; }
.term-meas { display: grid; grid-template-columns: 1fr auto; gap: 1.2rem; align-items: start; }
.term-meas-entry { font-size: 3.2rem; font-weight: 800; font-variant-numeric: tabular-nums; padding: .4rem 1rem; background: #0b1120; border-radius: 14px; margin-bottom: .8rem; }
.term-meas-entry small { font-size: 1.2rem; color: #94a3b8; }
.term-keypad.sm { grid-template-columns: repeat(3, 92px); gap: .6rem; }
.term-keypad.sm .term-key { height: 72px; min-width: 72px; font-size: 1.8rem; }
.term-keypad.sm .term-key.ok { grid-column: span 3; font-size: 1.3rem; }
.term-chip.bad { background: #7f1d1d; border-color: #ef4444; }
@media (max-width: 900px) { .term-meas { grid-template-columns: 1fr; } }

/* ── Kom igång-checklista ─────────────────────────────── */
.ob-card{border:1px solid var(--mud-palette-lines-default);border-left:4px solid var(--mud-palette-primary);border-radius:12px;background:var(--mud-palette-surface)}
.ob-head{display:flex;justify-content:space-between;gap:12px;align-items:flex-start;flex-wrap:wrap}
.ob-head-actions{display:flex;align-items:center;gap:4px}
.ob-eyebrow{color:var(--mud-palette-primary);font-weight:700;letter-spacing:.08em;line-height:1.2}
.ob-steps{display:grid;grid-template-columns:repeat(auto-fill,minmax(320px,1fr));gap:8px}
.ob-step{display:flex;gap:10px;align-items:center;padding:10px 12px;border:1px solid var(--mud-palette-lines-default);border-radius:10px}
.ob-step.ob-next{border-color:var(--mud-palette-primary);box-shadow:0 0 0 1px var(--mud-palette-primary) inset}
.ob-step.ob-done{opacity:.7}.ob-step.ob-done .ob-title{text-decoration:line-through;text-decoration-color:rgba(0,0,0,.25)}
.ob-icon{flex:0 0 auto}.ob-text{flex:1;min-width:0}.ob-title{font-weight:600;font-size:.92rem}
.ob-desc{font-size:.8rem;color:var(--mud-palette-text-secondary);line-height:1.35}
.ob-actions{display:flex;align-items:center;gap:2px;flex:0 0 auto}
.ob-skip-tag{font-size:.68rem;font-weight:500;color:var(--mud-palette-text-secondary);border:1px solid var(--mud-palette-lines-default);border-radius:8px;padding:0 6px;margin-left:4px}
@media (max-width:600px){.ob-steps{grid-template-columns:1fr}.ob-step{flex-wrap:wrap}.ob-actions{width:100%;justify-content:flex-end}}

/* ── Tomlägen med uppmaning ───────────────────────────── */
.es-box{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:6px;padding:36px 20px;border:1px dashed var(--mud-palette-lines-default);border-radius:12px;color:var(--mud-palette-text-secondary);background:var(--mud-palette-surface)}
.es-box.es-compact{padding:20px 14px}
.es-icon{font-size:40px !important;opacity:.5;margin-bottom:4px}
.es-title{font-weight:600;font-size:1rem;color:var(--mud-palette-text-primary)}
.es-text{font-size:.86rem;max-width:460px;line-height:1.45}
.es-actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:center;margin-top:8px}

/* ── Hjälptips ────────────────────────────────────────── */
.help-tip{display:inline-flex;align-items:center;vertical-align:middle;margin-left:4px;color:var(--mud-palette-text-secondary);cursor:help;border-radius:50%}
.help-tip:hover,.help-tip:focus{color:var(--mud-palette-primary);outline:none}
.help-tip-pop{max-width:300px}

/* ── /logga: fullbredd verkstadslayout ─────────────────────────────────── */
.cc-content:has(> .logga-page) { max-width: none; padding: 0; }
.logga-page { display: flex; flex-direction: column; }
.logga-page .logga-hero { padding: 22px clamp(16px, 2.4vw, 36px) 18px; align-items: center; }
.logga-page .machine-panel { background: var(--shop-panel); border: 1px solid var(--shop-border); border-radius: 14px;
    margin: 16px clamp(8px, 1.6vw, 28px) 0; padding: 0; box-shadow: 0 1px 2px rgba(15,23,42,.04); overflow: hidden; }
.logga-page .machine-bar { gap: 12px; padding: 14px 16px 16px; }
.logga-page .machine-cluster { flex: 1 1 auto; }
.logga-page .cluster-btns { flex-wrap: wrap; gap: 10px; }
.logga-fs-btn { margin-left: auto; align-self: flex-start; display: inline-flex; align-items: center; gap: 6px;
    background: rgba(255,255,255,.08); color: #e2e8f0; border: 1px solid rgba(148,163,184,.35); border-radius: 10px;
    padding: 7px 12px; font-size: .8rem; font-weight: 700; cursor: pointer; }
.logga-fs-btn:hover { background: rgba(255,255,255,.16); }
.mbtn-img { position: relative; }
.mbtn-ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 2.2rem; color: #94a3b8; }
.mbtn-img img { position: relative; z-index: 1; }
.mbtn-name { font-size: .68rem; color: var(--shop-muted, #64748b); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 4px; }
.mbtn.mbtn-selected .mbtn-name { color: rgba(255,255,255,.85); }
:fullscreen .cc-appbar, :fullscreen .cc-drawer, :fullscreen .cc-bottom-nav { display: none !important; }
:fullscreen .cc-main { padding-top: 0 !important; margin-left: 0 !important; }

/* ── Inloggad toppmeny (v2) ─────────────────────────────────────────────── */
.cc-appbar.mud-appbar { height: 64px; border-bottom: 1px solid rgba(0,0,0,.08); box-shadow: 0 1px 0 rgba(15,23,42,.04), 0 4px 16px rgba(15,23,42,.06); }
.cc-appbar .mud-toolbar { height: 64px; min-height: 64px; gap: 10px; padding-left: 12px; padding-right: 12px; }
.cc-appbar-dark  { --hdr-fg: #f8fafc; --hdr-muted: rgba(226,232,240,.72); --hdr-soft: rgba(255,255,255,.08); --hdr-soft2: rgba(255,255,255,.14); --hdr-line: rgba(255,255,255,.16); }
.cc-appbar-light { --hdr-fg: #0f172a; --hdr-muted: rgba(15,23,42,.62);   --hdr-soft: rgba(15,23,42,.06);   --hdr-soft2: rgba(15,23,42,.11);   --hdr-line: rgba(15,23,42,.14); }
.cc-appbar, .cc-appbar .mud-icon-button, .cc-appbar .mud-button-root { color: var(--hdr-fg) !important; }
.cc-appbar .mud-icon-button { width: 38px; height: 38px; padding: 8px; border-radius: 10px; }
.cc-appbar .mud-icon-button:hover { background: var(--hdr-soft2); }
.cc-appbar .mud-badge.mud-badge-top.right { inset: auto auto calc(100% - 14px) calc(100% - 14px); }
.cc-brand { gap: 10px; padding-right: 6px; }
.cc-brand-mark { width: 36px; height: 36px; flex: 0 0 36px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center;
    background: var(--hdr-soft2); border: 1px solid var(--hdr-line); overflow: hidden; }
.cc-brand-mark img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.cc-brand-name { font-size: .92rem; font-weight: 800; letter-spacing: .03em; color: var(--hdr-fg); max-width: 240px; }
.cc-brand-sub { font-size: .7rem; color: var(--hdr-muted); opacity: 1; }
.cc-search-wrap { flex: 1 1 auto; display: flex; justify-content: center; min-width: 0; padding: 0 12px; }
.cc-search { width: 100%; max-width: 460px; height: 38px; display: flex; align-items: center; gap: 10px; padding: 0 10px 0 12px;
    border-radius: 10px; border: 1px solid var(--hdr-line); background: var(--hdr-soft); color: var(--hdr-muted); cursor: pointer;
    font: inherit; font-size: .85rem; text-align: left; transition: background .15s, border-color .15s; }
.cc-search:hover { background: var(--hdr-soft2); }
.cc-search .cc-search-label { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-search .cc-search-kbd { margin: 0; background: var(--hdr-soft2); color: var(--hdr-fg); border: 1px solid var(--hdr-line); font-size: .68rem; padding: 2px 6px; border-radius: 6px; }
.cc-actions { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.cc-pill { height: 38px; display: inline-flex; align-items: center; gap: 6px; padding: 0 10px; border-radius: 10px; border: 1px solid transparent;
    background: transparent; color: var(--hdr-fg); font: inherit; font-size: .78rem; font-weight: 700; cursor: pointer; }
.cc-pill:hover { background: var(--hdr-soft2); }
.cc-divider { width: 1px; height: 26px; background: var(--hdr-line); margin: 0 6px; }
.cc-user { height: 42px; display: inline-flex; align-items: center; gap: 8px; padding: 0 6px 0 3px; border-radius: 12px; border: 0;
    background: transparent; color: var(--hdr-fg); cursor: pointer; font: inherit; }
.cc-user:hover { background: var(--hdr-soft2); }
.cc-avatar { width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 34px;
    background: linear-gradient(135deg, #fdb912, #f59e0b); color: #1a1a1a; font-weight: 800; font-size: .8rem; letter-spacing: .02em;
    box-shadow: 0 0 0 2px var(--hdr-line, rgba(0,0,0,.1)); }
.cc-avatar-lg { width: 42px; height: 42px; flex-basis: 42px; font-size: .95rem; box-shadow: none; }
.cc-user-text { display: flex; flex-direction: column; line-height: 1.15; text-align: left; }
.cc-user-name { font-size: .82rem; font-weight: 700; max-width: 160px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-user-role { font-size: .68rem; color: var(--hdr-muted); }
.cc-user-head { display: flex; gap: 12px; align-items: center; padding: 12px 16px; min-width: 240px; }
.cc-user-mail { font-size: .75rem; color: #64748b; }
@media (max-width: 900px) { .cc-search .cc-search-label, .cc-search .cc-search-kbd { display: none; } .cc-search { width: 38px; padding: 0; justify-content: center; } .cc-search-wrap { justify-content: flex-end; padding: 0; } }
@media (max-width: 600px) { .cc-brand-name { max-width: 110px; } .cc-lang span { display: none; } }

/* /logga – kort med samma marginaler och rytm */
.logga-page { --lg-gutter: clamp(8px, 1.6vw, 28px); }
.logga-page > .ai-warning-bar { background: transparent; border: 0; padding: 12px var(--lg-gutter) 0; }
.logga-page > .logga-form-section,
.logga-page > .log-section { background: var(--shop-panel); border: 1px solid var(--shop-border); border-radius: 14px;
    margin: 12px var(--lg-gutter) 0; padding: 14px 16px; box-shadow: 0 1px 2px rgba(15,23,42,.04); overflow: hidden; }
.logga-page > .log-section { padding: 0; }
.logga-page .machine-panel .msel-bar { padding: 10px 16px; }

/* ── Gemensamma sidkomponenter (PageHeader, kort, filterrad, tabeller) ───── */
.ph { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 4px 0 18px; }
.ph-main { display: flex; align-items: center; gap: 14px; min-width: 0; }
.ph-icon { width: 44px; height: 44px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 44px;
    background: linear-gradient(135deg, rgba(253,185,18,.18), rgba(253,185,18,.06)); color: #b7860b; border: 1px solid rgba(253,185,18,.35); }
.ph-kicker { font-size: .7rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: #64748b; margin-bottom: 2px; }
.ph-title { margin: 0; font-size: clamp(1.25rem, 2.2vw, 1.6rem); font-weight: 800; letter-spacing: -.01em; color: var(--mud-palette-text-primary); line-height: 1.2; }
.ph-sub { margin: 4px 0 0; color: var(--mud-palette-text-secondary); font-size: .9rem; max-width: 60rem; }
.ph-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.eo-card { background: var(--mud-palette-surface); border: 1px solid var(--cc-border, #e2e8f0); border-radius: 14px; box-shadow: 0 1px 2px rgba(15,23,42,.04); }
.eo-card-pad { padding: 16px 18px; }
.eo-card-title { font-size: .95rem; font-weight: 700; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.eo-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 16px; }
.eo-kpi { padding: 14px 16px; display: flex; align-items: center; gap: 12px; }
.eo-kpi-icon { width: 40px; height: 40px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 40px; }
.eo-kpi-val { font-size: 1.45rem; font-weight: 800; line-height: 1.1; }
.eo-kpi-label { font-size: .76rem; color: var(--mud-palette-text-secondary); font-weight: 600; }
.eo-filterbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding: 12px 14px; margin-bottom: 12px; }
.eo-filterbar > .mud-input-control { flex: 1 1 200px; max-width: 280px; margin: 0; }
.eo-filterbar .eo-grow { flex: 2 1 260px; max-width: 420px; }
.eo-filterbar .eo-spacer { flex: 1 1 auto; }
.eo-table.mud-table { border: 1px solid var(--cc-border, #e2e8f0); border-radius: 14px; box-shadow: 0 1px 2px rgba(15,23,42,.04) !important; overflow: hidden; }
.eo-table .mud-table-head .mud-table-cell { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: #64748b; background: var(--mud-palette-background-gray, #f8fafc); }
.eo-table .mud-table-body .mud-table-row:hover { background: rgba(253,185,18,.06) !important; }
.eo-tag { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 999px; font-size: .74rem; font-weight: 700;
    background: #f1f5f9; color: #334155; border: 1px solid #e2e8f0; white-space: nowrap; }
.eo-tag-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dot, #94a3b8); }
.eo-num { font-variant-numeric: tabular-nums; font-weight: 700; }
.eo-muted { color: var(--mud-palette-text-secondary); }
.eo-form-section { padding: 14px 0 6px; border-top: 1px solid var(--cc-border, #e2e8f0); }
.eo-form-section:first-child { border-top: 0; padding-top: 0; }
.eo-form-section-title { font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: #64748b; margin-bottom: 10px; display: flex; gap: 6px; align-items: center; }
.eo-img-drop { display: flex; align-items: center; gap: 14px; padding: 12px; border: 1px dashed #cbd5e1; border-radius: 12px; background: #f8fafc; }
.eo-img-drop img { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; border: 1px solid #e2e8f0; }
.eo-img-ph { width: 72px; height: 72px; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: #eef2f7; color: #94a3b8; }
.eo-leader { display: flex; align-items: center; gap: 12px; padding: 12px 14px; cursor: pointer; transition: transform .12s, box-shadow .12s; min-width: 0; }
.eo-leader:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(15,23,42,.08); }
.eo-rank { width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: .8rem; flex: 0 0 30px; background: #f1f5f9; color: #475569; }
.eo-rank-1 { background: #fef3c7; color: #b45309; } .eo-rank-2 { background: #e2e8f0; color: #334155; } .eo-rank-3 { background: #fde2cf; color: #9a3412; }
.mud-theme-dark .eo-tag, .dark-mode .eo-tag { background: rgba(148,163,184,.12); color: #cbd5e1; border-color: rgba(148,163,184,.2); }
/* Paneler som renderas inuti toppraden (notiser, inställningar) ska inte ärva rubrikradens färger/storlekar */
.cc-appbar :is(.nx-pop, .settings-panel) { color: var(--mud-palette-text-primary, #0f172a); }
.cc-appbar :is(.nx-pop, .settings-panel) :is(.mud-icon-button, .mud-button-root) { color: inherit !important; }
.cc-appbar :is(.nx-pop, .settings-panel) .mud-icon-button { width: auto; height: auto; padding: 5px; border-radius: 50%; }
.cc-appbar :is(.nx-pop, .settings-panel) .mud-icon-button:hover { background: rgba(15,23,42,.06); }

/* ── Enhetlig design för äldre sidor: samma rubrik, kort, tabeller ──────── */
.cc-content :is(.cc-hero, .ax-head, .nx-page-head) { align-items: center; margin: 4px 0 18px; gap: 16px; }
.cc-content :is(h1.page-title, .ax-title) { margin: 0; font-size: clamp(1.25rem, 2.2vw, 1.6rem) !important; font-weight: 800; letter-spacing: -.01em; line-height: 1.2; color: var(--mud-palette-text-primary); }
.cc-content :is(.cc-eyebrow, .ax-crumb) { display: block; font-size: .7rem !important; font-weight: 800 !important; letter-spacing: .12em !important; text-transform: uppercase; color: #64748b !important; margin-bottom: 2px; line-height: 1.4 !important; }
.cc-content :is(.ax-subtitle, .nx-sub, .cc-hero-text > .mud-typography-body2) { margin-top: 4px; color: var(--mud-palette-text-secondary) !important; font-size: .9rem !important; }
.cc-content :is(.cc-hero-actions, .ax-actions) { gap: 8px; }
.cc-content .mud-paper:is(.mud-elevation-1, .mud-elevation-2, .mud-elevation-3, .mud-elevation-4):not(.mud-popover):not(.mud-dialog):not(.mud-snackbar) {
    border-radius: 14px; border: 1px solid var(--cc-border, #e2e8f0); box-shadow: 0 1px 2px rgba(15,23,42,.04) !important; }
.cc-content .mud-table:not(.eo-table) .mud-table-head .mud-table-cell { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: #64748b; }
.cc-content .mud-table .mud-table-body .mud-table-row:hover { background: rgba(253,185,18,.05); }
.cc-content .mud-button-root.mud-button-filled, .cc-content .mud-button-root.mud-button-outlined { border-radius: 10px; text-transform: none; font-weight: 700; letter-spacing: 0; }
.cc-content .mud-input-control .mud-input.mud-input-outlined { border-radius: 10px; }
.ph-actions .mud-button-root { border-radius: 10px; text-transform: none; font-weight: 700; letter-spacing: 0; }
.cc-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 16px; }
.cc-kpis > .cc-kpi { display: flex; flex-direction: column; gap: 2px; }

/* ── Munkdiagram (kulturoberoende SVG) ── */
.eo-donut{display:flex;gap:20px;align-items:center;flex-wrap:wrap}
.eo-donut-svg{width:220px;height:220px;transform:none}
.eo-donut-legend{display:grid;gap:6px;font-size:.9rem}
.eo-donut-legend b{margin-left:6px}
.eo-donut-sw{display:inline-block;width:10px;height:10px;border-radius:3px;margin-right:8px;vertical-align:middle}

/* ── Vätskor: snabb påfyllning + förbrukning ── */
.fl-head{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;margin-bottom:12px}
.fl-head .eo-muted{font-size:.82rem}
.fl-quick{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-bottom:12px}
.fl-quick-btn{display:flex;align-items:center;justify-content:center;gap:8px;min-height:56px;border-radius:12px;border:2px solid var(--c);background:color-mix(in srgb,var(--c) 10%,transparent);color:inherit;font-weight:700;font-size:1rem;cursor:pointer;transition:transform .08s,background .15s}
.fl-quick-btn .mud-icon-root{color:var(--c)}
.fl-quick-btn:hover{background:color-mix(in srgb,var(--c) 18%,transparent)}
.fl-quick-btn:active{transform:scale(.98)}
.fl-quick-btn.on{background:var(--c);color:#fff}.fl-quick-btn.on .mud-icon-root{color:#fff}
.fl-form{border:1px solid color-mix(in srgb,var(--c) 40%,transparent);border-left:4px solid var(--c);border-radius:12px;padding:12px 14px;margin-bottom:14px;background:color-mix(in srgb,var(--c) 4%,transparent)}
.fl-form-row{display:flex;align-items:center;gap:12px;margin-bottom:8px;flex-wrap:wrap}
.fl-form-lbl{width:44px;font-size:.8rem;font-weight:600;opacity:.7}
.fl-chips{display:flex;flex-wrap:wrap;gap:6px;align-items:center;flex:1}
.fl-chip{min-width:48px;height:40px;padding:0 12px;border-radius:10px;border:1px solid rgba(127,127,127,.35);background:transparent;color:inherit;font-weight:600;font-size:.95rem;cursor:pointer}
.fl-chip.on{background:var(--c,#0d9488);border-color:var(--c,#0d9488);color:#fff}
.fl-num{max-width:120px}.fl-num .mud-input-control{margin:0}
.fl-dt{height:40px;border-radius:10px;border:1px solid rgba(127,127,127,.35);padding:0 8px;background:transparent;color:inherit;font:inherit}
.fl-tiles{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-bottom:12px}
.fl-tile{border:1px solid rgba(127,127,127,.18);border-top:3px solid var(--c);border-radius:12px;padding:10px 12px}
.fl-tile-top{display:flex;align-items:center;gap:6px;font-weight:600;font-size:.85rem}.fl-tile-top .mud-icon-root{color:var(--c)}
.fl-tile-val{font-size:1.6rem;font-weight:800;line-height:1.2;margin:4px 0}.fl-tile-val small{font-size:.75rem;font-weight:500;opacity:.6}
.fl-tile-meta{display:flex;flex-wrap:wrap;gap:4px 10px;font-size:.78rem;opacity:.8}
.fl-cmp{margin-top:6px;font-size:.78rem;padding:3px 8px;border-radius:8px;background:rgba(127,127,127,.1);display:inline-block}
.fl-cmp.bad{background:#fde2e1;color:#991b1b}.fl-cmp.good{background:#dcfce7;color:#166534}
.fl-chart-head{display:flex;justify-content:space-between;align-items:center;font-size:.82rem;font-weight:600;margin:4px 0}
.fl-legend{display:flex;gap:10px;font-weight:500;opacity:.8}.fl-legend i{display:inline-block;width:9px;height:9px;border-radius:2px;margin-right:4px}
.fl-chart{width:100%;height:auto;display:block}
.fl-list{margin-top:8px;border-top:1px solid rgba(127,127,127,.15)}
.fl-list-row{display:flex;align-items:center;gap:8px;padding:6px 0;border-bottom:1px solid rgba(127,127,127,.1);font-size:.88rem;flex-wrap:wrap}
.fl-dot{width:9px;height:9px;border-radius:50%;display:inline-block;flex:0 0 9px}
.fl-cmt{font-style:italic}
.fl-setup{margin-top:12px;padding-top:12px;border-top:1px dashed rgba(127,127,127,.3)}
.fl-setup-row{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:6px 0}
.fl-cap{max-width:150px}.fl-sens{max-width:300px}
@media (max-width:700px){.fl-quick,.fl-tiles{grid-template-columns:1fr}}
/* Analys-sida /vatskor */
.flx-bars{width:100%;height:auto;display:block}
.flx-cmp{display:grid;grid-template-columns:repeat(auto-fill,minmax(340px,1fr));gap:12px}
.flx-peer{display:grid;grid-template-columns:150px 1fr 130px;gap:10px;align-items:center;padding:6px 0;font-size:.88rem}
.flx-bar{height:14px;border-radius:7px;background:rgba(127,127,127,.12);position:relative;overflow:hidden}
.flx-bar>div{height:100%;border-radius:7px}
.flx-peer.out{color:#b91c1c;font-weight:600}
.flx-ref{position:absolute;top:-3px;bottom:-3px;width:2px;background:currentColor;opacity:.55}
.flx-badge{display:inline-block;font-size:.72rem;padding:2px 8px;border-radius:999px;background:#fde2e1;color:#991b1b;font-weight:700;margin-left:6px}
.flx-prices{display:flex;gap:12px;flex-wrap:wrap;align-items:center}
.flx-prices .mud-input-control{max-width:170px}

/* ── Stoppkodning (maskinsida) ───────────────────────────────────────── */
.st-head { display:flex; justify-content:space-between; align-items:center; margin-bottom:10px; gap:8px; }
.st-daynav { display:flex; align-items:center; gap:6px; }
.st-nav { width:30px; height:30px; border-radius:8px; border:1px solid var(--shop-border,#e2e8f0); background:#fff; font-size:18px; line-height:1; cursor:pointer; }
.st-nav:disabled { opacity:.35; cursor:default; }
.st-day { font-weight:600; min-width:84px; text-align:center; text-transform:capitalize; }
.st-kpis { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:8px; }
.st-kpi { background:#f8fafc; border:1px solid #e2e8f0; border-radius:999px; padding:3px 12px; font-size:13px; color:#475569; }
.st-kpi b { font-size:14px; margin-right:2px; }
.st-kpi-warn { background:#fef3c7; border-color:#fcd34d; color:#92400e; }
.st-kpi-auto { background:#e0f2fe; border-color:#7dd3fc; color:#075985; }
.st-tl { width:100%; height:56px; display:block; }
.st-tl .st-unc { cursor:pointer; }
.st-legend { display:flex; flex-wrap:wrap; gap:12px; font-size:12px; color:#64748b; margin:2px 0 10px; }
.st-legend i { display:inline-block; width:10px; height:10px; border-radius:2px; margin-right:4px; vertical-align:-1px; }
.st-hatch-i { background:repeating-linear-gradient(45deg,#f59e0b 0 3px,#fde68a 3px 6px); }
.st-sub { display:flex; justify-content:space-between; align-items:center; gap:8px; font-weight:600; font-size:13px; color:#334155; margin:12px 0 6px; flex-wrap:wrap; }
.st-all { font-weight:500; color:#475569; display:flex; gap:6px; align-items:center; cursor:pointer; }
.st-cards { display:flex; gap:8px; overflow-x:auto; padding-bottom:4px; }
.st-card { flex:0 0 auto; min-width:150px; text-align:left; display:flex; flex-direction:column; gap:2px; padding:10px 12px; border-radius:12px;
  border:2px dashed #f59e0b; background:#fffbeb; cursor:pointer; font:inherit; }
.st-card.on { border-style:solid; border-color:#0f172a; background:#fff; box-shadow:0 2px 8px rgba(15,23,42,.12); }
.st-card.live { animation: st-pulse 2s infinite; }
@keyframes st-pulse { 50% { box-shadow:0 0 0 4px rgba(239,68,68,.18); } }
.st-ct { font-weight:700; font-size:15px; color:#0f172a; }
.st-cd { font-size:13px; color:#475569; }
.st-cs { font-size:12px; font-weight:600; }
.st-ctool { font-size:11px; color:#c2410c; background:#ffedd5; border-radius:6px; padding:1px 6px; margin-top:2px; }
.st-more { justify-content:center; align-items:center; text-align:center; border-style:solid; border-color:#e2e8f0; background:#f8fafc; color:#475569; min-width:80px; }
.st-reasons { display:grid; grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); gap:8px; }
.st-reason { position:relative; min-height:64px; text-align:left; padding:10px 12px 10px 16px; border-radius:12px; border:1px solid #e2e8f0; background:#fff;
  cursor:pointer; font:inherit; display:flex; flex-direction:column; justify-content:center; align-items:flex-start; gap:2px; overflow:hidden; transition:transform .08s, box-shadow .12s; }
.st-reason::before { content:""; position:absolute; left:0; top:0; bottom:0; width:6px; background:var(--c); }
.st-reason:hover:not(:disabled) { box-shadow:0 2px 10px rgba(15,23,42,.12); transform:translateY(-1px); }
.st-reason:active:not(:disabled) { transform:scale(.98); }
.st-reason:disabled { opacity:.45; cursor:default; }
.st-reason.sugg { border:2px solid var(--c); background:#fff7ed; }
.st-rn { font-weight:700; font-size:15px; color:#0f172a; line-height:1.2; }
.st-rc { font-size:11px; color:#64748b; }
.st-sugg { position:absolute; top:6px; right:8px; font-size:10px; font-weight:700; color:#fff; background:#ea580c; border-radius:6px; padding:1px 6px; }
.st-ops { display:flex; flex-wrap:wrap; gap:6px; align-items:center; margin:10px 0 2px; }
.st-opl { font-size:13px; color:#64748b; margin-right:2px; }
.st-op { border:1px solid #cbd5e1; background:#fff; border-radius:999px; padding:4px 12px; font-weight:700; font-size:13px; cursor:pointer; }
.st-op.on { background:#0f172a; color:#fff; border-color:#0f172a; }
.st-linkbtn { background:none; border:none; color:#2563eb; cursor:pointer; font-size:13px; padding:6px 0; }
.st-alldone { background:#f0fdf4; border:1px solid #bbf7d0; color:#166534; border-radius:10px; padding:10px 12px; font-weight:600; margin-top:6px; }
.st-nosignal { background:#f8fafc; border:1px dashed #cbd5e1; border-radius:10px; padding:10px 12px; color:#475569; font-size:13px; }
.st-coded { display:flex; flex-direction:column; gap:4px; }
.st-crow { display:flex; align-items:center; gap:8px; font-size:13px; padding:6px 8px; border-radius:8px; background:#f8fafc; flex-wrap:wrap; }
.st-dot { width:10px; height:10px; border-radius:50%; flex:0 0 auto; }
.st-ctime { color:#64748b; font-variant-numeric:tabular-nums; min-width:88px; }
.st-cdur { color:#475569; }
.st-badge { background:#e0f2fe; color:#075985; border-radius:6px; padding:0 6px; font-size:11px; font-weight:600; }
.st-by { color:#94a3b8; font-size:12px; }
.st-tool { background:#ffedd5; color:#c2410c; border-radius:6px; padding:0 6px; font-size:12px; font-weight:600; text-decoration:none; }
.st-tool-miss { background:#fef2f2; color:#b91c1c; }
.st-undo { margin-left:auto; border:none; background:none; cursor:pointer; color:#94a3b8; font-size:15px; }
.st-undo:hover { color:#0f172a; }
.term-reason.top { box-shadow: inset 0 -4px 0 var(--c); }
.term-reason.sugg { outline:3px solid #f97316; outline-offset:2px; }
.term-reason small { display:block; font-size:12px; opacity:.7; font-weight:500; margin-top:2px; }

/* ── Plattformsanalys ─────────────────────────────────────────────── */
.eo-tc-svg { width:100%; height:auto; display:block; }
.eo-tc-legend { display:flex; flex-wrap:wrap; gap:12px; font-size:12px; color:#475569; margin-top:4px; }
.eo-tc-legend i { display:inline-block; width:10px; height:10px; border-radius:2px; margin-right:5px; vertical-align:-1px; }
.eo-tc-legend b { margin-left:4px; color:#0f172a; }
.pa-filters { display:flex; flex-wrap:wrap; gap:10px; align-items:center; margin:4px 0 14px; }
.pa-chips { display:flex; gap:4px; background:#f1f5f9; border-radius:10px; padding:3px; }
.pa-chip { border:none; background:transparent; padding:6px 12px; border-radius:8px; font-weight:600; font-size:13px; color:#475569; cursor:pointer; }
.pa-chip.on { background:#fff; color:#0f172a; box-shadow:0 1px 3px rgba(15,23,42,.12); }
.pa-date { display:flex; align-items:center; gap:6px; font-size:13px; color:#64748b; }
.pa-date input, .pa-select { border:1px solid #cbd5e1; border-radius:8px; padding:6px 8px; font:inherit; font-size:13px; background:#fff; }
.pa-select { min-width:200px; }
.pa-check { font-size:13px; color:#475569; display:flex; gap:6px; align-items:center; }
.pa-drill { background:#eff6ff; border:1px solid #bfdbfe; color:#1e3a8a; padding:8px 12px; border-radius:10px; margin-bottom:12px; font-weight:600; display:flex; justify-content:space-between; align-items:center; }
.pa-x { border:none; background:#fff; border-radius:8px; padding:4px 10px; cursor:pointer; color:#1e3a8a; font-weight:600; }
.pa-kpis { display:grid; grid-template-columns:repeat(auto-fill,minmax(180px,1fr)); gap:10px; margin-bottom:14px; }
.pa-kpi { background:#fff; border:1px solid #e2e8f0; border-radius:12px; padding:12px 14px; display:flex; flex-direction:column; gap:2px; }
.pa-kpi.pa-warn { border-color:#fcd34d; background:#fffbeb; }
.pa-kpi.pa-bad { border-color:#fca5a5; background:#fef2f2; }
.pa-kl { font-size:12px; color:#64748b; font-weight:600; text-transform:uppercase; letter-spacing:.03em; }
.pa-kv { font-size:24px; color:#0f172a; font-variant-numeric:tabular-nums; line-height:1.2; }
.pa-ks { font-size:12px; color:#64748b; }
.pa-grid2 { display:grid; grid-template-columns:repeat(auto-fit,minmax(420px,1fr)); gap:14px; margin-bottom:14px; }
.pa-card { background:#fff; border:1px solid #e2e8f0; border-radius:14px; padding:14px 16px; margin-bottom:14px; min-width:0; }
.pa-grid2 > .pa-card { margin-bottom:0; }
.pa-card h3 { font-size:15px; font-weight:700; color:#0f172a; margin:0 0 10px; }
.pa-sub { font-weight:500; color:#64748b; font-size:13px; }
.pa-empty { color:#94a3b8; font-size:13px; padding:12px 0; }
.pa-scroll { overflow-x:auto; }
.pa-table { width:100%; border-collapse:collapse; font-size:13px; }
.pa-table th { text-align:left; font-size:11px; text-transform:uppercase; letter-spacing:.03em; color:#64748b; padding:6px 8px; border-bottom:1px solid #e2e8f0; white-space:nowrap; }
.pa-table td { padding:7px 8px; border-bottom:1px solid #f1f5f9; vertical-align:middle; }
.pa-table .r { text-align:right; font-variant-numeric:tabular-nums; }
.pa-table .c { text-align:center; }
.pa-click tbody tr { cursor:pointer; }
.pa-click tbody tr:hover { background:#f8fafc; }
.pa-inactive td { opacity:.55; }
.pa-tag { display:inline-block; margin-left:6px; font-size:10px; font-weight:700; text-transform:uppercase; padding:1px 6px; border-radius:6px; background:#f1f5f9; color:#475569; }
.pa-tag.off { background:#fee2e2; color:#991b1b; }
.pa-tag.ok { background:#dcfce7; color:#166534; }
.pa-tag.warn { background:#fef3c7; color:#92400e; }
.pa-crit { margin-left:6px; background:#dc2626; color:#fff; border-radius:999px; padding:0 6px; font-size:11px; font-weight:700; }
.pa-ok { color:#16a34a; font-weight:700; } .pa-warn { color:#d97706; } .pa-bad { color:#dc2626; font-weight:700; }
.pa-bar { flex:1; height:8px; background:#f1f5f9; border-radius:999px; overflow:hidden; min-width:40px; }
.pa-bar i { display:block; height:100%; background:#2563eb; border-radius:999px; }
.pa-hbar { display:flex; align-items:center; gap:10px; font-size:13px; padding:4px 0; }
.pa-hl { width:170px; flex:0 0 170px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.pa-hbar b { min-width:64px; text-align:right; font-variant-numeric:tabular-nums; }
.pa-hbar small { color:#94a3b8; min-width:70px; }
.pa-ret td.c { font-weight:600; font-size:12px; border:2px solid #fff; border-radius:6px; }
.pa-na { color:#cbd5e1; }
.pa-errs { max-height:320px; overflow:auto; display:flex; flex-direction:column; gap:4px; margin-top:8px; }
.pa-err { display:grid; grid-template-columns:90px 180px 1fr; gap:8px; font-size:12px; padding:6px 8px; background:#fef2f2; border-radius:8px; }
.pa-err b { color:#991b1b; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.pa-err em { font-style:normal; color:#475569; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.pa-funnel { display:flex; flex-direction:column; gap:8px; }
.pa-fstep { display:flex; flex-direction:column; gap:2px; font-size:13px; color:#334155; }
.pa-fbar { background:linear-gradient(90deg,#2563eb,#60a5fa); color:#fff; border-radius:8px; padding:6px 10px; min-width:44px; }
.pa-fstep small { color:#94a3b8; }
