/* =========================
   BASE
========================= */
html,
body {
    background: #1e1e1e;
    color: #fff;
    font-family: Arial, sans-serif;
    margin: 0;
    overflow-x: hidden;
}

* {
    box-sizing: border-box;
}

/* =========================
   HEADER
========================= */
header {
    background: #2b2b2b;
    padding: 12px 40px;
}

.header-inner {
    position: relative;
    width: 100%;
    max-width: none;
    margin: 0;
    display: flex;
    align-items: center;
}

.header-inner h1 {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 18px;
    margin: 0;
    white-space: nowrap;
    color: #fff;
}

.menu-btn,
.back-btn {
    background: none;
    border: none;
    color: white;
    font-size: 22px;
    cursor: pointer;
    width: 40px;
    z-index: 10;
}

.back-btn {
    margin-left: auto;
    text-align: right;
}

/* =========================
   CONTAINER
========================= */
.container {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 20px 40px;
    background: #1e1e1e;
    color: #fff;
}

/* =========================
   FOOTER
========================= */
footer {
    text-align: center;
    padding: 10px;
    font-size: 12px;
    color: #888;
    border-top: 1px solid #333;
    background: #1e1e1e;
}

/* =========================
   SIDE MENU
========================= */
.side-menu {
    position: fixed;
    left: -260px;
    top: 0;
    width: 260px;
    height: 100%;
    background: #1e1e1e;
    padding: 20px;
    transition: 0.25s ease;
    z-index: 2000;
}

.side-menu.open {
    left: 0;
}

.side-menu a {
    display: block;
    color: #fff;
    margin-bottom: 16px;
    text-decoration: none;
    font-size: 14px;
}

.side-menu a:hover {
    color: #ccc;
}

/* =========================
   OVERLAY
========================= */
#overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    z-index: 1500;
}

#overlay.open {
    display: block;
}

/* =========================
   FILTER
========================= */
.filter-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.filter-box {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-box .label {
    font-size: 13px;
    color: #aaa;
    min-width: 60px;
}

/* =========================
   INPUTS / SELECTS
========================= */
input[type="text"],
input[type="number"],
input[type="date"],
select {
    background: #2b2b2b;
    color: #fff;
    border: 1px solid #444;
    padding: 8px;
    border-radius: 6px;
}

input::placeholder {
    color: #aaa;
}

input:focus,
select:focus {
    outline: none;
    border-color: #666;
}

select option {
    background: #2b2b2b;
    color: #fff;
}

/* =========================
   BUTTONS
========================= */
.btn-base {
    background: #2b2b2b;
    color: #fff;
    border: 1px solid #444;
    border-radius: 4px;
    padding: 8px 14px;
    cursor: pointer;
}

.btn-base:hover {
    background: #3a3a3a;
}

/* =========================
   ROW LINK
========================= */
.row-link {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    background: #252525;
    padding: 12px 14px;
    margin-bottom: 8px;
    text-decoration: none;
    color: #fff;
    border-radius: 8px;
    transition: 0.2s;
    position: relative;
}

.row-link:hover {
    background: #2f2f2f;
    transform: translateX(3px);
}

.row-left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.row-link > span:last-child {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.row-link.disabled {
    opacity: 0.4;
    pointer-events: none;
}

/* =========================
   RESULTATER
========================= */
.results {
    display: grid;
    gap: 4px;
    width: 100%;
    color: #fff;
}

.results .row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 10px 0;
    border-bottom: 1px solid #333;
}

.results .row span:last-child {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-weight: 500;
}

/* =========================
   TOTAL BOX
========================= */
.total-box {
    text-align: center;
    margin-top: 20px;
    background: #2b2b2b;
    padding: 14px;
    border-radius: 10px;
    font-size: 18px;
    font-weight: bold;
    font-variant-numeric: tabular-nums;
}

/* =========================
   TOOLTIP
========================= */
.tooltip {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: #333;
    padding: 6px 10px;
    font-size: 12px;
    border-radius: 4px;
    display: none;
    white-space: nowrap;
}

.row-link:hover .tooltip {
    display: block;
}

/* =========================
   ADMIN TABLE
========================= */
.admin-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 10px 0;
    table-layout: auto;
    margin-top: 10px;
    font-size: 14px;
    color: #fff;
}

.admin-table th,
.admin-table td {
    padding: 8px 0;
    border-bottom: 1px solid #333;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    vertical-align: middle;
}

.admin-table th {
    color: #aaa;
    font-weight: normal;
    text-align: left;
}

.admin-table input,
.admin-table select {
    width: 100%;
    min-width: 0;
}

.admin-table thead tr {
    border-bottom: 2px solid #555;
}

.admin-table tbody tr:hover {
    background: #2a2a2a;
}

/* Kolonnebredder for Admin Total */
.admin-table th:nth-child(1),
.admin-table td:nth-child(1) {
    width: 80px;
}

.admin-table th:nth-child(2),
.admin-table td:nth-child(2),
.admin-table th:nth-child(3),
.admin-table td:nth-child(3),
.admin-table th:nth-child(4),
.admin-table td:nth-child(4),
.admin-table th:nth-child(5),
.admin-table td:nth-child(5),
.admin-table th:nth-child(6),
.admin-table td:nth-child(6),
.admin-table th:nth-child(7),
.admin-table td:nth-child(7),
.admin-table th:nth-child(8),
.admin-table td:nth-child(8),
.admin-table th:nth-child(9),
.admin-table td:nth-child(9) {
    width: 100px;
}

.admin-table th:nth-child(10),
.admin-table td:nth-child(10) {
    width: 140px;
}

/* =========================
   OPPGJØR INPUT
========================= */
.oppgjor-input {
    width: 100%;
    max-width: 140px;
    background: #2b2b2b;
    border: 1px solid #444;
    color: #fff;
    padding: 4px 6px;
    border-radius: 4px;
    text-align: right;
    font-size: 13px;
}

.oppgjor-input:focus {
    outline: none;
    border-color: #666;
}

/* =========================
   PAGE INFO
========================= */
.page-info {
    margin-bottom: 10px;
    color: #ccc;
}

/* =========================
   FORM STYLES
========================= */
.regning-form {
    width: 100%;
    max-width: 100%;
}

.regning-btn {
    width: 100%;
    display: block;
    padding: 14px;
    margin-top: 10px;
    background: #2f2f2f;
    color: #fff;
    border: 1px solid #444;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
}

.regning-btn:hover {
    background: #3a3a3a;
}

.save-btn {
    background: #2b2b2b;
}

.regning-container {
    margin-top: 10px;
    border: 1px solid #444;
    width: 100%;
    min-height: 80px;
    max-height: 55vh;
    overflow-y: auto;
    background: #1e1e1e;
    padding: 10px;
    border-radius: 8px;
}

/* =========================
   REKVISISJON ROW
========================= */
.rek-row {
    display: grid;
    grid-template-columns: 1.3fr 1fr 44px;
    gap: 6px;
    margin-bottom: 8px;
}

.rek-row button {
    background: #3a3a3a;
    color: #fff;
    border: 1px solid #555;
    border-radius: 6px;
    cursor: pointer;
}

/* =========================
   MOBILE
========================= */
@media (max-width: 600px) {

    header {
        padding: 10px 8px;
    }

    .header-inner {
        width: 100%;
        max-width: 100%;
    }

    .header-inner h1 {
        font-size: 17px;
    }

    .container {
        width: 100%;
        max-width: 100%;
        padding: 12px;
    }

    form {
        width: 100%;
        max-width: 100%;
    }

    .filter-row {
        flex-direction: column;
        gap: 10px;
        width: 100%;
        margin-bottom: 16px;
    }

    .filter-box {
        width: 100%;
        display: block;
    }

    .filter-box .label {
        display: block;
        margin-bottom: 5px;
    }

    .filter-box select,
    .filter-box input,
    select,
    input[type="text"],
    input[type="number"],
    input[type="date"] {
        width: 100%;
        padding: 12px;
        font-size: 16px;
    }

    .row-link {
        width: 100%;
        padding: 14px 12px;
        font-size: 16px;
    }

    .results {
        width: 100%;
    }

    .results .row {
        width: 100%;
        padding: 14px 0;
        font-size: 16px;
    }

    .total-box {
        width: 100%;
        padding: 18px 12px;
        font-size: 24px;
    }

    .regning-form,
    .regning-btn,
    .regning-container {
        width: 100%;
        max-width: 100%;
    }

    .regning-btn {
        font-size: 16px;
        padding: 16px;
    }

    .regning-container {
        max-height: 60vh;
    }

    .rek-row {
        grid-template-columns: 1fr 1fr 44px;
    }

    .tooltip {
        display: none !important;
    }
}
