
/* ==========================================================
   /ui/css/base/ljh-components.css
   LJH COMPONENTS – Base Layer
   VERSION 0.03 - 20260527
   ----------------------------------------------------------
   Ansvar:
   - Återanvändbara paneler & block
   - Panel grid & struktur
   - Side cards
   - Status dot (BEM-modifiers)
   - Avatar med roll-modifiers
   - Stat card med grid
   - Search toolbar
   - Role group header
   - Control panel struktur
   - LJH Table
   - Badges (globala)
   - Roadmap
   - Admin glass panel
   - Item row layout
   - Inline form
   - Admin sidebar pending
   ----------------------------------------------------------
   INGA:
   - hero, layout, knappar, formulär
   - modul-specifika komponenter
   - globala bakgrunder
========================================================== */


/* ==========================================================
   BLOCKS / PANELS
========================================================== */

.ljh-block {
    position: relative;
    margin-bottom: 4.5rem;
    width: 100%;
}

.ljh-block-inner {
    width: 100%;
    padding: 2.4rem 2.6rem;
    border-radius: 26px;
    background: linear-gradient(
        180deg,
        rgba(255,255,255,0.16),
        rgba(255,255,255,0.07)
    );
    backdrop-filter: blur(16px) saturate(135%);
    -webkit-backdrop-filter: blur(16px) saturate(135%);
    border: 1px solid rgba(255,255,255,0.18);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.32),
        0 26px 60px rgba(0,0,0,0.45);
}


/* ==========================================================
   GLOBAL UI POPUP
========================================================== */

.ljh-ui-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 9998;
    display: none;
    align-items: flex-start;
    justify-content: center;
}

.ljh-ui-overlay.is-open { display: flex; }

.ljh-ui-popup {
    margin-top: 18vh;
    max-width: 480px;
    padding: 28px;
    background: linear-gradient(
        180deg,
        rgba(20,35,60,0.95),
        rgba(10,20,40,0.95)
    );
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,0.14);
    box-shadow:
        0 0 0 1px rgba(120,180,255,0.12),
        0 40px 80px rgba(0,0,0,0.75);
    color: #e6f0ff;
}


/* ==========================================================
   ADMIN GLASS PANEL
========================================================== */

.ljh-admin-glass-panel {
    background: rgba(15,23,42,0.55);
    backdrop-filter: blur(22px) saturate(160%);
    border-radius: 28px;
    padding: 28px;
    border: 1px solid rgba(255,255,255,0.12);
    box-shadow:
        0 20px 60px rgba(0,0,0,0.45),
        inset 0 0 40px rgba(255,255,255,0.06);
}


/* ==========================================================
   GLOBAL PANEL GRID
========================================================== */

.ljh-panel-grid {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 24px;
    align-items: start;
}

.ljh-panel-left {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ljh-panel-right {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

@media (max-width: 1024px) {
    .ljh-panel-grid { grid-template-columns: repeat(2, 1fr); }
}


/* ==========================================================
   PANEL ITEM
========================================================== */

.ljh-panel-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-bottom: 0.6rem;
}

.ljh-panel-item + .ljh-panel-item {
    border-top: 1px solid rgba(255,255,255,0.06);
    padding-top: 0.8rem;
}


/* ==========================================================
   SIDE CARD
========================================================== */

.ljh-side-card {
    padding: 14px;
    border-radius: 14px;
    background: linear-gradient(
        180deg,
        rgba(255,255,255,0.14),
        rgba(255,255,255,0.06)
    );
    backdrop-filter: blur(12px) saturate(130%);
    border: 1px solid rgba(255,255,255,0.16);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.28),
        0 18px 40px rgba(0,0,0,0.45);
}

.ljh-presence-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}


/* ==========================================================
   STATUS DOT
   Ersätter: .available / .busy / .away (borttagna V0.03)
   ----------------------------------------------------------
   Användning:
     <span class="ljh-status-dot ljh-status-dot--active"></span>
   ----------------------------------------------------------
   Modifiers:
     --active    Grön   (ersätter .available)
     --busy      Gul    (ersätter .busy)
     --inactive  Grå    (ersätter .away)
     --warning   Orange (ny)
     --pending   Lila   (ny)
     --info      Blå    (ny)
========================================================== */

.ljh-status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.ljh-status-dot--active   { background: #2ecc71; }
.ljh-status-dot--busy     { background: #f1c40f; }
.ljh-status-dot--inactive { background: #95a5a6; }
.ljh-status-dot--warning  { background: #f97316; }
.ljh-status-dot--pending  { background: #a855f7; }
.ljh-status-dot--info     { background: #3b82f6; }


/* ==========================================================
   AVATAR
   ----------------------------------------------------------
   Användning:
     <div class="ljh-avatar ljh-avatar--owner">JH</div>
   ----------------------------------------------------------
   Storlekar:
     Standard: 40px
     --sm:     32px
     --lg:     48px
   ----------------------------------------------------------
   Roll-modifiers matchar HR-systemets access_level-färger:
     --owner              access_level 100  (lila)
     --chef               access_level 90   (röd-orange)
     --admin              access_level 85   (orange)
     --arbetsledare       access_level 70   (gul-orange)
     --avdelningsansvarig access_level 50   (blå)
     --anstalld           access_level 30   (grön-blå)
     --vikarie            access_level 5    (grå)
     --medlem             access_level 0    (mörkgrå)
========================================================== */

.ljh-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    flex-shrink: 0;
    user-select: none;
    background: rgba(255,255,255,0.15);
}

.ljh-avatar--sm { width: 32px; height: 32px; font-size: 11px; }
.ljh-avatar--lg { width: 48px; height: 48px; font-size: 16px; }

.ljh-avatar--owner              { background: linear-gradient(135deg, #7c3aed, #a855f7); }
.ljh-avatar--chef               { background: linear-gradient(135deg, #dc2626, #f97316); }
.ljh-avatar--admin              { background: linear-gradient(135deg, #d97706, #f59e0b); }
.ljh-avatar--arbetsledare       { background: linear-gradient(135deg, #b45309, #fbbf24); }
.ljh-avatar--avdelningsansvarig { background: linear-gradient(135deg, #1d4ed8, #3b82f6); }
.ljh-avatar--anstalld           { background: linear-gradient(135deg, #0d9488, #2dd4bf); }
.ljh-avatar--vikarie            { background: linear-gradient(135deg, #4b5563, #9ca3af); }
.ljh-avatar--medlem             { background: linear-gradient(135deg, #1f2937, #374151); }


/* ==========================================================
   STAT CARD
   ----------------------------------------------------------
   Användning:
     <div class="ljh-stat-card ljh-stat-card--clickable">
       <div class="ljh-stat-card__label">MED SCHEMA</div>
       <div class="ljh-stat-card__value">8</div>
       <div class="ljh-stat-card__sublabel">aktiva scheman</div>
     </div>
   ----------------------------------------------------------
   Container:
     <div class="ljh-stat-grid">...</div>
   ----------------------------------------------------------
   Modifiers:
     --clickable   Klickbar med hover
     --active      Aktivt filter
     --success     Grön siffra
     --warning     Orange siffra
     --info        Blå siffra
     --neutral     Grå siffra
     --purple      Lila siffra (väntande)
========================================================== */

.ljh-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

@media (max-width: 900px) {
    .ljh-stat-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
    .ljh-stat-grid { grid-template-columns: 1fr; }
}

.ljh-stat-card {
    padding: 16px 18px;
    border-radius: 14px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    transition: border-color 0.2s ease, background 0.2s ease;
}

.ljh-stat-card__label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.45);
    margin-bottom: 6px;
}

.ljh-stat-card__value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    color: rgba(255,255,255,0.92);
    margin-bottom: 4px;
}

.ljh-stat-card__sublabel {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.4);
}

/* Modifiers */
.ljh-stat-card--clickable {
    cursor: pointer;
}

.ljh-stat-card--clickable:hover {
    background: rgba(255,255,255,0.07);
    border-color: rgba(255,255,255,0.16);
}

.ljh-stat-card--active {
    background: rgba(120,180,255,0.08);
    border-color: rgba(120,180,255,0.35);
}

.ljh-stat-card--active .ljh-stat-card__value {
    color: #7eb8ff;
}

.ljh-stat-card--success .ljh-stat-card__value { color: #4ade80; }
.ljh-stat-card--warning .ljh-stat-card__value { color: #fb923c; }
.ljh-stat-card--info    .ljh-stat-card__value { color: #60a5fa; }
.ljh-stat-card--neutral .ljh-stat-card__value { color: #9ca3af; }
.ljh-stat-card--purple  .ljh-stat-card__value { color: #c084fc; }


/* ==========================================================
   SEARCH TOOLBAR
   ----------------------------------------------------------
   Användning:
     <div class="ljh-search-toolbar">
       <input type="text"
              class="ljh-search-toolbar__search"
              placeholder="Sök...">
       <select class="ljh-search-toolbar__filter">...</select>
     </div>
========================================================== */

.ljh-search-toolbar {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.ljh-search-toolbar__search {
    flex: 1;
    min-width: 180px;
    padding: 9px 14px;
    font-size: 13px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 10px;
    color: rgba(255,255,255,0.9);
    outline: none;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.ljh-search-toolbar__search::placeholder {
    color: rgba(255,255,255,0.3);
}

.ljh-search-toolbar__search:focus {
    border-color: rgba(120,180,255,0.45);
    background: rgba(255,255,255,0.08);
}

.ljh-search-toolbar__filter {
    padding: 9px 12px;
    font-size: 12px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 10px;
    color: rgba(255,255,255,0.75);
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.ljh-search-toolbar__filter:focus {
    border-color: rgba(120,180,255,0.45);
}

@media (max-width: 600px) {
    .ljh-search-toolbar         { flex-direction: column; }
    .ljh-search-toolbar__search,
    .ljh-search-toolbar__filter { width: 100%; }
}


/* ==========================================================
   ROLE GROUP HEADER
   ----------------------------------------------------------
   Användning:
     <div class="ljh-role-group-header">
       <span class="ljh-role-group-header__title">ÄGARE</span>
       <span class="ljh-role-group-header__count">1</span>
     </div>
========================================================== */

.ljh-role-group-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.ljh-role-group-header__title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.45);
}

.ljh-role-group-header__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.6);
}


/* ==========================================================
   ITEM LINK
========================================================== */

.ljh-item-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.ljh-item-link:hover .ljh-item-card { transform: translateY(-2px); }


/* ==========================================================
   ITEM ROW LAYOUT
========================================================== */

.ljh-item-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ljh-item-title {
    flex: 1;
    min-width: 0;
}

.ljh-item-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ljh-item-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ljh-inline-form {
    display: inline-flex;
    margin: 0;
}


/* ==========================================================
   CARD TITLES
========================================================== */

.ljh-card-title {
    color: inherit;
    text-decoration: none;
    font-weight: 600;
}

.ljh-card-title:hover { color: var(--ljh-accent); }


/* ==========================================================
   GLOBAL BADGES
========================================================== */

.notes-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255,255,255,0.15);
}

.ljh-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
    backdrop-filter: blur(6px);
}

.ljh-badge.is-info {
    background: rgba(59,130,246,0.15);
    color: #60a5fa;
    border: 1px solid rgba(59,130,246,0.35);
}


/* ==========================================================
   CONTROL PANEL – BASE STRUCTURE
========================================================== */

.ljh-control-panel {
    display: flex;
    flex-direction: column;
    gap: 3.2rem;
}

.ljh-control-section {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.ljh-control-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ljh-control-title {
    font-size: 1.4rem;
    font-weight: 650;
    letter-spacing: 0.02em;
    color: #8bc4ff;
}

.ljh-control-description {
    font-size: 0.95rem;
    opacity: 0.75;
    color: rgba(255,255,255,0.75);
}


/* ==========================================================
   LJH TABLE
========================================================== */

.ljh-table {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ljh-table-row {
    display: grid;
    grid-template-columns: 120px 1fr 120px 120px 120px 100px;
    gap: 12px;
    align-items: center;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(255,255,255,0.02);
    transition: all 0.15s ease;
}

.ljh-table-head {
    font-size: 0.75rem;
    text-transform: uppercase;
    opacity: 0.6;
}

.ljh-table-row:hover {
    background: rgba(0,255,200,0.06);
    transform: translateY(-1px);
}

.ljh-table-row.is-active {
    border: 1px solid rgba(34,197,94,0.5);
    box-shadow: 0 0 14px rgba(34,197,94,0.35);
    background: linear-gradient(to right, rgba(34,197,94,0.08), transparent);
}

.ljh-table-row.is-next {
    border: 1px solid rgba(59,130,246,0.5);
    box-shadow: 0 0 10px rgba(59,130,246,0.25);
    background: linear-gradient(to right, rgba(59,130,246,0.08), transparent);
}

.ljh-table-row .muted { opacity: 0.45; }

.ljh-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}


/* ==========================================================
   LJH ROADMAP
========================================================== */

.ljh-roadmap {
    position: relative;
    margin-top: 20px;
    padding-left: 20px;
}

.ljh-roadmap::before {
    content: "";
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(
        to bottom,
        rgba(34,197,94,0.4),
        rgba(59,130,246,0.3),
        rgba(255,255,255,0.05)
    );
}

.ljh-roadmap-item {
    position: relative;
    display: flex;
    gap: 14px;
    margin-bottom: 18px;
}

.ljh-roadmap-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    margin-top: 6px;
}

.ljh-roadmap-item.is-active .ljh-roadmap-dot {
    background: #22c55e;
    box-shadow: 0 0 10px rgba(34,197,94,0.6);
    animation: pulseGlow 2s infinite;
}

.ljh-roadmap-item.is-next .ljh-roadmap-dot {
    background: #3b82f6;
    box-shadow: 0 0 8px rgba(59,130,246,0.5);
}

.ljh-roadmap-item.is-archived { opacity: 0.35; }

.ljh-roadmap-title  { font-weight: 600; }
.ljh-roadmap-name   { font-size: 0.9rem; opacity: 0.85; }
.ljh-roadmap-meta   { font-size: 0.75rem; margin-top: 4px; }

@keyframes pulseGlow {
    0%   { box-shadow: 0 0 6px rgba(34,197,94,0.4); }
    50%  { box-shadow: 0 0 14px rgba(34,197,94,0.8); }
    100% { box-shadow: 0 0 6px rgba(34,197,94,0.4); }
}


/* ==========================================================
   ADMIN SIDEBAR — Pending link
========================================================== */

.admin-pending-notice {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.admin-pending-count {
    font-size: 1.4rem;
    font-weight: 600;
    color: rgba(255,190,60,0.9);
}

.admin-pending-label {
    font-size: 0.85rem;
    opacity: 0.75;
}

.admin-pending-link {
    display: block;
    text-align: center;
    text-decoration: none;
    margin-top: 10px;
    padding: 6px 14px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.7);
    font-size: 13px;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.admin-pending-link:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.95);
}


/* ==========================================================
   LJH TABS – Global Tab System
   ----------------------------------------------------------
   Användning:
     <div class="ljh-tabs" role="tablist">
         <button class="ljh-tab is-active" data-tab="X" role="tab">
             ✏️ Skapa
             <span class="ljh-tab-count">12</span>
         </button>
         <button class="ljh-tab" data-tab="Y" role="tab">
             📋 Lista
         </button>
     </div>

     <section class="ljh-tabpanel is-active" data-panel="X" role="tabpanel">
         ... innehåll flik 1 ...
     </section>
     <section class="ljh-tabpanel" data-panel="Y" role="tabpanel">
         ... innehåll flik 2 ...
     </section>
   ----------------------------------------------------------
   Krav på JS:
   - Toggle .is-active på matchande tab + panel
   - Endast en aktiv flik och en synlig panel åt gången
========================================================== */

.ljh-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 1.6rem;
    padding: 6px;
    border-radius: var(--radius-md);
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
}

.ljh-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0.65rem 1.1rem;
    font-size: 0.88rem;
    font-weight: 600;
    font-family: inherit;
    line-height: 1.2;
    color: var(--ljh-text-muted);
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.18s ease,
                border-color 0.18s ease,
                color 0.18s ease;
    user-select: none;
}

.ljh-tab:hover {
    background: rgba(255,255,255,0.05);
    color: var(--ljh-text-soft);
}

.ljh-tab.is-active {
    background: linear-gradient(180deg,
        rgba(96,165,250,0.18),
        rgba(96,165,250,0.08));
    border-color: rgba(96,165,250,0.35);
    color: var(--ljh-aqua-light);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.15),
                0 2px 8px rgba(96,165,250,0.18);
}

.ljh-tab:focus-visible {
    outline: none;
    border-color: var(--ljh-aqua);
    box-shadow: 0 0 0 2px rgba(96,165,250,0.25);
}


/* ==========================================================
   TAB COUNT – Räknare-bubbla på fliken
========================================================== */

.ljh-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 20px;
    padding: 0 7px;
    font-size: 0.72rem;
    font-weight: 700;
    border-radius: 10px;
    background: rgba(255,255,255,0.1);
    color: var(--ljh-text);
    border: 1px solid rgba(255,255,255,0.12);
}

.ljh-tab.is-active .ljh-tab-count {
    background: rgba(96,165,250,0.25);
    border-color: rgba(96,165,250,0.45);
    color: var(--ljh-aqua-light);
}


/* ==========================================================
   TAB PANELS – Innehållet per flik
========================================================== */

.ljh-tabpanel {
    display: none;
    animation: ljhTabFadeIn 0.25s ease;
}

.ljh-tabpanel.is-active {
    display: block;
}

@keyframes ljhTabFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}


/* ==========================================================
   TAB VARIANTS – Stilvariationer
   ----------------------------------------------------------
   .ljh-tabs.is-pills    – Helt rundade flikar (notice-style)
   .ljh-tabs.is-minimal  – Bara underlinje, ingen bakgrund
========================================================== */

.ljh-tabs.is-pills .ljh-tab {
    border-radius: 9999px;
}

.ljh-tabs.is-minimal {
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    border-radius: 0;
    padding: 0;
    gap: 0;
}

.ljh-tabs.is-minimal .ljh-tab {
    border-radius: 0;
    border-bottom: 2px solid transparent;
    padding: 0.8rem 1.2rem;
}

.ljh-tabs.is-minimal .ljh-tab.is-active {
    background: transparent;
    border-color: transparent;
    border-bottom-color: var(--ljh-aqua);
    color: var(--ljh-aqua-light);
    box-shadow: none;
}


/* ==========================================================
   RESPONSIVE
========================================================== */

@media (max-width: 600px) {
    .ljh-tabs {
        gap: 4px;
        padding: 4px;
    }
    .ljh-tab {
        padding: 0.55rem 0.85rem;
        font-size: 0.82rem;
    }
}


