/* =========================================
   KOLLEGAER.DK - KOMPLET APP STYLESHEET
========================================= */

/* TEMAER & FARVESKALAER */
.hvh-app-scope[data-theme="theme-blue"]   { --t-h: 220; --t-s: 75%; }
.hvh-app-scope[data-theme="theme-green"]  { --t-h: 140; --t-s: 65%; }
.hvh-app-scope[data-theme="theme-sunset"] { --t-h: 15;  --t-s: 85%; }
.hvh-app-scope[data-theme="theme-purple"] { --t-h: 270; --t-s: 70%; }
.hvh-app-scope[data-theme="theme-ruby"]   { --t-h: 345; --t-s: 80%; }
.hvh-app-scope[data-theme="theme-teal"]   { --t-h: 180; --t-s: 80%; }
.hvh-app-scope[data-theme="theme-slate"]  { --t-h: 215; --t-s: 15%; }

.hvh-app-scope {
    --hvh-bg-color: #0b1329;
    --hvh-text: #f8fafc;
    --hvh-text-muted: #94a3b8;
    --hvh-border: rgba(255, 255, 255, 0.12);
    --hvh-line-color: hsl(var(--t-h), var(--t-s), 50%);
    --hvh-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
    --hvh-radius: 14px;
    --heart-active: #EF4444;

    --lvl-1-c1: hsl(var(--t-h), var(--t-s), 14%); --lvl-1-c2: hsl(var(--t-h), var(--t-s), 6%);
    --lvl-2-c1: hsl(var(--t-h), var(--t-s), 18%); --lvl-2-c2: hsl(var(--t-h), var(--t-s), 9%);
    --lvl-3-c1: hsl(var(--t-h), var(--t-s), 22%); --lvl-3-c2: hsl(var(--t-h), var(--t-s), 11%);

    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    background-color: var(--hvh-bg-color) !important;
    color: var(--hvh-text) !important;
    padding: 16px 20px !important;
    box-sizing: border-box !important;
    width: 100% !important;
    min-height: 100vh !important;
    position: relative !important;
}

.hvh-app-scope * { box-sizing: border-box !important; }
.hvh-app-scope[data-pattern="pattern-dots"] { background-image: radial-gradient(rgba(255, 255, 255, 0.08) 1.5px, transparent 1.5px) !important; background-size: 24px 24px !important; }

/* STYRING AF SKUFFE & MODAL (SKJULER DEM SOM STANDARD) */
.hvh-drawer {
    position: fixed !important;
    top: 0 !important;
    right: -420px !important;
    width: 400px !important;
    height: 100vh !important;
    background: #0f172a !important;
    border-left: 1px solid var(--hvh-border) !important;
    z-index: 99999 !important;
    transition: right 0.3s ease !important;
    display: flex !important;
    flex-direction: column !important;
    box-shadow: -10px 0 30px rgba(0,0,0,0.5) !important;
}
.hvh-drawer.open { right: 0 !important; }

.hvh-drawer-header { padding: 20px !important; background: #1e293b !important; display: flex !important; justify-content: space-between !important; align-items: center !important; }
.hvh-drawer-header h4 { margin: 0 !important; color: #fff !important; font-size: 1.1rem !important; }
.hvh-drawer-header button { background: transparent !important; border: none !important; color: var(--hvh-text-muted) !important; cursor: pointer !important; font-weight: bold !important; }

.hvh-drawer-tabs { display: flex !important; background: #0f172a !important; border-bottom: 1px solid var(--hvh-border) !important; }
.hvh-drawer-tab-btn { flex: 1 !important; padding: 12px 0 !important; background: transparent !important; border: none !important; color: var(--hvh-text-muted) !important; font-weight: 600 !important; cursor: pointer !important; }
.hvh-drawer-tab-btn.active { color: #60a5fa !important; border-bottom: 2px solid #60a5fa !important; }

.hvh-drawer-body { padding: 20px !important; overflow-y: auto !important; flex: 1 !important; }
.hvh-drawer-pane { display: none !important; }
.hvh-drawer-pane.active { display: block !important; }

/* MODAL OVERLAY */
.hvh-modal-overlay {
    display: none !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.75) !important;
    backdrop-filter: blur(5px) !important;
    z-index: 999999 !important;
    align-items: center !important;
    justify-content: center !important;
}
.hvh-modal-overlay.open { display: flex !important; }

.hvh-modal-content {
    background: #0f172a !important;
    border: 1px solid var(--hvh-border) !important;
    border-radius: 16px !important;
    width: 90% !important;
    max-width: 800px !important;
    overflow: hidden !important;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.7) !important;
}
.hvh-modal-header { padding: 16px 24px !important; background: #1e293b !important; display: flex !important; justify-content: space-between !important; align-items: center !important; }
.hvh-modal-header button { background: transparent !important; border: none !important; color: #94a3b8 !important; cursor: pointer !important; font-weight: bold !important; }

/* INPUT FELTER I ADMIN */
.hvh-control-group { margin-bottom: 14px !important; }
.hvh-control-group label { display: block !important; font-size: 0.8rem !important; color: var(--hvh-text-muted) !important; margin-bottom: 4px !important; }
.hvh-control-group input, .hvh-control-group select, .hvh-control-group textarea {
    width: 100% !important;
    padding: 8px 12px !important;
    background: #1e293b !important;
    border: 1px solid #334155 !important;
    border-radius: 6px !important;
    color: #fff !important;
    font-size: 0.9rem !important;
}

/* TOPBAR DESKTOP */
.hvh-topbar-header { display: flex !important; align-items: center !important; justify-content: space-between !important; gap: 12px !important; padding-bottom: 14px !important; border-bottom: 1px solid var(--hvh-border) !important; flex-wrap: wrap !important; }
.hvh-brand { display: flex !important; align-items: center !important; gap: 12px !important; }
.hvh-stok-logo-img { height: 36px !important; width: auto !important; object-fit: contain !important; }
.hvh-badge { background: rgba(255,255,255,0.1) !important; color: #fff !important; border: 1px solid rgba(255,255,255,0.2) !important; font-size: 0.75rem !important; font-weight: 600 !important; padding: 4px 10px !important; border-radius: 20px !important; }

.hvh-search-box-top input { width: 220px !important; padding: 8px 12px !important; border: 1px solid var(--hvh-border) !important; border-radius: 8px !important; background: rgba(30, 41, 59, 0.7) !important; color: #fff !important; }
.hvh-filter-box-top select { padding: 8px 12px !important; border: 1px solid var(--hvh-border) !important; border-radius: 8px !important; background: rgba(30, 41, 59, 0.7) !important; color: #fff !important; }

.hvh-view-switcher-top { display: flex !important; gap: 3px !important; background: rgba(15, 23, 42, 0.8) !important; border: 1px solid var(--hvh-border) !important; padding: 3px !important; border-radius: 8px !important; }
.hvh-tab-btn { border: none !important; background: transparent !important; padding: 6px 12px !important; font-size: 0.82rem !important; font-weight: 600 !important; border-radius: 6px !important; cursor: pointer !important; color: var(--hvh-text-muted) !important; }
.hvh-tab-btn.active { background: var(--hvh-line-color) !important; color: #fff !important; }

.hvh-edit-toggle-btn, .hvh-primary-btn { background: #2563eb !important; color: #fff !important; border: none !important; padding: 8px 16px !important; border-radius: 8px !important; font-weight: 600 !important; cursor: pointer !important; }
.hvh-view-toggle { display: none !important; }

/* BREADCRUMB */
.hvh-breadcrumb { padding: 12px 0 !important; font-size: 0.85rem !important; color: var(--hvh-text-muted) !important; }
.hvh-crumb { cursor: pointer !important; text-decoration: underline !important; }
.hvh-crumb.active { color: #fff !important; font-weight: 700 !important; text-decoration: none !important; }

/* KORT VISNING & FLIP ANIMATION */
.hvh-card-container { perspective: 1000px !important; width: 210px !important; height: 290px !important; cursor: pointer !important; margin: 0 auto !important; position: relative !important; }
.hvh-level-1a { width: 225px !important; height: 305px !important; }
.hvh-level-2 { width: 200px !important; height: 280px !important; }

.hvh-card-inner { position: relative !important; width: 100% !important; height: 100% !important; text-align: center !important; transition: transform 0.6s !important; transform-style: preserve-3d !important; border-radius: var(--hvh-radius) !important; box-shadow: var(--hvh-shadow) !important; }
.hvh-card-container.flipped .hvh-card-inner { transform: rotateY(180deg) !important; }

.hvh-card-front, .hvh-card-back { position: absolute !important; width: 100% !important; height: 100% !important; backface-visibility: hidden !important; border-radius: var(--hvh-radius) !important; border: 1px solid rgba(255,255,255,0.12) !important; overflow: hidden !important; display: flex !important; flex-direction: column !important; }
.hvh-card-front { background: linear-gradient(145deg, var(--lvl-2-c1), var(--lvl-2-c2)) !important; }
.hvh-card-back { background: #0f172a !important; transform: rotateY(180deg) !important; padding: 14px !important; text-align: left !important; font-size: 0.75rem !important; }

.hvh-photo-container { width: 100% !important; height: 50% !important; position: relative !important; overflow: hidden !important; }
.hvh-hero-photo { width: 100% !important; height: 100% !important; object-fit: cover !important; }

.hvh-card-body { padding: 8px 10px !important; flex: 1 !important; display: flex !important; flex-direction: column !important; justify-content: center !important; }
.hvh-card-body h4 { margin: 0 0 2px 0 !important; font-size: 0.95rem !important; color: #fff !important; }
.hvh-card-title { font-size: 0.75rem !important; color: var(--hvh-text-muted) !important; margin-bottom: 6px !important; }
.hvh-tag { display: inline-block !important; font-size: 0.65rem !important; font-weight: 700 !important; background: rgba(255,255,255,0.1) !important; color: #60a5fa !important; padding: 2px 8px !important; border-radius: 4px !important; }

.hvh-drill-btn { background: rgba(255,255,255,0.08) !important; border: none !important; border-top: 1px solid var(--hvh-border) !important; color: #94a3b8 !important; font-size: 0.72rem !important; font-weight: 600 !important; padding: 6px 0 !important; width: 100% !important; cursor: pointer !important; }
.hvh-drill-btn:hover { background: rgba(255,255,255,0.15) !important; color: #fff !important; }

/* REDIGER BLYANT & HJERTER */
.hvh-edit-pencil { display: none; position: absolute !important; top: 8px !important; left: 8px !important; background: rgba(0,0,0,0.6) !important; width: 28px !important; height: 28px !important; border-radius: 50% !important; align-items: center !important; justify-content: center !important; font-size: 0.8rem !important; z-index: 25 !important; cursor: pointer !important; }
.hvh-edit-mode .hvh-edit-pencil { display: flex !important; }

.hvh-fav-btn { position: absolute !important; top: 8px !important; right: 8px !important; background: rgba(0, 0, 0, 0.4) !important; backdrop-filter: blur(4px) !important; border: 1px solid rgba(255,255,255,0.2) !important; width: 28px !important; height: 28px !important; border-radius: 50% !important; display: flex !important; align-items: center !important; justify-content: center !important; font-size: 0.9rem !important; cursor: pointer !important; z-index: 20 !important; }
.hvh-fav-btn.is-fav { color: var(--heart-active) !important; }

/* MINI KORT (Stabsfunktioner) */
.hvh-mini-card { background: #1e293b !important; border: 1px solid var(--hvh-border) !important; border-radius: 10px !important; padding: 10px !important; width: 160px !important; position: relative !important; text-align: center !important; }
.hvh-mini-card h5 { margin: 0 !important; font-size: 0.85rem !important; color: #fff !important; }
.hvh-mini-title { font-size: 0.7rem !important; color: var(--hvh-text-muted) !important; }

/* TRÆ VISNING STRUCTURE */
.hvh-trippel-chart { display: flex !important; flex-direction: column !important; align-items: center !important; width: 100% !important; }
.hvh-top-row-grid { display: flex !important; justify-content: center !important; align-items: center !important; width: 100% !important; position: relative !important; }
.hvh-top-ceo { display: flex !important; justify-content: center !important; z-index: 2 !important; }
.hvh-top-right-staff { display: flex !important; flex-direction: column !important; gap: 10px !important; position: absolute !important; left: calc(50% + 130px) !important; top: 50% !important; transform: translateY(-50%) !important; z-index: 1 !important; }
.hvh-top-row-grid.has-right-staff::before { content: '' !important; position: absolute !important; top: 50% !important; left: calc(50% + 105px) !important; width: 25px !important; height: 2px !important; background: var(--hvh-line-color) !important; z-index: 1 !important; }

.hvh-stem-down { width: 2px !important; height: 24px !important; background: var(--hvh-line-color) !important; margin: 0 auto !important; }
.hvh-level2-branch-container { display: flex !important; flex-direction: column !important; align-items: center !important; width: 100% !important; }
.hvh-level2-row { display: flex !important; justify-content: center !important; gap: 16px !important; width: 100% !important; flex-wrap: wrap !important; }
.hvh-dept-column { display: flex !important; flex-direction: column !important; align-items: center !important; }
.hvh-dept-header-box { background: var(--hvh-line-color) !important; color: #fff !important; font-size: 0.75rem !important; font-weight: 700 !important; padding: 3px 10px !important; border-radius: 4px 4px 0 0 !important; text-transform: uppercase !important; }
.hvh-level3-stack { display: flex !important; flex-direction: column !important; gap: 8px !important; }

/* GRID & LISTE VISNINGER */
.hvh-hidden { display: none !important; }
.hvh-view-pane { display: none !important; }
.hvh-view-pane.active { display: block !important; }
.hvh-grid-layout { display: grid !important; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)) !important; gap: 18px !important; width: 100% !important; }

/* TABEL VISNING */
.hvh-list-table-wrapper { overflow-x: auto !important; }
.hvh-table { width: 100% !important; border-collapse: collapse !important; text-align: left !important; font-size: 0.85rem !important; }
.hvh-table td { padding: 12px !important; border-bottom: 1px solid var(--hvh-border) !important; vertical-align: middle !important; }
.hvh-table-user { display: flex !important; align-items: center !important; gap: 12px !important; }
.hvh-table-user img { width: 40px !important; height: 40px !important; border-radius: 50% !important; object-fit: cover !important; }

/* MOBILVISNING (MOBILE-FIRST FALLBACK) */
@media (max-width: 768px) {
    .hvh-app-scope { padding: 0 !important; }
    .hvh-topbar-header { position: sticky !important; top: 0 !important; flex-direction: column !important; align-items: stretch !important; padding: 12px !important; background: rgba(11, 19, 41, 0.95) !important; backdrop-filter: blur(10px) !important; z-index: 100 !important; }
    .hvh-search-box-top input, .hvh-filter-box-top select { width: 100% !important; }
    .hvh-view-switcher-top { display: none !important; }
    
    .hvh-view-toggle { display: flex !important; background: rgba(255,255,255,0.08) !important; border-radius: 8px !important; padding: 4px !important; }
    .hvh-toggle-btn { flex: 1 !important; border: none !important; background: transparent !important; padding: 8px 0 !important; font-size: 0.85rem !important; font-weight: 600 !important; color: var(--hvh-text-muted) !important; border-radius: 6px !important; }
    .hvh-toggle-btn.active { background: var(--hvh-line-color) !important; color: #fff !important; }

    .hvh-top-row-grid, .hvh-level2-row { flex-direction: column !important; gap: 12px !important; }
    .hvh-top-right-staff { position: static !important; transform: none !important; width: 100% !important; flex-direction: row !important; flex-wrap: wrap !important; justify-content: center !important; }
    .hvh-top-row-grid.has-right-staff::before, .hvh-stem-down { display: none !important; }

    .hvh-grid-layout, .hvh-level2-row { display: grid !important; grid-template-columns: repeat(2, 1fr) !important; gap: 10px !important; padding: 12px !important; }
    .hvh-card-container, .hvh-mini-card { width: 100% !important; height: auto !important; aspect-ratio: 0.8; }
}