*{box-sizing:border-box}body{margin:0;font-family:Inter,Segoe UI,Arial,sans-serif;background:#f4f6f8;color:#18212b}a{color:inherit}.topbar{height:56px;background:#fff;border-bottom:1px solid #e2e7eb;display:flex;align-items:center;justify-content:space-between;padding:0 12px 0 14px;gap:12px}.brand{font-weight:800;font-size:19px;text-decoration:none;letter-spacing:-.5px;white-space:nowrap}.top-actions{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:6px}.top-link{display:inline-flex;align-items:center;justify-content:center;min-height:30px;padding:0 8px;border:1px solid #dfe5e9;border-radius:7px;background:#f5f7f8;color:#243847;text-decoration:none;font-size:12px;font-weight:700;line-height:1;white-space:nowrap}.top-link:hover{background:#edf3f6}.page{max-width:1180px;margin:0 auto;padding:24px 16px}.hero{min-height:62vh;display:flex;align-items:center}.hero h1{font-size:64px;margin:8px 0 12px;letter-spacing:-3px}.hero p{font-size:21px;max-width:650px;color:#5a6672}.eyebrow{font-size:12px;font-weight:800;letter-spacing:1.4px;color:#71808d}.actions,.form-actions{display:flex;gap:10px;margin-top:22px}.btn{display:inline-flex;align-items:center;justify-content:center;min-height:42px;padding:0 17px;border:1px solid #cdd5dc;background:#fff;border-radius:8px;text-decoration:none;font-weight:700;cursor:pointer}.btn.primary{background:#162d3d;color:#fff;border-color:#162d3d}.btn.big{min-height:56px;font-size:17px}.btn.full{width:100%;margin-top:18px}.input{width:100%;padding:11px 12px;border:1px solid #cfd7de;border-radius:7px;background:#fff;font:inherit;margin:5px 0 14px}.auth-card{max-width:440px;margin:6vh auto;background:#fff;border:1px solid #e0e5e9;border-radius:14px;padding:30px;box-shadow:0 8px 30px rgba(20,35,45,.06)}.auth-card.wide{max-width:620px}.auth-card h1{margin-top:0}.muted{color:#71808d}.alert{display:block;padding:12px;border-radius:7px;background:#eaf4ee;margin:12px 0}.alert.danger{background:#fae9e9;color:#8a2020}.setup-link{text-align:center;margin-top:18px;font-size:13px}.admin-shell{display:flex;min-height:100vh}.sidebar{width:235px;background:#142631;color:#eaf0f3;padding:24px 18px;display:flex;flex-direction:column;position:fixed;inset:0 auto 0 0}.sidebar-brand{color:#fff;margin:0 8px 20px}.tenant{font-size:12px;color:#9db0bb;padding:0 8px 22px;border-bottom:1px solid rgba(255,255,255,.1)}.sidebar nav{display:flex;flex-direction:column;gap:4px;padding-top:18px}.sidebar nav a,.sidebar-bottom a{padding:10px 9px;text-decoration:none;border-radius:6px}.sidebar nav a:hover,.sidebar-bottom a:hover{background:rgba(255,255,255,.08)}.sidebar-bottom{margin-top:auto;display:flex;flex-direction:column;color:#9db0bb;font-size:13px}.admin-main{margin-left:235px;min-width:0;width:calc(100% - 235px)}.admin-header{height:64px;background:#fff;border-bottom:1px solid #e2e7eb;display:flex;justify-content:flex-end;align-items:center;padding:0 28px;font-size:13px}.admin-content{padding:30px;max-width:1400px}.page-title{display:flex;justify-content:space-between;align-items:center;margin-bottom:24px}.page-title h1{margin:4px 0;font-size:31px}.stats{display:grid;grid-template-columns:repeat(4,1fr);gap:14px;margin-bottom:20px}.stat,.panel{background:#fff;border:1px solid #e0e5e9;border-radius:10px;padding:20px}.stat span{display:block;color:#6e7a84;font-size:13px}.stat strong{font-size:32px;display:block;margin-top:5px}.stat.ok{border-top:3px solid #2f7c54}.stat.warning{border-top:3px solid #b7791f}.stat.danger{border-top:3px solid #b13a3a}.grid-2{display:grid;grid-template-columns:1fr 1fr;gap:18px}.panel h2{margin:0 0 16px;font-size:18px}.list-row{display:flex;justify-content:space-between;gap:15px;padding:12px 0;border-top:1px solid #edf0f2;text-decoration:none}.list-row small{display:block;color:#7b8790;margin-top:3px}.table-panel{overflow:auto}.data-table{width:100%;border-collapse:collapse}.data-table th{text-align:left;color:#66737d;font-size:12px;text-transform:uppercase;letter-spacing:.4px;padding:11px;border-bottom:1px solid #dfe5e9}.data-table td{padding:13px 11px;border-bottom:1px solid #edf0f2}.data-table a{font-weight:700}.status-pill{display:inline-block;padding:5px 9px;border-radius:999px;font-size:12px;font-weight:800}.status-ok{background:#e3f3e9;color:#25613f}.status-warning{background:#fff0d5;color:#85570f}.status-danger{background:#f9dfdf;color:#8d2929}.status-neutral{background:#edf0f2}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:0 20px;max-width:1000px}.span-2{grid-column:1/-1}.machine-card{max-width:720px;margin:10px auto}.machine-card h1{font-size:38px;margin:5px 0}.machine-location{color:#6e7a84;margin-bottom:20px}.machine-status{font-weight:900;font-size:24px;padding:18px;border-radius:10px;margin:14px 0}.machine-status.status-ok{background:#e3f3e9;color:#245f3e}.machine-status.status-warning{background:#fff0d5;color:#81530e}.machine-status.status-danger{background:#f9dfdf;color:#862828}.machine-summary{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:14px 0}.machine-summary>div{background:#fff;border:1px solid #e1e6e9;border-radius:9px;padding:15px}.machine-summary span{display:block;color:#71808d;font-size:12px;margin-bottom:4px}.notice{padding:16px;border-radius:9px;margin:14px 0}.notice.warning{background:#fff0d5}.machine-actions{margin:18px 0}.machine-info{margin-top:22px}.status-options label{margin-left:8px}.status-options td{padding:7px 0}@media(max-width:800px){.sidebar{position:static;width:100%;height:auto}.admin-shell{display:block}.admin-main{margin:0;width:100%}.sidebar nav{display:grid;grid-template-columns:1fr 1fr}.sidebar-bottom{display:none}.stats{grid-template-columns:1fr 1fr}.grid-2,.form-grid{grid-template-columns:1fr}.span-2{grid-column:auto}.admin-content{padding:20px}.hero h1{font-size:48px}.machine-summary{grid-template-columns:1fr}.topbar{padding:0 16px}.top-actions{font-size:12px;gap:9px}}

.notice.info{background:#e8f3fb;color:#264d69}.notice.neutral{background:#edf0f2}.check-item{padding:14px 0;border-bottom:1px solid #e7ebee}.check-item strong{display:block;margin-bottom:7px}.check-options td{padding-right:22px}.service-panel{margin-top:18px}.section-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}.section-heading h2{margin:0}.service-summary-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:14px}.service-summary-grid>div{background:#f5f7f8;border-radius:8px;padding:14px}.service-summary-grid strong{font-size:28px;display:block}.service-summary-grid span{font-size:12px;color:#71808d}.service-page{max-width:1100px;margin:0 auto}.service-form{max-width:760px}.form-grid.compact{padding:0;border:0}.btn.small{min-height:34px;padding:0 10px;font-size:12px}.check-options input{margin-right:4px}



/* v3 - formulär, aktiviteter, service och journal */
.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px 22px;margin-bottom:18px}.form-group{display:flex;flex-direction:column;gap:6px}.button-row{display:flex;gap:8px;flex-wrap:wrap}.report-box{border:1px solid #e0b957;background:#fff8e8;border-radius:10px;padding:16px;margin:18px 0}.report-box h2{margin-top:0}.activity-row{display:grid;grid-template-columns:minmax(180px,1fr) 90px auto;gap:10px;align-items:center;padding:12px 0;border-bottom:1px solid #eee}.activity-input{width:90px;padding:10px;border:1px solid #ccc;border-radius:6px;font-size:18px}.activity-unit{color:#666}.service-check{padding:12px 0;border-bottom:1px solid #eee;font-size:17px}.service-check input{margin-right:10px;transform:scale(1.25)}.history-item{display:grid;grid-template-columns:150px 1fr;gap:18px;padding:16px 0;border-bottom:1px solid #eee}.history-date{font-size:13px;color:#666}.history-content strong{display:block;margin-bottom:4px}.history-content small{display:block;color:#777;margin-top:5px}@media(max-width:760px){.form-grid{grid-template-columns:1fr}.activity-row{grid-template-columns:1fr 90px auto}.history-item{grid-template-columns:1fr;gap:5px}}


/* v4 - QR och resursjournal */
.table-actions{display:flex;gap:6px;white-space:nowrap}.qr-sheet{max-width:620px;margin:20px auto;background:#fff;border:1px solid #dfe5e9;border-radius:16px;padding:38px;text-align:center}.qr-brand{font-weight:900;font-size:24px;letter-spacing:-.5px}.qr-sheet h1{font-size:34px;margin:12px 0 3px}.qr-number{color:#66737d;margin-bottom:22px}.qr-image-wrap{display:flex;justify-content:center;margin:18px 0}.qr-image{width:min(420px,100%);height:auto;display:block}.qr-instruction{font-size:19px;font-weight:800;margin:20px 0 8px}.qr-url{display:block;font-size:12px;word-break:break-all;color:#53636e}.qr-note{margin-top:22px;padding-top:18px;border-top:1px solid #e6eaed;color:#66737d;font-size:13px}.qr-help{max-width:620px;margin:16px auto}.journal-filter{margin-bottom:18px}.journal-filter-types{display:flex;flex-wrap:wrap;gap:10px 22px;margin:0 0 18px}.journal-filter-types label{margin-left:6px}.journal-summary{display:grid;grid-template-columns:repeat(2,minmax(0,220px));gap:12px;margin-bottom:18px}.journal-summary>div{background:#fff;border:1px solid #e0e5e9;border-radius:10px;padding:15px}.journal-summary strong{display:block;font-size:24px}.journal-summary span{font-size:12px;color:#71808d}.journal-timeline{position:relative;margin:8px 0 40px;padding-left:28px}.journal-timeline:before{content:'';position:absolute;left:9px;top:8px;bottom:8px;width:2px;background:#dfe5e9}.journal-entry{position:relative;margin-bottom:14px}.journal-marker{position:absolute;left:-25px;top:23px;width:14px;height:14px;border:3px solid #fff;border-radius:50%;background:#8898a3;box-shadow:0 0 0 1px #cad3d9}.journal-entry-card{background:#fff;border:1px solid #e0e5e9;border-radius:10px;padding:17px 19px}.journal-entry-top{display:flex;justify-content:space-between;gap:18px}.journal-entry-top h2{font-size:18px;margin:4px 0 8px}.journal-entry-top time{font-size:13px;color:#6e7a84;white-space:nowrap}.journal-type{font-size:11px;font-weight:900;letter-spacing:.7px;text-transform:uppercase;color:#71808d}.journal-who{font-size:13px;color:#66737d;margin:6px 0 10px}.journal-description{line-height:1.48}.journal-detail{margin:5px 0}.journal-usage .journal-marker{background:#386f91}.journal-check .journal-marker{background:#6d5a9a}.journal-fault .journal-marker{background:#b13a3a}.journal-fault-resolved .journal-marker{background:#2f7c54}.journal-workorder .journal-marker{background:#b7791f}.journal-workorder-done .journal-marker{background:#4f7b55}.journal-service .journal-marker{background:#235b76}.journal-maintenance .journal-marker{background:#5a7043}.print-only{display:none}@media(max-width:760px){.journal-entry-top{display:block}.journal-entry-top time{display:block;margin-bottom:8px}.journal-summary{grid-template-columns:1fr 1fr}.qr-sheet{padding:24px 18px}.table-actions{flex-direction:column}}@media print{body{background:#fff}.sidebar,.admin-header,.no-print{display:none!important}.admin-main{margin:0!important;width:100%!important}.admin-content{padding:0!important;max-width:none!important}.print-only{display:block}.journal-print-header{margin-bottom:22px}.journal-timeline{padding-left:24px}.journal-entry-card{break-inside:avoid;border-color:#bbb}.journal-summary{margin:0 0 18px}.qr-sheet{border:0;box-shadow:none;margin:0 auto;padding:10mm}.qr-image{width:105mm;max-width:105mm}}


/* v5 - kundväxling och service-dashboard */
.tenant-switcher{padding:0 8px 16px;border-bottom:1px solid rgba(255,255,255,.1);margin-bottom:12px}.tenant-switcher label{display:block;color:#9db0bb;font-size:11px;font-weight:800;text-transform:uppercase;letter-spacing:.6px;margin-bottom:6px}.tenant-select{width:100%;padding:9px 10px;border:1px solid rgba(255,255,255,.18);border-radius:7px;background:#203844;color:#fff;font:inherit}.service-stats{margin-top:8px}.service-machine-list{margin-top:18px}.customer-current{font-weight:800}.customer-card-actions{display:flex;gap:8px;flex-wrap:wrap}@media(max-width:800px){.tenant-switcher{padding:0 8px 12px}.service-stats{grid-template-columns:1fr 1fr}}


/* v6 - grupperad admin, resurs- och användarnav */
.menu-section{margin:0 0 15px}.menu-section.first{margin-bottom:8px}.menu-heading{padding:0 9px 6px;color:#78909d;font-size:10px;font-weight:900;letter-spacing:.9px}.sidebar nav{padding-top:8px}.sidebar nav .menu-section{display:flex;flex-direction:column;gap:3px}.sidebar nav a,.menu-link{display:block;color:inherit}.menu-link.emphasis{margin:6px 0 0;padding:8px 9px;border-radius:6px;text-decoration:none;background:rgba(255,255,255,.06)}.tenant-fixed{font-weight:800;padding:3px 9px 8px;color:#eaf0f3}.tenant-switcher{border-bottom:0;margin-bottom:0;padding:0 8px 5px}.page-intro{max-width:760px;color:#6e7a84;margin:5px 0 0}.machine-tabs,.user-tabs{display:flex;gap:5px;flex-wrap:wrap;margin:-8px 0 20px;padding:5px;background:#e9eef1;border-radius:9px}.machine-tabs a,.user-tabs a{padding:9px 13px;border-radius:7px;text-decoration:none;font-size:13px;font-weight:800;color:#44545f}.machine-tabs a:hover,.user-tabs a:hover,.machine-tabs a.active{background:#fff;color:#142631;box-shadow:0 1px 3px rgba(0,0,0,.08)}.quick-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-bottom:18px}.quick-card{display:flex;flex-direction:column;gap:5px;padding:16px;border:1px solid #e0e5e9;border-radius:9px;text-decoration:none;background:#f8fafb}.quick-card:hover{border-color:#b9c7cf;background:#fff}.quick-card strong{color:#1c3441}.quick-card span{color:#6e7a84;font-size:13px}.access-checklist{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px 16px;margin:10px 0 18px}.access-checklist label{margin-left:7px}.access-table{border:1px solid #e0e5e9;border-radius:9px;overflow:hidden;margin:10px 0 18px}.access-row{display:grid;grid-template-columns:minmax(180px,1.4fr) minmax(130px,.8fr) minmax(90px,.5fr) minmax(150px,.8fr);gap:12px;align-items:center;padding:12px 14px;border-bottom:1px solid #edf0f2}.access-row:last-child{border-bottom:0}.access-row.access-head{background:#f5f7f8;font-size:11px;font-weight:900;text-transform:uppercase;color:#66737d}.access-row small{display:block;color:#7b8790;margin-top:3px}.anchor-panel{scroll-margin-top:15px}.inline-alert{display:inline-block;margin:0}.radio-list td{padding:6px 0}.radio-list label{margin-left:7px}.next-steps{margin-top:18px}@media(max-width:800px){.sidebar nav{display:block}.menu-section{margin-bottom:12px}.machine-tabs,.user-tabs{overflow-x:auto;flex-wrap:nowrap}.machine-tabs a,.user-tabs a{white-space:nowrap}.quick-grid{grid-template-columns:1fr}.access-checklist{grid-template-columns:1fr}.access-row{grid-template-columns:1fr;gap:5px}.access-row.access-head{display:none}}


/* v7 - livscykel och resursfilter */
.filter-row { display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.filter-row label { font-weight:600; }
.input.compact { width:auto; min-width:220px; }
.lifecycle-notice { margin-bottom:16px; }


/* Booking v9 */
.slot-list { width:100%; }
.slot-list td { padding:8px 0; }
.slot-list label { display:inline-block; margin-left:8px; }
.booking-card { border:1px solid #ddd; border-radius:10px; padding:16px; margin-bottom:12px; }
.booking-policy { font-weight:600; }


/* v10 - val av aktiv kund */
.tenant-choice-page {
    max-width: 1050px;
    margin: 20px auto 60px;
}

.tenant-choice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
}

.tenant-choice-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 22px;
}

.tenant-choice-card h2 {
    margin: 4px 0 8px;
    font-size: 20px;
}

.tenant-role {
    margin-bottom: 20px;
    color: #666;
}

.compact-title p {
    margin-bottom: 0;
}


/* v11 - mobilanpassade kontroller med hjälp */
.usage-mobile{max-width:760px}
.check-intro{margin:0 0 14px;color:#66737d;line-height:1.5}
.mobile-check-card{background:#fff;border:1px solid #dfe5e9;border-radius:14px;padding:18px;margin:0 0 16px;box-shadow:0 2px 8px rgba(20,38,49,.05)}
.mobile-check-card h2{font-size:21px;line-height:1.3;margin:3px 0 14px}
.check-number{font-size:11px;font-weight:900;letter-spacing:.8px;text-transform:uppercase;color:#74838d}
.check-help{margin:0 0 15px;border:1px solid #dce4e8;border-radius:10px;overflow:hidden;background:#f8fafb}
.check-help summary{cursor:pointer;list-style:none;padding:13px 15px;font-weight:800;min-height:48px;box-sizing:border-box}
.check-help summary::-webkit-details-marker{display:none}
.check-help summary:before{content:'?';display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;margin-right:9px;border-radius:50%;background:#e4edf2;font-weight:900}
.check-help[open] summary{border-bottom:1px solid #dce4e8}
.check-help-body{padding:15px;line-height:1.55}
.check-help-image{display:block;width:100%;height:auto;max-height:520px;object-fit:contain;margin-top:14px;border-radius:9px;background:#eef2f4}
.touch-choice{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px;width:100%}
.touch-choice span{display:block;position:relative}
.touch-choice input{position:absolute;opacity:0;pointer-events:none}
.touch-choice label{display:flex;align-items:center;justify-content:center;min-height:58px;padding:10px 12px;border:2px solid #d4dde2;border-radius:10px;background:#fff;font-weight:900;text-align:center;cursor:pointer;user-select:none;box-sizing:border-box}
.touch-choice input:checked+label{border-color:#1d536e;background:#eaf4f8;color:#153f54;box-shadow:0 0 0 2px rgba(29,83,110,.08)}
.touch-choice span:nth-of-type(2) input:checked+label{border-color:#b37a17;background:#fff7e5;color:#79520e}
.touch-choice span:nth-of-type(3) input:checked+label{border-color:#b33a3a;background:#fff0f0;color:#852626}
.compact-choice{margin:10px 0 18px}
.usage-submit{min-height:58px;font-size:17px;margin-top:16px}
@media(max-width:620px){
  .auth-card.wide.usage-mobile{padding:16px 12px}
  .usage-mobile h1{font-size:28px}
  .mobile-check-card{padding:16px 13px;margin-bottom:13px}
  .touch-choice{grid-template-columns:1fr}
  .touch-choice label{min-height:56px;font-size:16px}
  .activity-row{grid-template-columns:minmax(0,1fr) 82px auto}
  .activity-input{width:82px}
}


/* v12 - lättläst resursjournal */
.journal-list { display:flex; flex-direction:column; gap:10px; }
.journal-row { display:grid; grid-template-columns:150px 150px minmax(0,1fr); gap:14px; align-items:start; padding:14px 16px; background:#fff; border:1px solid #e4e7eb; border-radius:8px; }
.journal-date { font-weight:600; white-space:nowrap; }
.journal-type { font-size:13px; font-weight:700; text-transform:uppercase; letter-spacing:.03em; }
.journal-title { font-weight:700; margin-bottom:3px; }
.journal-detail { color:#555; line-height:1.45; }
.journal-row.journal-fault { border-left:5px solid #c44; }
.journal-row.journal-service { border-left:5px solid #777; }
.journal-row.journal-usage { border-left:5px solid #6a8; }
.journal-row.journal-maintenance { border-left:5px solid #aa8; }
@media (max-width:760px) {
  .journal-row { grid-template-columns:1fr; gap:5px; padding:13px; }
  .journal-date { font-size:13px; }
}
@media print {
  .journal-row { break-inside:avoid; box-shadow:none; }
}

/* v13 - bevakning och tillgänglighet */
.availability-workorder { margin:18px 0; }
.availability-workorder .muted { margin-top:10px; }
.machine-actions .btn { min-height:44px; display:inline-flex; align-items:center; justify-content:center; }
.notice.warning strong { display:block; margin-bottom:5px; }


/* v13.2 - administrationsmeny, ByggIgen-liknande arbetssätt */

:root {
    --sidebar-width: 238px;
}

.sidebar {
    width: var(--sidebar-width);
    padding: 0;
    overflow: hidden;
    z-index: 1100;
}

.sidebar-top {
    height: 70px;
    flex: 0 0 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.sidebar-brand {
    margin: 0;
}

.sidebar-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px 10px 14px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.18) transparent;
}

.sidebar-scroll::-webkit-scrollbar {
    width: 7px;
}

.sidebar-scroll::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,.18);
    border-radius: 10px;
}

.sidebar-bottom {
    flex: 0 0 auto;
    margin-top: 0;
    padding: 12px 14px 16px;
    border-top: 1px solid rgba(255,255,255,.08);
}

.admin-main {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
}

.menu-section {
    margin: 0 0 4px;
}

.menu-section-fixed {
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.menu-heading {
    padding: 0 8px 7px;
    color: #7f98a5;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 1px;
}

.admin-nav {
    display: block !important;
    padding-top: 0 !important;
}

.menu-section-toggle {
    width: 100%;
    min-height: 33px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 6px 8px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #7f98a5;
    font: inherit;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 1px;
    text-align: left;
    cursor: pointer;
}

.menu-section-toggle:hover {
    background: rgba(255,255,255,.05);
    color: #b8c8d0;
}

.menu-chevron {
    display: inline-block;
    font-size: 19px;
    line-height: 1;
    transform: rotate(90deg);
    transition: transform .16s ease;
}

.menu-section.is-collapsed .menu-chevron {
    transform: rotate(0deg);
}

.menu-section-items {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
}

.menu-section.is-collapsed .menu-section-items {
    display: none;
}

.sidebar nav .menu-section-items a,
.sidebar nav .menu-section-items .menu-link,
.menu-link {
    display: block;
    min-height: 35px;
    padding: 7px 9px;
    border-radius: 7px;
    color: #e9eff2;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.sidebar nav .menu-section-items a:hover,
.sidebar nav .menu-section-items .menu-link:hover,
.menu-link:hover {
    background: rgba(255,255,255,.075);
}

.menu-count {
    float: right;
    min-width: 20px;
    padding: 2px 6px;
    border-radius: 999px;
    background: #c84d4d;
    color: #fff;
    font-size: 11px;
    font-weight: 900;
    line-height: 1.2;
    text-align: center;
}

.sidebar nav a.is-active,
.sidebar nav .menu-link.is-active {
    background: #26404d;
    color: #fff;
    font-weight: 800;
    box-shadow: inset 3px 0 0 #7cc7e6;
}

.menu-link.emphasis {
    background: #203844;
    margin: 4px 0;
}

.tenant-switcher {
    margin: 0;
    padding: 0 0 8px;
    border: 0;
}

.tenant-fixed {
    padding: 8px 9px 10px;
    color: #fff;
    font-weight: 700;
}

.tenant-select {
    min-height: 42px;
}

.sidebar-close {
    display: none;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 31px;
    line-height: 1;
    cursor: pointer;
}

.sidebar-open {
    display: none;
    width: 44px;
    height: 44px;
    padding: 10px;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.admin-back {
    display: none;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    margin-left: 8px;
    border: 1px solid #dfe5e9;
    border-radius: 7px;
    background: #f5f7f8;
    color: #243847;
    font-size: 24px;
    line-height: 1;
    text-decoration: none;
}

.admin-back:hover {
    background: #edf3f6;
}

.sidebar-open span {
    display: block;
    height: 2px;
    margin: 5px 0;
    background: #263844;
}

.admin-header-spacer {
    flex: 1;
}

.admin-account {
    position: relative;
    margin-right: 8px;
}

.admin-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid #cbd8df;
    border-radius: 50%;
    background: #e8f0f3;
    color: #183344;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    list-style: none;
}

.admin-avatar::-webkit-details-marker {
    display: none;
}

.admin-account-menu {
    position: absolute;
    top: 44px;
    right: 0;
    z-index: 20;
    min-width: 210px;
    padding: 12px 14px;
    border: 1px solid #dfe5e9;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 22px rgba(20,35,45,.12);
    color: #243847;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.sidebar-overlay {
    display: none;
}

@media (max-width: 900px) {
    .admin-back {
        display: inline-flex;
    }

    body.sidebar-visible {
        overflow: hidden;
    }

    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        width: min(86vw, 300px);
        height: 100vh;
        transform: translateX(-105%);
        transition: transform .2s ease;
        box-shadow: 12px 0 40px rgba(0,0,0,.22);
    }

    body.sidebar-visible .sidebar {
        transform: translateX(0);
    }

    .sidebar-close {
        display: block;
    }

    .sidebar-open {
        display: block;
    }

    .sidebar-overlay {
        position: fixed;
        inset: 0;
        z-index: 1050;
        background: rgba(0,0,0,.38);
    }

    body.sidebar-visible .sidebar-overlay {
        display: block;
    }

    .admin-main {
        margin-left: 0;
        width: 100%;
    }

    .admin-header {
        justify-content: flex-start;
        padding: 0 14px;
    }

    .sidebar nav {
        display: block;
    }

    .sidebar-bottom {
        display: flex;
    }

    .admin-content {
        padding: 18px 14px 28px;
    }
}

@media (min-width: 901px) {

    body.sidebar-collapsed .sidebar {
        transform: translateX(calc(-1 * var(--sidebar-width)));
    }

    body.sidebar-collapsed .admin-main {
        margin-left: 0;
        width: 100%;
    }

    body.sidebar-collapsed .sidebar-open {
        display: block;
    }
}

/* v14 - felbilder och lösenordsåterställning */
.fault-photo-upload {
    min-height: 46px;
    padding: 8px;
}

.fault-image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill,minmax(180px,1fr));
    gap: 14px;
}

.fault-image-link {
    display: block;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #dde2e5;
    background: #f6f8f9;
}

.fault-image-link img {
    display: block;
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.detail-label {
    display: block;
    font-size: 12px;
    color: #687780;
    margin-bottom: 3px;
}

.fault-description {
    line-height: 1.55;
}

.auth-links {
    margin-top: 16px;
    text-align: center;
}

.auth-links a {
    color: inherit;
}

@media (max-width:700px) {
    .detail-grid {
        grid-template-columns: 1fr;
    }

    .fault-image-link img {
        height: auto;
    }
}


/* v15 - effektiv arbetsorderhantering på laptop */
.workorder-summary {
    display: grid;
    grid-template-columns: repeat(4,minmax(0,1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.workorder-summary > div {
    background: #fff;
    border: 1px solid #e1e6e9;
    border-radius: 9px;
    padding: 14px 16px;
}

.workorder-summary strong {
    display: block;
    font-size: 25px;
    line-height: 1;
    margin-bottom: 5px;
}

.workorder-summary span {
    color: #687780;
    font-size: 13px;
}

.workorder-filter-grid {
    display: grid;
    grid-template-columns: minmax(240px,2fr) minmax(180px,1fr) minmax(180px,1fr) minmax(180px,1fr);
    gap: 14px;
    align-items: end;
}

.workorder-filter-checks {
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding-bottom: 8px;
}

.table-sub {
    display: block;
    margin-top: 3px;
    color: #718089;
    line-height: 1.25;
}

.table-title {
    font-weight: 750;
    color: inherit;
    text-decoration: none;
}

.table-title:hover {
    text-decoration: underline;
}

.status-chip {
    display: inline-block;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.status-troubleshooting { background:#eef3f6; color:#334d5a; }
.status-started { background:#e9f2fb; color:#235d8c; }
.status-waiting { background:#fff1cf; color:#795600; }
.status-overdue { background:#fee4e4; color:#9b2626; }
.status-completed { background:#e5f4e8; color:#276b35; }
.status-other { background:#eee; color:#555; }

.availability-blocked {
    color: #9b2626;
    font-weight: 750;
}

.availability-ok {
    color: #276b35;
    font-weight: 650;
}

.booking-impact {
    color: #a25a00;
    font-weight: 750;
}

.workorder-editor-grid {
    display: grid;
    grid-template-columns: minmax(0,1fr) 300px;
    gap: 18px;
    align-items: start;
}

.workorder-side-card {
    position: sticky;
    top: 88px;
}

.detail-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.detail-list > div {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    border-bottom: 1px solid #edf0f2;
    padding-bottom: 8px;
}

.detail-list span {
    color: #687780;
}

.btn.full {
    width: 100%;
    margin-bottom: 9px;
}

.btn.success {
    background: #2f743f;
    color: #fff;
}

.modal-panel {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0,0,0,.42);
}

.modal-card {
    width: min(620px,100%);
    max-height: 90vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 20px 70px rgba(0,0,0,.25);
}

/* v15 - kompakt men informationsrik resursjournal */
.journal-filter-main {
    display: grid;
    grid-template-columns: 180px 180px 1fr;
    gap: 14px;
    align-items: end;
}

.journal-compact-list {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.journal-compact-row {
    display: grid;
    grid-template-columns: 132px 145px minmax(0,1fr);
    gap: 12px;
    align-items: start;
    background: #fff;
    border: 1px solid #e2e7ea;
    border-left: 4px solid #bbc5ca;
    border-radius: 7px;
    padding: 11px 13px;
}

.journal-compact-date {
    color: #42525b;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.journal-compact-kind .journal-type {
    display: inline-block;
    font-size: 11px;
    font-weight: 850;
    letter-spacing: .025em;
    text-transform: uppercase;
    background: #eef2f4;
    padding: 4px 7px;
    border-radius: 5px;
}

.journal-compact-title {
    font-size: 15px;
    font-weight: 800;
    line-height: 1.25;
}

.journal-compact-who {
    color: #6b7981;
    font-size: 12px;
    margin-top: 2px;
}

.journal-compact-content .journal-description {
    margin-top: 6px;
    color: #39484f;
    line-height: 1.42;
    font-size: 13px;
}

.journal-compact-row.journal-fault { border-left-color:#c34b4b; }
.journal-compact-row.journal-service { border-left-color:#337a4a; }
.journal-compact-row.journal-usage { border-left-color:#3e79a6; }
.journal-compact-row.journal-check { border-left-color:#6c7e8a; }
.journal-compact-row.journal-workorder { border-left-color:#d4942e; }
.journal-compact-row.journal-maintenance { border-left-color:#765ca4; }

.journal-print-date {
    margin-top: 6px;
    font-size: 12px;
}

.journal-print-footer {
    margin-top: 18px;
    padding-top: 7px;
    border-top: 1px solid #bbb;
    font-size: 10px;
    color: #555;
}

@media (max-width: 980px) {
    .workorder-filter-grid {
        grid-template-columns: 1fr 1fr;
    }

    .workorder-editor-grid {
        grid-template-columns: 1fr;
    }

    .workorder-side-card {
        position: static;
    }
}

@media (max-width: 700px) {
    .workorder-summary {
        grid-template-columns: 1fr 1fr;
    }

    .workorder-filter-grid,
    .journal-filter-main {
        grid-template-columns: 1fr;
    }

    .journal-compact-row {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .journal-compact-kind {
        order: -1;
    }
}

@media print {
    @page {
        size: A4 portrait;
        margin: 12mm 10mm 13mm;
    }

    body {
        background: #fff !important;
        color: #000 !important;
        font-size: 10pt;
    }

    .sidebar,
    .admin-header,
    .no-print,
    .journal-summary {
        display: none !important;
    }

    .admin-main,
    .admin-content {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
    }

    .print-only {
        display: block !important;
    }

    .journal-compact-list {
        gap: 3mm;
    }

    .journal-compact-row {
        grid-template-columns: 31mm 34mm 1fr;
        border: 0;
        border-bottom: .3mm solid #bbb;
        border-left: 1.2mm solid #777;
        border-radius: 0;
        padding: 2.5mm 2mm;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .journal-compact-kind .journal-type {
        background: none !important;
        padding: 0;
        color: #000;
    }

    .journal-description {
        color: #000 !important;
    }

    a {
        color: #000 !important;
        text-decoration: none !important;
    }
}

/* v16 - aviseringsmottagare */
.notification-settings .section-heading { margin-bottom:14px; }
.notification-recipient-table th:nth-child(3),
.notification-recipient-table th:nth-child(4),
.notification-recipient-table td:nth-child(3),
.notification-recipient-table td:nth-child(4) { width:110px; text-align:center; }
.notification-recipient-table input[type="checkbox"] { width:20px; height:20px; cursor:pointer; }
.notification-help { margin-top:12px; padding:11px 13px; background:#f4f7f8; border-radius:7px; color:#53636b; font-size:13px; }
.notification-help strong { color:#263941; }

/* v17 - checklistadmin */
.checklist-admin-layout { display:grid; grid-template-columns:minmax(330px,420px) minmax(0,1fr); gap:18px; align-items:start; }
.admin-help{position:relative;align-self:center;flex:0 0 28px;margin:0 0 0 10px}
.admin-help summary{display:flex;align-items:center;justify-content:center;width:28px;height:28px;border:1px solid #b9c8cf;border-radius:50%;background:#fff;color:#36525f;font-weight:900;cursor:pointer;list-style:none}
.admin-help summary::-webkit-details-marker{display:none}
.admin-help-body{position:absolute;right:0;top:36px;z-index:20;width:min(360px,calc(100vw - 40px));min-width:0;max-height:calc(100vh - 88px);overflow-x:hidden;overflow-y:auto;box-sizing:border-box;padding:15px 17px;background:#fff;border:1px solid #d9e1e5;border-radius:9px;box-shadow:0 8px 24px rgba(20,38,49,.14);color:#3e5059;font-size:13px;line-height:1.5;white-space:normal;overflow-wrap:anywhere}
.admin-header .admin-help-body{position:fixed;top:72px;right:16px;left:auto;width:min(360px,calc(100vw - 32px));max-height:calc(100vh - 88px)}
@media (max-width:900px){.admin-header .admin-help-body{left:16px;right:16px;width:auto;max-width:none}}
.admin-help-body strong{display:block;margin-bottom:5px;color:#1c3441}
.admin-help-body p{margin:6px 0 0}
.checklist-items-panel { min-width:0; }
.checklist-current-image { margin:10px 0 14px; padding:12px; background:#f5f7f8; border-radius:8px; }
.checklist-current-image img { display:block; max-width:100%; max-height:240px; object-fit:contain; margin:6px 0 10px; border-radius:6px; }
.checklist-order-buttons,.checklist-row-actions { display:flex; gap:5px; white-space:nowrap; }
.btn.icon.small { min-width:34px; padding-left:8px; padding-right:8px; }
.btn.danger { background:#fff; color:#a12c2c; border-color:#d9b6b6; }
.btn.danger:hover { background:#fff0f0; }
.checklist-sort-number { display:inline-flex; min-width:27px; min-height:27px; align-items:center; justify-content:center; border-radius:50%; background:#eef2f4; font-weight:800; }
.check-fail-stop { color:#a12c2c; font-weight:750; }
.check-fail-warning { color:#956600; font-weight:700; }
@media (max-width:1050px) { .checklist-admin-layout { grid-template-columns:1fr; } }
@media (max-width:700px) {
    .checklist-admin-table th:nth-child(3),.checklist-admin-table td:nth-child(3) { display:none; }
    .checklist-row-actions,.checklist-order-buttons { flex-direction:column; }
}

/* v18 - ja/nej före extra felrapport */
.additional-fault-check { margin:18px 0; padding:16px; border:1px solid #dfe5e8; border-radius:10px; background:#fff; }
.additional-fault-check > h2 { margin-top:0; margin-bottom:6px; }
.yes-no-choice { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin:14px 0 0; }
.fault-toggle { min-height:52px; border:2px solid #d3dde2; border-radius:9px; background:#fff; color:#152b35; font:inherit; font-weight:800; cursor:pointer; }
.fault-toggle.selected { border-color:#176488; background:#eaf4f8; box-shadow:0 0 0 1px rgba(23,100,136,.08); }
.additional-fault-details { display:none; margin-top:14px; }
.additional-fault-check .report-box { border-color:#e0a62f; }
@media (max-width:520px) { .fault-toggle { min-height:56px; } }

/* v19 - dokumentation per kontrollpunkt */
.checklist-advanced { margin:16px 0 4px; border:1px solid #dce4e8; border-radius:8px; background:#f8fafb; }
.checklist-advanced summary { cursor:pointer; padding:12px 14px; font-weight:800; }
.checklist-advanced summary span { margin-left:7px; color:#6d7d85; font-size:12px; font-weight:600; }
.checklist-advanced-body { padding:0 14px 14px; }
.documentation-setting { padding:13px 0; border-top:1px solid #e3e9ec; }
.documentation-setting h3 { margin:0 0 8px; font-size:14px; }
.checklist-documentation-summary { display:block; max-width:240px; color:#596a73; line-height:1.35; }
.check-item-documentation { margin-top:12px; }
.check-item-description,.check-item-photo { display:none; margin-top:10px; padding:12px; background:#f7f9fa; border:1px solid #e1e7ea; border-radius:8px; }
.required-indicator,.check-photo-required { color:#b32d2d; font-weight:900; }

/* v20 - statistik */
.stats-period{max-width:240px;display:inline-block;margin-right:10px}
.stats-kpis{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin:16px 0}
.stats-kpis>div{background:#fff;border:1px solid #e1e6e9;border-radius:9px;padding:15px}
.stats-kpis strong{display:block;font-size:26px;line-height:1;margin-bottom:6px}
.stats-kpis span{color:#687780;font-size:13px}
.stats-signal{border-left:4px solid #d4942e}
@media(max-width:700px){.stats-kpis{grid-template-columns:1fr 1fr}}

/* v21 */
.login-help{text-align:center;margin-top:12px}.login-help a{font-weight:700}.password-panel{border-left:4px solid #3e79a6}.btn.success.full{margin-top:10px}

/* v22 - flera samtidiga arbetsorder */
.workorder-create-row{display:grid;grid-template-columns:minmax(260px,420px) auto;gap:14px;align-items:end}
.workorder-create-row .button-row{margin:0 0 14px}
@media(max-width:700px){.workorder-create-row{grid-template-columns:1fr}}
.workorder-history-card h2{margin-bottom:12px}
.workorder-history-row{padding:10px 0;border-top:1px solid #edf0f2}
.workorder-history-row:first-child{border-top:0}
.workorder-history-row time,.workorder-history-row small{display:block;color:#71808d;font-size:12px}
.workorder-history-row strong{display:block;margin:3px 0}
.workorder-history-row p{margin:4px 0 0;font-size:13px;line-height:1.4}

/* v23 */
.dashboard-links{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:10px;
    margin:0 0 16px;
}
.dashboard-links .stat{
    display:flex;
    flex-direction:column;
    justify-content:space-between;
    min-height:96px;
    padding:10px 11px 9px;
    border:1px solid #e1e6e9;
    border-left-width:3px;
    border-radius:10px;
    background:#fff;
    color:inherit;
    text-decoration:none;
    box-shadow:0 1px 0 rgba(15,28,38,.02);
    transition:transform .12s ease,box-shadow .12s ease,border-color .12s ease;
}
.dashboard-links .stat:hover{
    transform:translateY(-1px);
    box-shadow:0 4px 10px rgba(0,0,0,.05);
    border-color:#c9d4da;
}
.dashboard-links .stat span{
    display:block;
    color:#5d6f7b;
    font-size:11px;
    font-weight:700;
    line-height:1.25;
}
.dashboard-links .stat strong{
    display:block;
    font-size:26px;
    line-height:1.1;
    letter-spacing:-.04em;
    color:#172833;
}
.dashboard-links .stat.ok{border-left-color:#2fa374;background:#f5fbf8}.dashboard-links .stat.warning{border-left-color:#d28b1f;background:#fffaf2}.dashboard-links .stat.danger{border-left-color:#c84d4d;background:#fff5f5}.dashboard-links .stat:not(.ok):not(.warning):not(.danger){border-left-color:#2d4b5a;background:#f8fafb}
.active-filter{margin:0 0 14px;padding:10px 13px;background:#eef5f8;border-radius:8px}
.active-filter a{margin-left:8px;font-weight:700}
.danger-zone{border-left:4px solid #b33a3a}
@media(min-width:681px){.dashboard-links{grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.dashboard-links .stat{min-height:108px;padding:12px 14px 11px}.dashboard-links .stat span{font-size:12px}.dashboard-links .stat strong{font-size:30px}} 
@media(max-width:520px){.admin-content{padding:18px 12px 20px}.page-title{margin-bottom:16px}.page-title h1{font-size:26px;line-height:1.1}.eyebrow{font-size:10px;letter-spacing:.12em}.dashboard-links{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.dashboard-links .stat{min-height:88px;padding:9px 10px 8px}.dashboard-links .stat span{font-size:10px}.dashboard-links .stat strong{font-size:22px}}

/* v24 */
.resolve-fault{border-left:4px solid #d4942e}
.booking-manage-actions{margin-top:14px}

.resource-search-main{display:grid;grid-template-columns:1fr auto auto;gap:8px;margin-bottom:12px}.filter-row{flex-wrap:wrap}.resource-table-panel{min-width:0}.resource-table-panel .data-table{min-width:900px}.resource-table-panel .table-actions{flex-wrap:wrap;white-space:normal}@media(max-width:1100px){.admin-help-body{left:0;right:auto}.resource-table-panel{overflow:visible;padding:12px}.resource-table-panel .data-table{min-width:0;display:block}.resource-table-panel .data-table thead{display:none}.resource-table-panel .data-table tbody,.resource-table-panel .data-table tr{display:block}.resource-table-panel .data-table tr{padding:12px 0;border-bottom:1px solid #dfe5e9}.resource-table-panel .data-table tr:last-child{border-bottom:0}.resource-table-panel .data-table td{display:flex;flex-direction:column;gap:3px;padding:7px 0;border-bottom:0}.resource-table-panel .data-table td:before{content:'';font-size:10px;font-weight:900;letter-spacing:.5px;text-transform:uppercase;color:#71808d}.resource-table-panel .data-table td:nth-child(1):before{content:'Resurs'}.resource-table-panel .data-table td:nth-child(2):before{content:'Nr'}.resource-table-panel .data-table td:nth-child(3):before{content:'Typ'}.resource-table-panel .data-table td:nth-child(4):before{content:'Kategori'}.resource-table-panel .data-table td:nth-child(5):before{content:'Enhet'}.resource-table-panel .data-table td:nth-child(6):before{content:'Plats'}.resource-table-panel .data-table td:nth-child(7):before{content:'Bokning'}.resource-table-panel .data-table td:nth-child(8):before{content:'Livscykel'}.resource-table-panel .data-table td:nth-child(9):before{content:'Teknisk status'}.resource-table-panel .data-table td:nth-child(10):before{content:'Användning'}.resource-table-panel .data-table td:nth-child(11){padding-top:10px}.resource-table-panel .data-table td:nth-child(11):before{content:''}}@media(max-width:700px){.resource-search-main{grid-template-columns:1fr}}@media(max-width:520px){.resource-table-panel{padding:10px}.resource-table-panel .data-table td{padding:6px 0}}

.public-fault-btn{border-style:solid}
.public-honeypot{position:absolute!important;left:-9999px!important;width:1px!important;height:1px!important;overflow:hidden!important}
.public-fault-page .notice{margin-bottom:16px}

/* Service template editor */
.service-template-layout{display:grid;grid-template-columns:minmax(300px,420px) minmax(0,1fr);gap:18px;align-items:start}
.service-template-items-panel{min-width:0}
.service-template-items-panel .input{margin:0}
.service-template-preview{white-space:pre-line;line-height:1.45;min-width:240px}
@media(max-width:1050px){.service-template-layout{grid-template-columns:1fr}}

/* Service resource status */
.service-machine-list .status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0 11px;
    border: 1px solid transparent;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}

.service-machine-list .status-ok {
    background: #e8f5ed;
    border-color: #b9ddc5;
    color: #216b3b;
}

.service-machine-list .status-warning {
    background: #fff5d9;
    border-color: #ead28a;
    color: #765500;
}

.service-machine-list .status-danger {
    background: #fbe9e9;
    border-color: #e3b6b6;
    color: #9b2626;
}

.service-machine-list .status-neutral {
    background: #eef2f4;
    border-color: #d5dde2;
    color: #53636d;
}

.service-page .machine-status {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 56px;
    margin: 14px 0 18px;
    padding: 12px 18px;
    border-radius: 10px;
    font-size: 22px;
    font-weight: 800;
    text-align: center;
}

.dashboard-links .stat strong {
    width: 100%;
    text-align: center;
}

.dashboard-links .stat span {
    font-size: 12px;
    line-height: 1.25;
    font-weight: 700;
}

.dashboard-links .stat strong {
    font-size: 30px;
    line-height: 1;
}

@media(max-width:520px) {
    .dashboard-links .stat {
        min-height: 96px;
        padding: 10px 11px 9px;
    }

    .dashboard-links .stat span {
        font-size: 12px;
    }

    .dashboard-links .stat strong {
        font-size: 28px;
    }
}

.service-page .page-title > .button-row {
    align-items: stretch;
}

@media(max-width:520px) {
    .service-page .page-title {
        display: block;
    }

    .service-page .page-title h1 {
        margin-bottom: 2px;
    }

    .service-page .page-title > .button-row {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        margin-top: 14px;
    }

    .service-page .page-title > .button-row .btn {
        width: 100%;
        min-width: 0;
        padding-left: 8px;
        padding-right: 8px;
        font-size: 13px;
        white-space: normal;
        text-align: center;
    }

    .service-page .page-title > .button-row .btn.primary {
        grid-column: 1 / -1;
        order: -1;
    }
    .service-page .grid-2 .section-heading {
        display: block;
    }
    .service-page .grid-2 .section-heading .btn {
        width: 100%;
        margin-top: 12px;
    }
}

/* Header help must stay inside the viewport at every responsive width. */
.admin-header > .admin-help .admin-help-body {
    position: fixed;
    top: 72px !important;
    right: 16px !important;
    left: 16px !important;
    width: calc(100vw - 32px) !important;
    max-width: calc(100vw - 32px) !important;
    box-sizing: border-box !important;
    max-height: calc(100vh - 88px);
    overflow: auto;
    white-space: normal;
    overflow-wrap: anywhere;
}

.workorder-mobile-list {
    display: none;
}

.workorder-mobile-searchbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
}

.workorder-mobile-searchbar .input {
    min-width: 0;
    margin: 0;
}

.workorder-filter-options {
    margin-top: 12px;
}

.workorder-mobile-card {
    display: flex;
    min-width: 0;
    flex-direction: column;
    padding: 14px;
    border: 1px solid #b9c8d0;
    border-radius: 10px;
    background: #fff;
}

.workorder-card-main {
    color: inherit;
    text-decoration: none;
}

.workorder-card-header {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 3px;
    margin: -14px -14px 0;
    padding: 12px 14px;
    border: 1px solid #b9c8d0;
    border-radius: 9px 9px 0 0;
    background: #e8f0f3;
}

.workorder-card-header strong,
.workorder-card-header span {
    overflow-wrap: anywhere;
}

.workorder-card-header strong {
    color: #142631;
    font-size: 17px;
}

.workorder-card-header span {
    color: #3e5663;
    font-size: 13px;
    font-weight: 700;
}

.workorder-card-status-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
    padding: 12px 0 9px;
}

.workorder-card-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 9px 0;
    border-top: 1px solid #edf0f2;
}

.workorder-card-meta span {
    display: block;
    color: #71808d;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.workorder-card-meta strong {
    display: block;
    overflow-wrap: anywhere;
    font-size: 13px;
}

.workorder-card-detail {
    min-height: 18px;
    padding: 9px 0;
    border-top: 1px solid #edf0f2;
    color: #687780;
    font-size: 12px;
}

.workorder-card-action {
    width: 100%;
    margin-top: 8px;
}

@media (max-width: 900px) {
    .workorder-table {
        display: none;
    }

    .workorder-mobile-list {
        display: grid;
        gap: 10px;
    }

    .workorder-filter-options {
        display: none;
        margin-top: 10px;
    }

    .workorder-filter-options.is-open {
        display: block;
    }

    .workorder-filter-grid {
        grid-template-columns: 1fr;
    }

    .workorder-filter .button-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .workorder-filter .button-row .btn {
        width: 100%;
    }
}

@media (min-width: 700px) and (max-width: 900px) {
    .workorder-mobile-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.resource-filter-area {
    margin-bottom: 14px;
}

.resource-search-main {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto 44px;
    gap: 8px;
    align-items: center;
}

.resource-search-main .input {
    min-width: 0;
    margin: 0;
}

.resource-filter-toggle {
    display: inline-flex;
    position: relative;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 42px;
    padding: 0;
    border: 1px solid #cdd5dc;
    border-radius: 8px;
    background: #fff;
    color: #183344;
    cursor: pointer;
}

.resource-filter-toggle svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linejoin: round;
}

.resource-filter-count {
    position: absolute;
    top: -5px;
    right: -5px;
    display: none;
    min-width: 18px;
    height: 18px;
    padding: 1px 4px;
    border-radius: 999px;
    background: #c84d4d;
    color: #fff;
    font-size: 11px;
    font-weight: 900;
    line-height: 16px;
}

.resource-search-clear {
    display: none;
    position: absolute;
    right: 58px;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #71808d;
    font-size: 20px;
    line-height: 20px;
    cursor: pointer;
}

.resource-search-clear.is-visible {
    display: block;
}

.resource-filter-panel {
    display: none;
    margin-top: 12px;
}

.resource-filter-apply {
    grid-column: 1 / -1;
}

.resource-filter-clear-all {
    color: #53636d;
    font-size: 13px;
    font-weight: 700;
    text-decoration: underline;
}

.resource-active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.resource-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 28px;
    padding: 4px 8px 4px 10px;
    border: 1px solid #b9c8d0;
    border-radius: 999px;
    background: #eef3f5;
    color: #183344;
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
}

.resource-filter-chip-remove {
    font-size: 16px;
    font-weight: 400;
    line-height: 1;
}

@media (max-width: 900px) {
    .resource-filter-area {
        margin-bottom: 10px;
    }

    .resource-search-main {
        grid-template-columns: minmax(0, 1fr) 44px;
    }

    .resource-search-main > .btn {
        display: none;
    }

    .resource-filter-toggle {
        display: inline-flex;
    }

    .resource-filter-panel {
        display: none;
        padding: 12px;
        border: 1px solid #dfe5e9;
        border-radius: 9px;
        background: #f8fafb;
    }

    .resource-filter-panel.is-open {
        display: block;
    }

    .resource-filter-panel .filter-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 5px;
    }

    .resource-filter-panel .filter-row label {
        margin-top: 5px;
    }

    .resource-filter-panel .input.compact {
        width: 100%;
        min-width: 0;
        margin: 0 0 4px;
    }

    .resource-filter-apply {
        width: 100%;
        margin-top: 5px;
    }

    .resource-filter-clear-all {
        justify-self: start;
        margin-top: 2px;
    }

    .resource-search-clear {
        right: 52px;
    }
}

/* Separate resource presentations: the desktop table is never transformed into cards. */
.resource-mobile-list {
    display: none;
}

.resource-card-main {
    display: block;
    color: inherit;
    text-decoration: none;
}

.resource-mobile-card {
    display: flex;
    min-width: 0;
    flex-direction: column;
    padding: 14px;
    border: 2px solid #b9c8d0;
    border-radius: 10px;
    background: #fff;
}

.resource-card-header {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 3px;
    margin: -14px -14px 0;
    padding: 13px 14px 12px;
    border: 1px solid #b9c8d0;
    border-left: 0;
    border-radius: 9px 9px 0 0;
    background: #e8f0f3;
}

.resource-card-header strong {
    overflow-wrap: anywhere;
    font-size: 18px;
    line-height: 1.2;
}

.resource-card-header span {
    overflow-wrap: anywhere;
    color: #687780;
    font-size: 13px;
}

.resource-card-header strong,
.resource-card-header span {
    position: relative;
    z-index: 1;
}

.resource-card-header strong {
    color: #142631;
    font-size: 19px;
    font-weight: 900;
}

.resource-card-header span {
    color: #3e5663;
    font-weight: 700;
}

.resource-card-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 10px 0;
}

.resource-card-meta div,
.resource-card-status div {
    min-width: 0;
}

.resource-card-meta span,
.resource-card-status span,
.resource-card-booking span {
    display: block;
    margin-bottom: 2px;
    color: #71808d;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.resource-card-meta strong,
.resource-card-status strong,
.resource-card-booking strong {
    display: block;
    overflow-wrap: anywhere;
    font-size: 13px;
    line-height: 1.25;
}

.resource-card-status {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px 12px;
    padding: 10px 0;
    border-top: 1px solid #edf0f2;
}

.resource-card-status div:last-child {
    grid-column: 1 / -1;
}

.resource-card-status .status-pill {
    display: inline-block;
    max-width: 100%;
    overflow-wrap: anywhere;
    padding: 4px 8px;
}

.resource-card-booking {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 0 10px;
    border-top: 1px solid #edf0f2;
}

.resource-card-booking span {
    flex: 0 0 auto;
    margin: 0;
}

.resource-card-booking strong {
    text-align: right;
}

.resource-card-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid #edf0f2;
}

.resource-card-actions .btn {
    width: 100%;
    min-width: 0;
}

@media (max-width: 900px) {
    .resource-desktop-list {
        display: none;
    }

    .resource-mobile-list {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

@media (min-width: 700px) and (max-width: 900px) {
    .resource-mobile-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}


.resource-filter-panel.is-open { display: block; }
.resource-desktop-list th a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.resource-desktop-list th a:focus-visible { outline: 2px solid #2474b5; outline-offset: 3px; }
@media (min-width: 901px) { .resource-search-clear.is-visible { display: none; } }
.image-upload-status{margin:6px 0 10px;padding:9px 11px;border-radius:7px;background:#edf4f8;color:#234b61;font-size:13px}.image-upload-status.ready{background:#e3f3e9;color:#245f3e}.image-upload-status.error{background:#fae9e9;color:#8a2020}input[data-image-upload="true"][aria-busy="true"]{opacity:.58;cursor:wait}


/* v20 - kontrollflöde med tydliga val och validering */
.checklist-progress{margin:12px 0 14px;padding:10px 13px;border:1px solid #bfd0d9;border-radius:9px;background:#eef5f8;color:#173f54;font-weight:800}
.checklist-progress.complete{border-color:#5b9a72;background:#e8f5ed;color:#1d633b}
.checklist-validation-summary{margin:0 0 14px}
.checklist-validation-summary[hidden],.check-answer-required[hidden]{display:none!important}
.mobile-check-card{transition:border-color .16s ease,background-color .16s ease,box-shadow .16s ease}
.mobile-check-card.check-result-ok{border-color:#5b9a72;background:#f3faf6;box-shadow:0 0 0 2px rgba(42,126,77,.12)}
.mobile-check-card.check-result-remark{border-color:#cf8b19;background:#fff9eb;box-shadow:0 0 0 2px rgba(207,139,25,.14)}
.mobile-check-card.check-result-remark-blocking{border-color:#c64046;background:#fff3f3;box-shadow:0 0 0 2px rgba(198,64,70,.14)}
.mobile-check-card.check-result-stop{border-color:#c64046;background:#fff3f3;box-shadow:0 0 0 2px rgba(198,64,70,.14)}
.mobile-check-card.check-unanswered{border-color:#b52f36;background:#fff5f5;box-shadow:0 0 0 3px rgba(181,47,54,.2)}
.usage-mobile .touch-choice span:nth-of-type(1) input:checked+label{border-color:#2f8050;background:#dff2e6;color:#185a35;box-shadow:0 0 0 2px rgba(47,128,80,.14)}
.usage-mobile .touch-choice span:nth-of-type(2) input:checked+label{border-color:#c27f0f;background:#ffefc7;color:#704800;box-shadow:0 0 0 2px rgba(194,127,15,.14)}
.usage-mobile .touch-choice span:nth-of-type(3) input:checked+label{border-color:#bd3037;background:#f9dfe0;color:#7f171c;box-shadow:0 0 0 2px rgba(189,48,55,.14)}
.mobile-check-card.check-result-remark-blocking .touch-choice span:nth-of-type(2) input:checked+label{border-color:#bd3037;background:#f9dfe0;color:#7f171c;box-shadow:0 0 0 2px rgba(189,48,55,.14)}
.touch-choice input:focus-visible+label{outline:3px solid #2474b5;outline-offset:2px}
.check-result-consequence{min-height:20px;margin:9px 2px 2px;color:#334f5e;font-size:14px;font-weight:750;line-height:1.42}
.check-result-ok .check-result-consequence{color:#1d633b}
.check-result-remark .check-result-consequence{color:#79520e}
.check-result-remark-blocking .check-result-consequence{color:#8a2026}
.check-result-stop .check-result-consequence{color:#8a2026}
.check-answer-required{margin:10px 0 0;padding:9px 11px;border-radius:7px;background:#f7dfe0;color:#831b21;font-weight:800}
.checklist-fixed-outcomes{display:flex;flex-direction:column;gap:5px;margin:12px 0 16px}
