/**
 * Infrahost Lizenzsystem — Admin UI
 * Visual language angelehnt an nxtbyte / Nitro-Host_Dark (Inter, Deep Navy, Panel-Karten)
 */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap");

:root {
  --ih-bg-deep: #060818;
  --ih-bg-panel: #0e1726;
  --ih-bg-sidebar: #0a101f;
  --ih-bg-sidebar-hover: rgba(255, 255, 255, 0.06);
  --ih-text: #ebedf2;
  --ih-text-muted: #888ea8;
  --ih-accent: #009688;
  --ih-accent-soft: rgba(0, 150, 136, 0.22);
  --ih-border: rgba(255, 255, 255, 0.08);
  --ih-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
  --ih-radius: 10px;
  --sidebar-width: 260px;
}

/* Bootstrap dark tuning — vollständig an Infrahost-Palette binden */
[data-bs-theme="dark"] {
  color-scheme: dark;
  --bs-body-bg: var(--ih-bg-deep);
  --bs-body-color: var(--ih-text-muted);
  --bs-emphasis-color: var(--ih-text);
  --bs-border-color: var(--ih-border);
  --bs-secondary-color: var(--ih-text-muted);
  --bs-secondary-bg: rgba(255, 255, 255, 0.06);
  --bs-tertiary-bg: var(--ih-bg-panel);
  --bs-tertiary-color: var(--ih-text-muted);
  --bs-heading-color: var(--ih-text);
  --bs-link-color: var(--ih-accent);
  --bs-link-hover-color: #4db6ac;
}

/* Utilities mit „light“ im Admin erzwingen dunkel (Legacy-Templates / Bootstrap-Mix) */
.ih-admin .table-light,
.ih-admin thead.table-light,
.ih-admin .table > thead.table-light > tr > th {
  --bs-table-bg: rgba(255, 255, 255, 0.05);
  --bs-table-color: var(--ih-text);
  --bs-table-border-color: var(--ih-border);
  background-color: rgba(255, 255, 255, 0.05) !important;
  color: var(--ih-text) !important;
  border-color: var(--ih-border) !important;
}

.ih-admin .bg-light {
  background-color: rgba(255, 255, 255, 0.06) !important;
  color: var(--ih-text) !important;
}

.ih-admin .card.bg-light,
.ih-admin .card-header.bg-light {
  background-color: rgba(255, 255, 255, 0.05) !important;
  color: var(--ih-text) !important;
  border-color: var(--ih-border) !important;
}

.ih-admin .badge.bg-light.text-dark,
.ih-admin .badge.bg-light {
  background-color: rgba(255, 255, 255, 0.12) !important;
  color: var(--ih-text) !important;
  border: 1px solid var(--ih-border);
  font-weight: 500;
}

.ih-admin .card.bg-dark {
  background-color: rgba(6, 8, 24, 0.85) !important;
  border-color: var(--ih-border) !important;
}

.ih-admin .modal-content {
  background-color: var(--ih-bg-panel);
  border: 1px solid var(--ih-border);
  color: var(--ih-text-muted);
}

.ih-admin .modal-header,
.ih-admin .modal-footer {
  border-color: var(--ih-border);
}

.ih-admin .list-group-item {
  background-color: var(--ih-bg-panel);
  border-color: var(--ih-border);
  color: var(--ih-text-muted);
}

.ih-admin .pagination .page-link {
  background-color: var(--ih-bg-panel);
  border-color: var(--ih-border);
  color: var(--ih-text-muted);
}

.ih-admin .pagination .page-link:hover {
  background-color: rgba(255, 255, 255, 0.08);
  color: var(--ih-text);
}

.ih-admin .pagination .page-item.active .page-link {
  background-color: var(--ih-accent);
  border-color: var(--ih-accent);
  color: #fff;
}

.ih-admin .text-muted {
  color: var(--ih-text-muted) !important;
}

.ih-admin code {
  color: #f472b6;
  background: rgba(255, 255, 255, 0.06);
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
}

.ih-admin .text-primary {
  color: var(--ih-accent) !important;
}

body.ih-admin {
  background-color: var(--ih-bg-deep);
  color: var(--ih-text-muted);
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  font-size: 0.9375rem;
  letter-spacing: 0.02em;
  min-height: 100vh;
}

.ih-admin h1,
.ih-admin h2,
.ih-admin h3,
.ih-admin h4,
.ih-admin .page-title,
.ih-admin .card-title {
  color: var(--ih-text);
}

.ih-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: var(--sidebar-width);
  background: linear-gradient(180deg, var(--ih-bg-sidebar) 0%, #060818 100%);
  border-right: 1px solid var(--ih-border);
  z-index: 1040;
  transition: transform 0.25s ease;
  box-shadow: var(--ih-shadow);
}

.ih-sidebar-brand {
  padding: 1.35rem 1.1rem;
  border-bottom: 1px solid var(--ih-border);
  text-align: center;
}

.ih-sidebar-brand .brand-title {
  color: var(--ih-text);
  margin: 0;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.ih-sidebar-brand .brand-sub {
  color: var(--ih-text-muted);
  font-size: 0.78rem;
  margin-top: 0.35rem;
  display: block;
}

.ih-sidebar-brand .brand-mark {
  width: 42px;
  height: 42px;
  margin: 0 auto 0.65rem;
  border-radius: 12px;
  background: linear-gradient(145deg, var(--ih-accent-soft), transparent);
  border: 1px solid var(--ih-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ih-accent);
  font-size: 1.15rem;
}

.ih-sidebar-nav {
  padding: 1rem 0.65rem;
}

.ih-sidebar .nav-link {
  color: var(--ih-text-muted);
  padding: 0.68rem 1rem;
  display: flex;
  align-items: center;
  text-decoration: none;
  transition: color 0.2s, background 0.2s;
  border-radius: 8px;
  margin-bottom: 2px;
  border-left: 3px solid transparent;
}

.ih-sidebar .nav-link:hover {
  color: var(--ih-text);
  background: var(--ih-bg-sidebar-hover);
  border-left-color: var(--ih-accent);
}

.ih-sidebar .nav-link.active {
  color: var(--ih-text);
  background: rgba(0, 150, 136, 0.12);
  border-left-color: var(--ih-accent);
}

.ih-sidebar .nav-link i {
  width: 22px;
  margin-right: 0.65rem;
  text-align: center;
  opacity: 0.95;
}

.ih-main-wrap {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  transition: margin 0.25s ease;
}

.ih-topbar {
  background: var(--ih-bg-panel);
  border-bottom: 1px solid var(--ih-border);
  padding: 0.85rem 1.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 1030;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04);
}

.ih-content {
  padding: 1.75rem;
}

.ih-page-head .page-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0;
}

.ih-admin .breadcrumb {
  background: none;
  padding: 0;
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
}

.ih-admin .breadcrumb-item a {
  color: var(--ih-accent);
  text-decoration: none;
}

.ih-admin .breadcrumb-item.active {
  color: var(--ih-text-muted);
}

.ih-admin .breadcrumb-item + .breadcrumb-item::before {
  content: "›";
  color: var(--ih-text-muted);
}

.ih-stats-card,
.ih-admin .stats-card {
  background: var(--ih-bg-panel);
  border-radius: var(--ih-radius);
  padding: 1.35rem;
  border: 1px solid var(--ih-border);
  border-left: 4px solid var(--ih-accent);
  transition: transform 0.2s ease, box-shadow 0.2s;
}

.ih-stats-card:hover,
.ih-admin .stats-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--ih-shadow);
}

.ih-stats-card.success,
.ih-admin .stats-card.success {
  border-left-color: #26bf94;
}
.ih-stats-card.warning,
.ih-admin .stats-card.warning {
  border-left-color: #f59e0b;
}
.ih-stats-card.danger,
.ih-admin .stats-card.danger {
  border-left-color: #e7515a;
}

.ih-stats-card .stats-number,
.ih-admin .stats-card .stats-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--ih-text);
  margin: 0;
}

.ih-stats-card .stats-label,
.ih-admin .stats-card .stats-label {
  color: var(--ih-text-muted);
  font-size: 0.82rem;
  margin: 0.35rem 0 0;
}

.ih-admin .card {
  background: var(--ih-bg-panel);
  border: 1px solid var(--ih-border);
  border-radius: var(--ih-radius);
  box-shadow: none;
}

.ih-admin .card-header {
  background: transparent;
  border-bottom: 1px solid var(--ih-border);
  padding: 1rem 1.25rem;
}

.ih-admin .table {
  --bs-table-bg: transparent;
  --bs-table-striped-bg: rgba(255, 255, 255, 0.03);
  color: var(--ih-text-muted);
}

.ih-admin .table th {
  border-top: none;
  font-weight: 600;
  color: var(--ih-text);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.ih-admin .table td {
  vertical-align: middle;
}

.ih-admin .badge {
  font-size: 0.72rem;
  padding: 0.4rem 0.65rem;
  border-radius: 6px;
}

.ih-admin .btn-primary {
  background-color: var(--ih-accent);
  border-color: var(--ih-accent);
}

.ih-admin .btn-primary:hover {
  background-color: #00796b;
  border-color: #00796b;
}

.ih-admin .btn-outline-secondary {
  color: var(--ih-text-muted);
  border-color: var(--ih-border);
}

.ih-admin .btn-outline-secondary:hover {
  background: var(--ih-bg-sidebar-hover);
  border-color: var(--ih-text-muted);
  color: var(--ih-text);
}

.ih-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--ih-text);
}

.ih-user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--ih-accent-soft);
  border: 1px solid var(--ih-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ih-accent);
  font-weight: 700;
  font-size: 0.95rem;
}

.ih-admin .dropdown-menu {
  background: var(--ih-bg-panel);
  border: 1px solid var(--ih-border);
}

.ih-admin .dropdown-item {
  color: var(--ih-text-muted);
}

.ih-admin .dropdown-item:hover {
  background: var(--ih-bg-sidebar-hover);
  color: var(--ih-text);
}

.ih-admin #sidebarToggle {
  border-color: var(--ih-border);
  color: var(--ih-text-muted);
}

.ih-admin #sidebarToggle:hover {
  background: var(--ih-bg-sidebar-hover);
  color: var(--ih-text);
}

.ih-admin .form-control,
.ih-admin .form-select {
  background-color: rgba(14, 23, 38, 0.85);
  border-color: var(--ih-border);
  color: var(--ih-text);
}

.ih-admin .form-control:focus,
.ih-admin .form-select:focus {
  border-color: var(--ih-accent);
  box-shadow: 0 0 0 0.2rem var(--ih-accent-soft);
}

.ih-admin .alert {
  border-radius: var(--ih-radius);
  border: 1px solid var(--ih-border);
}

@media (max-width: 768px) {
  .ih-sidebar {
    transform: translateX(-100%);
  }

  .ih-sidebar.show {
    transform: translateX(0);
  }

  .ih-main-wrap {
    margin-left: 0;
  }

  .ih-content {
    padding: 1rem;
  }
}

/* ----- Login / Auth (Admin) ----- */
.ih-auth-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  font-family: "Inter", system-ui, sans-serif;
  background: radial-gradient(ellipse 120% 80% at 50% -20%, #1a2744 0%, var(--ih-bg-deep) 45%);
  color: var(--ih-text-muted);
}

.ih-auth-wrap {
  max-width: 420px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.ih-auth-back {
  color: var(--ih-text-muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.ih-auth-back:hover {
  color: var(--ih-accent);
}

.ih-auth-card {
  background: var(--ih-bg-panel);
  border-radius: 14px;
  border: 1px solid var(--ih-border);
  overflow: hidden;
  box-shadow: var(--ih-shadow);
}

.ih-auth-head {
  padding: 2rem 1.5rem 1.25rem;
  text-align: center;
  border-bottom: 1px solid var(--ih-border);
  background: linear-gradient(180deg, rgba(0, 150, 136, 0.15) 0%, transparent 100%);
}

.ih-auth-head .auth-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 1rem;
  border-radius: 14px;
  background: var(--ih-accent-soft);
  border: 1px solid var(--ih-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ih-accent);
  font-size: 1.5rem;
}

.ih-auth-head h3 {
  color: var(--ih-text);
  margin: 0;
  font-weight: 700;
  font-size: 1.25rem;
}

.ih-auth-head p {
  margin: 0.5rem 0 0;
  font-size: 0.88rem;
  color: var(--ih-text-muted);
}

.ih-auth-body-inner {
  padding: 1.75rem 1.5rem;
}

.ih-auth-body-inner .form-label {
  color: var(--ih-text);
  font-size: 0.88rem;
}

.ih-auth-body-inner .input-group-text {
  background: rgba(6, 8, 24, 0.6);
  border-color: var(--ih-border);
  color: var(--ih-text-muted);
}

.ih-auth-body-inner .form-control {
  background: rgba(6, 8, 24, 0.55);
  border-color: var(--ih-border);
  color: var(--ih-text);
}

.ih-auth-body-inner .form-control:focus {
  border-color: var(--ih-accent);
  box-shadow: 0 0 0 0.2rem var(--ih-accent-soft);
}

.ih-auth-body-inner .btn-login {
  background: linear-gradient(135deg, var(--ih-accent) 0%, #00796b 100%);
  border: none;
  border-radius: 10px;
  padding: 0.75rem;
  font-weight: 600;
}

.ih-auth-body-inner .btn-login:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.ih-auth-foot {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.8rem;
  color: var(--ih-text-muted);
}

.ih-auth-foot i {
  color: var(--ih-accent);
}
