/**
 * mottatte-bestillinger-forbedret CSS
 * Flyttet fra includes/mottatte-bestillinger-forbedret.php
 */

/* ========================================
   BESTILLING MODALER - ISOLERT CSS
   Bruker unike klassenavn for aa unngaa konflikter
   ======================================== */

/* SKJULT som standard - HOYESTE PRIORITET */
html body #send-melding-til-kunde-modal:not(.modal-visible),
html body #leveringsdato-modal:not(.modal-visible) {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* SYNLIG naar aapen - HOYESTE PRIORITET */
html body #send-melding-til-kunde-modal.modal-visible,
html body #leveringsdato-modal.modal-visible {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background: rgba(0, 0, 0, 0.75) !important;
    z-index: 2147483647 !important; /* Maksimum z-index */
    align-items: center !important;
    justify-content: center !important;
    overflow-y: auto !important;
}

/* Laas body scroll naar modal er aapen */
/* VIKTIG: IKKE bruk position:fixed - det låser hele siden */
body.modal-active {
    overflow: hidden !important;
}

/* Modal-boksen - sentrert og scrollbar - KRITISK: må være klikkbar */
.bestilling-modal-box {
    background: #fff;
    border-radius: 16px;
    max-width: 500px;
    width: calc(100% - 40px);
    max-height: calc(100vh - 40px);
    max-height: calc(100dvh - 40px); /* Dynamisk viewport for mobil */
    margin: 20px;
    overflow-y: auto; /* FIKSET: Tillat scrolling i modal */
    -webkit-overflow-scrolling: touch; /* Smooth scroll på iOS */
    box-shadow: 0 25px 80px rgba(0,0,0,0.4);
    display: flex;
    flex-direction: column;
    position: relative;
    pointer-events: auto !important; /* KRITISK: Tillat klikk */
    z-index: 2147483648 !important; /* Over overlay */
}

/* KRITISK: Alt innhold i modal-boksen må være klikkbart */
.bestilling-modal-box * {
    pointer-events: auto !important;
}

/* Inputs og buttons må være interaktive */
.bestilling-modal-box input,
.bestilling-modal-box textarea,
.bestilling-modal-box select,
.bestilling-modal-box button,
.bestilling-modal-box a,
.bestilling-modal-box label {
    pointer-events: auto !important;
    cursor: pointer;
    touch-action: manipulation !important;
}

/* Header */
.bestilling-modal-header {
    background: linear-gradient(135deg, #2c5530, #3d7344);
    color: #fff;
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bestilling-modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: #fff;
}

/* Lukk-knapp - KRITISK: må være klikkbar */
.bestilling-modal-lukk {
    background: rgba(255,255,255,0.2);
    border: none;
    color: #fff;
    width: 44px; /* Touch-vennlig størrelse */
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer !important;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: background 0.2s;
    pointer-events: auto !important; /* KRITISK */
    touch-action: manipulation !important;
    -webkit-tap-highlight-color: transparent;
    z-index: 10 !important;
}

.bestilling-modal-lukk:hover {
    background: rgba(255,255,255,0.4);
}

/* Body - scrollbar innhold */
.bestilling-modal-body {
    padding: 25px;
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0; /* KRITISK for flex scrolling */
    -webkit-overflow-scrolling: touch;
}

/* Footer med knapper - ALLTID synlig */
.bestilling-modal-footer {
    padding: 15px 25px;
    background: #f9f9f9;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    flex-shrink: 0; /* KRITISK: Ikke krymp footer */
}

/* Info-boks */
.bestilling-modal-info {
    background: #e8f5e9;
    border-left: 4px solid #2c5530;
    padding: 12px 16px;
    margin-bottom: 20px;
    border-radius: 0 8px 8px 0;
}

.bestilling-modal-info p {
    margin: 0;
    color: #2c5530;
    font-size: 14px;
}

/* Form-gruppe */
.bestilling-form-gruppe {
    margin-bottom: 20px;
}

.bestilling-form-gruppe label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.bestilling-form-gruppe input,
.bestilling-form-gruppe textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.bestilling-form-gruppe input:focus,
.bestilling-form-gruppe textarea:focus {
    outline: none;
    border-color: #2c5530;
}

.bestilling-form-gruppe textarea {
    resize: vertical;
    min-height: 100px;
}

/* Knapper i body (gamle modaler) */
.bestilling-modal-btns {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 25px;
}

/* Modal footer - ALLTID synlig under body */
.bestilling-modal-footer {
    padding: 20px 25px;
    background: #f9f9f9;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    flex-shrink: 0; /* KRITISK: Ikke krymp footer */
    border-radius: 0 0 16px 16px;
}

.bestilling-btn-avbryt {
    padding: 12px 24px;
    background: #f5f5f5;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
}

.bestilling-btn-avbryt:hover {
    background: #e0e0e0;
    border-color: #999;
}

.bestilling-btn-send {
    padding: 12px 24px;
    background: linear-gradient(135deg, #2c5530, #3d7344);
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s;
}

.bestilling-btn-send:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(44, 85, 48, 0.3);
}

.bestilling-btn-send:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Mobil */
@media (max-width: 600px) {
    .bestilling-modal-overlay {
        padding: 10px;
    }
    
    .bestilling-modal-box {
        max-width: 100%;
        max-height: 95vh;
        border-radius: 12px;
    }
    
    .bestilling-modal-header {
        padding: 16px 20px;
    }
    
    .bestilling-modal-header h3 {
        font-size: 1.1rem;
    }
    
    .bestilling-modal-body {
        padding: 20px;
    }
    
    .bestilling-modal-btns,
    .bestilling-modal-footer {
        flex-direction: column;
        padding: 15px 20px;
    }
    
    .bestilling-btn-avbryt,
    .bestilling-btn-send {
        width: 100%;
        text-align: center;
    }
}

/* Forbedret design for mottatte bestillinger */
.anbud-mottatte-bestillinger-forbedret {
    padding: 20px 0;
}

.anbud-seksjon-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.anbud-header-handlinger {
    display: flex;
    gap: 15px;
    align-items: center;
}

/* Statistikk */
.bestillinger-statistikk {
    margin-bottom: 30px;
}

.statistikk-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.stat-kort {
    background: linear-gradient(135deg, #2C5F2D 0%, #3d7a2f 100%);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    border: 1px solid #2C5F2D;
    transition: all 0.3s ease;
}

.stat-kort:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(44, 95, 45, 0.3);
}

.stat-kort.varsel {
    border-color: #ffc107;
    background: linear-gradient(135deg, #ff9800 0%, #ffc107 100%);
}

.stat-kort.info {
    border-color: #17a2b8;
    background: linear-gradient(135deg, #17a2b8 0%, #20c9e0 100%);
}

/* Ventende dato-forslag kort */
.stat-kort.varsel-dato {
    border-color: #ff6b6b;
    background: linear-gradient(135deg, #fff5f5 0%, #ffe0e0 100%);
    position: relative;
    overflow: visible;
}

.stat-kort.pulserende {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 2px 8px rgba(0,0,0,0.05), 0 0 0 0 rgba(255, 107, 107, 0.4);
    }
    50% {
        box-shadow: 0 4px 12px rgba(0,0,0,0.1), 0 0 0 10px rgba(255, 107, 107, 0);
    }
}

.stat-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ff6b6b;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.4);
}

.stat-ikon {
    font-size: 2.5em;
    opacity: 1;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.stat-verdi {
    font-size: 1.8em;
    font-weight: 700;
    color: #ffffff;
    line-height: 1;
}

.stat-label {
    font-size: 0.9em;
    color: #ffffff;
    margin-top: 5px;
}

/* Bestillingskort */
.bestilling-kort {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border: 1px solid #e8dfd0;
    margin-bottom: 25px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.bestilling-kort:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.bestilling-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px 25px;
    background: linear-gradient(135deg, #faf8f5 0%, #f5f0e8 100%);
    border-bottom: 1px solid #e8dfd0;
}

.bestilling-info h3 {
    margin: 0 0 8px;
    font-size: 1.3em;
}

.bestilling-info h3 a {
    color: #3a5f41;
    text-decoration: none;
}

.bestilling-info h3 a:hover {
    color: #8B4513;
}

.bestilling-meta {
    display: flex;
    gap: 15px;
    font-size: 0.9em;
    color: #666;
}

.bestilling-innhold {
    padding: 25px;
}

.bestilling-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-bottom: 25px;
}

.kunde-seksjon,
.detaljer-seksjon,
.levering-seksjon {
    background: #faf8f5;
    padding: 20px;
    border-radius: 12px;
}

.kunde-seksjon h4,
.detaljer-seksjon h4,
.levering-seksjon h4,
.kunde-kommentar h4 {
    margin: 0 0 15px;
    color: #3a5f41;
    font-size: 1.1em;
}

.kunde-info p {
    margin: 5px 0;
}

.kunde-info a {
    color: #8B4513;
    text-decoration: none;
}

.kunde-info a:hover {
    text-decoration: underline;
}

.leveringsadresse-info {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e8dfd0;
}

.leveringsadresse-info .adresse-label {
    margin-bottom: 5px;
    color: #3a5f41;
}

.leveringsadresse-info p {
    margin: 3px 0;
}

.leveringsadresse-info.mangler .ingen-adresse {
    color: #dc3545;
    font-style: italic;
}

.detalj-rad {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #e8dfd0;
}

.detalj-rad:last-child {
    border-bottom: none;
}

.detalj-rad.total {
    margin-top: 10px;
    padding-top: 15px;
    border-top: 2px solid #8B4513;
    font-size: 1.1em;
}

.detalj-rad.total strong {
    color: #8B4513;
}

.leveringsdato-felt {
    margin-top: 15px;
}

.godkjent-dato {
    color: #28a745;
    font-weight: 600;
}

.foreslatt-dato {
    color: #ffc107;
}

.venter-godkjenning {
    font-size: 0.9em;
    color: #666;
    font-style: italic;
}

/* Selger notat/huskelapp */
.selger-notat-seksjon {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed #d4c9b0;
}

.notat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.notat-header span {
    font-weight: 600;
    color: #5a4a3a;
    font-size: 0.95em;
}

.notat-toggle-btn {
    background: transparent;
    border: 1px solid #8B4513;
    color: #8B4513;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.2s;
}

.notat-toggle-btn:hover {
    background: #8B4513;
    color: #fff;
}

.notat-visning {
    background: #fffbf5;
    border-left: 3px solid #ffc107;
    padding: 10px 15px;
    border-radius: 0 8px 8px 0;
    margin-bottom: 10px;
}

.notat-visning p {
    margin: 0;
    color: #5a4a3a;
    font-size: 0.95em;
    line-height: 1.5;
}

.notat-editor {
    background: #faf8f5;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #e8dfd0;
}

.notat-textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #d4c9b0;
    border-radius: 6px;
    font-size: 0.95em;
    resize: vertical;
    min-height: 60px;
    font-family: inherit;
}

.notat-textarea:focus {
    outline: none;
    border-color: #8B4513;
    box-shadow: 0 0 0 2px rgba(139, 69, 19, 0.1);
}

.notat-knapper {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 10px;
}

/* MODERNE LEVERINGSDATO-FORSLAG FRA KUNDE */
.leveringsdato-forslag-fra-kunde-moderne {
    background: linear-gradient(135deg, #fff3cd 0%, #fff8e1 100%);
    border: 2px solid #ffc107;
    border-radius: 12px;
    padding: 20px;
    margin-top: 15px;
    display: flex;
    align-items: flex-start;
    gap: 15px;
    animation: slideIn 0.4s ease-out;
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.2);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.forslag-ikon-moderne {
    font-size: 2.5em;
    line-height: 1;
    flex-shrink: 0;
}

.forslag-innhold-moderne {
    flex: 1;
}

.forslag-overskrift {
    margin: 0 0 10px 0;
    color: #856404;
    font-size: 1.05em;
    font-weight: 600;
}

.forslag-dato-moderne {
    margin: 10px 0 15px 0;
    font-size: 1.15em;
    color: #2d5016;
}

.forslag-dato-moderne strong {
    font-size: 1.25em;
    color: #2d5016;
}

.forslag-tid-moderne {
    margin-left: 10px;
    color: #666;
    font-size: 0.95em;
}

.forslag-handlinger-moderne {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* MODERNE KNAPPER */
.moderne-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    white-space: nowrap;
}

.moderne-btn.btn-success {
    background: #28a745;
    color: white;
}

.moderne-btn.btn-success:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.moderne-btn.btn-warning {
    background: white;
    color: #856404;
    border: 2px solid #ffc107;
}

.moderne-btn.btn-warning:hover {
    background: #ffc107;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3);
}

.moderne-btn.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
    min-height: 36px;
    min-width: 100px;
}

/* PRIMARY knapp - grønn bakgrunn, hvit tekst */
.moderne-btn.btn-primary {
    background: #3a5f41;
    color: white;
    border: 2px solid #3a5f41;
}

.moderne-btn.btn-primary:hover {
    background: #2c4a33;
    border-color: #2c4a33;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(58, 95, 65, 0.3);
}

/* OUTLINE knapp - hvit bakgrunn, grønn tekst/border */
.moderne-btn.btn-outline {
    background: white;
    color: #3a5f41;
    border: 2px solid #3a5f41;
}

.moderne-btn.btn-outline:hover {
    background: #3a5f41;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(58, 95, 65, 0.3);
}

/* Sikre lik størrelse på alle knapper i bestilling-handlinger */
.bestilling-handlinger .moderne-btn {
    padding: 8px 16px;
    font-size: 13px;
    min-height: 36px;
    font-weight: 600;
}

/* MODAL INFO-BOKS */
.modal-info-boks {
    background: linear-gradient(135deg, #e8f5e9 0%, #f0f7ff 100%);
    border-left: 4px solid #2d5016;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 20px;
}

.modal-info-boks p {
    margin: 0;
    color: #2d5016;
    font-size: 14px;
    line-height: 1.5;
    font-weight: 500;
}

.kunde-kommentar {
    background: #fff3cd;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.kunde-kommentar p {
    margin: 0;
    line-height: 1.6;
}

/* Handlinger */
.bestilling-handlinger {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    padding-top: 20px;
    border-top: 1px solid #e8dfd0;
}

/* Faktura status badge */
.faktura-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    color: #2e7d32;
    border: 1px solid #a5d6a7;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
}

/* Send faktura knapp styling */
.bestilling-handlinger .send-faktura {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    color: #e65100;
    border-color: #ffcc80;
}

.bestilling-handlinger .send-faktura:hover {
    background: linear-gradient(135deg, #ffe0b2 0%, #ffcc80 100%);
    border-color: #ffb74d;
}

/* Responsive */
@media (max-width: 768px) {
    .anbud-seksjon-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .anbud-header-handlinger {
        flex-direction: column;
    }
    
    .statistikk-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .bestilling-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    /* Kompakt seksjoner paa mobil */
    .kunde-seksjon,
    .detaljer-seksjon,
    .levering-seksjon {
        padding: 12px;
        border-radius: 8px;
    }
    
    .kunde-seksjon h4,
    .detaljer-seksjon h4,
    .levering-seksjon h4,
    .kunde-kommentar h4 {
        font-size: 1rem;
        margin-bottom: 10px;
    }
    
    .kontakt-melding-info {
        padding: 8px 10px;
        font-size: 12px;
        margin-bottom: 10px;
    }
    
    .leveringsadresse-info {
        margin-top: 10px;
        padding-top: 10px;
    }
    
    .detalj-rad {
        padding: 5px 0;
        font-size: 0.9em;
    }
    
    .bestilling-handlinger {
        flex-direction: column;
        gap: 8px;
        padding-top: 12px;
    }
    
    .bestilling-handlinger .anbud-btn {
        width: 100%;
        justify-content: center;
        padding: 10px 15px;
    }
    
    .bestilling-kort {
        padding: 12px;
    }
    
    .bestilling-innhold {
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .statistikk-grid {
        grid-template-columns: 1fr;
    }
    
    .bestilling-header {
        flex-direction: column;
        gap: 10px;
    }
    
    .kunde-seksjon,
    .detaljer-seksjon,
    .levering-seksjon {
        padding: 10px;
    }
}

/* Admin footer - sikre synlige knapper paa mobil */
.bestilling-admin-footer .anbud-btn-link {
    color: #475569 !important;
    background: transparent !important;
    border: none !important;
    font-size: 13px;
}
.bestilling-admin-footer .anbud-btn-link:hover,
.bestilling-admin-footer .anbud-btn-link:active {
    color: #1e293b !important;
    background: transparent !important;
}
.admin-more-menu .anbud-btn-link {
    color: #475569 !important;
}
@media (max-width: 768px) {
    .bestilling-admin-footer .anbud-btn-link {
        color: #334155 !important;
        font-size: 14px;
        padding: 8px 10px;
    }
}

/* Suksessmelding - MIDTSTILT OG TYDELIG */
.anbud-suksess-melding {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    color: #2d5016;
    padding: 40px 60px;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    z-index: 999999;
    font-size: 20px;
    font-weight: 600;
    text-align: center;
    border: 3px solid #2d5016;
    animation: popIn 0.3s ease-out;
    max-width: 500px;
    line-height: 1.6;
}

.anbud-suksess-melding::before {
    content: '';
    font-size: 50px;
    display: block;
    margin-bottom: 15px;
}

.anbud-suksess-melding small {
    display: block;
    font-size: 14px;
    font-weight: normal;
    color: #666;
    margin-top: 15px;
}

@keyframes popIn {
    from {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 0;
    }
    to {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

/* Overlay bak meldingen */
.anbud-melding-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 999998;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* TOAST NOTIFICATIONS - Vises oeverst uten sideoppdatering */
.anbud-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 15px;
    z-index: 999999;
    transform: translateX(120%);
    transition: transform 0.3s ease;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    max-width: 400px;
}

.anbud-toast.show {
    transform: translateX(0);
}

.anbud-toast-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    border: 1px solid #28a745;
}

.anbud-toast-error {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
    border: 1px solid #dc3545;
}

/* SPINNER for loading states */
.anbud-spinner {
    display: inline-block;
    padding: 10px 20px;
    color: #666;
    font-style: italic;
}

.anbud-spinner::before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #ddd;
    border-top-color: #2d5016;
    border-radius: 50%;
    margin-right: 8px;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Fullfoert ordre tekst */
.bestilling-fullfort-tekst {
    display: inline-block;
    padding: 10px 20px;
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    border-radius: 8px;
    font-weight: 600;
}

/* MODAL FOR LEVERINGSDATO */
.anbud-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.6) !important;
    z-index: 999999 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: auto !important;
}

.anbud-modal-innhold {
    position: relative !important;
    background: white;
    border-radius: 15px;
    max-width: 600px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 10px 50px rgba(0,0,0,0.3);
    margin: auto;
    transform: none !important;
}

.anbud-modal-header {
    background: linear-gradient(135deg, #2d5016 0%, #3d6b1e 100%);
    color: white;
    padding: 25px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 15px 15px 0 0;
}

.anbud-modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
    color: white !important;
    font-weight: 600;
}

.anbud-lukk-modal {
    background: none;
    border: none;
    color: white;
    font-size: 42px !important;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.anbud-lukk-modal:hover {
    background: rgba(255,255,255,0.2);
    transform: scale(1.1);
}

.anbud-modal-body {
    padding: 30px;
}

.anbud-form-gruppe {
    margin-bottom: 20px;
}

.anbud-form-gruppe label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2d5016;
}

.anbud-form-gruppe input[type="date"],
.anbud-form-gruppe textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e8dfd0;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s ease;
}

.anbud-form-gruppe input[type="date"]:focus,
.anbud-form-gruppe textarea:focus {
    outline: none;
    border-color: #2d5016;
    box-shadow: 0 0 0 3px rgba(45, 80, 22, 0.1);
}

.anbud-modal-handlinger {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 30px;
}

/* DATO FORSLAG KNAPPER */
.dato-forslag-knapper {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.dato-forslag-knapper .anbud-btn {
    padding: 8px 20px;
    border-radius: 6px;
    font-weight: 500;
    font-size: 14px;
    border: 2px solid;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dato-forslag-knapper .anbud-btn-success {
    background: #28a745;
    color: white;
    border-color: #28a745;
}

.dato-forslag-knapper .anbud-btn-success:hover {
    background: #218838;
    border-color: #1e7e34;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}

.dato-forslag-knapper .anbud-btn-outline {
    background: white;
    color: #856404;
    border-color: #ffc107;
}

.dato-forslag-knapper .anbud-btn-outline:hover {
    background: #ffc107;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(255, 193, 7, 0.3);
}

/* ========================================
   SELGER STATUSFLYT
   Timeline for ordre-fremdrift
   ======================================== */

.selger-statusflyt-container {
    padding: 16px 20px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    border-bottom: 1px solid #e9ecef;
    margin: 0;
}

.selger-statusflyt {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    max-width: 550px;
    margin: 0 auto;
}

.selger-status-steg {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    z-index: 2;
    position: relative;
}

.selger-status-sirkel {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    border: 3px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.selger-status-sirkel.aktiv {
    background: #28a745;
}

.selger-status-sirkel.gjeldende {
    background: #ffc107;
    animation: selger-pulse 2s infinite;
    transform: scale(1.1);
}

@keyframes selger-pulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.5); }
    70% { box-shadow: 0 0 0 10px rgba(255, 193, 7, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 193, 7, 0); }
}

.selger-status-steg .selger-status-tekst {
    font-size: 11px;
    color: #666;
    text-align: center;
    white-space: nowrap;
    font-weight: 500;
}

.selger-statusflyt-linje {
    position: absolute;
    top: 18px;
    left: 35px;
    right: 35px;
    height: 3px;
    background: #e9ecef;
    z-index: 1;
}

.selger-statusflyt-fremdrift {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #20c997);
    transition: width 0.5s ease;
    border-radius: 3px;
}

/* Selger status info boks */
.selger-status-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 14px;
    padding: 14px 16px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 10px;
    border: 1px solid #e9ecef;
    border-left: 4px solid #ffc107;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    flex-wrap: wrap;
}

.selger-status-info-innhold {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex: 1;
    min-width: 200px;
}

.selger-status-ikon {
    font-size: 24px;
    flex-shrink: 0;
    line-height: 1;
}

.selger-status-tekst-blokk {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.selger-status-beskrivelse {
    font-size: 14px;
    line-height: 1.4;
    color: #495057;
}

.selger-status-neste {
    font-size: 13px;
    color: #2d5016;
    background: #e8f5e9;
    padding: 4px 10px;
    border-radius: 20px;
    display: inline-block;
    margin-top: 4px;
}

.selger-status-neste strong {
    color: #1b5e20;
}

/* Kontakt kunde knapp */
.selger-kontakt-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    background: linear-gradient(135deg, #3d6b1e 0%, #2d5016 100%);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(45, 80, 22, 0.25);
    white-space: nowrap;
    flex-shrink: 0;
}

.selger-kontakt-btn:hover {
    background: linear-gradient(135deg, #4a7d26 0%, #3a6520 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(45, 80, 22, 0.35);
}

.selger-kontakt-btn:active {
    transform: translateY(0);
}

/* Responsiv for selger-statusflyt */
@media (max-width: 600px) {
    .selger-statusflyt {
        max-width: 100%;
    }
    
    .selger-status-sirkel {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .selger-statusflyt-linje {
        top: 16px;
        left: 30px;
        right: 30px;
    }
    
    .selger-status-steg .selger-status-tekst {
        font-size: 10px;
    }
    
    .selger-status-info {
        flex-direction: column;
        align-items: stretch;
    }
    
    .selger-kontakt-btn {
        width: 100%;
        justify-content: center;
        margin-top: 8px;
    }
    
    .selger-status-neste {
        display: block;
        text-align: center;
    }
}
