/* =============================================================================
   shadcn/ui Design System — Dracula (Dark) / Alucard (Light)
   ============================================================================= */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap");

/* =============================================================================
   CSS Custom Properties — Light Mode (Alucard)
   ============================================================================= */
:root {
  --background: 48 100% 96%;
  --foreground: 0 0% 12%;
  --card: 0 0% 100%;
  --card-foreground: 0 0% 12%;
  --popover: 54 37% 90%;
  --popover-foreground: 0 0% 12%;
  --primary: 252 54% 54%;
  --primary-foreground: 0 0% 100%;
  --secondary: 46 25% 90%;
  --secondary-foreground: 0 0% 12%;
  --muted: 46 25% 90%;
  --muted-foreground: 49 18% 36%;
  --accent: 54 37% 90%;
  --accent-foreground: 0 0% 12%;
  --destructive: 6 66% 48%;
  --destructive-foreground: 0 0% 100%;
  --border: 51 13% 78%;
  --input: 51 13% 78%;
  --ring: 252 54% 54%;
  --radius: 0.5rem;

  --success: 114 84% 24%;
  --success-foreground: 0 0% 100%;
  --warning: 24 78% 36%;
  --warning-foreground: 0 0% 100%;
  --info: 198 96% 30%;
  --info-foreground: 0 0% 100%;

  --sidebar-background: 48 100% 96%;
  --sidebar-foreground: 0 0% 12%;
  --sidebar-border: 51 13% 78%;
  --sidebar-primary: 252 54% 54%;
  --sidebar-primary-foreground: 0 0% 100%;
  --sidebar-accent: 54 37% 90%;
  --sidebar-accent-foreground: 0 0% 12%;
  --sidebar-muted: 49 18% 36%;

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg:
    0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);

  --gradient-primary: linear-gradient(
    135deg,
    hsl(252 54% 54%),
    hsl(336 78% 36%)
  );
  --gradient-accent: linear-gradient(
    135deg,
    hsl(198 96% 30%),
    hsl(252 54% 54%)
  );
  --gradient-success: linear-gradient(
    135deg,
    hsl(114 84% 24%),
    hsl(198 96% 30%)
  );
  --gradient-surface: linear-gradient(
    180deg,
    hsl(48 100% 96%),
    hsl(46 25% 92%)
  );
  --glow-primary: 0 0 20px hsl(252 54% 54% / 0.15);
  --glow-accent: 0 0 20px hsl(198 96% 30% / 0.1);
}

/* Localized controls must accommodate languages whose labels are longer than
   English without shrinking text or clipping keyboard focus outlines. */
html[lang="de"] .btn:not(.btn-icon):not(.btn-icon-sm),
html[lang="de"] .badge,
html[lang="de"] .sidebar-item,
html[lang="de"] .sidebar-group-toggle {
  white-space: normal;
  overflow-wrap: anywhere;
  height: auto;
  min-height: var(--control-height, 2.25rem);
}

html[lang="de"] .dialog-content {
  width: min(94vw, 36rem);
}
html[lang="de"] .page-intro-actions,
html[lang="de"] .table-actions {
  flex-wrap: wrap;
}

/* =============================================================================
   Dark Mode (Dracula)
   ============================================================================= */
.dark {
  --background: 231 15% 18%;
  --foreground: 60 30% 96%;
  --card: 230 15% 24%;
  --card-foreground: 60 30% 96%;
  --popover: 230 15% 24%;
  --popover-foreground: 60 30% 96%;
  --primary: 265 89% 78%;
  --primary-foreground: 231 15% 18%;
  --secondary: 232 14% 31%;
  --secondary-foreground: 60 30% 96%;
  --muted: 232 14% 31%;
  --muted-foreground: 225 30% 68%;
  --accent: 232 14% 31%;
  --accent-foreground: 60 30% 96%;
  --destructive: 0 100% 67%;
  --destructive-foreground: 60 30% 96%;
  --border: 232 14% 31%;
  --input: 232 14% 31%;
  --ring: 265 89% 78%;

  --success: 135 94% 65%;
  --success-foreground: 231 15% 18%;
  --warning: 31 100% 71%;
  --warning-foreground: 231 15% 18%;
  --info: 191 97% 77%;
  --info-foreground: 231 15% 18%;

  --sidebar-background: 235 14% 15%;
  --sidebar-foreground: 60 30% 96%;
  --sidebar-border: 232 14% 31%;
  --sidebar-primary: 265 89% 78%;
  --sidebar-primary-foreground: 231 15% 18%;
  --sidebar-accent: 232 14% 31%;
  --sidebar-accent-foreground: 60 30% 96%;
  --sidebar-muted: 225 30% 68%;

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.4), 0 1px 2px -1px rgb(0 0 0 / 0.4);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.4);
  --shadow-lg:
    0 10px 15px -3px rgb(0 0 0 / 0.5), 0 4px 6px -4px rgb(0 0 0 / 0.5);

  --gradient-primary: linear-gradient(135deg, #bd93f9, #ff79c6);
  --gradient-accent: linear-gradient(135deg, #8be9fd, #bd93f9);
  --gradient-success: linear-gradient(135deg, #50fa7b, #8be9fd);
  --gradient-surface: linear-gradient(
    180deg,
    hsl(231 15% 18%),
    hsl(235 14% 15%)
  );
  --glow-primary: 0 0 25px hsl(265 89% 78% / 0.2);
  --glow-accent: 0 0 20px hsl(191 97% 77% / 0.15);
}

/* =============================================================================
   Base Reset & Typography
   ============================================================================= */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family:
    "Inter",
    ui-sans-serif,
    system-ui,
    -apple-system,
    sans-serif;
  font-size: 0.875rem;
  line-height: 1.5;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  min-height: 100vh;
  transition:
    background-color 0.2s,
    color 0.2s;
}

a {
  color: hsl(var(--primary));
  text-decoration: none;
  transition: opacity 0.15s;
}
a:hover {
  opacity: 0.8;
}

code {
  font-family: "JetBrains Mono", "Fira Code", monospace;
  font-size: 0.8em;
  background: hsl(var(--muted));
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
}

/* =============================================================================
   Layout
   ============================================================================= */
.layout {
  display: flex;
  min-height: 100vh;
}
.skip-link {
  position: fixed;
  z-index: 1000;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius);
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  font-weight: 600;
  transform: translateY(-160%);
  transition: transform 0.15s ease;
}
.skip-link:focus {
  transform: translateY(0);
  opacity: 1;
}
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid hsl(var(--ring));
  outline-offset: 2px;
}

.main-content {
  flex: 1;
  margin-left: 260px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left 0.2s;
}

.content-area {
  flex: 1;
  padding: 1.5rem;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

.page-intro {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.page-intro-copy {
  min-width: 0;
}
.page-intro-eyebrow {
  color: hsl(var(--primary));
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.page-intro-title {
  margin: 0.2rem 0 0;
  font-size: 1.45rem;
  line-height: 1.25;
}
.page-intro-description {
  margin: 0.35rem 0 0;
  color: hsl(var(--muted-foreground));
  font-size: 0.86rem;
  max-width: 760px;
}
.page-intro-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
}
.narrow-page-workspace {
  width: 100%;
  max-width: 700px;
  margin: 0 auto;
}
.narrow-page-workspace--wide {
  max-width: 900px;
}

.page-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.page-toolbar-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.page-toolbar .input,
.page-toolbar .select {
  width: auto;
  min-width: 12rem;
}

.attention-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.attention-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  min-height: 88px;
  padding: 1rem;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--card));
  color: inherit;
  text-decoration: none;
}
.attention-item:hover {
  border-color: hsl(var(--primary) / 0.55);
  background: hsl(var(--accent) / 0.35);
}
.attention-item-icon {
  display: grid;
  flex: 0 0 2.25rem;
  width: 2.25rem;
  height: 2.25rem;
  place-items: center;
  border-radius: var(--radius);
  color: hsl(var(--primary));
  background: hsl(var(--primary) / 0.12);
}
.attention-item-warning .attention-item-icon {
  color: hsl(var(--warning));
  background: hsl(var(--warning) / 0.12);
}
.attention-item-danger .attention-item-icon {
  color: hsl(var(--destructive));
  background: hsl(var(--destructive) / 0.12);
}
.attention-item-value {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.15;
}
.attention-item-label {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.82rem;
  font-weight: 600;
}
.attention-item-help {
  display: block;
  margin-top: 0.2rem;
  color: hsl(var(--muted-foreground));
  font-size: 0.73rem;
  line-height: 1.35;
}

.status-indicator {
  display: inline-block;
  width: 0.42rem;
  height: 0.42rem;
  margin-right: 0.35rem;
  border-radius: 999px;
  background: currentColor;
  vertical-align: 0.08em;
}
.action-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem;
}
.action-group-destructive {
  margin-left: 0.25rem;
  padding-left: 0.5rem;
  border-left: 1px solid hsl(var(--border));
}
.capability-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.75rem 0 1rem;
}
.module-global-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 1rem;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--muted) / 0.25);
}
.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  cursor: pointer;
}
.checkbox-row input {
  flex: 0 0 auto;
  margin-top: 0.15rem;
}
.checkbox-row span {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.checkbox-row small {
  color: hsl(var(--muted-foreground));
  font-size: 0.75rem;
}
.checkbox-row-compact {
  align-items: center;
}
.checkbox-row-compact input {
  margin-top: 0;
}
.section-heading-inline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
}
.section-heading-inline h3 {
  margin: 0;
  font-size: 0.95rem;
}
.module-assignment-table .input {
  min-width: 8rem;
}

@media (max-width: 640px) {
  .page-toolbar {
    align-items: stretch;
  }
  .page-toolbar-group {
    width: 100%;
  }
  .page-toolbar .input,
  .page-toolbar .select {
    flex: 1;
    width: 100%;
    min-width: 0;
  }
  .attention-grid {
    grid-template-columns: 1fr;
  }
  .module-global-control {
    align-items: stretch;
  }
  .module-global-control .btn {
    width: 100%;
  }
}
.section-jump-nav {
  display: flex;
  gap: 0.35rem;
  padding: 0.4rem;
  margin-bottom: 1.25rem;
  overflow-x: auto;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--card));
  scrollbar-width: thin;
}
.section-jump-nav a {
  flex: 0 0 auto;
  padding: 0.45rem 0.7rem;
  border-radius: calc(var(--radius) - 2px);
  color: hsl(var(--muted-foreground));
  font-size: 0.78rem;
  font-weight: 500;
  text-decoration: none;
}
.section-jump-nav a:hover,
.section-jump-nav a:focus-visible,
.section-jump-nav a[aria-current="location"] {
  background: hsl(var(--accent));
  color: hsl(var(--foreground));
  outline: none;
}

/* =============================================================================
   Sidebar
   ============================================================================= */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 260px;
  background: var(--gradient-surface);
  border-right: 1px solid hsl(var(--sidebar-border) / 0.5);
  display: flex;
  flex-direction: column;
  z-index: 50;
  transition: transform 0.2s;
  overflow-y: auto;
  backdrop-filter: blur(12px);
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 1rem;
  border-bottom: 1px solid hsl(var(--sidebar-border));
}

.sidebar-logo {
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  box-shadow: 0 0 10px hsl(var(--primary) / 0.2);
  transition: transform 0.2s;
}

.sidebar-logo:hover {
  transform: scale(1.1);
}

.sidebar-icon-logo {
  width: 34px;
  height: 34px;
  border-radius: var(--radius);
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--glow-primary);
  transition: transform 0.2s;
  flex-shrink: 0;
}

.sidebar-icon-logo:hover {
  transform: scale(1.1);
}

.sidebar-icon-logo .material-symbols-outlined {
  font-size: 20px;
  color: #fff;
}

.sidebar-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: hsl(var(--sidebar-foreground));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-nav {
  flex: 1;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.sidebar-group {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.sidebar-group + .sidebar-group {
  margin-top: 0.25rem;
}

.sidebar-group-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.75rem;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: hsl(var(--sidebar-foreground));
  font: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.sidebar-group-toggle:hover,
.sidebar-group-toggle:focus-visible {
  background: hsl(var(--sidebar-accent));
  outline: 2px solid transparent;
}

.sidebar-group-toggle > .material-symbols-outlined:first-child {
  color: hsl(var(--sidebar-muted));
  font-size: 20px;
}

.sidebar-group-active > .sidebar-group-toggle {
  color: hsl(var(--sidebar-primary));
}

.sidebar-chevron {
  margin-left: auto;
  font-size: 18px;
  transition: transform 0.15s ease;
}

.sidebar-group-toggle[aria-expanded="true"] .sidebar-chevron {
  transform: rotate(180deg);
}

.sidebar-group-items {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.sidebar-group-items[hidden] {
  display: none;
}

.sidebar-child {
  padding-left: 1.25rem;
  font-size: 0.8rem;
}

.sidebar-child .material-symbols-outlined {
  font-size: 18px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  color: hsl(var(--sidebar-foreground));
  font-size: 0.85rem;
  font-weight: 400;
  text-decoration: none;
  transition:
    background 0.15s,
    color 0.15s;
  opacity: 1;
}

.sidebar-item:hover {
  background: hsl(var(--sidebar-accent));
  color: hsl(var(--sidebar-accent-foreground));
  opacity: 1;
}

.sidebar-item-active {
  background: hsl(var(--sidebar-accent));
  color: hsl(var(--sidebar-primary));
  font-weight: 500;
  box-shadow: inset 3px 0 0 hsl(var(--sidebar-primary));
  border-radius: 0 var(--radius) var(--radius) 0;
}

.sidebar-item .material-symbols-outlined {
  font-size: 20px;
  color: hsl(var(--sidebar-muted));
}

.sidebar-item-active .material-symbols-outlined {
  color: hsl(var(--sidebar-primary));
}

.sidebar-separator {
  height: 1px;
  background: hsl(var(--sidebar-border));
  margin: 0.5rem 0.75rem;
}

.sidebar-footer {
  padding: 0.75rem 1rem;
  border-top: 1px solid hsl(var(--sidebar-border));
  font-size: 0.75rem;
  color: hsl(var(--sidebar-muted));
  text-align: center;
}

.sidebar-footer a {
  color: hsl(var(--sidebar-muted));
  font-weight: 500;
}
.sidebar-footer a:hover {
  color: hsl(var(--sidebar-primary));
}

.sidebar-footer-heart {
  color: hsl(var(--destructive));
}

/* =============================================================================
   Top Bar
   ============================================================================= */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  background: hsl(var(--background) / 0.8);
  border-bottom: 1px solid hsl(var(--border) / 0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.topbar-title {
  font-size: 1rem;
  font-weight: 600;
  color: hsl(var(--foreground));
  margin: 0;
}

.topbar-heading {
  flex: 1;
  min-width: 0;
}

.breadcrumbs {
  margin-top: 0.15rem;
  color: hsl(var(--muted-foreground));
  font-size: 0.7rem;
}

.breadcrumbs ol {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.breadcrumbs li:empty {
  display: none;
}

.breadcrumbs li + li::before {
  content: "/";
  margin-right: 0.3rem;
  color: hsl(var(--border));
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.notification-control {
  position: relative;
}
.notification-bell {
  position: relative;
}
.notification-badge {
  position: absolute;
  top: -0.25rem;
  right: -0.3rem;
  min-width: 1.1rem;
  height: 1.1rem;
  padding: 0 0.28rem;
  border: 2px solid hsl(var(--background));
  border-radius: 999px;
  background: #ff5555;
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 0.85rem;
  text-align: center;
}
.notification-popover {
  position: absolute;
  z-index: 80;
  top: calc(100% + 0.65rem);
  right: 0;
  width: min(390px, calc(100vw - 2rem));
  overflow: hidden;
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) + 3px);
  background: hsl(var(--popover));
  color: hsl(var(--popover-foreground));
  box-shadow: 0 20px 55px rgb(0 0 0/0.38);
}
.notification-popover__header,
.notification-popover__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid hsl(var(--border));
}
.notification-popover__footer {
  justify-content: center;
  border-top: 1px solid hsl(var(--border));
  border-bottom: 0;
}
.notification-list {
  max-height: 390px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.notification-item {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr) auto;
  gap: 0.65rem;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid hsl(var(--border) / 0.6);
  color: inherit;
  text-decoration: none;
}
.notification-item:hover {
  background: hsl(var(--accent) / 0.5);
}
.notification-item.unread {
  background: hsl(var(--primary) / 0.07);
}
.notification-item__icon {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
}
.notification-item__icon.success {
  color: #50fa7b;
}
.notification-item__icon.warning {
  color: #f1fa8c;
}
.notification-item__icon.error {
  color: #ff5555;
}
.notification-item__icon.info {
  color: #8be9fd;
}
.notification-item__icon .material-symbols-outlined {
  font-size: 1.05rem;
}
.notification-item__copy {
  min-width: 0;
}
.notification-item__title {
  overflow: hidden;
  font-size: 0.82rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.notification-item__message {
  display: -webkit-box;
  overflow: hidden;
  margin-top: 0.15rem;
  color: hsl(var(--muted-foreground));
  font-size: 0.73rem;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.notification-item__time {
  margin-top: 0.25rem;
  color: hsl(var(--muted-foreground));
  font-size: 0.66rem;
}
.notification-unread-dot {
  width: 0.5rem;
  height: 0.5rem;
  margin-top: 0.45rem;
  border-radius: 50%;
  background: #ff79c6;
}
.notification-state {
  padding: 2rem 1rem;
  color: hsl(var(--muted-foreground));
  font-size: 0.8rem;
  text-align: center;
}
@media (max-width: 640px) {
  .notification-control {
    position: static;
  }
  .notification-popover {
    position: fixed;
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    max-height: 78vh;
    border-radius: 1rem 1rem 0 0;
  }
  .notification-list {
    max-height: calc(78vh - 8rem);
  }
  .topbar-user span:last-child {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .notification-popover {
    scroll-behavior: auto;
  }
}
.notification-center__toolbar {
  flex-wrap: wrap;
}
.notification-center__toolbar .tabs {
  display: flex;
  gap: 0.25rem;
}
.notification-center__list {
  display: grid;
  gap: 0.65rem;
}
.notification-center-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.8rem;
  padding: 1rem;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--card));
}
.notification-center-item.unread {
  border-left: 3px solid #ff79c6;
  background: hsl(var(--primary) / 0.045);
}
.notification-center-item__heading {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.notification-center-item__body p {
  margin: 0.3rem 0;
  color: hsl(var(--muted-foreground));
  font-size: 0.82rem;
}
.notification-center-item__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  flex-wrap: wrap;
}
@media (max-width: 720px) {
  .notification-center-item {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .notification-center-item__actions {
    grid-column: 1/-1;
    justify-content: flex-start;
  }
  .notification-center__toolbar > * {
    width: 100% !important;
  }
  .notification-center__toolbar .tabs > * {
    flex: 1;
  }
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.85rem;
  color: hsl(var(--muted-foreground));
}

.topbar-user .material-symbols-outlined {
  font-size: 20px;
}

#menuToggle {
  display: none;
}

/* =============================================================================
   Buttons
   ============================================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.25;
}

.btn:focus-visible {
  outline: 2px solid hsl(var(--ring));
  outline-offset: 2px;
}

.btn:disabled {
  opacity: 0.5;
  pointer-events: none;
}
.btn.is-loading {
  cursor: wait;
}
.btn.is-loading .material-symbols-outlined {
  animation: ux-spin 0.8s linear infinite;
}
@keyframes ux-spin {
  to {
    transform: rotate(360deg);
  }
}

.btn .material-symbols-outlined {
  font-size: 18px;
}

.btn-primary {
  background: var(--gradient-primary);
  color: hsl(var(--primary-foreground));
  border-color: transparent;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
  opacity: 0.9;
  box-shadow: var(--glow-primary), var(--shadow-md);
  transform: translateY(-1px);
}

.btn-secondary {
  background: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
  border-color: hsl(var(--secondary));
}
.btn-secondary:hover {
  opacity: 0.8;
}

.btn-destructive {
  background: linear-gradient(
    135deg,
    hsl(var(--destructive)),
    hsl(var(--destructive) / 0.8)
  );
  color: hsl(var(--destructive-foreground));
  border-color: transparent;
}
.btn-destructive:hover {
  opacity: 0.9;
  box-shadow: 0 0 15px hsl(var(--destructive) / 0.3);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: hsl(var(--foreground));
  border-color: hsl(var(--border));
}
.btn-outline:hover {
  background: hsl(var(--accent));
  border-color: hsl(var(--primary) / 0.3);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: hsl(var(--foreground));
  border-color: transparent;
}
.btn-ghost:hover {
  background: hsl(var(--accent));
  transform: translateY(-1px);
}

.btn-link {
  background: transparent;
  color: hsl(var(--primary));
  border-color: transparent;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.btn-sm {
  padding: 0.25rem 0.75rem;
  font-size: 0.8rem;
}

.btn-lg {
  padding: 0.625rem 1.5rem;
  font-size: 0.95rem;
}

.btn-icon {
  padding: 0.5rem;
  width: 2.25rem;
  height: 2.25rem;
}

.btn-icon-sm {
  padding: 0.25rem;
  width: 1.75rem;
  height: 1.75rem;
}

.btn-full {
  width: 100%;
}

/* =============================================================================
   Cards
   ============================================================================= */
.card {
  background: hsl(var(--card));
  color: hsl(var(--card-foreground));
  border: 1px solid hsl(var(--border) / 0.6);
  border-radius: calc(var(--radius) * 1.5);
  box-shadow: var(--shadow-sm);
  transition:
    box-shadow 0.25s,
    transform 0.25s,
    border-color 0.25s;
  overflow: hidden;
}

.card:hover {
  box-shadow: var(--shadow-md), var(--glow-accent);
  border-color: hsl(var(--border));
}

.card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid hsl(var(--border) / 0.5);
  flex-wrap: wrap;
  position: relative;
}

.card-header::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 1.5rem;
  right: 1.5rem;
  height: 1px;
  background: var(--gradient-primary);
  opacity: 0.3;
}

.card-header-icon {
  font-size: 22px;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.card-title {
  font-size: 1.05rem;
  font-weight: 600;
  flex: 1;
}

.card-description {
  font-size: 0.85rem;
  color: hsl(var(--muted-foreground));
}

.card-content {
  padding: 1.5rem;
}

.card-content--flush {
  padding: 0;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid hsl(var(--border));
}

/* =============================================================================
   Form Elements
   ============================================================================= */
.form-field {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 0.375rem;
  color: hsl(var(--foreground));
}

.form-description {
  font-size: 0.8rem;
  color: hsl(var(--muted-foreground));
  margin-top: 0.25rem;
}

.form-message {
  font-size: 0.8rem;
  color: hsl(var(--destructive));
  margin-top: 0.25rem;
}

.input,
.textarea,
.select {
  width: 100%;
  font-family: inherit;
  font-size: 0.875rem;
  padding: 0.5rem 0.75rem;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  border: 1px solid hsl(var(--input));
  border-radius: var(--radius);
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}

.input:focus,
.textarea:focus,
.select:focus {
  outline: none;
  border-color: hsl(var(--ring));
  box-shadow:
    0 0 0 3px hsl(var(--ring) / 0.15),
    var(--glow-primary);
}

.input[aria-invalid="true"] {
  border-color: hsl(var(--destructive));
  box-shadow: 0 0 0 3px hsl(var(--destructive) / 0.15);
}

.input::placeholder,
.textarea::placeholder {
  color: hsl(var(--muted-foreground));
}

.textarea {
  resize: vertical;
  min-height: 5rem;
}

.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236272a4' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.5rem;
}

.input-with-icon {
  position: relative;
}

.input-with-icon .material-symbols-outlined {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  color: hsl(var(--muted-foreground));
}

.input-with-icon .input {
  padding-left: 2.5rem;
}

.notification-schedule {
  margin-top: 1.25rem;
  padding: 1.1rem;
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) + 2px);
  background: hsl(var(--muted) / 0.22);
}
.notification-schedule__header,
.notification-schedule__title,
.notification-schedule__mode,
.notification-schedule__summary {
  display: flex;
  align-items: center;
}
.notification-schedule__header {
  justify-content: space-between;
  gap: 1rem;
}
.notification-schedule__title {
  gap: 0.5rem;
  font-weight: 600;
}
.notification-schedule__title .material-symbols-outlined {
  color: hsl(var(--primary));
}
.notification-schedule__mode {
  gap: 0.25rem;
  padding: 0.25rem;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--background));
}
.notification-schedule__mode-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.45rem 0.7rem;
  border: 0;
  border-radius: calc(var(--radius) - 2px);
  background: transparent;
  color: hsl(var(--muted-foreground));
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
}
.notification-schedule__mode-btn .material-symbols-outlined {
  font-size: 17px;
}
.notification-schedule__mode-btn.active {
  color: hsl(var(--primary-foreground));
  background: var(--gradient-primary);
  box-shadow: var(--shadow-sm);
}
.notification-schedule__fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid hsl(var(--border));
}
.notification-schedule__field {
  min-width: 0;
}
.notification-schedule__input {
  position: relative;
}
.notification-schedule__input > .material-symbols-outlined {
  position: absolute;
  z-index: 1;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: hsl(var(--muted-foreground));
  font-size: 19px;
  pointer-events: none;
}
.notification-schedule__input .input {
  padding-left: 2.5rem;
  color-scheme: dark;
}
html:not(.dark) .notification-schedule__input .input {
  color-scheme: light;
}
.notification-schedule__now {
  margin-top: 0.35rem;
}
.notification-schedule__presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.5rem;
}
.notification-schedule__summary {
  gap: 0.65rem;
  margin-top: 1rem;
  padding: 0.75rem;
  border-radius: var(--radius);
  background: hsl(var(--background) / 0.7);
  color: hsl(var(--foreground));
}
.notification-schedule__summary > .material-symbols-outlined {
  color: hsl(var(--primary));
}
.notification-schedule__summary span:last-child {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.notification-schedule__summary small {
  color: hsl(var(--muted-foreground));
}
@media (max-width: 680px) {
  .notification-schedule__header {
    align-items: flex-start;
    flex-direction: column;
  }
  .notification-schedule__mode {
    width: 100%;
  }
  .notification-schedule__mode-btn {
    flex: 1;
    justify-content: center;
  }
  .notification-schedule__fields {
    grid-template-columns: 1fr;
  }
}

.announcement-window {
  min-width: 190px;
  font-size: 0.78rem;
}
.announcement-window__point {
  display: grid;
  grid-template-columns: 9px 40px 1fr;
  align-items: center;
  gap: 0.45rem;
  position: relative;
}
.announcement-window__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: hsl(var(--primary));
  box-shadow: 0 0 0 3px hsl(var(--primary) / 0.13);
}
.announcement-window__point--end .announcement-window__dot {
  background: hsl(var(--muted-foreground));
  box-shadow: 0 0 0 3px hsl(var(--muted-foreground) / 0.12);
}
.announcement-window__line {
  width: 1px;
  height: 0.65rem;
  margin: 0.12rem 0 0.12rem 3.5px;
  background: hsl(var(--border));
}
.announcement-window__label {
  color: hsl(var(--muted-foreground));
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.announcement-window__value {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  white-space: nowrap;
}
.announcement-window__value strong {
  font-size: 0.78rem;
  font-weight: 600;
}
.announcement-window__value small {
  color: hsl(var(--muted-foreground));
  font-size: 0.7rem;
}
.announcement-window--immediate {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  padding: 0.45rem 0.65rem;
  border: 1px solid hsl(var(--primary) / 0.2);
  border-radius: var(--radius);
  background: hsl(var(--primary) / 0.08);
}
.announcement-window--immediate > .material-symbols-outlined {
  color: hsl(var(--primary));
  font-size: 19px;
}
.announcement-window--immediate > span:last-child {
  display: flex;
  flex-direction: column;
}
.announcement-window--immediate small {
  color: hsl(var(--muted-foreground));
}

.fixture-preview__controls {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(200px, 1fr) auto;
  gap: 1rem;
  align-items: end;
}
.fixtures-workspace {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
}
.fixtures-workspace > .simple-tabs {
  margin-bottom: 1rem;
}
.fixtures-workspace .simple-tab .material-symbols-outlined {
  font-size: 18px;
}
.fixture-preview__controls .form-field {
  margin: 0;
}
.fixture-preview__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.8rem;
  margin-top: 1.5rem;
}
.fixture-preview__match {
  overflow: hidden;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--background) / 0.55);
}
.fixture-preview__league {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0.75rem;
  background: hsl(var(--muted) / 0.35);
  color: hsl(var(--muted-foreground));
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.035em;
}
.fixture-preview__teams {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
}
.fixture-preview__teams > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  text-align: center;
}
.fixture-preview__teams img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}
.fixture-preview__teams strong {
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}
.fixture-preview__versus {
  color: hsl(var(--muted-foreground));
  font-size: 0.68rem;
  font-weight: 700;
}
.tsdb-today {
  margin-top: 1.5rem;
  padding: 10px;
  border-radius: 10px;
  background: #121212;
  color: #f0f0f0;
  font-family: Arial, sans-serif;
}
.tsdb-today__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.tsdb-today__event {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border-radius: 10px;
  background: #2a2a2a;
  box-shadow: 0 4px 8px rgb(0 0 0 / 30%);
}
.tsdb-today__media {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: #202020;
}
.tsdb-today__media > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.tsdb-today__placeholder {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  color: #777;
}
.tsdb-today__placeholder .material-symbols-outlined {
  font-size: 46px;
}
.tsdb-today__overlay {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1;
  padding: 8px;
  background: rgb(0 0 0 / 70%);
  color: white;
  font-size: clamp(0.72rem, 1.3vw, 0.9rem);
}
.tsdb-today__overlay > div {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 5px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.tsdb-today__overlay .material-symbols-outlined {
  flex: 0 0 auto;
  font-size: 16px;
}
.tsdb-today__channels {
  position: relative;
  height: 26px;
  overflow: hidden;
  padding: 4px 8px;
  border-radius: 0 0 10px 10px;
  background: rgb(0 0 0 / 50%);
  font-size: clamp(0.7rem, 1.4vw, 0.9rem);
}
.tsdb-today__channels span {
  position: absolute;
  display: flex;
  align-items: center;
  white-space: nowrap;
  animation: tsdb-scroll-left 15s linear infinite;
}
@keyframes tsdb-scroll-left {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(-100%);
  }
}
@media (max-width: 680px) {
  .fixture-preview__controls {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 768px) {
  .tsdb-today__grid {
    display: block;
  }
  .tsdb-today__event {
    display: none;
  }
  .tsdb-today__event:first-child {
    display: block;
  }
  .tsdb-today__media {
    aspect-ratio: 9/16;
  }
  .tsdb-today__channels,
  .tsdb-today__overlay {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .tsdb-today__channels span {
    animation: none;
    position: static;
  }
}

/* =============================================================================
   Utility
   ============================================================================= */
.hidden {
  display: none !important;
}

/* =============================================================================
   Simple Tabs (e.g. Provision page sections)
   ============================================================================= */
.simple-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid hsl(var(--border));
  margin-bottom: 1.5rem;
  overflow-x: auto;
}
.simple-tab {
  padding: 0.6rem 1.25rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  border-bottom: 2px solid transparent;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: inherit;
  transition:
    color 0.15s,
    border-color 0.15s;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.simple-tab:hover {
  color: hsl(var(--foreground));
}
.simple-tab.active {
  color: hsl(var(--primary));
  border-bottom-color: hsl(var(--primary));
}
.simple-tab-panel {
  display: none;
}
.simple-tab-panel.active {
  display: block;
}

/* =============================================================================
   Tables
   ============================================================================= */
.table-container {
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-gutter: stable;
}
.table-container:focus-visible {
  outline: 2px solid hsl(var(--ring));
  outline-offset: 2px;
  border-radius: var(--radius);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.table th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  border-bottom: 1px solid hsl(var(--border));
  white-space: nowrap;
}

.table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid hsl(var(--border));
  color: hsl(var(--foreground));
}

.table tbody tr:hover {
  background: hsl(var(--accent) / 0.5);
  box-shadow: inset 3px 0 0 hsl(var(--primary) / 0.5);
}

.table tbody tr:last-child td {
  border-bottom: none;
}

.table-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* =============================================================================
   Badges
   ============================================================================= */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.125rem 0.625rem;
  border-radius: 9999px;
  border: 1px solid transparent;
  white-space: nowrap;
  transition: box-shadow 0.2s;
}

.badge .material-symbols-outlined {
  font-size: 14px;
}

.badge-default {
  background: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
}

.badge-primary {
  background: hsl(var(--primary) / 0.15);
  color: hsl(var(--primary));
  border-color: hsl(var(--primary) / 0.3);
}

.badge-success {
  background: hsl(var(--success) / 0.15);
  color: hsl(var(--success));
  border-color: hsl(var(--success) / 0.3);
}

.badge-destructive {
  background: hsl(var(--destructive) / 0.15);
  color: hsl(var(--destructive));
  border-color: hsl(var(--destructive) / 0.3);
}

.badge-warning {
  background: hsl(var(--warning) / 0.15);
  color: hsl(var(--warning));
  border-color: hsl(var(--warning) / 0.3);
}

.badge-info {
  background: hsl(var(--info) / 0.15);
  color: hsl(var(--info));
  border-color: hsl(var(--info) / 0.3);
}

.badge-outline {
  background: transparent;
  color: hsl(var(--foreground));
  border-color: hsl(var(--border));
}

/* =============================================================================
   Alerts
   ============================================================================= */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-radius: var(--radius);
  border: 1px solid hsl(var(--border));
  border-left: 3px solid hsl(var(--primary));
  margin-bottom: 1rem;
  font-size: 0.85rem;
  backdrop-filter: blur(4px);
}

.alert .material-symbols-outlined {
  font-size: 20px;
  flex-shrink: 0;
  margin-top: 0.0625rem;
}

.alert-destructive {
  border-color: hsl(var(--destructive) / 0.5);
  border-left-color: hsl(var(--destructive));
  background: hsl(var(--destructive) / 0.1);
  color: hsl(var(--destructive));
}

.alert-warning {
  border-color: hsl(var(--warning) / 0.5);
  border-left-color: hsl(var(--warning));
  background: hsl(var(--warning) / 0.1);
  color: hsl(var(--warning));
}

.alert-success {
  border-color: hsl(var(--success) / 0.5);
  border-left-color: hsl(var(--success));
  background: hsl(var(--success) / 0.1);
  color: hsl(var(--success));
}

.alert-info {
  border-color: hsl(var(--info) / 0.5);
  border-left-color: hsl(var(--info));
  background: hsl(var(--info) / 0.1);
  color: hsl(var(--info));
}

/* =============================================================================
   Dialog / Modal
   ============================================================================= */
.dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgb(8 7 13 / 0.76);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  padding: 1.25rem;
  transition: opacity 0.18s ease;
}

.dialog-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.dialog-content {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border) / 0.8);
  border-radius: calc(var(--radius) * 1.75);
  box-shadow:
    0 24px 80px rgb(0 0 0 / 0.5),
    0 0 0 1px hsl(var(--foreground) / 0.025);
  padding: 1.75rem;
  width: min(100%, 430px);
  transform: scale(0.97) translateY(8px);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: min(90vh, 720px);
  overflow-y: auto;
  overflow-wrap: anywhere;
}

.dialog-overlay.active .dialog-content {
  transform: scale(1) translateY(0);
}

.dialog-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 1.25rem;
  text-align: center;
}

.dialog-icon {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  margin-bottom: 1rem;
  border: 1px solid hsl(var(--primary) / 0.25);
  border-radius: 999px;
  color: hsl(var(--primary));
  background: hsl(var(--primary) / 0.1);
}

.dialog-icon .material-symbols-outlined {
  font-size: 1.5rem;
  color: inherit;
}

.dialog-icon:has(.material-symbols-outlined[data-variant="destructive"]) {
  border-color: hsl(var(--destructive) / 0.3);
  color: hsl(var(--destructive));
  background: hsl(var(--destructive) / 0.1);
}

.dialog-icon:has(.material-symbols-outlined[data-variant="warning"]) {
  border-color: hsl(var(--warning) / 0.3);
  color: hsl(var(--warning));
  background: hsl(var(--warning) / 0.1);
}

.dialog-icon:has(.material-symbols-outlined[data-variant="success"]) {
  border-color: hsl(var(--success) / 0.3);
  color: hsl(var(--success));
  background: hsl(var(--success) / 0.1);
}

.dialog-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: hsl(var(--foreground));
  margin: 0;
}

.dialog-description {
  max-width: 34rem;
  margin: 0.625rem 0 0;
  font-size: 0.925rem;
  color: hsl(var(--muted-foreground));
  line-height: 1.6;
}

.dialog-description--callout {
  display: flex;
  width: 100%;
  max-width: none;
  align-items: flex-start;
  gap: 0.75rem;
  margin-top: 1.25rem;
  padding: 0.875rem 1rem;
  border: 1px solid hsl(var(--destructive) / 0.5);
  border-left: 3px solid hsl(var(--destructive));
  border-radius: var(--radius);
  color: hsl(var(--foreground));
  background: hsl(var(--destructive) / 0.1);
  text-align: left;
}

.dialog-description--callout::before {
  content: "error";
  flex: 0 0 auto;
  color: hsl(var(--destructive));
  font-family: "Material Symbols Outlined";
  font-size: 1.25rem;
  font-weight: normal;
  line-height: 1.25;
}

.dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.625rem;
  margin-top: 1.75rem;
}

.dialog-footer .btn {
  min-width: 6.5rem;
  min-height: 2.625rem;
}

.dialog-field-error {
  margin-top: 0.4rem;
  color: hsl(var(--destructive));
  font-size: 0.78rem;
}

.dialog-content[aria-busy="true"] {
  cursor: progress;
}
.dialog-content[aria-busy="true"] .dialog-footer .btn {
  pointer-events: none;
}
.dialog-content [hidden] {
  display: none !important;
}
.dialog-content > .alert {
  margin: 0.25rem 0 0;
}

@media (max-width: 480px) {
  .dialog-overlay {
    padding: 1rem;
  }
  .dialog-content {
    width: 100%;
    max-width: none;
    padding: 1.5rem;
  }
  .dialog-footer {
    flex-direction: column-reverse;
    margin-top: 1.5rem;
  }
  .dialog-footer .btn {
    width: 100%;
    justify-content: center;
  }
}

/* =============================================================================
   Empty State
   ============================================================================= */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  color: hsl(var(--muted-foreground));
  text-align: center;
}

.empty-state .material-symbols-outlined {
  font-size: 48px;
  margin-bottom: 1rem;
  opacity: 0.4;
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.empty-state p {
  font-size: 0.9rem;
}

/* =============================================================================
   Separator
   ============================================================================= */
.separator {
  height: 1px;
  background: hsl(var(--border));
  margin: 1.5rem 0;
}

.separator-text {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.5rem 0;
  color: hsl(var(--muted-foreground));
  font-size: 0.8rem;
}

.separator-text::before,
.separator-text::after {
  content: "";
  flex: 1;
  height: 1px;
  background: hsl(var(--border));
}

/* =============================================================================
   Toast Notifications
   ============================================================================= */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  background: hsl(var(--card));
  color: hsl(var(--card-foreground));
  border: 1px solid hsl(var(--border));
  border-left: 3px solid hsl(var(--primary));
  transform: translateX(100%);
  opacity: 0;
  transition:
    transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.3s;
  max-width: 360px;
}

.toast-visible {
  transform: translateX(0);
  opacity: 1;
}

.toast-hiding {
  transform: translateX(100%);
  opacity: 0;
}

.toast-success {
  border-left-color: hsl(var(--success));
  border-color: hsl(var(--success) / 0.5);
  background: hsl(var(--success) / 0.1);
  color: hsl(var(--success));
}

.toast-destructive {
  border-left-color: hsl(var(--destructive));
  border-color: hsl(var(--destructive) / 0.5);
  background: hsl(var(--destructive) / 0.1);
  color: hsl(var(--destructive));
}

.toast-warning {
  border-left-color: hsl(var(--warning));
  border-color: hsl(var(--warning) / 0.5);
  background: hsl(var(--warning) / 0.1);
  color: hsl(var(--warning));
}

/* =============================================================================
   Theme Toggle
   ============================================================================= */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius);
  border: 1px solid hsl(var(--border));
  background: transparent;
  color: hsl(var(--foreground));
  cursor: pointer;
  transition:
    background 0.15s,
    transform 0.2s,
    box-shadow 0.2s;
}

.theme-toggle:hover {
  background: hsl(var(--accent));
  transform: rotate(15deg);
  box-shadow: var(--glow-primary);
}

.theme-toggle .material-symbols-outlined {
  font-size: 20px;
  transition: transform 0.3s;
}

/* =============================================================================
   Helper & Utility Classes
   ============================================================================= */
.text-muted {
  color: hsl(var(--muted-foreground));
}
.text-primary {
  color: hsl(var(--primary));
}
.text-destructive {
  color: hsl(var(--destructive));
}
.text-success {
  color: hsl(var(--success));
}
.text-sm {
  font-size: 0.8rem;
}
.text-xs {
  font-size: 0.75rem;
}
.text-center {
  text-align: center;
}
.font-medium {
  font-weight: 500;
}
.font-semibold {
  font-weight: 600;
}

.flex {
  display: flex;
}
.flex-col {
  flex-direction: column;
}
.items-center {
  align-items: center;
}
.justify-between {
  justify-content: space-between;
}
.justify-end {
  justify-content: flex-end;
}
.gap-1 {
  gap: 0.25rem;
}
.gap-2 {
  gap: 0.5rem;
}
.gap-3 {
  gap: 0.75rem;
}
.gap-4 {
  gap: 1rem;
}
.mt-1 {
  margin-top: 0.25rem;
}
.mt-2 {
  margin-top: 0.5rem;
}
.mt-4 {
  margin-top: 1rem;
}
.mb-2 {
  margin-bottom: 0.5rem;
}
.mb-4 {
  margin-bottom: 1rem;
}
.mx-auto {
  margin-left: auto;
  margin-right: auto;
}
.w-full {
  width: 100%;
}
.max-w-lg {
  max-width: 600px;
}
.max-w-xl {
  max-width: 700px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 200px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.copy-value {
  appearance: none;
  -webkit-appearance: none;
  display: block;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.copy-value:focus-visible {
  outline: 2px solid hsl(var(--ring));
  outline-offset: 3px;
  border-radius: calc(var(--radius) / 2);
}

/* =============================================================================
   Login Page
   ============================================================================= */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1rem;
  background: var(--gradient-surface);
  position: relative;
}

.login-body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(
      ellipse at top,
      hsl(var(--primary) / 0.08) 0%,
      transparent 60%
    ),
    radial-gradient(
      ellipse at bottom right,
      hsl(var(--info) / 0.05) 0%,
      transparent 50%
    );
  pointer-events: none;
}

.login-card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border) / 0.5);
  border-radius: calc(var(--radius) * 1.5);
  box-shadow: var(--shadow-lg), var(--glow-primary);
  padding: 2rem;
  width: 100%;
  max-width: 400px;
  position: relative;
  overflow: hidden;
}

.login-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-primary);
}

.login-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.login-logo {
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem;
  display: block;
  border-radius: calc(var(--radius) * 1.5);
  box-shadow: var(--glow-primary);
  transition: transform 0.3s;
}

.login-logo:hover {
  transform: scale(1.05) rotate(2deg);
}

.login-icon-logo {
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem;
  border-radius: calc(var(--radius) * 1.5);
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--glow-primary), var(--shadow-lg);
  transition:
    transform 0.3s,
    box-shadow 0.3s;
}

.login-icon-logo:hover {
  transform: scale(1.05) rotate(2deg);
  box-shadow:
    0 0 30px hsl(var(--primary) / 0.4),
    var(--shadow-lg);
}

.login-icon-logo .material-symbols-outlined {
  font-size: 32px;
  color: #fff;
}

.login-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.login-subtitle {
  font-size: 0.85rem;
  color: hsl(var(--muted-foreground));
}

.login-footer {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.8rem;
  color: hsl(var(--muted-foreground));
}

.login-footer a {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: hsl(var(--muted-foreground));
}
.login-footer a:hover {
  color: hsl(var(--primary));
}

/* =============================================================================
   Mobile Responsive
   ============================================================================= */
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgb(0 0 0 / 0.5);
  z-index: 45;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.sidebar-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

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

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  #menuToggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: var(--radius);
    border: none;
    background: transparent;
    color: hsl(var(--foreground));
    cursor: pointer;
  }

  #menuToggle:hover {
    background: hsl(var(--accent));
  }

  .grid-2 {
    grid-template-columns: 1fr;
  }

  .card-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  .page-intro {
    flex-direction: column;
  }
  .page-intro-actions {
    width: 100%;
    justify-content: flex-start;
  }
  .content-area {
    padding: 1rem;
  }

  .topbar {
    padding: 0.75rem 1rem;
  }

  .topbar-user span:not(.material-symbols-outlined) {
    display: none;
  }

  .table {
    font-size: 0.8rem;
  }

  .table th,
  .table td {
    padding: 0.5rem 0.625rem;
  }
  .btn {
    min-height: 2.75rem;
  }
  .btn-icon,
  .btn-icon-sm {
    width: 2.75rem;
    height: 2.75rem;
    padding: 0.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* =============================================================================
   Analytics Components
   ============================================================================= */
.grid-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border) / 0.6);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  position: relative;
  overflow: hidden;
  transition:
    box-shadow 0.2s,
    transform 0.2s;
}

.stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-accent);
  opacity: 0.6;
}

.stat-card:hover {
  box-shadow: var(--shadow-md), var(--glow-accent);
  transform: translateY(-2px);
}

.stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.stat-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
}

.stat-icon {
  color: hsl(var(--primary));
}

.stat-icon .material-symbols-outlined {
  font-size: 20px;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: hsl(var(--foreground));
}

.grid-analytics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

@media (max-width: 1023px) {
  .grid-analytics {
    grid-template-columns: 1fr;
  }
}

.country-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.country-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.375rem 0;
  border-bottom: 1px solid hsl(var(--border));
  font-size: 0.85rem;
}

.country-item:last-child {
  border-bottom: none;
}

.country-count {
  font-weight: 600;
  color: hsl(var(--primary));
}

.bar-chart {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.bar-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.bar-label {
  font-size: 0.8rem;
  color: hsl(var(--muted-foreground));
  min-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-track {
  flex: 1;
  height: 8px;
  background: hsl(var(--muted));
  border-radius: 4px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: 4px;
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.bar-value {
  font-size: 0.8rem;
  font-weight: 600;
  color: hsl(var(--foreground));
  min-width: 40px;
  text-align: right;
}

.client-map {
  width: 100%;
  height: 300px;
  border-radius: var(--radius);
  border: 1px solid hsl(var(--border));
  background: hsl(var(--muted));
  overflow: hidden;
}

.traffic-vector-map {
  position: relative;
  min-height: 350px;
  background:
    radial-gradient(circle at 50% 48%, rgb(68 71 90 / 0.42), transparent 68%),
    #282a36;
  border-color: rgb(98 114 164 / 0.42);
}

.traffic-vector-map .jvectormap-container {
  background: transparent !important;
}

.traffic-vector-map .jvectormap-zoomin,
.traffic-vector-map .jvectormap-zoomout,
.traffic-map-reset {
  box-sizing: border-box;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid rgb(189 147 249 / 0.48);
  border-radius: 6px;
  background: #343746;
  color: #f8f8f2;
  font:
    600 18px/1 Inter,
    sans-serif;
  box-shadow: 0 5px 18px rgb(25 26 33 / 0.34);
  cursor: pointer;
}

.traffic-vector-map .jvectormap-zoomin {
  top: 12px;
  left: 12px;
}
.traffic-vector-map .jvectormap-zoomout {
  top: 46px;
  left: 12px;
}

.traffic-map-reset {
  position: absolute;
  z-index: 3;
  top: 80px;
  left: 12px;
}

.traffic-vector-map .jvectormap-zoomin:hover,
.traffic-vector-map .jvectormap-zoomout:hover,
.traffic-map-reset:hover,
.traffic-map-reset:focus-visible {
  border-color: #ff79c6;
  background: #44475a;
  color: #ff79c6;
  outline: none;
}

body .jvectormap-tip {
  z-index: 1000;
  padding: 0.55rem 0.7rem;
  border: 1px solid rgb(189 147 249 / 0.48);
  border-radius: 7px;
  background: #21222c;
  color: #f8f8f2;
  font:
    500 0.75rem/1.45 Inter,
    sans-serif;
  box-shadow: 0 10px 30px rgb(25 26 33 / 0.52);
}

.traffic-map-tip-value {
  color: #ff79c6;
}
.traffic-map-tip-muted {
  color: #8be9fd;
  opacity: 0.78;
}

/* Hourly Bar Chart */
.hourly-chart {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 120px;
  padding-bottom: 1.25rem;
  position: relative;
}

.hourly-bar-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
  position: relative;
}

.hourly-bar {
  width: 100%;
  min-height: 2px;
  background: var(--gradient-accent);
  border-radius: 2px 2px 0 0;
  transition:
    height 0.3s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.2s;
  opacity: 0.7;
}

.hourly-bar[data-peak="1"] {
  background: var(--gradient-primary);
  opacity: 1;
  box-shadow: 0 0 8px hsl(var(--primary) / 0.4);
}

.hourly-bar-wrap:hover .hourly-bar {
  opacity: 1;
}

.hourly-label {
  position: absolute;
  bottom: -1.25rem;
  font-size: 0.65rem;
  color: hsl(var(--muted-foreground));
}

/* Daily Bar Chart */
.daily-chart {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 80px;
  padding-bottom: 1.25rem;
  position: relative;
}

.daily-bar-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
  position: relative;
}

.daily-bar {
  width: 100%;
  min-height: 2px;
  background: var(--gradient-primary);
  border-radius: 2px 2px 0 0;
  transition: height 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  opacity: 0.8;
}

.daily-bar-wrap:hover .daily-bar {
  opacity: 1;
  box-shadow: 0 0 6px hsl(var(--primary) / 0.3);
}

.daily-label {
  position: absolute;
  bottom: -1.25rem;
  font-size: 0.6rem;
  color: hsl(var(--muted-foreground));
  white-space: nowrap;
}

/* Country list expanded */
.country-item-expanded {
  padding: 0.5rem 0;
  border-bottom: 1px solid hsl(var(--border) / 0.5);
}

.country-item-expanded:last-child {
  border-bottom: none;
}

.country-item-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.375rem;
}

.country-bar-track {
  height: 4px;
  background: hsl(var(--muted));
  border-radius: 2px;
  overflow: hidden;
}

.country-bar-fill {
  height: 100%;
  background: var(--gradient-accent);
  border-radius: 2px;
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Window selector buttons */
.window-selector {
  display: flex;
  gap: 0.25rem;
}
