/* app.css – Activator Manager */

/* ── Layout ────────────────────────────────────────────────────────────────── */
html, body, #root {
  height: 100%;
  margin: 0;
}

#app-shell {
  display: flex;
  height: 100%;
}

/* ── Sidebar ────────────────────────────────────────────────────────────────── */
#sidebar {
  width: 220px;
  min-width: 220px;
  background: #1a1f2e;
  color: #c8d0e0;
  display: flex;
  flex-direction: column;
  padding-top: 0;
  z-index: 100;
  transition: margin-left .2s ease;
}
#app-shell.sidebar-collapsed #sidebar { margin-left: -221px; }
#sidebar-handle {
  display: none; position: fixed; left: 0; top: 50%; transform: translateY(-50%);
  z-index: 200; border: none; background: #1a1f2e; color: #c8d0e0;
  border-radius: 0 .5rem .5rem 0; padding: .7rem .45rem; box-shadow: 1px 0 6px rgba(0,0,0,.2);
}
#app-shell.sidebar-collapsed #sidebar-handle { display: block; }

#sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.25rem 1rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.08);
  letter-spacing: .02em;
}

#sidebar-brand i {
  color: #6ea8fe;
}
#sidebar-collapse-btn { background: none; border: none; color: inherit; opacity: .7; }
#sidebar-collapse-btn:hover { opacity: 1; color: #fff; }
#mobile-topbar { display: none; }
#mobile-topbar .mobile-brand { font-weight: 700; }
#mobile-topbar .mobile-brand i { color: #6ea8fe; }

#nav-menu {
  flex: 1;
  padding: .5rem 0;
}

#nav-menu .nav-link {
  display: flex;
  align-items: center;
  padding: .6rem 1.25rem;
  color: #9ba8bb;
  font-size: .9rem;
  border-radius: 0;
  transition: background .15s, color .15s;
}

#nav-menu .nav-link i {
  width: 1.4rem;
  text-align: center;
}

#nav-menu .nav-link:hover {
  background: rgba(255,255,255,.06);
  color: #fff;
}

#nav-menu .nav-link.active {
  background: rgba(110,168,254,.15);
  color: #6ea8fe;
  border-left: 3px solid #6ea8fe;
}

#sidebar-footer {
  padding: .75rem 1.25rem;
  border-top: 1px solid rgba(255,255,255,.08);
  font-size: .82rem;
  color: #6c7a93;
}

#sidebar-footer .user-email {
  color: #9ba8bb;
  font-size: .8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Software-Suite- & Konto-Buttons — dezent
   (siehe _corporate-design/components/suite-switcher.md + account-link.md) */
#btn-suite,
#btn-account {
  color: #9ba8bb;
  border: none;
  padding-left: 0;
  padding-right: 0;
}

#btn-suite:hover,
#btn-account:hover {
  color: #fff;
}

/* Footer-Block unterhalb des Sign-out-Buttons (Copyright/Changelog/Datenschutz) */
#sidebar-footer .sidebar-copyright {
  margin-top: .85rem;
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .78rem;
  color: #6c7a93;
}

#sidebar-footer .sidebar-copyright a,
#sidebar-footer .sidebar-legal a {
  color: #9ba8bb;
  text-decoration: none;
}

#sidebar-footer .sidebar-copyright a:hover,
#sidebar-footer .sidebar-legal a:hover {
  color: #fff;
  text-decoration: underline;
}

#sidebar-footer .sidebar-legal {
  margin-top: .2rem;
  font-size: .78rem;
}

#sidebar-footer .cl-icon {
  background: none;
  border: none;
  color: #6c7a93;
  padding: 0;
  margin-left: auto;
  line-height: 1;
  cursor: pointer;
}

#sidebar-footer .cl-icon:hover {
  color: #fff;
}

/* Software-Suite-Switcher (Modal-Kacheln) */
.suite-grid {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.suite-tile {
  display: flex;
  align-items: center;
  gap: .9rem;
  padding: .75rem .9rem;
  border: 1px solid #e3e8f0;
  border-radius: .6rem;
  text-decoration: none;
  color: inherit;
  transition: background .15s, border-color .15s;
}

.suite-tile:hover {
  background: #f4f6fb;
  border-color: #6ea8fe;
}

.suite-tile.current {
  background: #f4f6fb;
  cursor: default;
  pointer-events: none;
}

.suite-tile-icon {
  font-size: 1.25rem;
  width: 1.6rem;
  text-align: center;
  color: #6ea8fe;
}

.suite-tile-name {
  font-weight: 600;
  font-size: .9rem;
}

.suite-tile-desc {
  font-size: .8rem;
  color: #6c757d;
}

/* ── Main content ───────────────────────────────────────────────────────────── */
#main-area { flex: 1; min-width: 0; display: flex; flex-direction: column; }
#main-content {
  flex: 1;
  overflow-y: auto;
  background: #f4f6fb;
  padding: 1.75rem 2rem;
}

/* Persistent legal footer — visible on every page & viewport (transparency / imprint duty). */
#app-footer {
  flex: 0 0 auto;
  display: flex; flex-wrap: wrap; gap: .3rem 1rem;
  align-items: center; justify-content: space-between;
  padding: .6rem 2rem calc(.6rem + env(safe-area-inset-bottom));
  background: #fff; border-top: 1px solid rgba(0,0,0,.08);
  font-size: .78rem; color: #6c757d;
}
#app-footer .af-links a { color: #6c757d; text-decoration: none; margin-right: .9rem; }
#app-footer .af-links a:last-child { margin-right: 0; }
#app-footer .af-links a:hover { color: #1f8a4c; text-decoration: underline; }
@media (max-width: 600px) {
  #app-footer { padding: .55rem 1rem calc(.55rem + env(safe-area-inset-bottom)); justify-content: center; text-align: center; }
  #app-footer .af-op { width: 100%; }
}

/* ── Cards ──────────────────────────────────────────────────────────────────── */
.card {
  border: none;
  border-radius: .6rem;
}

.card.shadow-sm {
  box-shadow: 0 1px 6px rgba(0,0,0,.08) !important;
}

/* ── Tables ─────────────────────────────────────────────────────────────────── */
.table th {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #6c757d;
  font-weight: 600;
  border-top: none;
}

.table td {
  vertical-align: middle;
  font-size: .9rem;
}

/* ── Status badges ──────────────────────────────────────────────────────────── */
.badge-status-active     { background-color: #198754; }
.badge-status-inactive   { background-color: #6c757d; }
.badge-status-pending    { background-color: #fd7e14; }
.badge-status-cancelled  { background-color: #dc3545; }

/* ── Toast container ────────────────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

/* ── Spinner overlay ────────────────────────────────────────────────────────── */
.page-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 0;
}

/* ── Off-Canvas-Drawer + Mobile-Topbar (siehe _corporate-design/components/app-shell.md) ── */
#sidebar-backdrop { display: none; }
@media (max-width: 768px) {
  #mobile-topbar { display: flex; align-items: center; gap: .5rem; flex-shrink: 0; height: 48px; padding: 0 .75rem; background: #1a1f2e; color: #fff; }
  #mobile-topbar .btn { color: #fff; font-size: 1.15rem; padding: .2rem .5rem; }
  #sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    margin-left: 0 !important;
    transform: translateX(-100%);
    transition: transform .25s ease;
    z-index: 1100;
  }
  body.sidebar-open #sidebar { transform: none; }
  #sidebar-backdrop {
    display: none; position: fixed; inset: 0;
    background: rgba(0, 0, 0, .45); z-index: 1090;
  }
  body.sidebar-open #sidebar-backdrop { display: block; }
  #sidebar-handle, #sidebar-collapse-btn { display: none !important; }
  #main-content { padding: 1rem; }
}
