/* ==========================================================================
   MRB Guss Unternehmensportal – Basis-Stylesheet
   Layout nach c1-it.com (Sidebar links, Inhalt mittig), Farbwelt MRB Guss CI
   CI-Farben: Rot #C8102E · Logo-Grau #9EA2A2 · Grau #575756 · Anthrazit #3B3D40
   ========================================================================== */

/* ── Schriften (lokal ausgeliefert, keine Google-Server) ── */
@font-face { font-family: "Source Sans 3"; font-style: normal; font-weight: 400; font-display: swap; src: url("../vendor/fonts/source-sans-3-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-style: normal; font-weight: 500; font-display: swap; src: url("../vendor/fonts/source-sans-3-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-style: normal; font-weight: 600; font-display: swap; src: url("../vendor/fonts/source-sans-3-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-style: normal; font-weight: 700; font-display: swap; src: url("../vendor/fonts/source-sans-3-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("../vendor/fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 600; font-display: swap; src: url("../vendor/fonts/ibm-plex-mono-latin-600-normal.woff2") format("woff2"); }

/* ── Design-Tokens: hell ── */
:root {
    --mrb-red:           #C8102E;   /* CI-Rot (Logo "MRB") */
    --mrb-steel:         #9EA2A2;   /* CI-Grau (Logo "GUSS") */
    --mrb-graphite:      #575756;
    --mrb-anthracite:    #3B3D40;

    --mrb-primary:       #C8102E;
    --mrb-primary-dark:  #A00D25;
    --mrb-primary-ink:   #ffffff;   /* Text auf Rot */
    --mrb-primary-tint:  rgba(200,16,46,.07);
    --mrb-primary-tint2: rgba(200,16,46,.16);
    --mrb-accent:        #E87722;   /* glühendes Eisen – sparsam einsetzen */

    --mrb-bg:            #f3f4f5;
    --mrb-surface:       #ffffff;
    --mrb-surface-2:     #f7f8f8;
    --mrb-border:        #dcdfe0;
    --mrb-text:          #46484b;
    --mrb-heading:       #2a2b2e;
    --mrb-text-muted:    #85898c;
    --mrb-success:       #2e7d32;
    --mrb-warning:       #b45309;
    --mrb-danger:        #C8102E;
    --mrb-info:          #1565c0;
    --mrb-shadow:        rgba(30,31,33,.06);
    --mrb-shadow-strong: rgba(30,31,33,.14);

    --font-main:    "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-display: "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-mono:    "IBM Plex Mono", "SFMono-Regular", Consolas, Menlo, monospace;
    --sidebar-width: 264px;
    --header-height: 58px;
}

/* ── Design-Tokens: dunkel ── */
[data-theme="dark"] {
    --mrb-primary:       #E3324E;
    --mrb-primary-dark:  #C8102E;
    --mrb-primary-ink:   #ffffff;
    --mrb-primary-tint:  rgba(227,50,78,.10);
    --mrb-primary-tint2: rgba(227,50,78,.22);
    --mrb-accent:        #F08A3C;

    --mrb-bg:            #111214;
    --mrb-surface:       #18191c;
    --mrb-surface-2:     #1f2124;
    --mrb-border:        #2f3236;
    --mrb-text:          #c9ccce;
    --mrb-heading:       #eceeef;
    --mrb-text-muted:    #8d9195;
    --mrb-success:       #66bb6a;
    --mrb-warning:       #f0a04b;
    --mrb-danger:        #ef5350;
    --mrb-shadow:        rgba(0,0,0,.3);
    --mrb-shadow-strong: rgba(0,0,0,.5);
}

/* ── Basis ── */
body {
    font-family: var(--font-main);
    background: var(--mrb-bg);
    color: var(--mrb-text);
    font-size: 1rem;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background .2s, color .2s;
}
h1, h2, h3, h4, h5, h6 { color: var(--mrb-heading); font-family: var(--font-display); font-weight: 700; }
a { color: var(--mrb-primary-dark); }
[data-theme="dark"] a { color: var(--mrb-primary); }
::selection { background: var(--mrb-primary); color: #fff; }
:focus-visible { outline: 2px solid var(--mrb-primary); outline-offset: 2px; }

/* Logo-Umschaltung hell/dunkel */
.logo-dark { display: none; }
[data-theme="dark"] .logo-light { display: none; }
[data-theme="dark"] .logo-dark { display: inline-block; }

/* ── TOPBAR (nur Tablet/Mobile) ── */
.topbar {
    display: none;
    position: fixed; top: 0; left: 0; right: 0; z-index: 1030;
    height: var(--header-height);
    background: var(--mrb-surface);
    border-bottom: 2px solid var(--mrb-primary);
    align-items: center; gap: .75rem; padding: 0 1rem;
    box-shadow: 0 2px 8px var(--mrb-shadow);
}
.topbar-logo img { height: 18px; width: auto; }

/* ── SIDEBAR ── */
.sidebar {
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 1020;
    width: var(--sidebar-width);
    background: var(--mrb-surface);
    border-right: 1px solid var(--mrb-border);
    display: flex; flex-direction: column;
    overflow-y: auto;
    transition: transform .25s ease;
    box-shadow: 2px 0 8px var(--mrb-shadow);
}
.sidebar-brand {
    padding: 1.35rem 1.25rem 1.1rem;
    border-bottom: 1px solid var(--mrb-border);
    position: relative;
}
.sidebar-brand::after { /* rote CI-Linie */
    content: ""; position: absolute; left: 1.25rem; bottom: -1px; width: 48px; height: 2px; background: var(--mrb-primary);
}
.sidebar-brand img { max-width: 190px; width: 100%; height: auto; }
.sidebar-brand .brand-sub {
    display: block; margin-top: .55rem;
    font-family: var(--font-mono); font-size: .6rem; font-weight: 500;
    letter-spacing: .18em; text-transform: uppercase; color: var(--mrb-text-muted);
}
.sidebar-search { position: relative; padding: .9rem 1.25rem .25rem; }
.sidebar-search i { position: absolute; left: 1.9rem; top: calc(50% + .32rem); transform: translateY(-50%); color: var(--mrb-text-muted); font-size: .85rem; pointer-events: none; }
.sidebar-search input {
    width: 100%; padding: .4rem .6rem .4rem 1.9rem; font-size: .85rem;
    background: var(--mrb-bg); border: 1px solid var(--mrb-border); border-radius: 18px; color: var(--mrb-text);
}
.sidebar-search input:focus { outline: none; border-color: var(--mrb-primary); box-shadow: 0 0 0 3px var(--mrb-primary-tint2); }
.sidebar-nav { padding: .5rem 0 .75rem; flex: 1 0 auto; }
.sidebar-section {
    padding: 1.05rem 1.25rem .4rem;
    font-family: var(--font-mono);
    font-size: .6rem; font-weight: 500;
    text-transform: uppercase; letter-spacing: .16em;
    color: var(--mrb-text-muted);
}
.sidebar .nav-link {
    position: relative;
    display: flex; align-items: center; gap: .7rem;
    padding: .5rem 1.25rem;
    color: var(--mrb-text);
    font-size: .95rem; font-weight: 500;
    border-left: 3px solid transparent;
    text-decoration: none;
    transition: color .15s, background .15s, border-color .15s;
}
.sidebar .nav-link:hover { color: var(--mrb-primary-dark); background: var(--mrb-primary-tint); border-left-color: var(--mrb-primary-tint2); }
.sidebar .nav-link.active { color: var(--mrb-primary-dark); background: var(--mrb-primary-tint); border-left-color: var(--mrb-primary); font-weight: 600; }
[data-theme="dark"] .sidebar .nav-link:hover,
[data-theme="dark"] .sidebar .nav-link.active { color: var(--mrb-primary); }
.sidebar .nav-link i { font-size: 1rem; width: 1.15rem; text-align: center; }
.sidebar .nav-link.planned { color: var(--mrb-text-muted); }
.nav-soon {
    margin-left: auto;
    font-family: var(--font-mono); font-size: .55rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase;
    padding: .12em .45em; border-radius: 5px;
    background: var(--mrb-surface-2); border: 1px solid var(--mrb-border); color: var(--mrb-text-muted);
}
.sidebar-foot {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--mrb-border);
    font-size: .74rem; color: var(--mrb-text-muted); line-height: 1.7;
}
.sidebar-foot a { color: var(--mrb-text-muted); text-decoration: none; }
.sidebar-foot a:hover { color: var(--mrb-primary-dark); }

/* ── Obere Inhaltszeile (Breadcrumb + Aktionen) ── */
.content-topbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.25rem; }
.breadcrumb-path { font-size: .85rem; color: var(--mrb-text-muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.breadcrumb-path a { color: var(--mrb-primary-dark); text-decoration: none; }
.breadcrumb-path a:hover { text-decoration: underline; text-underline-offset: 2px; }
.breadcrumb-path .sep { margin: 0 .4rem; opacity: .5; }
[data-theme="dark"] .breadcrumb-path a { color: var(--mrb-primary); }
.topbar-actions { display: flex; align-items: center; gap: .5rem; flex-shrink: 0; }
.topbar-pill {
    display: inline-flex; align-items: center; gap: .4rem;
    padding: .2rem .7rem; border: 1px solid var(--mrb-border); border-radius: 14px;
    font-size: .76rem; font-weight: 600; background: transparent;
    color: var(--mrb-text-muted); text-decoration: none; white-space: nowrap; line-height: 1.3; cursor: pointer;
    transition: color .15s, border-color .15s, background .15s;
}
.topbar-pill i { font-size: .85rem; }
.topbar-pill i.bi-box-arrow-up-right { font-size: .62rem; opacity: .7; }
[data-theme="dark"] .topbar-pill { color: var(--mrb-text-muted); }
.topbar-pill:hover { color: var(--mrb-primary-dark); border-color: var(--mrb-primary); background: var(--mrb-primary-tint); }
[data-theme="dark"] .topbar-pill:hover { color: var(--mrb-primary); }
.topbar-pill.user { color: var(--mrb-text); }
@media (max-width: 575.98px) { .topbar-pill span { display: none; } }

/* ── MAIN ── */
.main-content { margin-left: var(--sidebar-width); min-height: 100vh; display: flex; flex-direction: column; }
.content-inner { padding: 2rem 2.5rem; flex: 1 0 auto; max-width: 1280px; width: 100%; overflow-wrap: break-word; }

/* ── HERO (Anthrazit mit Glut) ── */
.mrb-hero {
    background:
        radial-gradient(640px 320px at 90% -30%, rgba(200,16,46,.42) 0%, rgba(200,16,46,0) 62%),
        radial-gradient(520px 360px at 2% 135%, rgba(232,119,34,.18) 0%, rgba(232,119,34,0) 60%),
        linear-gradient(150deg, #1b1c1f 0%, #26282b 55%, #3B3D40 100%);
    color: #fff;
    border-radius: 16px;
    padding: 2.1rem 2.3rem;
    position: relative; overflow: hidden; isolation: isolate;
    box-shadow: 0 18px 48px -22px rgba(20,20,22,.6);
}
.mrb-hero::before { /* feines technisches Raster */
    content: ""; position: absolute; inset: 0; pointer-events: none; z-index: -1;
    background-image:
        linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
    background-size: 38px 38px;
    mask-image: radial-gradient(120% 120% at 80% 0%, #000 35%, transparent 78%);
    -webkit-mask-image: radial-gradient(120% 120% at 80% 0%, #000 35%, transparent 78%);
}
.mrb-hero::after { /* rote CI-Kante unten */
    content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
    background: linear-gradient(90deg, var(--mrb-red) 0%, var(--mrb-red) 30%, rgba(200,16,46,0) 100%);
}
.mrb-hero h1 {
    color: #fff; font-weight: 700;
    font-size: clamp(1.9rem, 1.2rem + 2.4vw, 2.75rem);
    letter-spacing: -.025em; line-height: 1.06; margin: .85rem 0 .55rem;
}
.mrb-hero .lead { color: #d0d2d4; font-size: 1.08rem; max-width: 62ch; margin-bottom: 0; }
.mrb-hero .accent { color: #ff5a72; white-space: nowrap; }
.hero-badge {
    display: inline-flex; align-items: center; gap: .5rem;
    background: rgba(200,16,46,.16); color: #ff8a9b;
    border: 1px solid rgba(200,16,46,.4);
    font-family: var(--font-mono); font-size: .66rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase;
    padding: .32rem .75rem; border-radius: 7px;
}
.hero-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--mrb-red); box-shadow: 0 0 0 3px rgba(200,16,46,.3); }
.hero-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.35rem; }
.hero-q {
    display: inline-flex; align-items: center; gap: .55rem;
    background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.14);
    color: #eceef1; text-decoration: none;
    padding: .5rem .9rem; border-radius: 10px; font-size: .9rem; font-weight: 500;
    transition: background .18s, border-color .18s, transform .18s, box-shadow .18s;
}
.hero-q:hover { background: rgba(200,16,46,.2); border-color: rgba(200,16,46,.65); color: #fff; transform: translateY(-2px); box-shadow: 0 8px 18px -8px rgba(200,16,46,.55); }
.hero-q i { color: #ff5a72; font-size: 1rem; }

/* gestaffelte Einblendung */
.reveal { opacity: 0; transform: translateY(12px); animation: revealUp .6s cubic-bezier(.2,.7,.2,1) forwards; }
.reveal-1 { animation-delay: .05s; } .reveal-2 { animation-delay: .15s; } .reveal-3 { animation-delay: .27s; } .reveal-4 { animation-delay: .4s; }
@keyframes revealUp { to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .reveal { animation: none; opacity: 1; transform: none; } }

/* ── Abschnittsüberschriften ── */
.section-title { font-size: 1.55rem; font-weight: 700; margin: .35rem 0 .35rem; letter-spacing: -.02em; }
.section-sub { color: var(--mrb-text-muted); margin: 0 0 1.4rem; }
.section-eyebrow {
    display: inline-flex; align-items: center; gap: .5rem;
    font-family: var(--font-mono); font-size: .66rem; font-weight: 500; letter-spacing: .14em;
    text-transform: uppercase; color: var(--mrb-primary-dark);
}
.section-eyebrow::before { content: ""; width: 1.4rem; height: 1px; background: var(--mrb-primary); display: inline-block; }
[data-theme="dark"] .section-eyebrow { color: var(--mrb-primary); }

/* ── Karten ── */
.card { background: var(--mrb-surface); border: 1px solid var(--mrb-border); border-radius: 12px; box-shadow: 0 1px 3px var(--mrb-shadow); color: var(--mrb-text); }
.card-header { background: var(--mrb-surface-2); border-bottom: 1px solid var(--mrb-border); padding: .7rem 1rem; font-weight: 600; color: var(--mrb-heading); }

/* ── Kacheln ── */
.mrb-tile {
    position: relative; display: block; height: 100%;
    background: var(--mrb-surface); border: 1px solid var(--mrb-border); border-radius: 14px;
    padding: 1.5rem 1.4rem; overflow: hidden;
    text-decoration: none; color: inherit;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.mrb-tile::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--mrb-primary); transform: scaleY(0); transform-origin: top; transition: transform .22s ease; }
a.mrb-tile:hover { transform: translateY(-4px); box-shadow: 0 16px 34px -16px var(--mrb-shadow-strong); border-color: var(--mrb-primary); }
a.mrb-tile:hover::before { transform: scaleY(1); }
.mrb-tile-icon {
    width: 46px; height: 46px; border-radius: 12px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.4rem; margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--mrb-primary-tint2), var(--mrb-primary-tint));
    border: 1px solid var(--mrb-primary-tint2);
    color: var(--mrb-primary-dark);
    transition: transform .2s ease;
}
[data-theme="dark"] .mrb-tile-icon { color: var(--mrb-primary); }
a.mrb-tile:hover .mrb-tile-icon { transform: scale(1.06) rotate(-3deg); }
.mrb-tile h3 { font-size: 1.12rem; font-weight: 700; margin: 0 0 .45rem; letter-spacing: -.01em; }
.mrb-tile p { font-size: .93rem; margin: 0; }
.mrb-tile .tile-meta { position: absolute; top: 1.1rem; right: 1.1rem; }
.mrb-tile .tile-more { display: inline-flex; align-items: center; gap: .35rem; margin-top: .9rem; font-size: .85rem; font-weight: 600; color: var(--mrb-primary-dark); }
[data-theme="dark"] .mrb-tile .tile-more { color: var(--mrb-primary); }
.mrb-tile .tile-more i { transition: transform .2s ease; }
a.mrb-tile:hover .tile-more i { transform: translateX(4px); }

/* ── Badges ── */
.mrb-badge { font-family: var(--font-mono); font-size: .64rem; font-weight: 500; letter-spacing: .03em; padding: .28em .6em; border-radius: 6px; white-space: nowrap; }
.mrb-badge.ok    { background: rgba(46,125,50,.12);  color: var(--mrb-success); }
.mrb-badge.warn  { background: rgba(180,83,9,.13);   color: var(--mrb-warning); }
.mrb-badge.crit  { background: rgba(200,16,46,.12);  color: var(--mrb-danger); }
.mrb-badge.muted { background: var(--mrb-surface-2); color: var(--mrb-text-muted); border: 1px solid var(--mrb-border); }

/* ── Roadmap (Schritte) ── */
.steps { counter-reset: step; list-style: none; padding-left: 0; margin: 0; }
.steps li { position: relative; padding: 0 0 1.1rem 3rem; }
.steps li::before {
    counter-increment: step; content: counter(step);
    position: absolute; left: 0; top: 0; width: 2rem; height: 2rem; border-radius: 50%;
    background: var(--mrb-surface-2); border: 1px solid var(--mrb-border); color: var(--mrb-text-muted); font-weight: 700;
    display: flex; align-items: center; justify-content: center; font-size: .9rem;
}
.steps li.done::before { content: "\F26E"; font-family: "bootstrap-icons"; background: var(--mrb-success); border-color: var(--mrb-success); color: #fff; }
.steps li.next::before { background: var(--mrb-primary); border-color: var(--mrb-primary); color: #fff; box-shadow: 0 0 0 4px var(--mrb-primary-tint2); }
.steps li:not(:last-child)::after { content: ""; position: absolute; left: .97rem; top: 2.1rem; bottom: .1rem; width: 2px; background: var(--mrb-border); }
.steps li h4 { font-size: 1rem; font-weight: 700; margin: .3rem 0 .1rem; }
.steps li p { margin: 0; font-size: .9rem; color: var(--mrb-text-muted); }

.check-list { list-style: none; padding-left: 0; }
.check-list li { position: relative; padding-left: 1.7rem; margin-bottom: .5rem; }
.check-list li::before { content: "\F26E"; font-family: "bootstrap-icons"; position: absolute; left: 0; top: .05rem; color: var(--mrb-primary-dark); }
[data-theme="dark"] .check-list li::before { color: var(--mrb-primary); }

/* ── Tabellen ── */
.table { --bs-table-bg: transparent; --bs-table-border-color: var(--mrb-border); --bs-table-color: var(--mrb-text); color: var(--mrb-text); font-size: .93rem; margin: 0; }
.table th { color: var(--mrb-text-muted); font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.table td { vertical-align: middle; }
.kv-table th { text-transform: none; letter-spacing: 0; font-size: .9rem; font-weight: 600; white-space: nowrap; width: 1%; padding-right: 1.5rem; }

/* ── Buttons & Formulare ── */
.btn { font-weight: 600; border-radius: 9px; transition: transform .12s ease, background .15s, box-shadow .15s; }
.btn:active { transform: translateY(1px); }
.btn-primary { --bs-btn-bg: var(--mrb-primary); --bs-btn-border-color: var(--mrb-primary); --bs-btn-color: #fff; --bs-btn-hover-bg: var(--mrb-primary-dark); --bs-btn-hover-border-color: var(--mrb-primary-dark); --bs-btn-hover-color: #fff; --bs-btn-active-bg: var(--mrb-primary-dark); --bs-btn-active-border-color: var(--mrb-primary-dark); box-shadow: 0 6px 16px -8px rgba(200,16,46,.7); }
.btn-outline-primary { --bs-btn-color: var(--mrb-primary-dark); --bs-btn-border-color: var(--mrb-primary); --bs-btn-hover-bg: var(--mrb-primary); --bs-btn-hover-border-color: var(--mrb-primary); --bs-btn-hover-color: #fff; }
.form-control, .form-select { background: var(--mrb-surface); border-color: var(--mrb-border); color: var(--mrb-text); }
.form-control:focus, .form-select:focus { background: var(--mrb-surface); border-color: var(--mrb-primary); color: var(--mrb-text); box-shadow: 0 0 0 3px var(--mrb-primary-tint2); }
.form-label { font-size: .88rem; color: var(--mrb-heading); font-weight: 600; }
.alert { border-radius: 8px; font-size: .93rem; }

/* ── Footer ── */
.content-footer {
    border-top: 1px solid var(--mrb-border);
    padding: 1.4rem 2.5rem;
    font-size: .8rem; color: var(--mrb-text-muted);
    display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between;
}
.content-footer a { color: var(--mrb-text-muted); text-decoration: none; }
.content-footer a:hover { color: var(--mrb-primary-dark); }

/* ── Responsive ── */
@media (max-width: 991.98px) {
    .topbar { display: flex; }
    .sidebar { top: var(--header-height); transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-brand { display: none; }
    .main-content { margin-left: 0; margin-top: var(--header-height); }
    .content-inner { padding: 1.5rem 1.15rem; }
    .content-footer { padding: 1.25rem 1.15rem; }
    .mrb-hero { padding: 2rem 1.5rem; }
}
.sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 1015; }
.sidebar-backdrop.show { display: block; }
@media (max-width: 575.98px) {
    .content-inner { padding: 1.15rem 1rem; }
    .mrb-hero { padding: 1.75rem 1.2rem; }
    .mrb-hero h1 { font-size: 1.5rem; }
    .section-title { font-size: 1.3rem; }
    .mrb-tile { padding: 1.25rem 1.15rem; }
}
