/* --- 1. ROOT & FONTS --- */
:root {
    --brons-blue: #00126b;
    --brons-blue-light: rgba(0, 18, 107, 0.05);
    --success-green: #10b981;
    --urgent-red: #ef4444;
    --warning-orange: #f59e0b;
    --glass-bg: rgba(255, 255, 255, 0.25);
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
}

/* --- 2. BASE LAYOUT & BOARD --- */
.brons-planner-wrap {
    background: linear-gradient(135deg, #f0f4f8 0%, #d7e3ed 100%) !important;
    font-family: 'Inter', -apple-system, sans-serif !important;
    padding: 10px !important;
    min-height: 100vh;
    color: var(--text-main);
}

@media (min-width: 1024px) {
    .brons-planner-wrap { padding: 30px !important; }
}

.planner-board {
    display: flex !important;
    align-items: flex-start;
    gap: 20px;
    padding-bottom: 50px; /* Luft i bunden til scrollbar */
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    min-height: calc(100vh - 200px);
}

/* --- 3. COLUMN WIDTHS --- */
.planner-column {
    background: var(--glass-bg) !important;
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    border-radius: 24px !important;
    padding: 15px !important;
    flex-shrink: 0;
    flex: 0 0 94vw !important;
    width: 94vw !important;
    box-sizing: border-box !important;
}

@media (min-width: 1024px) {
    .planner-column {
        flex: 0 0 450px !important;
        width: 450px !important;
        max-width: 450px !important;
        padding: 25px !important;
        margin-right: 25px !important;
    }
    .planner-board { gap: 25px; }
}

.column-header h3 {
    color: var(--text-main);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    font-weight: 900;
    border-bottom: 3px solid var(--brons-blue);
    display: inline-block;
    margin-bottom: 20px;
    padding-bottom: 8px;
}

.card-list {
    max-height: calc(100vh - 250px);
    overflow-y: auto;
    padding-right: 5px;
}

/* --- 4. DYNAMISK HEADER & BRAND SELECTOR --- */
.planner-header {
    background-color: <?php echo $active_brand_color; ?>;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 25px;
    transition: background-color 0.4s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-radius: 12px 12px 0 0;
    margin-bottom: 20px;
    gap: 15px;
    position: relative;
    flex-wrap: nowrap;
}

#planner-search {
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.17);
    width: 100%;
    padding: 12px 18px;
    border-radius: 25px;
    font-size: 14px;
    outline: none;
    color: #fff;
    transition: all 0.3s ease;
}

#planner-search::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

#planner-search:focus {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.25);
}

.brand-selector-desktop { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.brand-selector-mobile { display: none; }
.burger-menu-btn { display: none !important; }
.mobile-menu { display: none !important; }

.desktop-brand-dropdown {
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.15);
    color: #fff;
    font-weight: 600;
    min-width: 200px;
}

@media (max-width: 1024px) {
    .brand-selector-desktop { display: none; }
    .brand-selector-mobile { display: block; }
}

.brand-tab {
    background: rgba(255,255,255,0.15);
    color: #fff !important;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 8px 16px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.2s;
    white-space: nowrap;
}

.brand-tab:hover { background: rgba(255,255,255,0.25); transform: translateY(-2px); }

.brand-tab.active {
    background: #fff;
    color: var(--brons-blue) !important;
    border-color: #fff;
    box-shadow: 0 10px 15px -3px rgba(0, 18, 107, 0.3);
}

.brand-logo-display img {
    max-height: 34px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

/* --- 5. TASK CARDS --- */
.task-card {
    background: var(--card-bg) !important;
    border-radius: 18px !important;
    margin-bottom: 20px !important;
    border-left: 12px solid var(--brand-color, #cbd5e1) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05) !important;
    width: 100% !important;
    box-sizing: border-box !important;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.4s ease, border-color 0.4s ease !important;
    position: relative;
    overflow: hidden;
}

.task-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1) !important;
}

.task-card.is-ready-for-review {
    animation: pulse-ready 2s infinite !important;
    border: 2px solid var(--success-green) !important;
    border-left: 14px solid var(--success-green) !important; 
    background: #f0fff4 !important;
}

.card-inner { padding: 18px !important; width: 100%; box-sizing: border-box; }

.card-title { 
    font-size: 18px !important; 
    font-weight: 800; 
    color: #0f172a; 
    margin: 0 0 8px 0 !important; 
    line-height: 1.2; 
    cursor: pointer;
}

.card-title:hover { text-decoration: underline; color: var(--brons-blue); }

/* --- 6. BADGES & LABELS --- */
.card-top-meta { display: flex; gap: 5px; margin-bottom: 8px; flex-wrap: wrap; }

.mini-badge { 
    font-size: 11px; 
    font-weight: 800; 
    background: #f1f5f9; 
    padding: 6px 10px; 
    border-radius: 6px; 
    color: #374151; 
    border: 1px solid #e2e8f0; 
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 120px;
    justify-content: space-between;
}

.badge-so {
    font-size: 10px;
    font-weight: 900;
    background: #1e293b;
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
}

.rekl-badge {
    background-color: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
    font-size: 13px !important;
    padding: 4px 10px !important;
    border-radius: 6px;
    font-weight: 800 !important;
    display: inline-flex;
    align-items: center;
    text-transform: uppercase;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.rekl-badge::before {
    content: "⚠️";
    margin-right: 4px;
    font-size: 11px;
}

.rekl-badge:hover {
    background-color: #fee2e2;
    border-color: #f87171;
}

.copy-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0 4px;
    font-size: 13px;
    color: #475569;
    opacity: 0.8;
    transition: opacity 0.15s ease, color 0.15s ease;
}

.copy-btn:hover {
    opacity: 1;
    color: var(--brons-blue);
}

.send-to-lager {
    background: var(--brons-blue);
    border: none;
    color: #fff;
    border-radius: 8px;
    padding: 4px 8px;
    font-size: 12px;
    cursor: pointer;
    margin-left: 8px;
    flex-shrink: 0;
}

.send-to-lager:hover {
    background: rgba(0, 18, 107, 0.85);
}

/* --- 7. CARD CONTENT & INFO BOX --- */
.card-info-box { 
    background: #f8fafc; 
    padding: 12px; 
    border-radius: 12px; 
    margin: 10px 0; 
    font-size: 12px; 
    border: 1px solid #e2e8f0; 
}

.info-line { margin-bottom: 4px; color: #475569; }
.card-customer { font-weight: 600; color: #1e293b; }

.central-label-monteret { color: #166534; font-weight: 800; }
.central-label-bestilt { color: #854d0e; font-weight: 800; }
.central-label-ikke-bestilt { color: #ef4444; font-weight: 800; }

/* Dækombyt status labels */
.daekombyt-label-planlagt { color: #854d0e; font-weight: 800; }
.daekombyt-label-bestilt { color: #b45309; font-weight: 800; }
.daekombyt-label-udfort { color: #166534; font-weight: 800; }

.card-instruction-preview { 
    font-size: 12px; 
    color: #475569; 
    font-style: italic; 
    background: #f8fafc; 
    padding: 10px; 
    border-radius: 8px; 
    margin: 10px 0; 
    border-left: 3px solid #cbd5e1; 
}

.card-done-stats { 
    background: #f0fff4; 
    padding: 12px; 
    border-radius: 10px; 
    border: 1px dashed var(--success-green); 
    margin: 10px 0; 
}

.stat-note { font-size: 11px; color: #15803d; margin-top: 5px; }

.card-checklist-mini { 
    margin: 10px 0; 
    padding: 8px; 
    background: #f8fafc; 
    border-radius: 10px; 
}
.mini-check-row { 
    display: flex; 
    align-items: center; 
    gap: 8px; 
    font-size: 11px; 
    padding: 3px 0; 
    cursor: pointer; 
}
.mini-dot { 
    width: 8px; height: 8px; 
    border-radius: 50%; 
    border: 1.5px solid #cbd5e1; 
    transition: background-color 0.3s ease, border-color 0.3s ease;
}
.mini-check-row span { transition: color 0.3s ease, text-decoration 0.3s ease; }
.mini-check-row.is-checked span { text-decoration: line-through; color: #94a3b8; }
.mini-check-row.is-checked .mini-dot { background: var(--success-green); border-color: var(--success-green); }

/* Parts status indicators on cards */
.card-checklist-mini.parts-fulfilled { background: #fefce8 !important; border: 1px solid #fde047; }
.mini-check-row.parts-status-fulfilled .mini-dot { background: #eab308; border-color: #eab308; }
.mini-check-row.parts-status-bestilt .mini-dot { background: #f59e0b; border-color: #f59e0b; }
.mini-parts-status { font-size: 9px; font-weight: 700; padding: 1px 6px; border-radius: 4px; margin-left: auto; white-space: nowrap; }
.mini-parts-status.parts-status-fulfilled { background: #fef9c3; color: #854d0e; }
.mini-parts-status.parts-status-bestilt { background: #fff7ed; color: #9a3412; }
.fokus-check-row.parts-status-fulfilled { background: #fefce8 !important; border-color: #fde047 !important; }
.fokus-check-row.parts-status-bestilt { background: #fff7ed !important; border-color: #fed7aa !important; }

/* --- 8. ALERTS & ACTIONS --- */
.alert-strip {
    background: #ef4444;
    color: white;
    font-size: 10px;
    font-weight: 900;
    text-align: center;
    padding: 4px;
    border-radius: 0;
    margin: -18px -18px 12px -18px; 
    animation: pulse-red 2s infinite;
}

.card-actions-row { display: flex; gap: 8px; margin-top: 15px; }

.btn-move-top {
    background: transparent;
    border: none;
    color: #cbd5e1; 
    cursor: pointer;
    font-size: 10px;
    padding: 2px 5px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.btn-move-top:hover {
    color: var(--brons-blue); 
    background: #f1f5f9;
    transform: translateY(-2px);
}

.btn-main-fokus { 
    flex: 1; 
    background: var(--brons-blue); 
    color: #fff; 
    border: none; 
    padding: 10px; 
    border-radius: 12px; 
    font-weight: 700; 
    cursor: pointer; 
    transition: background 0.2s; 
}
.btn-main-fokus:hover { background: #000b4d; }

.btn-check-finish {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: none;
    background: #e2e8f0;
    color: #94a3b8;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.btn-check-finish.pulse-button {
    background: #10b981;
    color: white;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
    animation: pulse-green-small 2s infinite;
}

.btn-check-finish.is-disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

/* --- 9. MODAL & FOKUS MODE --- */
.custom-modal {
    display: none; 
    position: fixed; 
    z-index: 999999; 
    left: 0; top: 0; 
    width: 100vw; height: 100vh;
    background: rgba(15, 23, 42, 0.9); 
    backdrop-filter: blur(10px);
    align-items: center; 
    justify-content: center;
}

.modal-content {
    background: #fff;
    width: 95%;
    max-width: 1150px;
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    height: 85vh;
    overflow: hidden;
}

#fokus-header {
    padding: 20px 30px;
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--brons-blue);
}

.fokus-grid-layout { display: grid; grid-template-columns: 1fr 380px; flex: 1; overflow: hidden; }
.fokus-left-panel { padding: 30px; overflow-y: auto; border-right: 1px solid #eee; background: #fcfcfc; }
.fokus-right-panel { 
    padding: 30px; 
    background: #f1f5f9; 
    display: flex; 
    flex-direction: column; 
    border-left: 1px solid #e2e8f0;
}

.ux-select, .ux-input {
    width: 100%;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    font-size: 14px;
    box-sizing: border-box;
}

/* Fokus modal checklist table styling */
#fokus-checklist-area table,
#fokus-parts-checklist-area table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    margin-bottom: 10px;
}

#fokus-checklist-area table th,
#fokus-parts-checklist-area table th {
    background: #f1f5f9;
    padding: 8px;
    text-align: left;
    font-weight: 700;
    color: #475569;
}

#fokus-checklist-area table td,
#fokus-parts-checklist-area table td {
    padding: 8px;
    border-bottom: 1px solid #e2e8f0;
}

#fokus-checklist-area table select,
#fokus-parts-checklist-area table select {
    width: 100%;
    padding: 4px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-size: 12px;
}

.fokus-check-row {
    display: flex;
    align-items: center;
    padding: 12px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: 0.2s;
}

.fokus-check-row.is-checked {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.4);
}

.fokus-check-row.is-checked .custom-check {
    background: var(--success-green);
    border-color: var(--success-green);
}

.fokus-check-row.is-checked span {
    text-decoration: line-through;
    color: #94a3b8;
}

.custom-check {
    width: 20px;
    height: 20px;
    border: 2px solid #cbd5e1;
    border-radius: 6px;
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    flex-shrink: 0;
}

.ck-text {
    flex: 1;
    font-size: 14px;
    color: #1e293b;
    font-weight: 500;
}

.parts-status-select {
    padding: 6px 8px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 12px;
    margin-right: 8px;
    background: #fff;
    color: #1e293b;
    cursor: pointer;
    transition: border-color 0.2s;
}

.parts-status-select:hover {
    border-color: #94a3b8;
}

.parts-status-select:focus {
    outline: none;
    border-color: var(--brons-blue);
    box-shadow: 0 0 0 3px rgba(0, 18, 107, 0.1);
}

.delete-check-item {
    flex-shrink: 0;
    cursor: pointer;
    color: #94a3b8;
    font-weight: 700;
    font-size: 16px;
    transition: color 0.2s;
    padding: 4px 8px;
}

.delete-check-item:hover {
    color: var(--urgent-red);
}

/* Skjul slet-knap på opgavekortet — kun synlig i Fokus-modal */
.task-card .delete-check-item {
    display: none !important;
}

.order-box { 
    background: #fff; 
    padding: 15px; 
    border-radius: 12px; 
    border: 1px solid #e2e8f0; 
}
.central-box { border-left: 5px solid var(--brons-blue); }
.parts-box { border-left: 5px solid var(--urgent-red); }

/* --- 10. MOBIL OPTIMERING (Under 768px) --- */
@media (max-width: 768px) {
    .planner-header {
        flex-direction: column;
        padding: 15px;
        align-items: stretch;
    }

    .brand-selector-desktop { display: none; }
    .brand-selector-mobile { display: block; order: 1; }
    
    .search-container { 
        max-width: 100% !important; 
        order: 2; 
    }
    
    #planner-search {
        padding: 14px 20px;
        font-size: 16px; 
    }

    .brand-logo-display { 
        order: 3; 
        justify-content: center !important; 
        display: flex;
        margin-top: 10px; 
    }

    .mobile-brand-dropdown {
        width: 100%;
        padding: 12px;
        border-radius: 8px;
        background: rgba(255,255,255,0.2);
        color: white;
        font-size: 16px;
        font-weight: 600;
        border: 1px solid rgba(255,255,255,0.4);
    }
    
    .mobile-brand-dropdown option { color: #333; background: #fff; }

    .modal-content {
        width: 100% !important;
        height: 100% !important;
        border-radius: 0 !important;
        overflow-y: auto !important;
    }
    .fokus-grid-layout {
        flex-direction: column !important;
        padding: 10px !important;
        display: block;
    }
    .fokus-right-panel {
        width: 100% !important;
        border-top: 2px solid #ddd;
    }
    #fokus-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    /* Burger Menu - Mobile only */
    .burger-menu-btn {
        display: flex !important;
        flex-direction: column;
        gap: 5px;
        background: rgba(255, 255, 255, 0.2);
        border: 1px solid rgba(255, 255, 255, 0.3);
        padding: 8px 12px;
        border-radius: 8px;
        cursor: pointer;
        transition: all 0.3s ease;
        order: 99;
        flex-shrink: 0;
    }

    .burger-menu-btn:hover {
        background: rgba(255, 255, 255, 0.3);
    }

    .burger-menu-btn span {
        width: 24px;
        height: 2px;
        background: #fff;
        display: block;
        transition: all 0.3s ease;
        border-radius: 2px;
    }

    .burger-menu-btn.active span:nth-child(1) {
        transform: rotate(45deg) translate(8px, 8px);
    }

    .burger-menu-btn.active span:nth-child(2) {
        opacity: 0;
    }

    .burger-menu-btn.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }

    /* Mobile Menu */
    .mobile-menu {
        display: block !important;
        position: absolute;
        top: 100%;
        right: 0;
        left: 0;
        background: rgba(0, 0, 0, 0.95);
        backdrop-filter: blur(10px);
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        z-index: 1000;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }

    .mobile-menu.active {
        max-height: 300px;
    }

    .mobile-menu-content {
        padding: 15px;
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .mobile-menu-item {
        width: 100%;
    }

    .mobile-menu-item select {
        width: 100%;
    }
}

/* --- 11. ANIMATIONS KEYFRAMES
@keyframes pulse-red {
    0% { background: #ef4444; }
    50% { background: #991b1b; }
    100% { background: #ef4444; }
}

@keyframes pulse-ready {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5); transform: scale(1); }
    70% { box-shadow: 0 0 0 15px rgba(16, 185, 129, 0); transform: scale(1.015); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); transform: scale(1); }
}

@keyframes pulse-green-small {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1.1); box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

 --- */