/* IMSBooking base: typografi, app-skal (sidebar + indhold). Bygger paa design-tokens.css.
   Alle farver laeses som var(--token), saa temaerne i design-tokens.css virker overalt. */
*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    font-family: var(--font-sans);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    color: var(--color-text);
    background: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: "cv11", "ss01";
}

h1, h2, h3, h4, h5, h6 {
    margin: 0;
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-tight);
    color: var(--color-text);
    letter-spacing: -0.01em;
}

h1 { font-size: var(--font-size-3xl); letter-spacing: -0.02em; }
h2 { font-size: var(--font-size-xl); }
h3 { font-size: var(--font-size-lg); }
h4 { font-size: var(--font-size-base); }

p { margin: 0 0 var(--space-2) 0; }

a { color: var(--color-accent); text-decoration: none; }
a:hover { color: var(--color-accent-hover); }

code, pre { font-family: var(--font-mono); font-size: 12px; }
code { background: var(--color-card-alt); border: 1px solid var(--border-subtle); border-radius: 4px; padding: 1px 5px; color: var(--color-text); }

:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: 4px; }

.icon { flex-shrink: 0; display: inline-block; vertical-align: middle; }

/* ---------- App-skal ---------- */
.shell { display: flex; min-height: 100vh; }

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    width: var(--sidebar-width);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    padding: var(--space-5) var(--space-3) var(--space-4);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: 0 var(--space-3) var(--space-5);
    color: var(--sidebar-text-strong);
}
.sidebar-brand:hover { color: var(--sidebar-text-strong); }
.sidebar-logo { height: 22px; }
.sidebar-product {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    padding-left: var(--space-3);
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    line-height: 1.1;
}

.sidebar-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }

.nav-section {
    font-size: 11px;
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.4);
    padding: var(--space-4) var(--space-3) var(--space-2);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    height: 38px;
    padding: 0 var(--space-3);
    border-radius: var(--radius-control);
    color: var(--sidebar-text);
    font-weight: var(--font-weight-medium);
    transition: background 0.12s, color 0.12s;
}
.nav-item:hover { background: var(--sidebar-hover); color: var(--sidebar-text-strong); }
.nav-item.active { background: var(--sidebar-active); color: var(--sidebar-text-strong); box-shadow: inset 3px 0 0 var(--color-accent); }
.nav-item .icon { opacity: 0.9; }

.sidebar-bottom { border-top: 1px solid rgba(255, 255, 255, 0.08); padding-top: var(--space-3); margin-top: var(--space-3); }

.sidebar-user { display: flex; align-items: center; gap: var(--space-2); }
.sidebar-user-link {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2);
    border-radius: var(--radius-control);
    color: var(--sidebar-text-strong);
}
.sidebar-user-link:hover { background: var(--sidebar-hover); color: var(--sidebar-text-strong); }
.avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #3B7EE5, #2E5FB8);
    color: #fff;
    font-size: 12px;
    font-weight: var(--font-weight-semibold);
    flex-shrink: 0;
}
.sidebar-user-text { display: flex; flex-direction: column; min-width: 0; }
.sidebar-user-name { font-size: var(--font-size-sm); font-weight: var(--font-weight-medium); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-upn { font-size: 11px; color: rgba(255, 255, 255, 0.5); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-signout {
    width: 34px; height: 34px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: var(--radius-control);
    color: var(--sidebar-text);
}
.sidebar-signout:hover { background: var(--sidebar-hover); color: var(--sidebar-text-strong); }
.sidebar-build { font-size: 11px; color: rgba(255, 255, 255, 0.35); padding: var(--space-2) var(--space-2) 0; }

.content { flex: 1; min-width: 0; }
.content-inner { max-width: var(--content-max); margin: 0 auto; padding: var(--space-6) var(--space-6) var(--space-8); }

/* Kompatibilitet med sider der stadig bruger .app-container */
.app-container { max-width: var(--content-max); margin: 0 auto; padding: var(--space-6); }

#blazor-error-ui {
    background: var(--color-danger);
    color: #fff;
    bottom: var(--space-4);
    display: none;
    left: 50%;
    transform: translateX(-50%);
    padding: var(--space-3) var(--space-6) var(--space-3) var(--space-5);
    position: fixed;
    border-radius: var(--radius-control);
    box-shadow: var(--shadow-pop);
    z-index: 1000;
}
#blazor-error-ui a { color: #fff; text-decoration: underline; margin-left: var(--space-3); }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: var(--space-3); top: var(--space-2); text-decoration: none; }

@media (max-width: 900px) {
    .shell { flex-direction: column; }
    .sidebar {
        position: sticky;
        height: auto;
        width: 100%;
        flex-direction: row;
        align-items: center;
        padding: var(--space-2) var(--space-3);
        gap: var(--space-3);
        z-index: 50;
    }
    .sidebar-brand { padding: 0 var(--space-2); }
    .sidebar-nav { flex-direction: row; overflow-x: auto; gap: var(--space-1); }
    .nav-section { display: none; }
    .nav-item { height: 34px; white-space: nowrap; }
    .nav-item.active { box-shadow: inset 0 -2px 0 var(--color-accent); }
    .sidebar-bottom { border: none; margin: 0; padding: 0; }
    .sidebar-user-text, .sidebar-build { display: none; }
    .content-inner { padding: var(--space-5) var(--space-4) var(--space-7); }
}

