/* ============================================================
   app.css – Layout-Kern
   @package immokumpel
   @module  Core / Assets
   @since   2026-05-23
   ============================================================ */

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Custom Properties ── */
:root {
    --clr-bg:          #f1f5f9;
    --clr-surface:     #ffffff;
    --clr-border:      #e2e8f0;
    --clr-text:        #1e293b;
    --clr-muted:       #64748b;
    --clr-primary:     #2563eb;
    --clr-primary-h:   #1d4ed8;
    --clr-danger:      #ef4444;
    --clr-danger-h:    #dc2626;
    --clr-success:     #22c55e;
    --clr-warning:     #f59e0b;
    --clr-sidebar-bg:  #0f172a;
    --clr-sidebar-tx:  #94a3b8;
    --radius:          6px;
    --shadow-sm:       0 1px 3px rgba(0,0,0,.08);
    --shadow-md:       0 4px 12px rgba(0,0,0,.10);
    --nav-h:           56px;
    --sa-bar-h:        28px;
    --license-banner-h: 0px;
    --sidebar-w:       220px;
    --font:            -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

html { font-size: 16px; }
body { font-family: var(--font); background: var(--clr-bg); color: var(--clr-text); line-height: 1.5; }
a    { color: var(--clr-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Topbar ── */
.topbar {
    position: fixed; top: var(--license-banner-h); left: 0; right: 0; z-index: 100;
    height: var(--nav-h);
    background: var(--clr-sidebar-bg);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 1.25rem;
    box-shadow: var(--shadow-md);
}
.topbar-brand { font-size: 1.1rem; font-weight: 700; color: #fff; letter-spacing: -.3px; }
.topbar-brand span { color: var(--clr-primary); }
.topbar-right { display: flex; align-items: center; gap: 1rem; }
.topbar-right button { background: transparent; border: none; cursor: pointer; border-radius: 8px; padding: .25rem .4rem; transition: background .12s; }
.topbar-right button:hover { background: #ffffff18; }
.topbar-user  { font-size: .82rem; color: #cbd5e1; }
.topbar-logout {
    font-size: .82rem; color: var(--clr-sidebar-tx);
    padding: .3rem .7rem; border-radius: var(--radius);
    transition: background .15s, color .15s;
}
.topbar-logout:hover { background: #ffffff18; color: #fff; text-decoration: none; }

/* ── Sidebar ── */
.sidebar {
    position: fixed; top: calc(var(--nav-h) + var(--license-banner-h)); left: 0; bottom: 0;
    width: var(--sidebar-w);
    background: var(--clr-sidebar-bg);
    overflow-y: auto; z-index: 90;
    padding: 1rem 0 2rem;
}
.sidebar-section {
    padding: .75rem 1rem .3rem;
    font-size: .65rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .08em;
    color: #475569;
}
.sidebar a {
    display: flex; align-items: center; gap: .6rem;
    padding: .48rem 1rem;
    color: var(--clr-sidebar-tx); font-size: .85rem;
    border-left: 3px solid transparent;
    transition: background .12s, color .12s, border-color .12s;
    text-decoration: none;
}
.sidebar a:hover { background: #ffffff0d; color: #cbd5e1; }
.sidebar a.active {
    background: #1e40af33; color: #e2e8f0;
    font-weight: 600; border-left-color: var(--clr-primary);
}
.sidebar a svg        { flex-shrink: 0; opacity: .75; }
.sidebar a:hover svg  { opacity: 1; }
.sidebar a.active svg { opacity: 1; }
.sidebar.has-banner { top: calc(var(--nav-h) + var(--license-banner-h) + 26px); }
.sidebar.superadmin { top: calc(var(--nav-h) + var(--sa-bar-h)); }

/* ── Layout-Wrapper ── */
.layout {
    margin-top: calc(var(--nav-h) + var(--license-banner-h));
    margin-left: var(--sidebar-w);
    min-height: calc(100vh - var(--nav-h));
    padding: 1.75rem 2rem;
    max-width: 1400px;
}
.layout.has-banner  { margin-top: calc(var(--nav-h) + var(--license-banner-h) + 26px); }
.layout.superadmin  { margin-left: 0; max-width: 1100px; margin-right: auto; padding: 2rem; margin-top: calc(var(--nav-h) + var(--sa-bar-h)); }

/* ── Responsive ── */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); transition: transform .2s; }
    .sidebar.open { transform: translateX(0); }
    .layout { margin-left: 0; padding: 1rem; }
}

/* Alpine x-cloak */
[x-cloak] { display: none !important; }

/* Gesperrte Sidebar-Links (Feature nicht im Tarif) */
.sidebar a.nav-locked { opacity: .45; cursor: pointer; display: flex; align-items: center; }
.sidebar a.nav-locked:hover { background: transparent; color: #94a3b8; }
