*{box-sizing:border-box}body{margin:0;font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;background:#f4f6f8;color:#1d2733}.topbar{display:flex;justify-content:space-between;align-items:center;padding:14px 20px;background:#0f2942;color:#fff;gap:16px;flex-wrap:wrap}.topbar a{color:#fff;text-decoration:none;margin-left:12px}.brand a{font-weight:700;font-size:18px}.container{max-width:1180px;margin:24px auto;padding:0 16px}.card{background:#fff;border-radius:14px;padding:20px;margin-bottom:18px;box-shadow:0 1px 7px rgba(0,0,0,.08)}.narrow{max-width:480px;margin:50px auto}.page-title{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}.grid-form{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}label{display:flex;flex-direction:column;font-weight:600;gap:6px}input,select,textarea{width:100%;padding:10px;border:1px solid #ccd4dc;border-radius:9px;font:inherit;background:#fff}textarea{min-height:80px}.primary,.button,button{display:inline-flex;align-items:center;justify-content:center;border:0;border-radius:10px;padding:10px 14px;text-decoration:none;cursor:pointer;font-weight:700}.primary{background:#1167b1;color:#fff}.button{background:#e8eef5;color:#102a43}.secondary{background:#eef2f6;color:#102a43}.error{background:#ffe6e8;color:#8a1020;padding:12px;border-radius:10px;margin-bottom:12px}.flash{background:#e8f7ed;color:#145c2e;padding:12px;border-radius:10px;margin-bottom:16px}.table-wrap{overflow:auto}table{width:100%;border-collapse:collapse}th,td{padding:10px;border-bottom:1px solid #e5e9ef;text-align:left;vertical-align:top}th{background:#f5f7fa}.actions a{margin-right:8px}.pill{display:inline-block;padding:4px 9px;border-radius:999px;background:#e8eef5;font-size:12px;font-weight:700}.check-row{display:grid;grid-template-columns:1fr 150px 1fr;gap:10px;align-items:center;padding:10px 0;border-bottom:1px solid #edf0f3}.repeat-row{display:grid;grid-template-columns:repeat(6,minmax(120px,1fr));gap:10px;align-items:start;border:1px solid #e5e9ef;background:#fafbfc;padding:12px;border-radius:12px;margin-bottom:10px}.inline{flex-direction:row;align-items:center;font-weight:500}.inline input{width:auto}.form-actions{grid-column:1/-1}.sticky-actions{position:sticky;bottom:0;background:#fff;border:1px solid #d8e0e8;border-radius:12px;padding:12px;margin:20px 0;display:flex;gap:10px;box-shadow:0 -2px 10px rgba(0,0,0,.08)}.details{display:grid;grid-template-columns:180px 1fr;gap:8px}.details dt{font-weight:700}.status-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.print h1{margin-top:0}@media(max-width:800px){.grid-form{grid-template-columns:1fr}.check-row{grid-template-columns:1fr}.repeat-row{grid-template-columns:1fr}.status-grid{grid-template-columns:1fr 1fr}.topbar nav{display:flex;flex-wrap:wrap;gap:8px}.topbar a{margin-left:0}.details{grid-template-columns:1fr}.page-title{align-items:flex-start}}@media print{body{background:#fff}.card{box-shadow:none;border-radius:0}.button,button,.topbar{display:none!important}.container{margin:0;padding:0}th{background:#eee!important}}
/* =========================================================
   Individdokument - layoutpatch för redigeringssidan
   Lägg längst ner i public/assets/css/app.css
   ========================================================= */

/* Grundlayout */
.document-edit-page {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.document-edit-hero {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    padding: 18px;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    background: linear-gradient(135deg, #f8fafc, #eef2ff);
    margin-bottom: 18px;
}

.document-edit-hero h1 {
    margin: 0 0 6px 0;
    font-size: 24px;
    line-height: 1.2;
}

.document-edit-hero p {
    margin: 0;
    color: #475569;
}

.document-edit-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

/* Kort/sektioner */
.document-edit-page .card,
.document-section {
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
    padding: 18px;
    margin-bottom: 16px;
}

.document-section h2,
.document-edit-page .card h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 0;
    margin-bottom: 14px;
    font-size: 20px;
}

.document-section h2 small,
.document-edit-page .card h2 small {
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
}

.section-main { border-left: 6px solid #2563eb; }
.section-production { border-left: 6px solid #0f766e; }
.section-overview { border-left: 6px solid #7c3aed; }
.section-inspection { border-left: 6px solid #16a34a; }
.section-restpoints { border-left: 6px solid #f97316; }
.section-mounting { border-left: 6px solid #0891b2; }
.section-commissioning { border-left: 6px solid #4f46e5; }
.section-function { border-left: 6px solid #9333ea; }
.section-final { border-left: 6px solid #334155; }

/* Formulärgrid */
.form-grid-2,
.grid-form-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.form-grid-3,
.grid-form-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.form-grid-4,
.grid-form-4 {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.full-width {
    grid-column: 1 / -1;
}

.document-edit-page label,
.document-section label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-weight: 700;
    color: #334155;
}

.document-edit-page input,
.document-edit-page select,
.document-edit-page textarea,
.document-section input,
.document-section select,
.document-section textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 10px 11px;
    font: inherit;
    background: #ffffff;
}

.document-edit-page textarea,
.document-section textarea {
    min-height: 96px;
    resize: vertical;
}

.document-edit-page input:focus,
.document-edit-page select:focus,
.document-edit-page textarea:focus,
.document-section input:focus,
.document-section select:focus,
.document-section textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Tabeller */
.document-edit-page .table-wrap,
.document-section .table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
}

.document-edit-page table,
.document-section table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

.document-edit-page th,
.document-edit-page td,
.document-section th,
.document-section td {
    padding: 10px;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: top;
}

.document-edit-page th,
.document-section th {
    background: #f8fafc;
    text-align: left;
    font-size: 13px;
    color: #475569;
}

.document-edit-page tr:last-child td,
.document-section tr:last-child td {
    border-bottom: 0;
}

/* Status */
.pill,
.status-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 4px 9px;
    background: #f1f5f9;
    color: #334155;
    font-size: 12px;
    font-weight: 700;
}

.status-ok,
.pill-ok {
    background: #dcfce7;
    color: #166534;
}

.status-nok,
.pill-nok {
    background: #fee2e2;
    color: #991b1b;
}

.status-na,
.pill-na {
    background: #e2e8f0;
    color: #475569;
}

/* Sticky spara */
.sticky-actions {
    position: sticky;
    bottom: 0;
    z-index: 50;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
    align-items: center;
    padding: 12px;
    margin-top: 20px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid #e5e7eb;
    border-radius: 14px 14px 0 0;
    box-shadow: 0 -8px 20px rgba(15, 23, 42, 0.08);
}

.sticky-actions .save-hint {
    margin-right: auto;
    color: #64748b;
    font-size: 13px;
}

/* Knappfallback om dina befintliga knappar saknar styling */
.button,
button,
.primary,
.secondary {
    cursor: pointer;
}

.button,
a.button,
button.secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 9px 12px;
    background: #f8fafc;
    color: #0f172a;
    text-decoration: none;
    font-weight: 700;
}

button.primary,
.button.primary,
a.button.primary {
    border-color: #1d4ed8;
    background: #2563eb;
    color: #ffffff;
}

button.primary:hover,
.button.primary:hover,
a.button.primary:hover {
    background: #1d4ed8;
}

.button:hover,
a.button:hover,
button.secondary:hover {
    background: #e2e8f0;
}

/* Responsivt */
@media (max-width: 1000px) {
    .form-grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .form-grid-3,
    .grid-form-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .document-edit-hero {
        padding: 14px;
    }

    .document-edit-hero-actions {
        width: 100%;
        justify-content: stretch;
    }

    .document-edit-hero-actions .button,
    .document-edit-hero-actions button {
        flex: 1 1 auto;
    }

    .form-grid-2,
    .form-grid-3,
    .form-grid-4,
    .grid-form-2,
    .grid-form-3,
    .grid-form-4 {
        grid-template-columns: 1fr;
    }

    .document-edit-page .card,
    .document-section {
        padding: 14px;
        border-radius: 14px;
    }

    .sticky-actions {
        justify-content: stretch;
    }

    .sticky-actions .button,
    .sticky-actions button {
        flex: 1 1 auto;
    }

    .sticky-actions .save-hint {
        width: 100%;
        margin-right: 0;
    }
}