:root {
  --kalilab-bg-1: #07111b;
  --kalilab-bg-2: #0b1220;
  --kalilab-bg-3: #0f1923;

  --kalilab-card-top: rgba(18, 28, 45, 0.92);
  --kalilab-card-bottom: rgba(10, 17, 30, 0.96);

  --kalilab-border: rgba(0, 180, 216, 0.16);
  --kalilab-border-hover: rgba(72, 202, 228, 0.34);
  --kalilab-border-soft: rgba(255, 255, 255, 0.05);

  --kalilab-shadow:
    0 8px 22px rgba(0, 0, 0, 0.34),
    0 0 0 1px rgba(0, 180, 216, 0.05);

  --kalilab-shadow-hover:
    0 14px 30px rgba(0, 0, 0, 0.42),
    0 0 0 1px rgba(0, 180, 216, 0.14);

  --kalilab-text: #ecf8ff;
  --kalilab-text-soft: #9fb3c8;
  --kalilab-text-dim: #7f95ac;

  --kalilab-accent: #00b4d8;
  --kalilab-accent-2: #48cae4;
  --kalilab-accent-3: #90e0ef;

  --kalilab-danger: #ef4444;
  --kalilab-danger-bg: rgba(239, 68, 68, 0.10);
  --kalilab-danger-border: rgba(239, 68, 68, 0.35);

  --kalilab-ok: #22c55e;
  --kalilab-warn: #f59e0b;
}

/* Basis */
html,
body,
#page_container {
  background:
    radial-gradient(circle at top left, rgba(0, 180, 216, 0.08), transparent 24%),
    radial-gradient(circle at top right, rgba(72, 202, 228, 0.05), transparent 20%),
    linear-gradient(180deg, var(--kalilab-bg-1) 0%, var(--kalilab-bg-2) 46%, #0a1018 100%) !important;
  color: var(--kalilab-text) !important;
}

/* Global Typography */
body,
button,
input,
textarea {
  color: var(--kalilab-text) !important;
}

/* Header / obere Widgets ruhiger */
div[class*="information-widget"],
div[class*="widget_resources"],
div[class*="widget_search"],
div[class*="widget_datetime"],
div[class*="widget_greeting"] {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

/* Suchfeld */
input,
input[type="text"],
.search-input {
  background: rgba(18, 24, 35, 0.82) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 12px !important;
  color: var(--kalilab-text) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

input:focus,
input[type="text"]:focus,
.search-input:focus {
  outline: none !important;
  border-color: rgba(0, 180, 216, 0.42) !important;
  box-shadow:
    0 0 0 3px rgba(0, 180, 216, 0.10),
    inset 0 1px 0 rgba(255,255,255,0.04) !important;
}

/* Gruppenüberschriften */
h2,
.group-title {
  color: #e8f7ff !important;
  font-weight: 800 !important;
  letter-spacing: 0.2px;
  margin-bottom: 0.7rem !important;
  text-shadow: 0 0 10px rgba(0, 180, 216, 0.08);
}

/* Gruppensektion leicht separieren */
div[data-name],
section {
  position: relative;
}

div[data-name]::before,
section::before {
  content: "";
  display: block;
  height: 1px;
  width: 100%;
  margin-bottom: 10px;
  background: linear-gradient(
    90deg,
    rgba(0, 180, 216, 0.00) 0%,
    rgba(0, 180, 216, 0.18) 18%,
    rgba(255, 255, 255, 0.04) 50%,
    rgba(0, 180, 216, 0.18) 82%,
    rgba(0, 180, 216, 0.00) 100%
  );
}

/* Service Cards / Bookmarks / Widget Cards */
.service-card,
.bookmark,
.widget-card,
.information-widget,
div[class*="service_"],
div[class*="bookmark_"] {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, var(--kalilab-card-top) 0%, var(--kalilab-card-bottom) 100%) !important;
  border: 1px solid var(--kalilab-border) !important;
  border-radius: 14px !important;
  box-shadow: var(--kalilab-shadow) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease !important;
}

/* Subtile Accent-Linie oben */
.service-card::before,
.bookmark::before,
.widget-card::before,
div[class*="service_"]::before,
div[class*="bookmark_"]::before {
  content: "";
  position: absolute;
  top: 0;
  left: 12px;
  right: 12px;
  height: 1px;
  background: linear-gradient(
    90deg,
    rgba(0, 180, 216, 0) 0%,
    rgba(72, 202, 228, 0.55) 50%,
    rgba(0, 180, 216, 0) 100%
  );
  opacity: 0.7;
}

/* Hover */
.service-card:hover,
.bookmark:hover,
.widget-card:hover,
div[class*="service_"]:hover,
div[class*="bookmark_"]:hover {
  transform: translateY(-2px);
  border-color: var(--kalilab-border-hover) !important;
  box-shadow: var(--kalilab-shadow-hover) !important;
  background: linear-gradient(180deg, rgba(22, 34, 54, 0.95) 0%, rgba(12, 20, 34, 0.98) 100%) !important;
}

/* Titel */
.service-card h3,
.service-card .title,
.bookmark h3,
.widget-card h3,
div[class*="service_"] h3 {
  color: #f4fbff !important;
  font-weight: 750 !important;
  font-size: 1rem !important;
  letter-spacing: 0.1px;
}

/* Beschreibungen */
.service-card p,
.service-card .description,
.bookmark p,
.widget-card p,
div[class*="service_"] p {
  color: var(--kalilab-text-soft) !important;
  font-size: 0.89rem !important;
  line-height: 1.35 !important;
}

/* Noch etwas ruhigere Secondary Texte */
small,
span[class*="description"],
div[class*="description"] {
  color: var(--kalilab-text-dim) !important;
}

/* Icons */
.service-card img,
.service-card svg,
.bookmark img,
.bookmark svg,
.widget-card img,
.widget-card svg {
  opacity: 0.96;
  filter: drop-shadow(0 0 4px rgba(0, 180, 216, 0.06));
}

/* Status-Dots etwas hochwertiger */
div[class*="status"],
.status {
  filter: saturate(1.05) brightness(1.04);
}

/* API-Fehler / Error Banner entschärft */
.error,
[class*="error"],
[class*="failed"],
[class*="danger"] {
  background: linear-gradient(180deg, rgba(127, 17, 17, 0.34), rgba(80, 12, 12, 0.38)) !important;
  border: 1px solid rgba(239, 68, 68, 0.18) !important;
  border-left: 3px solid rgba(239, 68, 68, 0.58) !important;
  border-radius: 10px !important;
  color: #fecaca !important;
  box-shadow: none !important;
}

/* Falls Error-Balken Links/Buttons enthalten */
.error a,
[class*="error"] a,
[class*="failed"] a,
[class*="danger"] a {
  color: #fecaca !important;
}

/* Kleine Badges / pills */
span,
div[class*="badge"] {
  border-radius: 999px;
}

/* Links */
a {
  color: var(--kalilab-accent-3);
}

a:hover {
  color: #ffffff;
}

/* Card-Inhalt etwas strukturierter */
.service-card > *,
div[class*="service_"] > * {
  position: relative;
  z-index: 1;
}

/* Sehr dezenter innerer Shine */
.service-card::after,
.bookmark::after,
.widget-card::after,
div[class*="service_"]::after,
div[class*="bookmark_"]::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      135deg,
      rgba(255,255,255,0.035) 0%,
      rgba(255,255,255,0.00) 24%,
      rgba(0,180,216,0.025) 100%
    );
  pointer-events: none;
}

/* Topbar etwas cleaner */
header,
div[class*="header"] {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: #0a1018;
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 180, 216, 0.22);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 180, 216, 0.40);
}

/* Mobile etwas kompakter */
@media (max-width: 900px) {
  .service-card,
  .bookmark,
  .widget-card,
  div[class*="service_"],
  div[class*="bookmark_"] {
    border-radius: 12px !important;
  }

  .service-card h3,
  .service-card .title,
  div[class*="service_"] h3 {
    font-size: 0.96rem !important;
  }

  .service-card p,
  div[class*="service_"] p {
    font-size: 0.84rem !important;
  }
}