@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@700&display=swap');

/* Universal box-sizing for easier layout */
*, *::before, *::after {
    box-sizing: border-box;
}

/* style.css */
body {
    font-family: 'Inter', sans-serif;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    color: #444; /* Justert for litt mykere tekstfarge */
    display: flex;
    justify-content: center; /* Midtstiller innholdet horisontalt */
    align-items: flex-start; /* Juster for å unngå sentrering vertikalt for lengre innhold */
    min-height: 100vh;
    box-sizing: border-box;
    font-size: 0.8rem; /* Økt base font size til ~12.8px for bedre lesbarhet */
}

.container {
    width: 1300px; /* Økt bredde fra 1100px til 1300px */
    margin: 20px auto;
    background-color: #ffffff;
    padding: 40px; /* Mer padding for luftighet */
    border-radius: 16px; /* Mer avrundede hjørner for moderne preg */
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.12); /* Dypere og mykere skygge */
    box-sizing: border-box;
    display: block;
}

.container.minimized {
    height: 120px !important;
    min-height: 0 !important;
    max-height: 120px !important;
    overflow: hidden !important;
    transition: max-height 0.3s, height 0.3s;
    box-shadow: 0 4px 16px rgba(0,160,176,0.08);
    cursor: pointer;
    padding-bottom: 0 !important;
}
.container.minimized .procalc-header-row {
    border-bottom: none;
}
.container.minimized .header-button-group {
    display: flex !important;
}
.container.minimized > *:not(.procalc-header-row) {
    display: none !important;
}

h1, h2, h3 {
    color: black; /* Changed to black as requested */
    margin-top: 0;
    margin-bottom: 25px; /* Litt mer avstand */
    border-bottom: 2px solid #e0e6ec; /* Subtil bunnlinje */
    padding-bottom: 12px;
    font-family: inherit;
}

h1 {
    font-size: 2rem;
    color: #1a2233;
    font-weight: 700;
    letter-spacing: 0;
    margin-bottom: 18px;
    margin-top: 0;
    border: none;
    padding-bottom: 0;
    text-align: left;
    line-height: 1.08;
    text-shadow: 0 2px 8px rgba(0,0,0,0.04);
    font-family: inherit;
}

h2 {
    font-size: 1.5rem;
    color: #1a2233;
    font-weight: 700;
    margin-bottom: 16px;
    margin-top: 0;
    border: none;
    padding-bottom: 0;
    letter-spacing: -0.01em;
    line-height: 1.15;
}

h3 {
    font-size: 1.1rem;
    color: #2a3a4d;
    font-weight: 600;
    margin-bottom: 12px;
    margin-top: 0;
    border: none;
    padding-bottom: 0;
    letter-spacing: 0.01em;
    line-height: 1.18;
}

.section {
    margin-bottom: 50px; /* Mer avstand mellom seksjonene */
    padding: 25px; /* Mer padding */
    background-color: #fdfefe; /* Veldig lys bakgrunn */
    border-radius: 12px; /* Mer avrundet */
    border: 1px solid #e0e6ec;
    /* REMOVED box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06); */
}

.input-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 24px;
    margin-bottom: 32px;
    gap: 20px;
}

.input-group label {
    flex: 0 0 180px; /* Litt bredere labels */
    font-weight: 600;
    color: #555;
    font-size: 0.8rem; /* ~12.8px, justert */
}

.input-group select,
.input-group input[type="number"],
.input-group input[type="text"],
.input-group input[type="date"], /* Added for date inputs */
.input-group textarea { /* Added for textareas */
    flex: 1;
    min-width: 200px; /* Økt minimum bredde */
    padding: 12px 15px; /* More padding */
    border: 1px solid #c0c9d2;
    border-radius: 8px;
    font-size: 0.8rem; /* ~12.8px, adjusted */
    color: #333;
    transition: border-color 0.3s, box-shadow 0.3s;
}
.input-group textarea {
    min-height: 80px; /* Default height for textareas */
    resize: vertical; /* Allow vertical resizing only */
}

.input-group select:focus,
.input-group input[type="number"]:focus,
.input-group input[type="text"]:focus,
.input-group input[type="date"]:focus, /* Added for date inputs */
.input-group textarea:focus { /* Added for textareas */
    border-color: #00a0b0; /* Turquoise focus border */
    box-shadow: 0 0 0 4px rgba(0, 160, 176, 0.25); /* Softer turquoise focus shadow */
    outline: none;
}

.rounded-button {
    padding: 10px 20px; /* Reduced padding */
    background: linear-gradient(135deg, #00a0b0 0%, #007a86 100%); /* Turquoise gradient */
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.8rem; /* Reduced font size */
    font-weight: 600;
    transition: background 0.3s ease, transform 0.15s ease, box-shadow 0.3s ease;
    box-shadow: 0 8px 20px rgba(0, 160, 176, 0.35); /* Deeper turquoise shadow */
    letter-spacing: 0.02em; /* Slightly more letter spacing for readability */
    margin-bottom: 0.15em;
}

.rounded-button:hover {
    background: linear-gradient(135deg, #007a86 0%, #005a63 100%); /* Darker turquoise on hover */
    transform: translateY(-3px); /* More pronounced hover effect */
    box-shadow: 0 10px 25px rgba(0, 160, 176, 0.45);
}

.rounded-button:active {
    transform: translateY(0);
    box-shadow: 0 4px 10px rgba(0, 160, 176, 0.3);
}
.rounded-button.secondary {
    background: linear-gradient(135deg, #6c757d 0%, #545b62 100%); /* Grey gradient */
    box-shadow: 0 8px 20px rgba(108, 117, 125, 0.35);
}
.rounded-button.secondary:hover {
    background: linear-gradient(135deg, #545b62 0%, #343a40 100%);
    box-shadow: 0 10px 25px rgba(108, 117, 125, 0.45);
}
.rounded-button.danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%); /* Red gradient */
    box-shadow: 0 8px 20px rgba(220, 53, 69, 0.35);
}
.rounded-button.danger:hover {
    background: linear-gradient(135deg, #c82333 0%, #a71d2a 100%);
    box-shadow: 0 10px 25px rgba(220, 53, 69, 0.45);
}

.rounded-button.edit {
    background: #2ecc40;
    color: #fff;
    border: none;
    box-shadow: 0 2px 8px rgba(46,204,64,0.08);
}
.rounded-button.edit:hover, .rounded-button.edit:focus {
    background: #27ae38;
    color: #fff;
}

.message-area {
    color: #dc3545;
    margin-top: -15px;
    margin-bottom: 20px;
    font-weight: 600;
    text-align: center;
    min-height: 25px;
    font-size: 0.8rem; /* Adjusted */
}

.table-container {
    margin-top: 25px;
    overflow: visible;
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    padding-left: 0;
    padding-right: 0;
}

/* New wrapper for horizontal overflow specifically for tables */
.inner-table-scroll {
    overflow-x: auto; /* Handles horizontal scrolling */
    /* No overflow-y: allows the table to expand naturally */
}

table {
    width: 100%;
    box-sizing: border-box;
    border-radius: 10px;
    overflow: hidden;
    border-collapse: separate;
    border-spacing: 0;
    background-color: #fff;
}

table th, table td {
    border: 1px solid #e0e6ec;
    padding: 10px 15px; /* Lower padding for table rows */
    text-align: left;
    font-size: 0.8rem; /* Adjusted */
    line-height: 1.4; /* Improved readability */
    border-radius: 0 !important;
}
table td input[type="text"],
table td input[type="number"],
table td select,
table td textarea { /* Added select and textarea for consistency in table cells */
    width: calc(100% - 20px);
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-sizing: border-box;
    font-size: 0.8rem; /* Adjusted */
}
table td textarea {
    min-height: 50px; /* Smaller textarea for table cells */
    resize: vertical;
}


table th {
    background-color: #eef2f5;
    font-weight: 700;
    color: #2c3e50;
    white-space: nowrap;
    font-size: 0.85rem; /* Adjusted */
    border-bottom: 3px solid #00a0b0; /* Turquoise line under table headers */
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
}

table tbody tr:nth-child(even) {
    background-color: #f9fbfd;
}

table tbody tr:hover {
    background-color: #e3f2f5; /* Light turquoise background on hover */
}

table button {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 6px 12px; /* Smaller for table buttons */
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.7rem; /* Smaller for table buttons */
    transition: background-color 0.2s;
    white-space: nowrap;
}

table button:hover {
    background-color: #c82333;
}
table button.add-item-to-base-btn {
    background-color: #28a745;
    margin-left: 15px; /* This will be overridden for the specific button in the sidebar */
}
table button.add-item-to-base-btn:hover {
    background-color: #218838;
}

.summary-text {
    font-size: 0.9rem; /* Adjusted */
    margin-top: 25px;
    margin-bottom: 15px;
    color: #333;
    font-weight: 500;
}

.summary-text strong {
    color: #004d99; /* Deeper blue for totals */
    font-weight: 700;
}

hr {
    border: 0;
    height: 1px;
    background: #d4dbe3;
    margin: 50px 0;
}

/* Fixed sidebar toggle button */
.fixed-sidebar-toggle-btn {
    background: linear-gradient(135deg, #00a0b0 0%, #007a86 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 24px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0, 160, 176, 0.25);
    transition: background 0.2s, box-shadow 0.2s, transform 0.1s;
    outline: none;
    margin-left: 0;
    margin-right: 0;
    margin-top: 0;
    margin-bottom: 0;
    display: inline-block;
}

.fixed-sidebar-toggle-btn:hover {
    background: linear-gradient(135deg, #007a86 0%, #005a63 100%);
    box-shadow: 0 10px 25px rgba(0, 160, 176, 0.35);
    transform: translateY(-2px);
}

/* Cost Base Sidebar */
.cost-base-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: -100%; /* Initially hidden, move off screen based on its own width */
    width: 100%; /* Take full width of parent (viewport) */
    max-width: 1800px; /* Constrain to main container's max-width for larger screens */
    background-color: #ffffff;
    padding: 40px; /* Increased padding inside sidebar to give more breathing room */
    box-shadow: 2px 0 15px rgba(0,0,0,0.2);
    transition: left 0.3s ease-in-out;
    z-index: 999;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    box-sizing: border-box; /* Include padding in the width calculation */
}

.cost-base-sidebar.open {
    left: 0;
}

.close-sidebar-button {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 2rem;
    color: #888;
    cursor: pointer;
    line-height: 1;
    z-index: 1000; /* Ensure it's clickable */
}
.close-sidebar-button:hover {
    color: #333;
}

.sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.4);
    z-index: 998;
    display: none; /* Initially hidden */
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.sidebar-backdrop.active {
    display: block; /* Make it block to enable transition */
    opacity: 1;
}

/* Specific styles for the new "Add New Item" section within the sidebar */
.add-new-item-section {
    max-width: 700px; /* Make it narrower */
    margin: 20px auto 50px auto; /* Center it, and add bottom margin for spacing with next section */
    padding: 25px; /* Standard section padding */
    background-color: #fdfefe; /* Standard section background */
    border-radius: 12px; /* Standard section border-radius */
    border: 1px solid #e0e6ec;
    /* REMOVED box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06); */
    flex-shrink: 0; /* Prevent this section from shrinking */
}

.add-new-item-section h3 {
    margin-top: 0; /* Remove top margin for consistency inside the new section */
    border-bottom: 2px solid #e0e6ec; /* Keep the subtle border */
    padding-bottom: 12px;
    margin-bottom: 25px; /* Adjust spacing below the heading */
}

/* Styling for the new form fields within the add-new-item-section */
.add-new-item-section .form-fields {
    display: flex;
    flex-direction: column; /* Stack items vertically */
    gap: 15px; /* Spacing between each label-input pair */
}

.add-new-item-section .input-pair {
    display: flex;
    flex-direction: column; /* Stack label and input within the pair */
    align-items: flex-start; /* Align label and input to the left */
    width: 100%; /* Ensure the pair takes full width */
}

.add-new-item-section .input-pair label {
    margin-bottom: 5px; /* Space between label and input */
    font-size: 0.9rem; /* Make labels slightly larger within this section */
    font-weight: 600;
    color: #555;
    /* Override the global .input-group label flex properties */
    flex: unset;
    width: auto;
}

.add-new-item-section .input-pair select,
.add-new-item-section .input-pair input[type="text"],
.add-new-item-section .input-pair input[type="number"],
.add-new-item-section .input-pair textarea {
    width: 100%; /* Inputs fill the full width of their parent .input-pair */
    padding: 10px 12px; /* Slightly adjusted padding for these inputs */
    font-size: 0.9rem; /* Make inputs slightly larger within this section */
    /* Ensure box-sizing: border-box is applied (now universally applied) */
    min-width: 0; /* Override any inherited min-width that could cause overflow */
}

/* Adjust the button specifically within the add-new-item-section */
.add-new-item-section .add-item-to-base-btn {
    margin-left: 0; /* Remove previous left margin */
    margin-top: 30px; /* Add more space above the button */
    width: auto; /* Allow button to size itself based on content */
    padding: 9px 18px; /* Adjusted to match new general size */
    font-size: 0.78rem; /* Adjusted */
    background: linear-gradient(135deg, #00a0b0 0%, #007a86 100%); /* Turquoise gradient */
    box-shadow: 0 4px 10px rgba(0, 160, 176, 0.3);
}
.add-new-item-section .add-item-to-base-btn:hover {
    background: linear-gradient(135deg, #007a86 0%, #005a63 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 160, 176, 0.4);
}


/* Adjust margin for tables and h3 within the sidebar so they are consistently spaced */
.cost-base-sidebar h3 { /* Applies to "Materialer:" and "Arbeidstid:" sections within sidebar */
    margin-top: 35px; /* Standard top margin for h3 */
    margin-bottom: 20px; /* Standard bottom margin for h3 */
    border-bottom: 2px solid #e0e6ec; /* Standard border */
    padding-bottom: 12px; /* Standard padding */
    text-align: left; /* Ensure headings are left-aligned */
    flex-shrink: 0; /* Prevent heading from shrinking */
}

.cost-base-sidebar .table-container {
    margin-bottom: 50px; /* Add bottom margin for spacing between tables and sections */
    /* Tables now take full width of the sidebar's content area */
    width: 100%; /* Ensure it takes full width of its parent */
    margin-left: auto; /* Keep auto margins for centering if parent is smaller */
    margin-right: auto;
    flex-grow: 1; /* Retain flex-grow for vertical distribution */
    display: flex; /* Make it a flex container to allow inner-table-scroll to take height */
    flex-direction: column; /* Stack children vertically */
}
/* Ensure inner-table-scroll also expands vertically within table-container */
.cost-base-sidebar .table-container .inner-table-scroll {
    flex-grow: 1;
    display: flex; /* Make it a flex container to contain the table */
    flex-direction: column; /* Stack table vertically if needed, but primarily for expansion */
}
/* Ensure table also expands within inner-table-scroll */
.cost-base-sidebar .table-container .inner-table-scroll table {
    flex-grow: 1;
}


.cost-base-sidebar .table-container:last-of-type {
    margin-bottom: 0;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.35);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
}

.modal-content {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.18);
    padding: 2.2em 2.2em 1.7em 2.2em;
    position: relative;
    width: 100%;
    max-width: 520px;
    min-width: 320px;
    animation: fadeInModal 0.2s;
    display: flex;
    flex-direction: column;
    gap: 1.2em;
    max-height: 90vh;
    overflow-y: auto;
}

@media (max-width: 600px) {
    .modal-content {
        padding: 1em 0.2em 1em 0.2em;
        min-width: 0;
        max-width: 98vw;
        max-height: 98vh;
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.2em;
    border-bottom: 2px solid #e0e6ec;
    padding-bottom: 0.5em;
}

.close-button {
    font-size: 1.7em;
    background: none;
    border: none;
    color: #333;
    cursor: pointer;
    padding: 0 0.2em;
    line-height: 1;
    border-radius: 4px;
    transition: background 0.2s;
}
.close-button:hover {
    background: #f2f2f2;
}

.modal-input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 0.8em;
}
.modal-input-group label {
    font-weight: 600;
    color: #555;
    font-size: 0.93rem;
    margin-bottom: 2px;
}
.modal-input-group input,
.modal-input-group select,
.modal-input-group textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 13px;
    border: 1px solid #c0c9d2;
    border-radius: 8px;
    font-size: 0.93rem;
    color: #333;
    background: #f9fbfd;
    transition: border-color 0.3s, box-shadow 0.3s;
}
.modal-input-group input:focus,
.modal-input-group select:focus,
.modal-input-group textarea:focus {
    border-color: #00a0b0;
    box-shadow: 0 0 0 3px rgba(0, 160, 176, 0.18);
    outline: none;
}

.modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 0.5em;
    margin-bottom: 0;
    padding-bottom: 0;
}
.modal-buttons .add-button {
    /* Bruk hovedknappstil */
    @extend .rounded-button;
}
.modal-buttons .cancel-button {
    /* Sekundær knapp */
    @extend .rounded-button;
    background: linear-gradient(135deg, #6c757d 0%, #545b62 100%) !important;
    color: #fff !important;
}

/* For å sikre at alle knapper i modalene matcher */
.modal-buttons button,
.modal-buttons .add-button,
.modal-buttons .cancel-button {
    border-radius: 8px;
    font-size: 0.93rem;
    font-weight: 600;
    padding: 9px 20px;
    min-width: 90px;
    border: none;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s;
}

.modal-buttons .add-button:hover {
    background: linear-gradient(135deg, #007a86 0%, #005a63 100%) !important;
}
.modal-buttons .cancel-button:hover {
    background: linear-gradient(135deg, #545b62 0%, #343a40 100%) !important;
}

.projects-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 1.05em;
    background: #fafdff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.projects-table th, .projects-table td {
    padding: 0.7em 0.6em;
    text-align: left;
    border-bottom: 1px solid #e3e8ee;
}
.projects-table th {
    background: #eaf3fa;
    font-weight: 600;
    font-size: 1.08em;
}
.projects-table tr:last-child td {
    border-bottom: none;
}
.projects-table button.load-project-btn {
    background: #eaf3fa;
    color: #1a355b;
    border: none;
    border-radius: 4px;
    padding: 0.3em 0.9em;
    margin-right: 0.5em;
    cursor: pointer;
    font-size: 1em;
    transition: background 0.2s;
}
.projects-table button.load-project-btn:hover {
    background: #d2e6f7;
}
.projects-table button.delete-project-btn {
    background: #fff0f0;
    color: #b00;
    border: none;
    border-radius: 4px;
    padding: 0.3em 0.7em;
    cursor: pointer;
    font-size: 1.1em;
    transition: background 0.2s;
}
.projects-table button.delete-project-btn:hover {
    background: #ffdede;
}
@media (max-width: 700px) {
    .projects-table th, .projects-table td {
        padding: 0.5em 0.2em;
        font-size: 0.98em;
    }
    .projects-table {
        font-size: 0.97em;
    }
}
@media (max-width: 500px) {
    .projects-table th, .projects-table td {
        padding: 0.3em 0.1em;
        font-size: 0.93em;
    }
}

/* Styling for sub-items in the calculation table */
tr.sub-item td {
    background-color: inherit;
    font-style: normal;
    color: inherit;
}

tr.sub-item td:first-child {
    position: relative;
    padding-left: 24px !important;
}

tr.sub-item td:first-child::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 7px;
    bottom: 7px;
    width: 2px;
    background: #bdbdbd;
    border-radius: 1px;
    z-index: 1;
}

tr.overstyrt-linje.sub-item td:first-child::after {
    background: #ff9800 !important;
}

/* Style for the separator row */
tr.category-separator td {
    height: 20px;
    background-color: #eef2f5;
    border-top: 2px solid #e0e6ec;
    border-bottom: 2px solid #e0e6ec;
    padding: 10px 15px !important; /* Samme som pakkeoverskrifter */
    margin: 10px 0 !important;
    text-align: left; /* VENSTRESTILLING */
    font-weight: 700;
    color: #2c3e50;
    font-size: 1.1rem;
    vertical-align: middle;
    letter-spacing: 0.5px;
}

/* NEW: Styling for package header rows */
.package-header-row {
    background-color: #e0f2f7; /* Light turquoise for package headers */
    border-bottom: 2px solid #00a0b0; /* Stronger line */
    font-weight: 700;
    color: #2c3e50;
}

.package-header-row h3 {
    margin: 0;
    padding: 10px 15px;
    font-size: 1.2rem;
    color: black;
    border-bottom: none; /* Remove h3's own border-bottom */
    display: inline-block; /* Make it inline to allow button next to it */
    vertical-align: middle; /* Align with button */
    text-align: left;
    width: 100%;
}
.package-header-row button {
    margin-left: 20px; /* Space between title and button */
    padding: 8px 16px; /* Slightly larger button for header */
    font-size: 0.8rem;
    vertical-align: middle; /* Align with title */
}


/* Confirmation Modal Specific Styles */
.confirmation-modal-overlay {
    display: none;
    position: fixed;
    z-index: 1001; /* Higher than main modal */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.6); /* Slightly darker overlay */
    justify-content: center;
    align-items: center;
}

.confirmation-modal-content {
    background-color: #fefefe;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
    text-align: center;
    max-width: 450px;
    width: 90%;
    animation-name: animatetop;
    animation-duration: 0.4s;
}

.confirmation-modal-content p {
    margin-bottom: 25px;
    font-size: 1rem; /* Slightly larger text in confirmation modal */
    color: #444;
    font-weight: 500;
}

.confirmation-modal-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.confirmation-modal-buttons button {
    padding: 10px 25px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
}

.confirmation-modal-buttons .confirm-yes {
    background-color: #dc3545; /* Red for delete confirmation */
    color: white;
    border: none;
}

.confirmation-modal-buttons .confirm-yes:hover {
    background-color: #c82333;
    transform: translateY(-2px);
}

.confirmation-modal-buttons .confirm-no {
    background-color: #e9e9e9;
    color: #555;
    border: 1px solid #c0c0c0;
}

.confirmation-modal-buttons .confirm-no:hover {
    background-color: #dcdcdc;
    transform: translateY(-2px);
}

/* Overall container for both profitability columns */
.profitability-overall-container {
    display: flex;
    gap: 30px; /* Space between columns */
    flex-wrap: wrap; /* Allows items to wrap on smaller screens */
    margin-bottom: 50px; /* Standard section margin-bottom */
}

/* Styling for each profitability column */
.profitability-column {
    flex: 1; /* Each column takes equal space */
    min-width: 300px; /* Minimum width before wrapping */
    padding: 25px; /* Standard section padding */
    background-color: #fdfefe; /* Standard section background */
    border-radius: 12px; /* Standard section border-radius */
    border: 1px solid #e0e6ec;
    /* REMOVED box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06); */
    box-sizing: border-box; /* Ensure padding is included in width */
}

.profitability-column h2 {
    margin-top: 0;
    margin-bottom: 25px;
    border-bottom: 2px solid #e0e6ec;
    padding-bottom: 12px;
}

/* Resultat Grid Styling for internal content */
.profitability-grid {
    display: grid;
    grid-template-columns: auto 1fr auto auto; /* First column for labels (auto width), second for values (takes remaining space) */
    gap: 10px 20px; /* Row gap, column gap */
    align-items: baseline; /* Align text baselines */
}
/* Make the span for value take up the rest of the space in the second column */
.profitability-grid .value-span {
    grid-column: 2;
    text-align: left;
}
/* Make the percentage input and label take up the third and fourth columns */
.profitability-grid .percentage-input-wrapper {
    grid-column: 3;
    display: flex; /* Use flex to align input and % symbol */
    align-items: baseline;
    gap: 5px; /* Small gap between input and % */
}
.profitability-grid .percentage-input-wrapper input {
    width: 90px; /* Økt bredde for prosent-input */
    padding: 4px 8px; /* Redusert padding for lavere høyde */
    font-size: 0.8rem;
    text-align: right;
    height: 28px; /* Sett eksplisitt høyde for jevn linjehøyde */
}
.profitability-grid .percentage-symbol {
    grid-column: 4;
    font-weight: bold;
    margin-right: 0;
}

.profitability-grid .summary-text {
    margin-top: 0; /* Remove existing margins from p tags to let grid control spacing */
    margin-bottom: 0;
    display: contents; /* Makes children (strong and span) direct grid items */
}

.profitability-grid .summary-text strong {
    grid-column: 1; /* Place labels in the first column */
    text-align: left; /* Align labels to the left */
}
/* Specific styling for the result numbers */
.profitability-grid .result-value {
    font-weight: 700;
    color: #004d99; /* Deeper blue for main result numbers */
    font-size: 0.9rem;
}

/* Project Info section styling */
.project-info-grid-container {
    display: flex;
    flex-wrap: wrap; /* Allows columns to wrap on smaller screens */
    gap: 30px; /* Space between columns */
    margin-top: 20px;
}

.project-info-left-column,
.project-info-right-column {
    flex: 1; /* Each column takes equal space */
    min-width: 300px; /* Minimum width before wrapping */
    display: flex;
    flex-direction: column;
    gap: 15px; /* Space between input groups */
}

.project-info-input-group {
    display: flex;
    flex-direction: column; /* Stack label and input vertically */
    align-items: flex-start;
    width: 100%;
}

.project-info-input-group label {
    margin-bottom: 5px;
    font-weight: 600;
    color: #555;
    font-size: 0.9rem;
}

.project-info-input-group input[type="text"],
.project-info-input-group input[type="date"],
.project-info-input-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #c0c9d2;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #333;
}
.project-info-input-group input[type="date"] {
    /* Make date input look like text input */
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}
.project-info-input-group textarea {
    min-height: 100px; /* Taller textarea */
    resize: vertical;
}

.project-info-input-group input[type="radio"] {
    margin-right: 6px;
    margin-left: 12px;
    vertical-align: middle;
}
.project-info-input-group label input[type="radio"]:first-child {
    margin-left: 0;
}
.project-info-input-group label[for="riskDescription"] {
    display: block;
    margin-top: 8px;
}

.radio-group {
    display: flex;
    gap: 15px;
    margin-top: 8px; /* Space below checkbox */
}
.radio-group label {
    font-weight: normal; /* Override bold from main label */
    color: #555;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}
.radio-group input[type="radio"] {
    margin: 0; /* Remove default margin */
    width: auto; /* Allow auto width for radio buttons */
    min-width: unset; /* Override global min-width */
}
/* New: for modals with radio buttons for item type */
.modal-input-group .radio-buttons {
    display: flex;
    gap: 15px;
    margin-top: 5px;
}
.modal-input-group .radio-buttons label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: normal;
}
.modal-input-group .radio-buttons input[type="radio"] {
    margin: 0;
    width: auto;
    min-width: unset;
}


.action-buttons-group {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e0e6ec;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 20px;
        margin: 10px auto;
    }

    h1 {
        font-size: 1.8rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.2rem;
    }

    /* .input-group in main container still works fine */
    .input-group label,
    .input-group select,
    .input-group input[type="number"],
    .input-group input[type="text"],
    .input-group input[type="date"],
    .input-group textarea,
    .input-group button {
        flex: 1 1 100%;
        min-width: unset;
        font-size: 0.85rem;
    }
    .input-group label {
        margin-bottom: 5px;
    }
    .input-group {
        flex-direction: column;
        align-items: stretch;
    }


    .table-container {
        border-radius: 4px;
    }

    table thead {
        display: none;
    }

    table, table tbody, table tr, table td {
        display: block;
        width: 100%;
    }

    table tr {
        margin-bottom: 10px;
        border: 1px solid #e0e6ec;
        border-radius: 8px;
        padding: 10px;
        background-color: #fff;
    }

    table td {
        text-align: right;
        padding-left: 50%;
        position: relative;
        border: none;
    }

    table td::before {
        content: attr(data-label);
        position: absolute;
        left: 10px;
        width: calc(50% - 20px);
        text-align: left;
        font-weight: 600;
        color: #555;
        font-size: 0.85rem;
    }

    table td:nth-of-type(1)::before { content: "Vare/Tjeneste:"; }
    table td:nth-of-type(2)::before { content: "Enhet:"; } /* Updated data-label */
    table td:nth-of-type(3)::before { content: "Antall:"; }
    table td:nth-of-type(4)::before { content: "Enhetskostnad:"; }
    table td:nth-of-type(5)::before { content: "Påslag (%):"; }
    table td:nth-of-type(6)::before { content: "Pris:"; }
    table td:nth-of-type(7)::before { content: "Resultat:"; }
    table td:nth-of-type(8)::before { content: "Dekningsgrad (%):"; }
    table td:nth-of-type(9)::before { content: "Handling:"; }

    /* For redigerbar base-tabell */
    table td:has(input[data-field="name"])::before { content: "Navn:"; }
    table td:has(input[data-field="unit"])::before { content: "Enhet:"; }
    table td:has(input[data-field="costPerUnit"])::before { content: "Kostnad:"; }
    table td:has(select[data-field="associatedLaborId"])::before { content: "Arbeid:"; } /* New label */
    table td:has(input[data-field="associatedLaborRatio"])::before { content: "Forhold:"; } /* New label */
    table td:has(textarea[data-field="description"])::before { content: "Beskrivelse:"; } /* New label for packages */
    table td:has(button)::before { content: "Handling:"; }

    table td:last-of-type {
        text-align: center;
    }

    tr.sub-item td {
        padding-left: 20px;
    }
    tr.sub-item td:first-child::before,
    tr.sub-item td:first-child::after {
        left: 5px;
    }
    tr.sub-item td:first-child::after {
        width: 10px;
    }
    tr.category-separator td {
        text-align: center;
        padding-left: 0;
    }
    tr.category-separator td::before {
        content: none; /* Hide data-label on separator */
    }

    .summary-text {
        font-size: 1rem;
    }
}

.table-container tfoot td {
    font-weight: bold;
    border-top: 2px solid #333;
    background-color: #f2f2f2;
}

/* Styling for header rows in calculation table */
.header-row td {
    background-color: #e9ecef;
    font-weight: bold;
}

.header-row input.header-input {
    width: 100%;
    border: none;
    background-color: transparent;
    font-weight: bold;
    font-size: 1em;
    padding: 5px 0;
}


/* Profitability Summary Section */
.summary-section {
    /* ... existing code ... */
}

.overstyrt-linje {
    background-color: #fff3e0 !important;
}

.overstyrt-indikator {
    display: inline-block;
    width: 6px;
    height: 24px;
    background: orange;
    border-radius: 3px;
    margin-right: 6px;
    vertical-align: middle;
}

/* --- HEADER OG LOGO --- */
.procalc-header {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 40px;
}
.procalc-logo {
    height: 56px;
    width: auto;
    margin-right: 12px;
    display: block;
}
@media (max-width: 700px) {
    .procalc-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .procalc-logo {
        margin-right: 0;
        margin-bottom: 8px;
    }
}

.procalc-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0;
    margin-bottom: 32px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.procalc-logo {
    height: 38px;
    width: auto;
    margin-right: 0;
    display: block;
}

.header-button-group {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* NY: Gruppe for header-knapper */
.header-button-group {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    margin-left: 24px;
}

@media (max-width: 700px) {
    .procalc-header-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .header-button-group {
        margin-left: 0;
        gap: 6px;
    }
}

/* --- Lagrede prosjekter --- */
#savedProjectsList {
    font-size: 1.15rem;
    margin-bottom: 1.5em;
}
.saved-projects-ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.saved-project-li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.7em 1em;
    border-radius: 8px;
    margin-bottom: 0.5em;
    background: #f8fafd;
    box-shadow: 0 1px 4px rgba(0,0,0,0.03);
    transition: background 0.2s;
}
.saved-project-li:hover {
    background: #e6f0fa;
}
.saved-project-title {
    font-weight: 600;
    font-size: 1.1em;
}
.saved-project-date {
    color: #666;
    font-size: 0.95em;
    margin-left: 0.7em;
}
.delete-project-btn {
    margin-left: 1em;
    font-size: 1.2em;
    background: #fff0f0;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    padding: 0.2em 0.7em;
    transition: background 0.2s;
}
.delete-project-btn:hover {
    background: #ffdddd;
}
@media (max-width: 600px) {
    .saved-project-li {
        flex-direction: column;
        align-items: flex-start;
        font-size: 1em;
    }
    .saved-project-date {
        margin-left: 0;
        margin-top: 0.2em;
    }
}

/* --- Små toppknapper --- */
/*
#openProjectsModalBtn, #toggleSidebarBtn {
    padding: 0.35em 1em !important;
    font-size: 1em !important;
    height: 2.1em !important;
    min-width: 0 !important;
    margin-left: 0.2em !important;
    margin-right: 0 !important;
    border-radius: 8px !important;
    background: linear-gradient(135deg, #00a0b0 0%, #007a86 100%) !important;
    color: white !important;
    border: none !important;
    font-weight: 600 !important;
    box-shadow: none !important;
    letter-spacing: 0.02em !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.3em !important;
    cursor: pointer !important;
    transition: background 0.3s, box-shadow 0.3s, transform 0.15s !important;
}
#openProjectsModalBtn:hover, #toggleSidebarBtn:hover {
    background: linear-gradient(135deg, #007a86 0%, #005a63 100%) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 10px rgba(0, 160, 176, 0.18) !important;
}
#openProjectsModalBtn:active, #toggleSidebarBtn:active {
    transform: translateY(0) !important;
    box-shadow: 0 2px 5px rgba(0, 160, 176, 0.12) !important;
}
*/
/* Kommentert ut for å la knappene bruke .rounded-button og få lik stil som de andre header-knappene */

/* --- Minimer seksjon --- */
.section-header {
    user-select: none;
}
.minimize-section-btn {
    color: #00a0b0 !important; /* Turkis */
    background: none;
    border: none;
    font-size: 1.2em;
    cursor: pointer;
    transition: color 0.2s;
}

.minimize-section-btn:hover {
    color: #007a86 !important; /* Mørkere turkis ved hover */
}

.section.minimized .minimize-section-btn {
    transform: rotate(0deg);
}
.section:not(.minimized) .minimize-section-btn {
    transform: rotate(90deg);
}
.section.minimized .project-info-content {
    display: none !important;
}
.section:not(.minimized) .project-info-content {
    display: block !important;
}

.kalkyle-section .section-header {
    user-select: none;
    margin-bottom: 18px;
    padding-bottom: 0;
}
.kalkyle-section .minimize-section-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.2em 0.5em;
    font-size: 1.2em;
    transition: transform 0.2s;
}
.kalkyle-section.minimized .minimize-section-btn {
    transform: rotate(0deg);
}
.kalkyle-section:not(.minimized) .minimize-section-btn {
    transform: rotate(90deg);
}
.kalkyle-section .kalkyle-content {
    max-width: none;
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    padding-left: 0;
    padding-right: 0;
}
.kalkyle-section.minimized .kalkyle-content {
    max-width: 0;
    opacity: 0;
    padding-left: 0;
    padding-right: 0;
    pointer-events: none;
}

@media (max-width: 1200px) {
    .kalkyle-section .kalkyle-content {
        max-width: 98vw;
    }
}
@media (max-width: 700px) {
    .kalkyle-section .kalkyle-content {
        max-width: 100vw;
        padding-left: 0;
        padding-right: 0;
    }
    .kalkyle-section .rounded-button {
        font-size: 0.95rem;
        padding: 0.4em 1em;
    }
}

.kalkyle-section {
    margin-bottom: 50px;
    padding: 25px;
    background-color: #fdfefe;
    border-radius: 12px;
    border: 1px solid #e0e6ec;
}

.kalkyle-section .rounded-button {
    font-size: 0.85rem;
    padding: 0.35em 0.9em;
    min-width: 0;
    min-height: 0;
    border-radius: 8px;
    margin-right: 0.3em;
    margin-bottom: 0.2em;
    height: 2.1em;
    line-height: 1.1;
}
.kalkyle-section .rounded-button:last-child {
    margin-right: 0;
}

/* Midtstill handling-knapper i tabeller */
td.action-buttons, td:last-child, th:last-child {
    text-align: center;
    vertical-align: middle;
}

.input-group + .table-container {
    margin-top: 32px !important;
}

/* Make the settings section smaller */
.small-settings-section {
    margin-bottom: 0;
}

/* Fordeling section styling */
.fordeling-section {
    background: #fff;
    border: 1px solid #e0e6ec;
    border-radius: 14px;
    padding: 25px;
    margin: 0 auto 50px auto;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.fordeling-section h2 {
    font-size: 1.35em;
    font-weight: 700;
    margin: 0 0 18px 0;
    color: #1a355b;
}

.fordeling-row {
    font-size: 1.08em;
    color: #222;
    margin-bottom: 6px;
}

.procalc-section-header td {
    background: #e0f7fa !important;
    color: #007a86 !important;
    font-weight: 600 !important;
    font-family: inherit !important;
    text-align: left !important;
    padding-left: 16px !important;
    font-size: 1em !important;
    letter-spacing: 0;
    border-bottom: 1px solid #b2ebf2 !important;
}

.procalc-package-separator td {
    border: none;
    border-top: 2px solid #00bcd4 !important;
    height: 0;
    padding: 0;
    background: none;
}

/* Horisontal layout for risikonivå radio-knapper */
#riskFields .project-info-input-group label:has(input[type="radio"]) {
    display: inline-flex;
    align-items: center;
    margin-right: 18px;
    font-weight: 400;
    font-style: italic;
}
#riskFields .project-info-input-group input[type="radio"] {
    margin-right: 6px;
}
#riskFields .project-info-input-group {
    align-items: flex-start;
}

/* Fjern spesialregler for #newProjectBtn.rounded-button for å sikre lik stil */
#newProjectBtn.rounded-button {
    padding: 10px 20px;
    font-size: 0.8rem;
    height: auto;
    min-width: 0;
    box-sizing: border-box;
}

.modal-content.large {
    max-width: 900px;
}

.modal-content.extra-large {
    max-width: 1300px;
}

#mengdeoppsettContent {
    padding: 10px 25px 25px 25px;
}

.notes-section {
    margin-top: 25px;
}

.notes-section h3 {
    font-size: 1.1em;
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
}

#mengdeoppsettNotes {
    width: calc(100% - 20px);
    padding: 10px;
    min-height: 120px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.5;
}

#mengdeoppsettTableBody .package-header-row td:first-child {
    cursor: pointer;
}

/* Template Grid Styling */
.template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.template-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    background: #fff;
    transition: all 0.3s ease;
    cursor: pointer;
}

.template-card:hover {
    border-color: #007cba;
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.15);
    transform: translateY(-2px);
}

.template-card h3 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 1.35em;
}

.template-card .template-category {
    display: inline-block;
    background: #f0f0f0;
    color: #666;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 1.1em;
    margin-bottom: 10px;
}

.template-card .template-description {
    color: #666;
    font-size: 1.1em;
    line-height: 1.4;
    margin-bottom: 15px;
    min-height: 40px;
}

.template-card .template-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.05em;
    color: #999;
}

.template-card .template-global {
    background: #007cba;
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 1.05em;
}

.template-card .template-actions {
    margin-top: 15px;
    display: flex;
    gap: 10px;
}

.template-card .template-actions button {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background-color 0.2s;
}

.template-card .template-actions .load-template-btn {
    background: #007cba;
    color: white;
}

.template-card .template-actions .load-template-btn:hover {
    background: #005a87;
}

.template-card .template-actions .delete-template-btn {
    background: #dc3545;
    color: white;
}

.template-card .template-actions .delete-template-btn:hover {
    background: #c82333;
}

.template-filters {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
}

.template-filters label {
    font-weight: 600;
    color: #333;
}

.template-filters select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    font-size: 0.9em;
}

.template-filters select:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.2);
}

/* Responsive template grid */
@media (max-width: 768px) {
    .template-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .template-card {
        padding: 15px;
    }
    
    .template-filters {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .template-filters select {
        width: 100%;
    }
}

.template-personal {
    display: inline-block;
    background: #2980d9;
    color: #fff;
    font-size: 0.95em;
    padding: 2px 8px;
    border-radius: 8px;
    margin-left: 8px;
    vertical-align: middle;
}

/* Mindre luft over beskrivelse */
#new-item-package-description-field {
    margin-top: 0.5em;
}

/* Jevnere spacing i alle modal-input-group */
.modal-input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 0.8em;
}

/* Modal-knapper alltid til høyre og kompakt */
.modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 0.5em;
    margin-bottom: 0;
    padding-bottom: 0;
}

/*
#new-item-labor-fields {
    display: flex;
    align-items: center;
    gap: 0.7em;
    margin-bottom: 0.5em;
}
.labor-fields-row {
    display: flex;
    align-items: center;
    gap: 0.7em;
}
.labor-fields-row label {
    margin-bottom: 0;
    font-weight: 600;
    color: #555;
    font-size: 0.93rem;
}
.labor-fields-row select,
.labor-fields-row input[type="number"] {
    padding: 10px 13px;
    border: 1px solid #c0c9d2;
    border-radius: 8px;
    font-size: 0.93rem;
    color: #333;
    background: #f9fbfd;
}
*/

.header-left h1 {
    margin: 0;
    padding: 0;
    line-height: 1.1;
    display: flex;
    align-items: center;
    font-family: 'Montserrat', 'Inter', 'Arial', sans-serif;
    font-weight: 600;
    font-size: 1.7rem;
    color: #1a355b;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.modal-bottom-logo {
    display: block;
    margin: 32px auto 8px auto;
    height: 38px;
    width: auto;
    opacity: 0.85;
}

@media print {
    .modal-bottom-logo {
        display: block !important;
        margin: 32px auto 8px auto !important;
        height: 38px !important;
        width: auto !important;
        opacity: 1 !important;
        filter: none !important;
    }
}

/* --- ProCalc hovedlayout: stretch seksjoner likt --- */
.flex-main-row {
    display: flex;
    gap: 32px;
    align-items: stretch;
    height: 100%;
    min-height: 350px; /* juster etter behov */
}
.flex-main-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.flex-main-col > .section {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
}
.flex-main-row > div:last-child > .section {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
}

@media (max-width: 1100px) {
    .flex-main-row {
        flex-direction: column;
        gap: 18px;
    }
    .flex-main-col {
        gap: 12px;
    }
}

/* --- ProCalc låste elementer (status 300) --- */
.locked {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}

.locked:hover {
    opacity: 0.6 !important;
}

/* Spesiell styling for låste knapper */
button.locked {
    background-color: #f5f5f5 !important;
    color: #999 !important;
    border-color: #ddd !important;
}

/* Spesiell styling for låste input-felter */
input.locked, select.locked, textarea.locked {
    background-color: #f9f9f9 !important;
    color: #666 !important;
    border-color: #ddd !important;
}

/* Låste tabell-rader */
tr.locked {
    opacity: 0.7;
}

/* Låste delete-knapper i tabeller */
.delete-item-btn.locked, .delete-fixed-cost-btn.locked {
    background-color: #f5f5f5 !important;
    color: #999 !important;
    border-color: #ddd !important;
}

/* --- ProCalc prosjektstatus-indikatorer --- */
.project-status {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: 500;
    display: inline-block;
    min-width: 120px;
    text-align: center;
}

.status-development {
    background-color: #e3f2fd;
    color: #1976d2;
    border: 1px solid #bbdefb;
}

.status-review {
    background-color: #fff3e0;
    color: #f57c00;
    border: 1px solid #ffcc02;
}

.status-locked {
    background-color: #f3e5f5;
    color: #7b1fa2;
    border: 1px solid #ce93d8;
}

.project-info-input-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #c0c9d2;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #333;
    background: #fff;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    box-sizing: border-box;
    margin-bottom: 0;
}

.project-info-input-group select:focus {
    border-color: #00a0b0;
    box-shadow: 0 0 0 3px rgba(0, 160, 176, 0.18);
    outline: none;
}

.fordeling-row-flex {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 0.5em;
}
.fordeling-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 1.05em;
}
.fordeling-value {
    display: flex;
    align-items: baseline;
    justify-content: flex-end;
    min-width: 70px;
    font-size: 1.15em;
    color: #1a355b;
    font-weight: 600;
    line-height: 1.2;
}

.fordeling-lps-row {
    display: flex;
    gap: 18px;
    align-items: flex-end;
    margin-bottom: 10px;
}
#faktureringsplanModal .modal-body {
    padding-bottom: 0.5em;
}
#faktureringsplanModal table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    background: #fff;
    font-size: 1em;
}
#faktureringsplanModal th, #faktureringsplanModal td {
    padding: 7px 8px;
    border-bottom: 1px solid #e0e6ec;
    text-align: left;
}
#faktureringsplanModal th {
    background: #f7fafd;
    font-weight: 600;
    color: #1a355b;
    border-bottom: 2px solid #1a355b;
}
#faktureringsplanModal .add-button, #faktureringsplanModal .rounded-button {
    min-width: 110px;
    padding: 8px 18px;
    font-size: 1em;
    margin: 0 4px;
    box-shadow: 0 2px 8px 0 #e0e6ec;
}
#faktureringsplanModal .add-button {
    background: #f7fafd;
    color: #1a355b;
    border: 1px solid #1a355b;
    border-radius: 6px;
    font-weight: 600;
}
#faktureringsplanModal .rounded-button {
    background: #00b6b0;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    transition: background 0.2s;
}
#faktureringsplanModal .rounded-button:hover {
    background: #008c87;
}
#faktureringsplanModal .modal-bottom-logo {
    width: 90px;
    opacity: 0.7;
    margin: 18px auto 0 auto;
    display: block;
}

/* --- Faktureringsplan Modal Customizations --- */
#faktureringsplanModal .modal-content {
    max-width: 1300px !important;
    min-width: 900px;
    width: 100%;
}
#faktureringsplanModal .input-group {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end !important;
    justify-content: flex-end !important;
    margin-top: 8px !important;
    margin-bottom: 18px !important;
    gap: 12px !important;
}
#faktureringsplanModal .input-group label {
    margin-bottom: 0 !important;
}
#faktureringsplanModal .input-group .faktura-knapper {
    margin-left: auto;
    display: flex;
    gap: 12px;
}
#faktureringsplanModal .input-group button {
    margin-bottom: 0 !important;
    height: 38px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

@media (max-width: 1400px) {
    #faktureringsplanModal .modal-content {
        max-width: 98vw !important;
        min-width: 0;
    }
}

#faktureringsplanModal .faktura-grid-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 24px;
    align-items: end;
    margin-top: 8px;
    margin-bottom: 18px;
}
#faktureringsplanModal .faktura-inputs {
    display: flex;
    gap: 18px;
    align-items: flex-end;
    flex-wrap: wrap;
}
#faktureringsplanModal .faktura-inputs label {
    margin-bottom: 0 !important;
}
#faktureringsplanModal .faktura-knapper {
    display: flex;
    gap: 16px;
    align-items: flex-end;
}
@media (max-width: 900px) {
    #faktureringsplanModal .faktura-grid-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    #faktureringsplanModal .faktura-knapper {
        justify-content: flex-start;
        margin-top: 10px;
    }
} 