:root {
    --service-blue: #1766b1;
    --service-text: #263445;
    --service-muted: #64748b;
    --service-border: #ccd4dd;
    --service-soft: #f1f5f9;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    background: #edf1f5;
    font-family: Arial, sans-serif;
    color: #263445;
    font-size: 13px;
}
.container {
    width: calc(100% - 24px);
    max-width: 1400px;
    margin: 8px auto;
}
.service-topbar {
    background: #173a5e;
    color: white;
    border-radius: 9px;
    padding: 17px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}
.service-topbar h1 { margin: 0; font-size: 21px; }
.service-topbar small { color: #d6e5f3; }
.panel {
    background: white;
    border-radius: 9px;
    padding: 15px;
    margin-top: 14px;
    box-shadow: 0 2px 8px #0000000b;
}
.panel h2 { font-size: 16px; margin: 0 0 12px; }
.job {
    border: 1px solid #dce3eb;
    border-left: 5px solid #a4afba;
    border-radius: 7px;
    padding: 12px;
    margin-bottom: 10px;
}
.job.new { border-left-color: #e59a24; }
.job.active { border-left-color: #269b65; }
.job.finished { border-left-color: #387fc0; }

.job.urgent { border-left-color: #d54848; }
.job.haster { border-left-color: #454b54; }

.jobtop {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}
.job h3 { margin: 0; font-size: 15px; }
.badge {
    background: #e9eef4;
    padding: 5px 9px;
    border-radius: 5px;
    font-size: 12px;
}
.meta { color: #64748b; margin: 7px 0; }
.description {
    margin: 8px 0;
    line-height: 1.5;
    overflow-wrap: anywhere;
}
.pagination {
    display: flex;
    justify-content: center;
    gap: 12px;
    align-items: center;
    padding: 12px;
}
a { color: #1766b1; }
.service-topbar a { color: white; }
@media(max-width:600px) {
    .jobtop { align-items: flex-start; }
    .service-topbar { flex-wrap: wrap; }
}

.status-overview {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    margin: 0 0 12px;
}

.status-box {
    background: #fff;
    border-radius: 6px;
    padding: 10px;
    text-align: center;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
}

.status-box span {
    display: block;
    font-size: 12px;
    margin-bottom: 5px;
}

.status-box strong {
    font-size: 23px;
}

@media (max-width: 600px) {
    .status-overview {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.status-box {
    display: block;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.status-box:hover {
    background: #f1f5f9;
}

.status-box.selected {
    background: #dbeafe;
    outline: 2px solid #2563eb;
}

.service-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.service-heading h2 {
    margin: 0;
}

.all-jobs {
    display: inline-block;
    padding: 7px 12px;
    background: #e2e8f0;
    border-radius: 5px;
    color: #1e293b;
    text-decoration: none;
    font-size: 12px;
}

.all-jobs.selected {
    background: #2563eb;
    color: white;
}

.job-actions {
    margin-top: 10px;
    text-align: right;
}

.edit-button {
    display: inline-block;
    padding: 7px 14px;
    background: #2563eb;
    color: white;
    border-radius: 5px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
}

.edit-button:hover {
    background: #1d4ed8;
}

/* ADM TECH venstremenu */
.sidebar {
    background: #172634;
    color: white;
    width: 220px;
    padding: 18px;
    border-radius: 9px;
}

.sidebar h3 {
    color: #9fb5c8;
    font-size: 12px;
    margin: 0 0 15px;
}

.sidebar a {
    display: block;
    color: #ffffff;
    text-decoration: none;
    padding: 11px 12px;
    border-radius: 5px;
    margin-bottom: 5px;
}

.sidebar a:hover,
.sidebar a.active {
    background: #304e69;
}

/* Layout med venstremenu */
.page-layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 15px;
    align-items: start;
    margin-top: 10px;
}

.main-content {
    min-width: 0;
}

@media (max-width: 750px) {
    .page-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        width: 100%;
    }
}

/* Kompakt serviceoversigt */
.panel {
    padding: 10px 12px;
    margin-top: 8px;
}

.job {
    padding: 7px 10px;
    margin-bottom: 6px;
}

.job h3 {
    font-size: 14px;
}

.meta {
    margin: 4px 0;
}

.description {
    margin: 4px 0;
    line-height: 1.3;
}

.job-actions {
    margin-top: 5px;
}

.edit-button {
    padding: 5px 10px;
}

/* Serviceopgaver - tre linjer */
.job-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-bottom: 6px;
}

.job-line:last-child {
    margin-bottom: 0;
}

.job-line > div:first-child {
    min-width: 0;
}

.job-line .description,
.job-line .meta {
    margin: 0;
}

.job-line .badge,
.job-line .job-type,
.job-line .edit-button {
    flex-shrink: 0;
    margin-left: auto;
}

.job-type {
    font-size: 12px;
    color: #64748b;
    text-align: right;
}

.job-line .edit-button {
    display: inline-block;
    padding: 4px 10px;
    font-size: 12px;
    line-height: 1.3;
}

/* Tydeligere opgavenummer, butik og adresse på første linje. */
.job-heading > div:first-child {
    font-size: 15px;
    line-height: 1.4;
}

/* Mobilvisning */
@media (max-width: 750px) {
    .job-line {
        flex-wrap: wrap;
    }
}


/* Faelles grundlayout for service og lager */
html {
    font-family: Arial, sans-serif;
    background: #edf1f5;
    color: #263445;
}
body {
    padding: 0;
    font: 13px/normal Arial, sans-serif;
}
.service-topbar h1 {
    font-weight: 700;
}
.service-topbar {
    flex-wrap: wrap;
}
.sidebar form {
    display: block;
    margin: 12px 0 0;
    padding: 0;
}
.sidebar button {
    display: block;
    width: 100%;
    margin: 0;
    padding: 12px;
    text-align: left;
    font: inherit;
    background: #24364b;
    color: white;
    border: 0;
    border-radius: 6px;
    cursor: pointer;
}
.sidebar button:hover {
    background: #304e69;
}
.sidebar a:focus-visible,
.sidebar button:focus-visible {
    outline: 2px solid white;
    outline-offset: 2px;
}

/* Butikker og brugere: fælles paneler, tabeller og formularer */
.service-panel {
    background: white;
    border-radius: 9px;
    padding: 18px;
    box-shadow: 0 2px 8px #0000000b;
    min-width: 0;
}
.service-panel h1 {
    margin: 0 0 16px;
    font-size: 21px;
}
.service-panel h2 {
    font-size: 17px;
    margin-top: 24px;
}
.service-panel .scroll,
.service-panel .table-wrap {
    max-width: 100%;
    overflow-x: auto;
}
.service-panel table {
    width: 100%;
    border-collapse: collapse;
}
.service-panel th,
.service-panel td {
    padding: 12px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid #dde3ea;
}
.service-panel th {
    background: #f1f5f9;
}
.service-panel label {
    display: block;
    margin-top: 16px;
    margin-bottom: 5px;
}
.service-panel input:not([type="hidden"]),
.service-panel select {
    width: 100%;
    min-width: 0;
    padding: 10px;
    font: inherit;
    border: 1px solid #ccd4dd;
    border-radius: 5px;
    background: white;
    color: #263445;
}
.service-panel button,
.service-panel .service-button {
    display: inline-block;
    margin-top: 18px;
    padding: 10px 18px;
    font: inherit;
    background: #1766b1;
    color: white;
    border: 0;
    border-radius: 5px;
    text-decoration: none;
    cursor: pointer;
}
.service-panel input:focus-visible,
.service-panel select:focus-visible,
.service-panel button:focus-visible {
    outline: 2px solid #1766b1;
    outline-offset: 2px;
}
.service-panel form[method="post"] {
    max-width: 700px;
}
.service-panel form[method="get"] {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: end;
}
.service-panel form[method="get"] > div {
    flex: 1 1 220px;
}
.service-panel form[method="get"] label {
    margin-top: 0;
}
.service-panel nav {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
    margin-top: 20px;
}
.service-panel dl {
    display: grid;
    grid-template-columns: minmax(100px,150px) minmax(0,1fr);
    gap: 10px;
}
.service-panel dt {
    font-weight: bold;
}
.service-panel dd {
    margin: 0;
    overflow-wrap: anywhere;
}
.service-panel .error {
    color: #b42318;
}
.service-panel .success {
    color: #16703c;
}

/* Smallere hovedmenu */
.page-layout {
    grid-template-columns: 180px minmax(0, 1fr);
}
.sidebar {
    width: 180px;
    padding: 14px 10px;
}
.sidebar a {
    padding: 9px 10px;
}
@media (max-width: 750px) {
    .page-layout {
        grid-template-columns: 1fr;
    }
    .sidebar {
        width: 100%;
    }
}

/* Kompakt brugerredigering */
.service-panel .compact-user-form {
    max-width: 850px;
}
.compact-user-form .user-fields-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 14px;
}
.service-panel .compact-user-form label {
    margin: 8px 0 3px;
    font-size: 13px;
}
.service-panel .compact-user-form input:not([type="hidden"]),
.service-panel .compact-user-form select {
    padding: 7px 9px;
}
.service-panel .compact-user-form p {
    margin: 7px 0;
    font-size: 12px;
    line-height: 1.35;
}
.service-panel .compact-user-form button {
    margin-top: 12px;
    padding: 9px 16px;
}
@media (max-width: 600px) {
    .compact-user-form .user-fields-grid {
        grid-template-columns: 1fr;
        gap: 3px;
    }
    .service-panel .compact-user-form input:not([type="hidden"]),
    .service-panel .compact-user-form select {
        font-size: 16px;
    }
}

/* Interne brugernoter */
.service-panel textarea#admin_note {
    display: block;
    box-sizing: border-box;
    width: 100%;
    min-height: 95px;
    padding: 8px 10px;
    font: 14px/1.4 Arial, sans-serif;
    color: var(--service-text, #263445);
    background: white;
    border: 1px solid var(--service-border, #ccd4dd);
    border-radius: 5px;
    resize: vertical;
}
.service-panel textarea#admin_note:focus-visible {
    outline: 2px solid var(--service-blue, #1766b1);
    outline-offset: 2px;
}
@media (max-width:600px) {
    .service-panel textarea#admin_note { font-size: 16px; }
}

/* Menuhoejde og lagerliste med sider */
.page-layout {
    align-items: stretch;
}
.page-layout > .sidebar {
    align-self: stretch;
}
.lager-module .inventory-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 16px;
    padding: 8px 0;
}
.lager-module .inventory-pagination a,
.lager-module .inventory-pagination .pagination-disabled {
    display: inline-block;
    padding: 10px 14px;
    border-radius: 5px;
    text-decoration: none;
    min-height: 40px;
}
.lager-module .inventory-pagination a {
    background: #e2e8f0;
    color: #173a5e;
}
.lager-module .inventory-pagination a:hover {
    background: #cbd5e1;
}
.lager-module .inventory-pagination a:focus-visible {
    outline: 2px solid #1766b1;
    outline-offset: 2px;
}
.lager-module .inventory-pagination .pagination-disabled {
    color: #64748b;
    background: #f1f5f9;
}
@media (max-width:750px) {
    .page-layout > .sidebar {
        align-self: start;
    }
}

/* Kompakt lagerliste uden links paa varenummer og varenavn */
.lager-module .inventory-table thead th,
.lager-module .inventory-table tbody td {
    padding: 6px 8px;
    font-size: 13px;
    line-height: 1.3;
    vertical-align: middle;
}
.lager-module .inventory-table .row-action,
.lager-module .inventory-table .label-print-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 5px 9px;
    font-size: 12px;
    line-height: 1.2;
    margin-left: 5px;
}
.lager-module .inventory-table .row-action:first-child {
    margin-left: 0;
}
.lager-module .inventory-table .legacy-location {
    margin-top: 2px;
    font-size: 11px;
    line-height: 1.2;
}
@media (pointer:coarse) {
    .lager-module .inventory-table .row-action,
    .lager-module .inventory-table .label-print-link {
        min-height: 44px;
    }
}

/* Lageroversigt: bredere varenummer og navn uden gruppekolonne */
.lager-module .inventory-table thead th:nth-child(1),
.lager-module .inventory-table tbody td:nth-child(1) {
    width: 14% !important;
    min-width: 100px;
    white-space: nowrap;
}
.lager-module .inventory-table thead th:nth-child(2),
.lager-module .inventory-table tbody td:nth-child(2) {
    width: 36% !important;
    min-width: 220px;
    overflow-wrap: anywhere;
}
.lager-module .inventory-table thead th:nth-child(5),
.lager-module .inventory-table tbody td:nth-child(5) {
    font-size: 11px;
    text-align: right;
    white-space: nowrap;
}
