/* I dag-fanen — to-kolonne layout. Speiler prod sin .today-grid. */

/* RESERVED HEIGHTS (anti-CLS) */
#idag .today-grid { min-height: calc(100vh - 320px); }
#idag .event-list { min-height: 200px; }

/* HERO ============================================== */
#idag .hero {
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: var(--space-6); margin-bottom: var(--space-8); flex-wrap: wrap;
}
#idag .hero-greeting {
    font-family: var(--font-display); font-size: var(--fs-3xl);
    font-weight: 700; color: var(--lh-4); line-height: 1; margin: 0;
}
#idag .hero-greeting .h-soft { color: var(--text-muted); }
#idag .hero-date {
    font-size: var(--fs-base); color: var(--text-muted);
    margin-top: var(--space-1); text-transform: lowercase;
}
#idag .hero-stats { display: flex; gap: var(--space-8); }
#idag .hero-stat { display: flex; flex-direction: column; align-items: flex-start; }
#idag .hero-stat-val {
    font-family: var(--font-display); font-size: var(--fs-2xl);
    font-weight: 700; color: var(--lh-4); line-height: 1;
}
#idag .hero-stat-label {
    font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.06em;
}
@media (max-width: 600px) { #idag .hero-stats { display: none; } }

/* TWO-COLUMN GRID ==================================== */
#idag .today-grid {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: var(--space-5);
}
@media (max-width: 900px) {
    #idag .today-grid { grid-template-columns: 1fr; }
}

/* EVENT-LIST ========================================= */
#idag .event-list { display: flex; flex-direction: column; gap: var(--space-2); }

#idag .ev {
    background: var(--bg-card);
    border: 1.4px solid var(--border-light);
    border-radius: 8px;
    padding: 0.7rem 1rem;
    display: grid;
    grid-template-columns: 65px 70px 1fr auto 68px;
    align-items: center;
    gap: 0.6rem;
    transition: all var(--tx-base);
}
#idag .ev {
    transition: border-color var(--tx-base), box-shadow var(--tx-base), transform var(--tx-base);
    animation: evIn 0.45s var(--ease-out) backwards;
}
#idag .ev:nth-child(1)  { animation-delay: 0.04s; }
#idag .ev:nth-child(2)  { animation-delay: 0.10s; }
#idag .ev:nth-child(3)  { animation-delay: 0.16s; }
#idag .ev:nth-child(4)  { animation-delay: 0.22s; }
#idag .ev:nth-child(5)  { animation-delay: 0.28s; }
#idag .ev:nth-child(6)  { animation-delay: 0.34s; }
#idag .ev:nth-child(7)  { animation-delay: 0.40s; }
#idag .ev:nth-child(8)  { animation-delay: 0.46s; }
#idag .ev:nth-child(9)  { animation-delay: 0.52s; }
#idag .ev:nth-child(10) { animation-delay: 0.58s; }
#idag .ev:nth-child(11) { animation-delay: 0.64s; }
#idag .ev:nth-child(12) { animation-delay: 0.70s; }

@keyframes evIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Sidebar-cards rullen inn med stagger fra høyre */
#idag .sidebar-card {
    animation: cardIn 0.45s var(--ease-out) backwards;
}
#idag .sidebar-card:nth-child(1) { animation-delay: 0.20s; }
#idag .sidebar-card:nth-child(2) { animation-delay: 0.28s; }
#idag .sidebar-card:nth-child(3) { animation-delay: 0.36s; }
#idag .sidebar-card:nth-child(4) { animation-delay: 0.44s; }
#idag .sidebar-card:nth-child(5) { animation-delay: 0.52s; }

@keyframes cardIn {
    from { opacity: 0; transform: translateX(12px); }
    to   { opacity: 1; transform: translateX(0); }
}
#idag .ev:hover {
    border-color: var(--lh-4);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

#idag .ev.status-active  { border-left: 5px solid var(--cyan);   background: rgba(0, 136, 170, 0.06); }
#idag .ev.status-active .ev-name { color: #006688; font-weight: 700; }
#idag .ev.status-rigg    { border-left: 5px solid var(--lh-4);   background: rgba(38, 91, 0, 0.03); }
#idag .ev.status-getin   { border-left: 5px solid var(--yellow); background: rgba(176, 140, 0, 0.03); }
#idag .ev.status-getout  { border-left: 5px solid var(--orange); background: rgba(224, 120, 0, 0.06); }
#idag .ev.status-pending { border-left: 5px solid var(--border); }
#idag .ev.status-finished{ border-left: 5px solid var(--border-light); opacity: 0.35; }

#idag .ev-room {
    font-family: var(--font-mono); font-size: var(--fs-base);
    color: var(--text-secondary); font-weight: 500;
}

/* Status-badge med progress-fyll */
#idag .ev-status {
    font-family: var(--font-mono); font-size: 0.6rem; font-weight: 600;
    padding: 0.2rem 0.45rem; border-radius: 4px;
    text-align: center; white-space: nowrap; letter-spacing: 0.02em;
    position: relative; overflow: hidden; min-width: 52px;
}
#idag .ev-status .ev-prog {
    position: absolute; left: 0; top: 0; bottom: 0;
    opacity: 0.18; border-radius: 4px; transition: width 30s linear;
}
#idag .ev-status span { position: relative; z-index: 1; }
#idag .ev-status.s-pending  { background: var(--bg-tertiary); color: var(--text-muted); }
#idag .ev-status.s-rigg     { background: rgba(38, 91, 0, 0.10); color: var(--lh-4); }
#idag .ev-status.s-rigg .ev-prog { background: var(--lh-4); }
#idag .ev-status.s-getin    { background: rgba(176, 140, 0, 0.10); color: var(--yellow); animation: statusPulse 2.5s ease-in-out infinite; }
#idag .ev-status.s-getin .ev-prog { background: var(--yellow); }
#idag .ev-status.s-active   { background: rgba(0, 136, 170, 0.12); color: var(--cyan); animation: statusPulse 2s ease-in-out infinite; }
#idag .ev-status.s-active .ev-prog { background: var(--cyan); }
#idag .ev-status.s-getout   { background: rgba(224, 120, 0, 0.12); color: var(--orange); animation: ejectBlink 1s ease-in-out infinite; }
#idag .ev-status.s-getout .ev-prog { background: var(--orange); }
#idag .ev-status.s-finished { background: var(--bg-secondary); color: var(--text-muted); }

@keyframes statusPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }
@keyframes ejectBlink  { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

#idag .ev-main { min-width: 0; }
#idag .ev-name {
    font-weight: 600; font-size: 0.88rem;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#idag .ev-meta { font-size: 0.7rem; color: var(--text-muted); margin-top: 0.1rem; }

#idag .ev-tek {
    font-family: var(--font-mono); font-size: 0.72rem;
    color: var(--lh-3); font-weight: 500; white-space: nowrap;
}
#idag .ev-tek.none { color: var(--text-muted); }

#idag .ev-time {
    font-family: var(--font-mono); font-size: 0.7rem;
    color: var(--text-muted); text-align: right; line-height: 1.3;
}
#idag .ev-time .ev-t-start { font-weight: 600; color: var(--text-secondary); }
#idag .ev-time .ev-t-end { font-size: 0.6rem; opacity: 0.7; }

/* Finished-toggle */
#idag .finished-toggle { margin-top: var(--space-1); }
#idag .finished-summary {
    font-family: var(--font-mono); font-size: var(--fs-xs);
    color: var(--text-muted); cursor: pointer;
    padding: var(--space-2);
    list-style: none; display: flex; align-items: center; gap: 0.4rem;
}
#idag .finished-summary::-webkit-details-marker { display: none; }
#idag .finished-summary::before { content: '▸'; font-size: 0.6rem; }
#idag details[open] .finished-summary::before { content: '▾'; }

/* LEGEND ============================================ */
#idag .legend {
    display: flex; gap: 1.25rem; flex-wrap: wrap;
    padding: var(--space-3) 0; margin-top: var(--space-3);
    border-top: 1px solid var(--border-light);
}
#idag .legend-item {
    display: flex; align-items: center; gap: 0.4rem;
    font-size: 0.7rem; color: var(--text-muted);
}
#idag .legend-dot {
    width: 14px; height: 6px; border-radius: 2px; flex-shrink: 0;
}
#idag .legend-dot.l-active   { background: var(--cyan); }
#idag .legend-dot.l-rigg     { background: var(--lh-4); }
#idag .legend-dot.l-getin    { background: var(--yellow); }
#idag .legend-dot.l-getout   { background: var(--orange); }
#idag .legend-dot.l-pending  { background: var(--border); }
#idag .legend-dot.l-finished { background: var(--border-light); }

/* SIDEBAR =========================================== */
#idag .sidebar { display: flex; flex-direction: column; gap: var(--space-3); }

#idag .sidebar-card {
    background: var(--bg-card);
    border: 1.4px solid var(--border-light);
    border-radius: 8px;
    padding: var(--space-4);
}
#idag .sidebar-card { transition: border-color var(--tx-base), box-shadow var(--tx-base); }
#idag .sidebar-card:hover { border-color: var(--lh-4); box-shadow: var(--shadow-sm); }

#idag .sidebar-label {
    font-size: var(--fs-xs); font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: var(--space-2);
}

/* Riverton/Leiligheten-rom-status-kort */
#idag .room-status { display: flex; align-items: center; gap: 0.6rem; }
#idag .room-dot {
    width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}
#idag .room-dot.free { background: var(--lh-2); box-shadow: 0 0 8px var(--lh-2); animation: pulse 2s ease-in-out infinite; }
#idag .room-dot.busy { background: var(--red); box-shadow: 0 0 8px var(--red); }
#idag .room-text { font-family: var(--font-mono); font-size: var(--fs-md); font-weight: 600; }
#idag .room-text.free { color: var(--lh-3); }
#idag .room-text.busy { color: var(--red); }
#idag .room-next { font-size: var(--fs-sm); color: var(--text-muted); margin-top: 0.3rem; }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

#idag .sidebar-btn {
    display: block; width: 100%; margin-top: var(--space-2);
    padding: 0.5rem;
    background: var(--lh-4); border: 1.4px solid var(--lh-4);
    border-radius: var(--radius-md);
    color: #ffffff; font-size: 0.7rem; font-weight: 500;
    cursor: pointer; text-align: center;
    transition: all var(--tx-base); text-decoration: none;
    font-family: inherit;
}
#idag .sidebar-btn:hover {
    background: var(--lh-3); border-color: var(--lh-3);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}
#idag .sidebar-btn:active { transform: translateY(0) scale(0.97); transition-duration: 0.05s; }
#idag .sidebar-btn:focus-visible { outline: 2px solid var(--lh-3); outline-offset: 2px; }
#idag .sidebar-btn-secondary {
    margin-top: 0.4rem; opacity: 0.6; font-size: 0.65rem;
}
#idag .sidebar-btn-secondary:hover { opacity: 1; }

/* Saler-liste */
#idag .saler-list { display: flex; flex-direction: column; gap: 0.2rem; }
#idag .saler-row {
    display: flex; align-items: center; gap: 0.5rem; font-size: 0.78rem;
}
#idag .saler-row .saler-dot {
    width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
}
#idag .saler-row.free  .saler-dot { background: var(--lh-2); }
#idag .saler-row.busy  .saler-dot { background: var(--red); }
#idag .saler-row .saler-name {
    font-weight: 500; min-width: 55px;
}
#idag .saler-row.free .saler-name { color: var(--lh-3); }
#idag .saler-row.busy .saler-name { color: var(--red); }
#idag .saler-row .saler-detail {
    color: var(--text-muted); font-size: 0.7rem;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Verter/teknikere-liste */
#idag .verter-list { display: flex; flex-direction: column; gap: 0.3rem; }
#idag .vert-item { display: flex; justify-content: space-between; font-size: 0.8rem; }
#idag .vert-name { color: var(--text-primary); }
#idag .vert-name.on { color: var(--lh-3); font-weight: 500; }
#idag .vert-tid {
    font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-muted);
}
#idag .live-dot {
    display: inline-block; width: 6px; height: 6px; border-radius: 50%;
    background: var(--lh-2); margin-right: 0.35rem; vertical-align: middle;
    box-shadow: 0 0 6px var(--lh-2);
    animation: pulse 2s ease-in-out infinite;
}


/* Mode-toggle (Arrangementer / Internt) — fungerer i bade light og dark */
.event-mode-toggle {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    padding: 4px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    width: fit-content;
}
.event-mode-toggle .mode-btn {
    padding: 6px 18px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 500;
    color: var(--text-muted);
    transition: all 0.15s ease;
}
.event-mode-toggle .mode-btn:hover {
    color: var(--text-primary);
}
.event-mode-toggle .mode-btn.active {
    background: var(--bg-card);
    color: var(--text-primary);
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}
