:root {
  --background: #f8fafc;
  --foreground: #0f172a;
  --card: #ffffff;
  --card-foreground: #0f172a;
  --popover: #ffffff;
  --popover-foreground: #0f172a;
  --primary: #4f46e5;
  --primary-foreground: #ffffff;
  --secondary: #e2e8f0;
  --secondary-foreground: #0f172a;
  --muted: #f1f5f9;
  --muted-foreground: #475569;
  --accent: #eef2ff;
  --accent-foreground: #3730a3;
  --destructive: #ef4444;
  --destructive-foreground: #ffffff;
  --mono: #0f172a;
  --mono-foreground: #ffffff;
  --border: #e2e8f0;
  --input: #e2e8f0;
  --ring: #06b6d4;
  --radius: 0.75rem;
  --foundry-z-header: 40;
  --foundry-z-sidebar: 80;
  --foundry-z-sidebar-backdrop: 70;
  --foundry-z-modal-backdrop: 90;
  --foundry-z-drawer: 100;
  --foundry-z-modal: 110;
  --foundry-z-popover: 120;
  --foundry-z-toast: 130;
}

body.foundry-public-auth-route #sidebar,
body.foundry-public-auth-route #header,
body.foundry-public-auth-route .kt-footer,
body.foundry-public-auth-route #mobileSidebarBackdrop {
  display: none !important;
}

body.foundry-public-auth-route {
  min-height: 100vh;
  background:
    radial-gradient(circle at 0% 0%, rgb(20 184 166 / 0.18) 0, transparent 28rem),
    radial-gradient(circle at 100% 0%, rgb(79 70 229 / 0.18) 0, transparent 30rem),
    linear-gradient(135deg, #edfdfa 0%, #f7fbff 45%, #f1f5ff 100%) !important;
}

body.foundry-public-auth-route .kt-wrapper {
  padding-inline-start: 0 !important;
  padding-top: 0 !important;
  width: 100vw !important;
  max-width: 100vw !important;
  min-height: 100vh !important;
  background: transparent !important;
}

body.foundry-public-auth-route main {
  position: fixed !important;
  inset: 0 !important;
  left: 0 !important;
  right: 0 !important;
  padding-top: 0 !important;
  width: 100vw !important;
  max-width: 100vw !important;
  min-height: 100vh !important;
  margin: 0 !important;
  overflow: hidden !important;
  background: transparent !important;
}

body.foundry-public-auth-route .foundry-page {
  position: fixed !important;
  inset: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-width: none;
  margin: 0 !important;
  padding: 0 !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  background: transparent !important;
}

.dark {
  --background: #0f172a;
  --foreground: #e2e8f0;
  --card: #111827;
  --card-foreground: #f8fafc;
  --popover: #111827;
  --popover-foreground: #f8fafc;
  --primary: #818cf8;
  --primary-foreground: #0f172a;
  --secondary: #1e293b;
  --secondary-foreground: #e2e8f0;
  --muted: #1e293b;
  --muted-foreground: #94a3b8;
  --accent: #164e63;
  --accent-foreground: #cffafe;
  --destructive: #f87171;
  --destructive-foreground: #0f172a;
  --mono: #f8fafc;
  --mono-foreground: #0f172a;
  --border: #334155;
  --input: #334155;
  --ring: #22d3ee;
}

.foundry-logo {
  width: 132px;
  max-height: 34px;
  object-fit: contain;
}

.foundry-mini-logo {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.foundry-page {
  min-height: calc(100vh - 70px);
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--ring) 18%, transparent);
}

.foundry-action-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.foundry-fit-action {
  width: fit-content;
  justify-self: start;
}

.foundry-contained-card-header > * {
  min-width: 0;
}

.foundry-contained-action-row {
  max-width: 100%;
  justify-content: flex-start;
}

@media (min-width: 640px) {
  .foundry-contained-action-row {
    justify-content: flex-end;
  }
}

.foundry-page-header > * {
  min-width: 0;
}

.foundry-stat-grid {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.foundry-module-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  align-items: stretch;
}

.foundry-mini-stat-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.foundry-dashboard-grid {
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
}

.foundry-two-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.foundry-form-grid {
  grid-template-columns: minmax(260px, 0.38fr) minmax(0, 1fr);
}

.foundry-form-field-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.foundry-check-list {
  display: grid;
  gap: 0.75rem;
}

.foundry-check-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.625rem;
  min-width: 0;
  border-radius: 0.625rem;
}

.foundry-check-row span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.foundry-control-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-width: 0;
  border-radius: 0.75rem;
  background: color-mix(in srgb, var(--muted) 70%, transparent);
  padding: 0.75rem;
  cursor: pointer;
}

.foundry-control-row > span:first-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.foundry-control-row .kt-switch,
.foundry-check-row .kt-checkbox,
.foundry-check-row input[type="checkbox"],
.foundry-check-row input[type="radio"] {
  flex: 0 0 auto;
}

.foundry-control-row .kt-switch input,
input.kt-switch,
.kt-checkbox,
input.kt-checkbox,
.kt-radio,
input.kt-radio,
.foundry-check-row input[type="checkbox"],
.foundry-check-row input[type="radio"] {
  accent-color: var(--primary);
}

.kt-checkbox,
input.kt-checkbox,
.kt-radio,
input.kt-radio,
.foundry-check-row input[type="checkbox"],
.foundry-check-row input[type="radio"] {
  width: 1rem;
  height: 1rem;
  min-width: 1rem;
}

input.kt-switch,
.kt-switch input[type="checkbox"] {
  min-width: 2.25rem;
  min-height: 1.25rem;
}

.foundry-check-row:focus-within,
.foundry-control-row:focus-within {
  outline: 2px solid color-mix(in srgb, var(--primary) 42%, transparent);
  outline-offset: 2px;
}

[data-control-state="checked"].foundry-check-row,
[data-control-state="checked"].foundry-control-row {
  background: color-mix(in srgb, var(--primary) 8%, transparent);
}

.kt-input,
.kt-select,
.kt-textarea {
  max-width: 100%;
}

.foundry-main-panel {
  min-width: 0;
}

.foundry-table-wrap {
  overflow-x: auto;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.kt-card,
.kt-card-body,
.kt-card-header,
.kt-card-table,
.foundry-dashboard-grid > *,
.foundry-two-grid > *,
.foundry-module-grid > *,
.foundry-stat-grid > *,
.foundry-kanban > * {
  min-width: 0;
  max-width: 100%;
}

.kt-card-table.foundry-table-wrap {
  display: block;
}

.foundry-mobile-only {
  display: none;
}

.foundry-table {
  min-width: 900px;
}

#header {
  z-index: var(--foundry-z-header);
}

#header_container {
  min-width: 0;
}

#header .kt-btn {
  white-space: nowrap;
}

#globalSearch {
  min-width: 0;
}

.foundry-footer {
  border-top: 1px solid var(--border);
  background: var(--background);
}

.foundry-footer button {
  cursor: pointer;
}

.foundry-footer .kt-container-fixed {
  min-width: 0;
}

.foundry-break {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.foundry-modal-open,
.foundry-drawer-open {
  display: flex !important;
}

.foundry-sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: var(--foundry-z-sidebar-backdrop);
}

.foundry-modal {
  z-index: var(--foundry-z-modal);
  pointer-events: none;
}

.foundry-drawer {
  z-index: var(--foundry-z-drawer);
  pointer-events: auto;
}

.foundry-toast {
  z-index: var(--foundry-z-toast);
}

.foundry-search-result.is-active {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px rgb(79 70 229 / 0.45);
}

.foundry-input-error {
  border-color: var(--error) !important;
  box-shadow: 0 0 0 1px rgb(239 68 68 / 0.35);
}

body.foundry-overlay-open {
  overflow: hidden;
}

#notificationsDrawer.foundry-drawer-open,
#utilityDrawer.foundry-drawer-open {
  position: fixed !important;
  box-sizing: border-box;
  width: min(520px, calc(100vw - 2.5rem)) !important;
  max-width: calc(100vw - 2.5rem) !important;
  inset-inline-start: auto !important;
  inset-inline-end: 1.25rem !important;
  right: 1.25rem !important;
  left: auto !important;
  --tw-translate-x: 0 !important;
  --tw-translate-y: 0 !important;
  translate: 0 0 !important;
  transform: translateX(0) !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

.foundry-modal-open {
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: 1.25rem;
  z-index: var(--foundry-z-modal) !important;
  pointer-events: none !important;
}

.foundry-modal-open .kt-modal-content {
  max-height: calc(100vh - 2.5rem);
  pointer-events: auto !important;
  position: relative;
  z-index: 1;
}

.foundry-modal-open .kt-modal-body {
  overflow-y: auto;
}

.foundry-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: var(--foundry-z-modal-backdrop);
  background: rgb(15 23 42 / 0.35);
}

.foundry-route-link.is-active {
  background: hsl(var(--accent) / 0.6);
  border-radius: 0.5rem;
}

.foundry-route-link:focus-visible {
  outline: 2px solid hsl(var(--primary));
  outline-offset: 2px;
  border-radius: 0.5rem;
}

.foundry-route-link.is-active .kt-menu-title,
.foundry-route-link.is-active .kt-menu-icon,
.foundry-route-link.is-active .kt-menu-bullet::before {
  color: hsl(var(--primary));
}

.foundry-menu-heading.is-active {
  color: hsl(var(--primary));
}

.foundry-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: visible;
}

.foundry-pill-row .kt-badge {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
  white-space: normal !important;
  overflow-wrap: anywhere;
}

.foundry-kanban {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  align-items: start;
}

.foundry-module-grid > .kt-card,
.foundry-kanban > .kt-card {
  height: 100%;
}

[data-kanban-card] {
  display: flex;
  min-height: 128px;
  flex-direction: column;
  justify-content: space-between;
}

.foundry-calendar {
  grid-template-columns: repeat(7, minmax(90px, 1fr));
}

.foundry-calendar-cell {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  min-height: 112px;
  min-width: 0;
}

.foundry-calendar-event {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.foundry-skeleton {
  position: relative;
  overflow: hidden;
  border-radius: 0.5rem;
  background: hsl(var(--muted));
}

.foundry-skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, hsl(var(--background) / 0.7), transparent);
  animation: foundry-shimmer 1.2s infinite;
}

.foundry-auth-shell {
  min-height: 100vh;
  width: 100%;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 8% 12%, rgb(20 184 166 / 0.2) 0, transparent 30rem),
    radial-gradient(circle at 94% 8%, rgb(79 70 229 / 0.18) 0, transparent 32rem),
    linear-gradient(135deg, #edfdfa 0%, #f7fbff 45%, #f1f5ff 100%);
  padding: clamp(1rem, 2.6vw, 2rem);
}

.foundry-auth-grid {
  display: grid;
  grid-template-columns: minmax(360px, 0.86fr) minmax(520px, 1.14fr);
  gap: clamp(1rem, 2vw, 1.5rem);
  min-height: calc(100vh - clamp(2rem, 5.2vw, 4rem));
  width: min(1440px, 100%);
  margin: 0 auto;
}

.foundry-auth-form-side {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.foundry-auth-panel {
  width: min(100%, 492px);
}

.foundry-auth-card {
  width: 100%;
  border: 1px solid color-mix(in srgb, var(--border) 82%, white);
  border-radius: 1.25rem;
  background: rgb(255 255 255 / 0.92);
  box-shadow: 0 24px 70px rgb(15 23 42 / 0.12);
  padding: clamp(1.5rem, 3vw, 2.5rem);
  backdrop-filter: blur(16px);
}

.foundry-auth-card-center {
  text-align: center;
}

.foundry-auth-brand {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
}

.foundry-auth-logo {
  width: 172px;
  max-height: 58px;
  object-fit: contain;
}

.foundry-auth-pill,
.foundry-auth-hero-eyebrow {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, #14b8a6 35%, white);
  background: color-mix(in srgb, #14b8a6 10%, white);
  color: #0f766e;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
  padding: 0.45rem 0.65rem;
  text-transform: uppercase;
}

.foundry-auth-title {
  font-size: clamp(1.85rem, 3vw, 2.65rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: 0;
}

.foundry-auth-copy {
  max-width: 34rem;
  color: var(--muted-foreground);
  font-size: 0.95rem;
  line-height: 1.65;
}

.foundry-auth-form {
  display: grid;
  gap: 1rem;
}

.foundry-auth-input {
  min-height: 2.9rem;
  border-radius: 0.875rem;
  background: color-mix(in srgb, #ffffff 88%, var(--muted));
}

.foundry-auth-options {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  color: var(--muted-foreground);
  font-size: 0.875rem;
}

.foundry-auth-check {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.foundry-auth-primary,
.foundry-auth-provider,
.foundry-auth-secondary {
  min-height: 2.85rem;
  justify-content: center;
  border-radius: 0.875rem;
  font-weight: 700;
}

.foundry-auth-primary {
  border: 0;
  background: linear-gradient(135deg, #0f766e 0%, #1d4ed8 52%, #4338ca 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 14px 26px rgb(29 78 216 / 0.22);
}

.foundry-auth-primary:hover {
  filter: brightness(1.04);
  transform: translateY(-1px);
}

.foundry-auth-provider {
  gap: 0.7rem;
  border-color: color-mix(in srgb, var(--border) 76%, #94a3b8) !important;
  background: #ffffff !important;
  color: #0f172a !important;
}

.foundry-auth-provider:hover {
  border-color: color-mix(in srgb, #1d4ed8 42%, var(--border)) !important;
  background: #f8fafc !important;
}

.foundry-auth-provider img {
  width: 1.15rem;
  height: 1.15rem;
  flex: 0 0 auto;
}

.foundry-auth-secondary {
  width: fit-content;
  justify-self: center;
  padding-inline: 1rem;
}

.foundry-auth-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.75rem;
  color: var(--muted-foreground);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.foundry-auth-divider span {
  height: 1px;
  background: var(--border);
}

.foundry-auth-divider em {
  font-style: normal;
}

.foundry-auth-hero {
  position: relative;
  min-height: 520px;
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / 0.42);
  border-radius: 1.5rem;
  background:
    radial-gradient(circle at 18% 15%, rgb(45 212 191 / 0.42) 0, transparent 18rem),
    radial-gradient(circle at 86% 12%, rgb(129 140 248 / 0.5) 0, transparent 22rem),
    linear-gradient(145deg, #07111f 0%, #0f2634 42%, #111827 100%);
  box-shadow: 0 24px 70px rgb(15 23 42 / 0.18);
}

.foundry-auth-hero-image {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(120deg, rgb(7 17 31 / 0.92) 0%, rgb(8 47 73 / 0.72) 46%, rgb(49 46 129 / 0.48) 100%),
    repeating-linear-gradient(135deg, rgb(255 255 255 / 0.08) 0 1px, transparent 1px 48px);
}

.foundry-auth-hero::before {
  content: "";
  position: absolute;
  right: clamp(-3rem, -4vw, -1.5rem);
  top: clamp(1rem, 6vw, 4rem);
  width: min(42vw, 560px);
  aspect-ratio: 1;
  background: url("assets/media/app/foundry-icon-white.png") center / contain no-repeat;
  opacity: 0.15;
  filter: drop-shadow(0 28px 60px rgb(0 0 0 / 0.22));
  z-index: 1;
}

.foundry-auth-hero::after {
  content: "";
  position: absolute;
  inset: auto clamp(1.4rem, 3vw, 3.5rem) clamp(1.4rem, 3vw, 3rem) auto;
  width: min(44%, 24rem);
  aspect-ratio: 1.65;
  border: 1px solid rgb(255 255 255 / 0.18);
  border-radius: 1.25rem;
  background:
    linear-gradient(180deg, rgb(255 255 255 / 0.2), rgb(255 255 255 / 0.08)),
    linear-gradient(90deg, rgb(20 184 166 / 0.32), rgb(79 70 229 / 0.3));
  box-shadow: 0 30px 80px rgb(0 0 0 / 0.18);
  backdrop-filter: blur(18px);
  z-index: 1;
}

.foundry-auth-hero-overlay {
  position: relative;
  z-index: 2;
  display: flex;
  min-height: 100%;
  max-width: 30rem;
  flex-direction: column;
  justify-content: flex-end;
  gap: 1rem;
  padding: clamp(2rem, 4vw, 4rem);
  color: #ffffff;
}

.foundry-auth-hero-overlay h2 {
  max-width: 29rem;
  font-size: clamp(2.1rem, 3.55vw, 4rem);
  font-weight: 850;
  line-height: 1;
  letter-spacing: 0;
}

.foundry-auth-hero-overlay p {
  max-width: 29rem;
  color: rgb(226 232 240 / 0.9);
  font-size: 1rem;
  line-height: 1.65;
}

.foundry-auth-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 0.5rem;
  max-width: 31rem;
}

.foundry-auth-stat {
  min-width: 0;
  border: 1px solid rgb(255 255 255 / 0.16);
  border-radius: 1rem;
  background: rgb(255 255 255 / 0.12);
  padding: 0.85rem;
  backdrop-filter: blur(12px);
}

.foundry-auth-stat strong,
.foundry-auth-stat span {
  display: block;
  overflow-wrap: anywhere;
}

.foundry-auth-stat strong {
  font-size: 1.15rem;
  line-height: 1;
}

.foundry-auth-stat span {
  margin-top: 0.35rem;
  color: rgb(226 232 240 / 0.84);
  font-size: 0.74rem;
}

.foundry-auth-status-icon {
  display: inline-flex;
  width: 3.25rem;
  height: 3.25rem;
  align-items: center;
  justify-content: center;
  border-radius: 1rem;
  background: color-mix(in srgb, #14b8a6 14%, white);
  color: #0f766e;
  font-size: 1.4rem;
}

.foundry-auth-status-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

@keyframes foundry-shimmer {
  100% {
    transform: translateX(100%);
  }
}

.foundry-sidebar-brand {
  min-width: 0;
}

.kt-sidebar-collapse .foundry-logo {
  display: none;
}

.kt-sidebar-collapse .foundry-mini-logo {
  display: block;
}

.foundry-mini-logo {
  display: none;
}

#sidebar {
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
}

#sidebar_content {
  flex: 1 1 auto !important;
  min-height: 0;
  overflow: hidden;
}

#sidebar_scrollable {
  flex: 1 1 auto !important;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  max-height: 100%;
}

#sidebar_menu {
  min-width: 0;
}

@media (max-width: 1023px) {
  .foundry-auth-shell {
    padding: 1rem;
  }

  .foundry-auth-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .foundry-auth-form-side {
    align-items: stretch;
    order: 1;
  }

  .foundry-auth-panel {
    width: 100%;
  }

  .foundry-auth-hero {
    order: 2;
    min-height: 240px;
    border-radius: 1.15rem;
  }

  .foundry-auth-hero-overlay {
    padding: 1.35rem;
  }

  .foundry-auth-hero-overlay h2 {
    max-width: 24rem;
    font-size: clamp(1.85rem, 8vw, 3rem);
  }

  .foundry-auth-hero-overlay p {
    max-width: 24rem;
  }

  main .kt-container-fixed.foundry-page {
    width: 100vw !important;
    max-width: 100%;
    box-sizing: border-box;
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .foundry-logo {
    width: 118px;
  }

  #sidebar {
    z-index: var(--foundry-z-sidebar);
  }

  #notificationsDrawer.foundry-drawer-open,
  #utilityDrawer.foundry-drawer-open {
    width: calc(100vw - 1.5rem) !important;
    max-width: calc(100vw - 1.5rem) !important;
    inset-inline-start: 0.75rem !important;
    inset-inline-end: 0.75rem !important;
    left: 0.75rem !important;
    right: 0.75rem !important;
  }

  .foundry-table {
    min-width: 760px;
  }

  .foundry-dashboard-grid,
  .foundry-two-grid,
  .foundry-form-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 1024px) and (max-width: 1279px) {
  body.demo1.kt-sidebar-fixed .kt-wrapper {
    width: 100vw;
    max-width: 100vw;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  body.demo1.kt-sidebar-fixed .kt-container-fixed {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding-left: 1rem;
    padding-right: 1rem;
  }

  #header_container .kt-input {
    width: min(240px, 100%);
  }

  .foundry-contained-action-row {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 1023px) {
  body.demo1 {
    --sidebar-width: 0px;
  }

  body.demo1 #sidebar {
    width: min(280px, 85vw) !important;
  }
}

@media (max-width: 640px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  .foundry-auth-grid {
    min-height: auto;
  }

  .foundry-auth-card {
    border-radius: 1rem;
    padding: 1.25rem;
  }

  .foundry-auth-brand {
    align-items: flex-start;
    flex-direction: column;
    margin-bottom: 1.5rem;
  }

  .foundry-auth-logo {
    width: 148px;
  }

  .foundry-auth-title {
    font-size: 1.85rem;
  }

  .foundry-auth-options {
    align-items: flex-start;
    flex-direction: column;
  }

  .foundry-auth-hero {
    min-height: 210px;
  }

  .foundry-auth-hero-overlay h2 {
    font-size: 1.65rem;
    line-height: 1.04;
  }

  .foundry-auth-hero-overlay p {
    font-size: 0.9rem;
  }

  .foundry-auth-stats {
    display: none;
  }

  .foundry-page-header {
    flex-direction: column;
    align-items: stretch;
    max-width: calc(100vw - 2rem);
  }

  .foundry-action-row {
    width: 100%;
    max-width: calc(100vw - 2rem);
    display: flex;
    flex-wrap: wrap;
  }

  .foundry-action-row .kt-btn {
    width: auto;
    max-width: 100%;
    justify-content: center;
    min-width: 0;
  }

  .foundry-desktop-table,
  .kt-card-table.foundry-table-wrap.foundry-desktop-table {
    display: none;
  }

  .foundry-mobile-only {
    display: grid;
  }

  .foundry-module-grid,
  .foundry-mini-stat-grid,
  .foundry-stat-grid,
  .foundry-kanban {
    grid-template-columns: 1fr;
  }

  .foundry-calendar {
    grid-template-columns: repeat(7, minmax(76px, 1fr));
  }

  .foundry-calendar-cell {
    min-height: 96px;
    padding: 0.5rem;
  }

  #header_container {
    width: 100vw !important;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    gap: 0.25rem;
    padding-left: 0.375rem;
    padding-right: 0.375rem;
  }

  html body.demo1.kt-sidebar-fixed.kt-header-fixed header#header.kt-header {
    inset-inline-start: 0 !important;
    inset-inline-end: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100vw !important;
  }

  html body.demo1.kt-sidebar-fixed .kt-wrapper {
    padding-inline-start: 0 !important;
  }

  #header_container > div {
    min-width: 0;
  }

  #header_container > div:last-child {
    flex-shrink: 0;
    gap: 0.125rem;
  }

  #header .foundry-logo {
    display: none;
  }

  #header .kt-btn-icon {
    width: 1.75rem;
    height: 1.75rem;
  }

  #header button[data-action="open-create-menu"] {
    width: 1.75rem;
    height: 1.75rem;
    min-width: 1.75rem;
    padding-inline: 0;
    font-size: 0;
  }

  #header button[data-action="open-create-menu"] i {
    margin: 0;
    font-size: 1rem;
  }

  #header button[data-action="toggle-theme"] {
    display: none;
  }

  #header button[data-action="open-user-menu"] {
    display: none;
  }

  #header button[data-action="open-user-menu"] img {
    width: 2rem;
    height: 2rem;
  }

  .kt-wrapper,
  main {
    min-width: 0;
  }
}
