:root {
    --primary: #d5fbd3;
    --bg-body: #f8fafc;
    --text-main: #1e293b;
    --text-muted: #64748b;
}

body {
    background-color: var(--bg-body);
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
}

/* Ta bort Bootstrap focus-ring i sub-header */

.sub-header .dropdown-toggle:focus,
.sub-header .dropdown-toggle:active {
    outline: none !important;
    box-shadow: none !important;
}

.main-header {
    background: #fff;
    border-bottom: 1px solid #f1f5f9;
    padding: 0.45rem 0;
    /* Above sticky .sub-header so language dropdown is not covered */
    position: relative;
    z-index: 1030;
}

.brand-logo {
    height: 32px;
    width: auto;
}

.doc-type-badge {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.8rem;
    padding-left: 15px;
    margin-left: 15px;
    border-left: 2px solid #f1f5f9;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.doc-type-badge.doc-type-badge--emphasis {
    color: #212529;
    border-left-color: rgba(33, 37, 41, 0.12);
}

/* Publik jobb-sida: luft mot kanter + JOBB som ljusgrå badge */
.hire-pub-main-header .hire-pub-header-inner {
    padding-left: 1rem;
    padding-right: 1rem;
}
@media (min-width: 768px) {
    .hire-pub-main-header .hire-pub-header-inner {
        padding-left: 0;
        padding-right: 0;
    }
}
.doc-type-badge.doc-type-badge--hire {
    border-left: none;
    margin-left: 0.65rem;
    padding: 0.3rem 0.65rem;
    border-radius: 0.5rem;
    background: #eef2f7;
    color: #0f172a;
    font-weight: 700;
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    line-height: 1.2;
    flex-shrink: 0;
}

.btn-login-light {
    background: #f1f5f9;
    border: none;
    padding: 8px 18px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: 0.2s;
}

.btn-login-light:hover {
    background: #e2e8f0;
}

.sub-header {
    background: #ffffff;
    border-bottom: 1px solid #f1f5f9;
    padding: 0.5rem 0;
    position: sticky;
    top: 0;
    z-index: 1020;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
}

.btn-pay-action {
    padding: 7px 18px;
        border-radius: 8px;
        font-size: 0.9rem;
    background: var(--primary)!important;
    color: #000!important;
    border: none;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

#estimate-respond {
    scroll-margin-top: 7rem;
}

.estimate-intro-hero__img {
    display: block;
    width: 100%;
    max-height: 280px;
    object-fit: cover;
}

.estimate-intro-hero__img--public {
    max-height: 320px;
    border-radius: 0.75rem;
}

.estimate-intro-hero--admin {
    margin-left: calc(-1 * var(--bs-card-spacer-x, 1.5rem));
    margin-right: calc(-1 * var(--bs-card-spacer-x, 1.5rem));
}

.estimate-intro-hero--admin .estimate-intro-hero__img {
    border-radius: 0;
    max-height: 300px;
}

.action-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: none;
    background: none;
}

.document-card {
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
    padding: 3.25rem 3.5rem;
    margin-top: 2.5rem;
    border: 1px solid rgba(0, 0, 0, 0.02);
    position: relative;
    overflow: visible;
}

.document-card-tight {
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
    padding: 2rem;
    margin-top: 2.5rem;
    border: 1px solid rgba(0, 0, 0, 0.02);
    position: relative;
}

.document-card-tighter {
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
    margin-top: 2.5rem;
    border: 1px solid rgba(0, 0, 0, 0.02);
    position: relative;
}

/* Status chip — must win over Bootstrap bg-*-subtle (block + full width) */
.status-tag-corner {
    position: absolute !important;
    top: 1.75rem !important;
    right: 1.75rem !important;
    left: auto !important;
    z-index: 3;
    width: auto !important;
    max-width: min(14rem, 42%);
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    background: #fff7ed;
    color: #c2410c;
    font-weight: 800;
    font-size: 0.8rem;
    line-height: 1.2;
    padding: 0.55rem 1.1rem;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border: 1px solid #ffedd5;
    box-sizing: border-box;
    white-space: nowrap;
}

.status-tag-corner.bg-success-subtle,
.status-tag-corner.text-success {
    background: #ecfdf5 !important;
    color: #047857 !important;
    border-color: #a7f3d0 !important;
}

.status-tag-corner.bg-warning-subtle,
.status-tag-corner.text-warning {
    background: #fff7ed !important;
    color: #c2410c !important;
    border-color: #ffedd5 !important;
}

.status-tag-corner.bg-danger-subtle,
.status-tag-corner.text-danger {
    background: #fef2f2 !important;
    color: #b91c1c !important;
    border-color: #fecaca !important;
}

.label-cap {
    color: #94a3b8;
    text-transform: uppercase;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    margin-bottom: 0.6rem;
    display: block;
}

.amount-display {
    font-size: 2.5rem;
    font-weight: 800;
    color: #10b981;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

.payment-quick-box {
    background: #f8faff;
    border: 1px solid #eef2ff;
    border-radius: 18px;
    padding: 1.75rem 2rem;
    margin-bottom: 2.5rem;
}

.public-doc__title {
    letter-spacing: -0.02em;
}

.public-doc__parties {
    row-gap: 1.5rem;
}

.public-doc__table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.premium-table {
    width: 100%;
    min-width: 520px;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
}

.premium-table thead th {
    background: #f8fafc;
    color: #94a3b8;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.85rem 1rem;
    font-weight: 700;
    vertical-align: bottom;
    white-space: nowrap;
}

.premium-table tbody td {
    padding: 1.15rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.95rem;
    vertical-align: top;
    word-break: break-word;
}

.public-doc__totals {
    min-width: 0;
}

.public-doc__grand-total {
    font-size: 1.35rem;
    line-height: 1.25;
}

.public-doc__grand-total .text-nowrap {
    font-variant-numeric: tabular-nums;
}

.sender-footer-grid {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 2rem;
    border-top: 1px solid #f1f5f9;
    padding-top: 2.5rem;
    margin-top: 4rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
    font-size: 0.9rem;
    color: #475569;
    text-decoration: none;
}

.contact-item i {
    width: 16px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

@media (max-width: 768px) {
    .document-card {
        padding: 1.75rem 1.25rem;
        margin-top: 1.25rem;
        border-radius: 18px;
    }

    .document-card-tight {
        padding: 1.75rem 1.25rem;
    }

    .status-tag-corner {
        position: static !important;
        display: inline-flex !important;
        max-width: none;
        margin: 0 0 1.25rem;
    }

    .desktop-actions {
        display: none !important;
    }

    .d-login-desktop {
        display: none !important;
    }

    .payment-quick-box {
        padding: 1.25rem 1.35rem;
        margin-bottom: 1.75rem;
    }

    .payment-quick-box .col-6 {
        width: 100%;
        text-align: left !important;
    }

    .premium-table {
        min-width: 0;
        table-layout: auto;
    }

    .premium-table thead {
        display: none;
    }

    .premium-table tbody tr {
        display: block;
        padding: 1.25rem 0;
        border-bottom: 1px solid #f1f5f9;
    }

    .premium-table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: baseline;
        gap: 1rem;
        padding: 0.35rem 0;
        border: none;
        font-size: 0.9rem;
        text-align: right;
    }

    .premium-table tbody td:first-child {
        display: block;
        font-weight: 700;
        font-size: 1rem;
        margin-bottom: 0.65rem;
        text-align: left;
        padding: 0;
    }

    .premium-table tbody td::before {
        content: attr(data-label);
        font-weight: 500;
        color: var(--text-muted);
        text-transform: uppercase;
        font-size: 0.7rem;
        letter-spacing: 0.04em;
        text-align: left;
    }

    .premium-table tbody td:first-child::before {
        display: none;
    }

    .amount-display {
        font-size: 2rem;
    }

    .public-doc__grand-total {
        font-size: 1.2rem;
    }
}

.offcanvas {
    width: 300px !important;
    border-left: none;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 1.2rem 1.5rem;
    color: var(--text-main);
    text-decoration: none;
    font-weight: 500;
    border-radius: 12px;
    margin: 5px 10px;
}

.mobile-nav-link:hover {
    background: #f1f5f9;
    color: var(--primary);
}

.table-striped-custom tbody tr:nth-child(even) {
    background-color: #f8fafc;
}

.table-striped-custom tbody tr {
    transition: background 0.2s ease;
}

.table-striped-custom tbody tr:hover {
    background-color: #eef2f7;
}

/* Webboffert — luft mellan sektioner, ingen extra card på avslut */
#public-estimate .estimate-public-cover {
    margin-bottom: 0;
    padding-bottom: 3.5rem;
    border-bottom: none;
}

#public-estimate .estimate-public-cover + .estimate-public-offer-head {
    margin-top: 4.5rem;
    padding-top: 3.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

#public-estimate .estimate-public-spec {
    margin-top: 4.5rem;
    padding-top: 3.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

#public-estimate .estimate-public-closing {
    margin-top: 6rem;
    padding-top: 2.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    background: transparent;
    box-shadow: none;
    border-left: none;
    border-right: none;
    border-bottom: none;
}

#public-estimate .estimate-public-closing .estimate-closing-hero-wrap {
    margin-top: 3rem;
}