:root{--bg:#f3f6fb;--card:#fff;--text:#101828;--muted:#667085;--line:#d0d5dd;--brand:#1d4ed8;--brand2:#0f172a;--green:#027a48;--yellow:#b54708;--red:#b42318;--shadow:0 12px 30px rgba(16,24,40,.08)}
*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--text);font-family:Inter,system-ui,-apple-system,Segoe UI,Arial,sans-serif}a{color:var(--brand);text-decoration:none}.topbar{background:var(--brand2);color:white;padding:14px 28px;display:flex;align-items:center;justify-content:space-between;gap:18px}.brand{font-weight:800;color:white;font-size:20px}.nav{display:flex;gap:12px;flex-wrap:wrap}.nav a{color:#dbeafe;font-weight:600}.container{max-width:1180px;margin:0 auto;padding:28px}.narrow{max-width:760px}.page-head{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;margin-bottom:18px}.page-head h1{margin:0 0 6px;font-size:32px}.muted,.subtle{color:var(--muted)}.card{background:var(--card);border:1px solid #e4e7ec;border-radius:18px;box-shadow:var(--shadow);padding:22px;margin-bottom:18px}.portal-grid,.kpi-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:18px}.portal-card{display:block;background:white;border:1px solid #e4e7ec;border-radius:22px;padding:28px;box-shadow:var(--shadow);color:var(--text)}.portal-card:hover{transform:translateY(-2px)}.portal-card h2{margin-top:0}.kpi{background:white;border-radius:18px;border:1px solid #e4e7ec;padding:20px;box-shadow:var(--shadow)}.kpi span{display:block;color:var(--muted);font-weight:600}.kpi strong{font-size:34px}.kpi.danger strong{color:var(--red)}.kpi.warn strong{color:var(--yellow)}.btn,button{display:inline-block;border:0;border-radius:12px;background:#eaf1ff;color:#174ea6;padding:10px 14px;font-weight:800;cursor:pointer}.btn.primary,button.primary,button{background:var(--brand);color:white}.btn.secondary{background:#f2f4f7;color:#344054}.btn.small{padding:7px 10px;font-size:13px}.actions{display:flex;gap:10px;align-items:center;flex-wrap:wrap}.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.full{grid-column:1/-1}label{display:block;font-weight:700;margin-bottom:6px}input,select,textarea{width:100%;border:1px solid var(--line);border-radius:12px;padding:11px;font:inherit;background:white}textarea{resize:vertical}.searchbar{display:flex;gap:10px;align-items:end}.table-wrap{overflow:auto}table{width:100%;border-collapse:collapse}th,td{padding:13px;border-bottom:1px solid #eaecf0;text-align:left}th{color:#475467;font-size:13px;text-transform:uppercase;letter-spacing:.04em}.badge,.status{display:inline-block;border-radius:999px;padding:5px 10px;font-weight:800;font-size:12px;background:#eef4ff;color:#3538cd}.status-new,.status-Ny{background:#eef4ff;color:#3538cd}.status-in-progress,.status-Igang{background:#fff6ed;color:#c4320a}.status-waiting,.status-Afventer{background:#fffaeb;color:#b54708}.status-closed,.status-Lukket{background:#ecfdf3;color:#027a48}.priority-low,.priority-Lav{background:#ecfdf3;color:#027a48}.priority-medium,.priority-Mellem{background:#fffaeb;color:#b54708}.priority-high,.priority-Høj,.priority-critical,.priority-Kritisk{background:#fef3f2;color:#b42318}.error{background:#fef3f2;color:#b42318;border:1px solid #fecdca;border-radius:12px;padding:12px}.empty{padding:18px;color:var(--muted);background:#f9fafb;border-radius:14px}.row,.two-col{display:grid;grid-template-columns:1fr 1fr;gap:18px}.detail-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:14px}.comment{border:1px solid #eaecf0;border-radius:14px;padding:14px;margin:12px 0;background:#fcfcfd}.comment-head{display:flex;justify-content:space-between;gap:10px}.gallery{display:flex;gap:12px;flex-wrap:wrap}.thumb{width:150px;height:110px;object-fit:cover;border-radius:14px;border:1px solid #d0d5dd}.preline{white-space:pre-line}.section-head{display:flex;justify-content:space-between;align-items:center}@media(max-width:760px){.topbar,.page-head{display:block}.nav{margin-top:12px}.form-grid,.row,.two-col,.detail-grid{grid-template-columns:1fr}.searchbar{display:block}.searchbar>*{margin-bottom:10px}.container{padding:18px}}

/* Work order v2 */
.asset-search-results{margin-top:6px;border:1px solid #eaecf0;border-radius:12px;overflow:hidden;background:#fff;max-height:260px;overflow-y:auto}
.asset-search-item{display:block;width:100%;text-align:left;border:0;border-radius:0;background:#fff;color:#101828;padding:9px 11px;font-weight:650;border-bottom:1px solid #f2f4f7}
.asset-search-item:hover{background:#f3f6fb;color:#174ea6}
.asset-search-empty{padding:10px;color:#667085;background:#f9fafb}
.recurrence-box{border:1px solid #eaecf0;background:#f9fafb;border-radius:14px;padding:14px}
.checkline{display:flex;align-items:center;gap:10px;margin:0}.checkline input{width:auto}
.recurrence-options{grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin-top:12px}
.inline-form{display:inline}.wo-action-card{display:flex;align-items:center;justify-content:space-between;gap:14px}
.btn.success{background:#027a48;color:white}.status-paused{background:#f2f4f7;color:#344054}
.clickable-row{cursor:pointer}.clickable-row:hover{background:#f9fafb}
.clickable-table td{user-select:none}
@media(max-width:760px){.wo-action-card{display:block}.wo-action-card .actions{margin-top:12px}.recurrence-options{grid-template-columns:1fr}}

/* Planner + asset WO badge update */
.wo-count-badge{min-width:48px;text-align:center}
.wo-count-zero{background:#ecfdf3;color:#027a48}
.wo-count-warn{background:#fffaeb;color:#b54708}
.wo-count-danger{background:#fef3f2;color:#b42318}
.planner-section h2{margin-top:0}.planner-overdue{border-color:#fecdca}.planner-table td{white-space:nowrap}.planner-table td:nth-child(3){white-space:normal}.planner-kpis{margin-bottom:18px}

/* Compact Work Order / Planner list update */
.compact-head { margin-bottom: 14px; }
.compact-head h1 { margin-bottom: 2px; }
.compact-card { padding: 14px; }
.compact-search { gap: 8px; margin-bottom: 12px; }
.compact-search input,
.compact-search select { min-height: 34px; padding: 7px 10px; }
.compact-search .btn { min-height: 34px; padding: 7px 12px; }

.slim-list { display: flex; flex-direction: column; gap: 6px; }
.wo-item {
    display: grid;
    grid-template-columns: minmax(220px, 1.3fr) minmax(240px, 1.6fr) auto;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    padding: 8px 10px 8px 12px;
    border: 1px solid rgba(15,23,42,.08);
    border-left-width: 3px;
    border-radius: 10px;
    background: #fff;
    color: inherit;
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(15,23,42,.035);
    transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease, background .12s ease;
}
.wo-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(15,23,42,.08);
    border-color: rgba(37,99,235,.25);
    background: #fbfdff;
}
.wo-main { display: flex; align-items: center; gap: 8px; min-width: 0; }
.wo-id {
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
    background: #f1f5f9;
    border-radius: 999px;
    padding: 2px 7px;
    flex: 0 0 auto;
}
.wo-title {
    font-size: 14px;
    line-height: 1.2;
    color: #0f172a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.wo-meta {
    display: flex;
    gap: 12px;
    align-items: center;
    min-width: 0;
    color: #64748b;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
}
.wo-meta span { overflow: hidden; text-overflow: ellipsis; }
.wo-badges { display: flex; gap: 6px; justify-content: flex-end; align-items: center; }
.wo-badges .badge { font-size: 11px; padding: 3px 7px; line-height: 1.1; }
.priority-left-critical { border-left-color: #dc2626; }
.priority-left-high { border-left-color: #f97316; }
.priority-left-medium { border-left-color: #2563eb; }
.priority-left-low { border-left-color: #94a3b8; }
.compact-empty { padding: 12px; font-size: 13px; }

.compact-kpis { gap: 10px; margin-bottom: 12px; }
.compact-kpis .kpi { padding: 12px 14px; min-height: 72px; }
.compact-kpis .kpi span { font-size: 12px; }
.compact-kpis .kpi strong { font-size: 24px; }
.compact-section-head { margin-bottom: 10px; }
.compact-section-head h2 { margin: 0; font-size: 17px; }
.compact-section-head .subtle { margin-top: 2px; }
.planner-section { margin-bottom: 12px; }
.planner-slim-list .wo-item { min-height: 42px; }

@media (max-width: 850px) {
    .wo-item { grid-template-columns: 1fr; gap: 5px; padding: 9px 10px; }
    .wo-meta { flex-wrap: wrap; gap: 6px 10px; white-space: normal; }
    .wo-badges { justify-content: flex-start; }
}

/* Cockpit v2: shift status + two WO lists */
.cockpit-page .cockpit-kpis{display:none !important;}
.cockpit-toolbar{margin-bottom:12px;}
.cockpit-toolbar .searchbar{margin-bottom:0;}
.cockpit-toolbar label{margin-bottom:0;}
.cockpit-toolbar .fullish{flex:1 1 360px;}
.shift-status-card{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  padding:16px 18px;
  border-left:6px solid #94a3b8;
}
.shift-status-main{display:flex;align-items:center;gap:14px;min-width:0;}
.shift-status-icon{
  width:40px;height:40px;border-radius:14px;display:flex;align-items:center;justify-content:center;
  font-size:22px;font-weight:900;flex:0 0 auto;
}
.shift-status-card h2{margin:0 0 2px;font-size:20px;}
.shift-status-card .eyebrow{margin:0 0 4px;font-size:11px;text-transform:uppercase;letter-spacing:.08em;color:#64748b;font-weight:900;}
.shift-status-card .muted{margin:0;color:#64748b;}
.shift-duty-line{margin-top:8px;font-size:15px;color:#0f172a;}
.shift-ok{border-left-color:#16a34a;background:linear-gradient(90deg,#ecfdf3,#fff 42%);}
.shift-ok .shift-status-icon{background:#dcfce7;color:#166534;}
.shift-missing{border-left-color:#dc2626;background:linear-gradient(90deg,#fef2f2,#fff 42%);}
.shift-missing .shift-status-icon{background:#fee2e2;color:#b91c1c;}
.cockpit-bottom-lists{display:grid;grid-template-columns:1fr 1fr;gap:14px;align-items:start;}
.event-feed{display:flex;flex-direction:column;gap:6px;}
.event-item{
  display:grid;grid-template-columns:54px 1fr;gap:10px;align-items:center;
  min-height:44px;padding:8px 10px;border:1px solid rgba(15,23,42,.08);border-left-width:3px;
  border-radius:10px;background:#fff;color:inherit;text-decoration:none;box-shadow:0 1px 2px rgba(15,23,42,.035);
}
.event-item:hover{background:#fbfdff;border-color:rgba(37,99,235,.25);box-shadow:0 6px 16px rgba(15,23,42,.08);transform:translateY(-1px);}
.event-time{font-size:13px;font-weight:900;color:#64748b;text-align:center;}
.event-title-row{display:flex;align-items:center;gap:8px;min-width:0;}
.event-title-row strong{font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.shift-separator{
  display:grid;grid-template-columns:170px 1fr auto;gap:14px;align-items:center;
  margin:6px 0;padding:10px 12px;border-radius:12px;background:linear-gradient(90deg,#dcfce7,#f8fafc);
  border:1px solid #86efac;border-left:6px solid #16a34a;color:#14532d;text-decoration:none;
}
.shift-separator:hover{filter:brightness(.99);box-shadow:0 6px 16px rgba(22,163,74,.12);}
.shift-separator-label{text-transform:uppercase;letter-spacing:.08em;font-size:11px;font-weight:900;color:#166534;}
.shift-separator strong{font-size:15px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.shift-separator span:last-child{font-size:12px;color:#166534;font-weight:800;}
.status-ordered,.status-new{background:#eef4ff;color:#3538cd;}
.status-planned{background:#e0f2fe;color:#0369a1;}
.status-in-progress{background:#dcfce7;color:#166534;}
.status-paused{background:#ffedd5;color:#9a3412;}
.status-waiting{background:#fef3c7;color:#92400e;}
.status-closed{background:#f1f5f9;color:#475569;}
@media(max-width:950px){
  .cockpit-bottom-lists{grid-template-columns:1fr;}
  .shift-status-card{display:block;}
  .shift-status-card .btn{margin-top:12px;}
  .shift-separator{grid-template-columns:1fr;gap:4px;}
}


/* SimpleWay fixed left navigation - v2 */
body:not(.sw-faceplate-mode){padding-left:260px;}
.topbar{display:none !important;}
.sw-side-nav{
    position:fixed;
    inset:0 auto 0 0;
    width:260px;
    height:100vh;
    background:#ffffff;
    color:var(--text);
    padding:18px 16px;
    display:flex;
    flex-direction:column;
    gap:18px;
    border-right:1px solid #e4e7ec;
    box-shadow:6px 0 24px rgba(16,24,40,.06);
    z-index:1000;
    overflow-y:auto;
}
.sw-side-brand{
    display:flex;
    flex-direction:column;
    align-items:flex-start;
    gap:8px;
    color:var(--text);
    font-size:22px;
    font-weight:900;
    line-height:1;
    padding:4px 8px 16px;
    border-bottom:1px solid #eef2f7;
}
.sw-side-brand:hover{color:var(--text);}
.sw-side-logo{
    width:150px;
    max-width:100%;
    height:auto;
    object-fit:contain;
    display:block;
    border-radius:10px;
}
.sw-side-links{
    display:flex;
    flex-direction:column;
    gap:6px;
}
.sw-side-links a{
    display:block;
    color:#344054;
    font-weight:800;
    padding:11px 12px;
    border-radius:12px;
}
.sw-side-links a:hover{
    color:#174ea6;
    background:#eef4ff;
}
.container{
    max-width:1320px;
    margin:0 auto;
    padding:28px;
}
.sw-faceplate-mode{padding-left:0 !important;}
.sw-faceplate-mode .container{padding:0;max-width:none;}
@media(max-width:860px){
    body:not(.sw-faceplate-mode){padding-left:0;}
    .sw-side-nav{
        position:static;
        width:auto;
        height:auto;
        min-height:0;
        padding:12px 16px;
        border-right:0;
        border-bottom:1px solid #e4e7ec;
        box-shadow:0 6px 18px rgba(16,24,40,.05);
    }
    .sw-side-brand{flex-direction:row;align-items:center;border-bottom:0;padding:0;font-size:20px;}
    .sw-side-logo{width:64px;}
    .sw-side-links{flex-direction:row;flex-wrap:wrap;gap:8px;}
    .sw-side-links a{padding:8px 10px;background:#f8fafc;}
    .container{padding:18px;}
}
