/* ==========================================================================
   HUB.One — Enterprise Demo
   main.css
   Design tokens, base styles, shell layout (sidebar + topbar + content)
   ========================================================================== */

/* ---------- Design tokens ---------- */
:root {
  /* Brand */
  --c-primary:        #E30613;   /* HUBTEX Red */
  --c-primary-600:    #C50410;
  --c-primary-700:    #A6030D;
  --c-primary-50:     #FDECEE;

  /* Neutrals */
  --c-ink-900:        #15181C;   /* Sidebar darker */
  --c-ink-800:        #1F2429;   /* Sidebar background */
  --c-ink-700:        #2A2F35;
  --c-ink-600:        #3A4047;
  --c-ink-500:        #5C6470;
  --c-ink-400:        #8A93A0;   /* Muted text */
  --c-ink-300:        #B0B5BB;   /* Sidebar inactive text */
  --c-ink-200:        #D6D9DD;
  --c-ink-100:        #E6E8EC;   /* Borders */
  --c-ink-50:         #F1F3F5;
  --c-bg:             #F5F6F8;   /* Page background */
  --c-surface:        #FFFFFF;
  --c-text:           #1F2937;
  --c-text-muted:     #6B7280;

  /* States */
  --c-success:        #10A66E;
  --c-success-50:     #E5F6EE;
  --c-warning:        #D97706;
  --c-warning-50:     #FEF3E2;
  --c-danger:         #DC2626;
  --c-danger-50:      #FDECEE;
  --c-info:           #1D4ED8;
  --c-info-50:        #E8EEFD;

  /* Geometry */
  --radius-sm:        4px;
  --radius:           8px;
  --radius-lg:        12px;
  --radius-xl:        16px;

  /* Elevation */
  --shadow-xs:        0 1px 2px rgba(15, 23, 42, .04);
  --shadow-sm:        0 1px 3px rgba(15, 23, 42, .06), 0 1px 2px rgba(15, 23, 42, .03);
  --shadow-md:        0 4px 12px rgba(15, 23, 42, .07), 0 2px 4px rgba(15, 23, 42, .04);
  --shadow-lg:        0 12px 28px rgba(15, 23, 42, .10);

  /* Layout */
  --sidebar-w:        240px;
  --sidebar-w-collapsed: 72px;
  --topbar-h:         64px;
  --content-max:      1440px;

  /* Type */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, svg { display: block; max-width: 100%; }

/* Sprint 6.1 Bugfix: globale Default-Größe für SVG-Icons.
   Ohne diese Regel skalieren SVGs ohne explizite width/height-Attribute
   bis zur Container-Breite (siehe `max-width:100%` oben). Spezifische
   Kontexte (Sidebar, Topbar, Toast, Empty-State) überschreiben gezielt. */
.ico { width: 16px; height: 16px; flex-shrink: 0; display: inline-block; vertical-align: middle; }

/* Wrapper-Container, in denen das Icon visuell groß bleiben soll */
.solution__ico .ico,
.rel-card__ico .ico,
.quick__ico .ico,
.afeed__ico .ico,
.list__ico .ico,
.lbadge__ico .ico,
.dl-item__ico .ico,
.compliance__ico .ico,
.svc-card__brand .ico,
.wf-card__ico .ico,
.reportcard__ico .ico,
.kpi__ico .ico,
.mod-ico .ico,
.qr .ico { width: 20px; height: 20px; }

/* Trailing-Pfeile in Karten klein halten */
.solution > .ico:last-child,
.rel-card > .ico:last-child { width: 14px; height: 14px; opacity: .5; }
button { font-family: inherit; cursor: pointer; border: 0; background: transparent; color: inherit; }
a { color: inherit; text-decoration: none; }
input, select, textarea { font-family: inherit; font-size: 14px; color: inherit; }
h1, h2, h3, h4, h5, h6 { margin: 0; font-weight: 600; letter-spacing: -.01em; color: var(--c-text); }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
table { border-collapse: collapse; width: 100%; }

/* ---------- App Shell Layout ---------- */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
  background: var(--c-bg);
}

/* ===== SIDEBAR ===== */
.sidebar {
  position: sticky; top: 0;
  height: 100vh;
  background: var(--c-ink-800);
  color: var(--c-ink-300);
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255,255,255,.04);
  z-index: 30;
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 22px 18px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.sidebar__logo {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -.02em;
  color: #fff;
  line-height: 1;
}
.sidebar__logo .dot { color: var(--c-primary); }
.sidebar__brand-sub {
  font-size: 10.5px;
  color: var(--c-ink-400);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-top: 4px;
  font-weight: 500;
}

.sidebar__nav {
  flex: 1;
  overflow-y: auto;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--c-ink-300);
  cursor: pointer;
  transition: background .15s, color .15s;
  white-space: nowrap;
  position: relative;
}
.sidebar__item .ico { width: 18px; height: 18px; flex-shrink: 0; opacity: .85; }
.sidebar__item:hover { background: rgba(255,255,255,.05); color: #fff; }
.sidebar__item:hover .ico { opacity: 1; }

.sidebar__item.is-active {
  background: var(--c-primary);
  color: #fff;
}
.sidebar__item.is-active .ico { opacity: 1; }
.sidebar__item .badge {
  margin-left: auto;
  background: rgba(255,255,255,.12);
  color: #fff;
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
}
.sidebar__item.is-active .badge { background: rgba(255,255,255,.22); }

.sidebar__collapse {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-top: 1px solid rgba(255,255,255,.06);
  font-size: 12.5px;
  color: var(--c-ink-300);
  font-weight: 500;
  cursor: pointer;
  transition: background .15s;
}
.sidebar__collapse:hover { background: rgba(255,255,255,.04); color: #fff; }
.sidebar__collapse .ico { width: 16px; height: 16px; }

/* ===== TOPBAR ===== */
.topbar {
  position: sticky; top: 0;
  height: var(--topbar-h);
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-ink-100);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 28px;
  z-index: 20;
}

.topbar__search {
  flex: 1;
  max-width: 720px;
  position: relative;
  display: flex;
  align-items: center;
}
.topbar__search .ico {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--c-text-muted);
}
.topbar__search input {
  width: 100%;
  height: 40px;
  padding: 0 14px 0 40px;
  background: var(--c-ink-50);
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--c-text);
  outline: none;
  transition: border-color .15s, background .15s;
}
.topbar__search input::placeholder { color: var(--c-text-muted); }
.topbar__search input:focus {
  background: #fff;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(227,6,19,.10);
}

.topbar__actions { display: flex; align-items: center; gap: 8px; }

.topbar__icnbtn {
  position: relative;
  width: 38px; height: 38px;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center; justify-content: center;
  color: var(--c-text-muted);
  transition: background .15s, color .15s;
}
.topbar__icnbtn:hover { background: var(--c-ink-50); color: var(--c-text); }
.topbar__icnbtn .ico { width: 18px; height: 18px; }
.topbar__icnbtn .ind {
  position: absolute; top: 8px; right: 9px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--c-primary);
  border: 2px solid #fff;
}

.topbar__profile {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
  transition: background .15s;
  text-decoration: none; color: inherit;
  border: 0; background: transparent; cursor: pointer;
  flex-shrink: 0;
}
.topbar__profile:hover { background: var(--c-ink-50); }
.topbar__profile .name {
  display: flex; flex-direction: column; line-height: 1.15; text-align: left;
  white-space: nowrap;
}
.topbar__profile .name strong { font-size: 13px; font-weight: 600; white-space: nowrap; }
.topbar__profile .name span  { font-size: 11px; color: var(--c-text-muted); text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
.topbar__profile .ico        { width: 14px; height: 14px; flex-shrink: 0; opacity: .55; }

/* Avatar circle */
.avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--c-primary), var(--c-primary-700));
  color: #fff;
  display: inline-flex;
  align-items: center; justify-content: center;
  font-weight: 600;
  font-size: 12.5px;
  flex-shrink: 0;
  user-select: none;
}
.avatar--sm { width: 26px; height: 26px; font-size: 10.5px; }
.avatar--lg { width: 44px; height: 44px; font-size: 16px; }
.avatar--xl { width: 64px; height: 64px; font-size: 22px; }
.avatar--ink { background: linear-gradient(135deg, #4B5563, #1F2937); }
.avatar--blue { background: linear-gradient(135deg, #3B82F6, #1D4ED8); }
.avatar--green { background: linear-gradient(135deg, #34D399, #059669); }
.avatar--amber { background: linear-gradient(135deg, #F59E0B, #B45309); }

/* ===== MAIN ===== */
.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.page {
  padding: 28px 32px 64px;
  flex: 1;
}

/* Page header */
.page__head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
}
.page__title { font-size: 24px; font-weight: 700; letter-spacing: -.015em; }
.page__subtitle { color: var(--c-text-muted); font-size: 14px; margin-top: 4px; }
.page__actions { display: flex; gap: 8px; align-items: center; }

/* Breadcrumb */
.breadcrumb {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--c-text-muted);
  margin-bottom: 6px;
}
.breadcrumb a:hover { color: var(--c-primary); }
.breadcrumb .sep { color: var(--c-ink-200); }
.breadcrumb strong { color: var(--c-text); font-weight: 500; }

/* Utility wrapper */
.container { max-width: var(--content-max); margin: 0 auto; }
[hidden] { display: none !important; }

/* Scrollbar styling */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--c-ink-200); border-radius: 8px; }
*::-webkit-scrollbar-thumb:hover { background: var(--c-ink-300); }
*::-webkit-scrollbar-track { background: transparent; }
