:root {
  --background: 220 20% 6%;
  --foreground: 0 0% 98%;
  --card: 220 18% 10%;
  --card-foreground: 0 0% 98%;
  --primary: 24 84% 53%;
  --primary-foreground: 0 0% 100%;
  --muted-foreground: 220 9% 64%;
  --border: 220 14% 18%;
  --warning: 38 90% 55%;
  --info: 217 85% 65%;
  --danger: 0 78% 58%;
  --success: 145 63% 42%;

  --toast-neutral-bg: hsl(220 18% 10%);
  --toast-neutral-fg: hsl(0 0% 98%);
  --toast-neutral-border: hsl(220 14% 18%);
}

* {
  box-sizing: border-box;
}

[x-cloak] {
  display: none !important;
}

body {
  margin: 0;
  padding: 0;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  font-family: "DM Sans", "Segoe UI", sans-serif;
}

.admin-header,
.admin-nav,
.card,
.alert {
  border: 1px solid hsl(var(--border));
  border-radius: 12px;
  background: hsl(var(--card));
  color: hsl(var(--card-foreground));
}

.admin-header {
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

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

.admin-nav {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.admin-nav a {
  color: hsl(var(--primary));
  text-decoration: none;
  border-bottom: 2px solid transparent;
  padding-bottom: 0.1rem;
}

.admin-nav a.active {
  border-color: hsl(var(--primary));
}

.admin-main {
  margin-top: 1rem;
  display: grid;
  gap: 1rem;
}

.admin-main > * {
  min-width: 0;
}

.card {
  padding: 1rem;
  min-width: 0;
}

code {
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}

.auth-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1rem;
  background: radial-gradient(circle at 50% -20%, hsl(var(--card)), hsl(var(--background)) 70%);
}

.auth-wrapper {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin: 0 auto;
}

.auth-brand {
  text-align: center;
}

.auth-brand-logo {
  display: block;
  width: min(100%, 220px);
  height: auto;
  margin: 0 auto;
}

.auth-brand p {
  margin: 0.25rem 0 0;
  font-size: 1.1rem;
}

.auth-card {
  padding: 2.5rem 2rem;
  box-shadow: 0 10px 40px -10px hsla(0, 0%, 0%, 0.5), 0 0 0 1px hsl(var(--border));
  border: none;
  background: hsl(var(--card));
  border-radius: 16px;
}

.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-header h2 {
  margin: 0 0 0.5rem 0;
  font-size: 1.5rem;
}

.auth-header p {
  margin: 0;
  font-size: 0.95rem;
}

.button-large {
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-weight: 600;
  margin-top: 1rem;
  border-radius: 10px;
  transition: filter 0.2s ease, transform 0.1s ease;
  width: 100%;
}

.button-large:hover {
  filter: brightness(1.1);
}

.button-large:active {
  transform: scale(0.98);
}

.form-grid label span {
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.2rem;
  display: block;
}

.form-grid input {
  border-radius: 10px;
  padding: 0.7rem 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-grid input:focus {
  outline: none;
  border-color: hsl(var(--primary));
  box-shadow: 0 0 0 3px hsla(var(--primary), 0.2);
}

.admin-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.admin-sidebar {
  background: hsl(var(--card));
  border-right: 1px solid hsl(var(--border));
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
}

.sidebar-header {
  height: 64px;
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  border-bottom: 1px solid hsl(var(--border));
}

.sidebar-brand {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
}

.sidebar-brand-logo {
  display: block;
  width: min(100%, 156px);
  height: auto;
}

.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1.25rem 0.75rem;
}

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

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  text-decoration: none;
  color: hsl(var(--muted-foreground));
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.nav-item:hover {
  background: hsla(var(--primary), 0.1);
  color: hsl(var(--primary));
}

.nav-item.active {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

.nav-item svg,
.sidebar-footer svg {
  width: 1.25rem;
  height: 1.25rem;
}

.sidebar-footer {
  padding: 1.25rem 1rem;
  border-top: 1px solid hsl(var(--border));
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
}

.avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 10px;
  background: linear-gradient(135deg, hsl(var(--primary)), #f9a826);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  flex-shrink: 0;
  box-shadow: 0 2px 10px hsla(var(--primary), 0.3);
}

.user-info {
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
}

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

.user-role {
  font-size: 0.7rem;
  color: hsl(var(--muted-foreground));
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.logout-icon-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
}

.logout-icon-button:hover {
  background: hsla(var(--danger), 0.1);
  color: hsl(var(--danger));
}

.logout-icon-button svg {
  width: 1.1rem;
  height: 1.1rem;
}

.admin-content {
  display: flex;
  flex-direction: column;
  min-width: 0;
  width: 100%;
}

.content-header {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  background: hsla(var(--background), 0.8);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid hsl(var(--border));
  position: sticky;
  top: 0;
  z-index: 10;
}

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

.header-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-width: 0;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.75rem;
  background: hsla(var(--foreground), 0.04);
  border: 1px solid hsl(var(--border));
  border-radius: 8px;
  font-size: 0.8rem;
}

.breadcrumb-item {
  display: flex;
  align-items: center;
  color: hsl(var(--muted-foreground));
  text-decoration: none;
  transition: color 0.2s ease;
}

.breadcrumb-item:not(.active):hover {
  color: hsl(var(--primary));
}

.breadcrumb-item svg {
  width: 1rem;
  height: 1rem;
}

.breadcrumb-item.active {
  color: hsl(var(--foreground));
  font-weight: 600;
}

.breadcrumb-separator {
  color: hsl(var(--muted-foreground));
  opacity: 0.4;
  font-size: 0.75rem;
}

.admin-main {
  padding: 2rem;
  margin-top: 0;
}

.mobile-nav-toggle {
  display: none;
  align-items: center;
  padding: 0.45rem 0.7rem;
  border: 1px solid hsl(var(--border));
  border-radius: 8px;
  background: hsla(var(--foreground), 0.04);
  color: hsl(var(--foreground));
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}

.mobile-nav-toggle-icon {
  display: inline-flex;
  flex-direction: column;
  gap: 3px;
}

.mobile-nav-toggle-icon span {
  display: block;
  width: 14px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.admin-sidebar-overlay {
  display: none;
}

body.sidebar-open {
  overflow: hidden;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.stat-card svg {
  width: 1.25rem;
  height: 1.25rem;
}

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

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
}

.stat-delta {
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.stat-delta svg {
  width: 0.85rem;
  height: 0.85rem;
}

.delta-up { color: hsl(var(--success)); }
.delta-down { color: hsl(var(--danger)); }

.dashboard-split {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.operations-page-header {
  margin-bottom: 1.5rem;
}

.operations-page-header h2,
.operations-section-header h3 {
  margin: 0;
}

.operations-page-header h2 {
  font-size: clamp(1.7rem, 3vw, 2.15rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.operations-section-header p,
.operations-link-card p,
.operations-flow-description,
.recent-order-item p {
  margin: 0;
}

.operations-flow-grid {
  margin-bottom: 1.5rem;
}

.operations-flow-card {
  gap: 0.95rem;
  padding: 1.35rem;
  background:
    linear-gradient(180deg, hsl(var(--card)), hsl(220 18% 9%));
}

.operations-flow-top,
.operations-section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.operations-flow-top {
  justify-content: flex-start;
}

.operations-flow-count {
  font-size: 0.8rem;
  color: hsl(var(--muted-foreground));
}

.operations-flow-description {
  line-height: 1.45;
  max-width: 24ch;
}

.operations-flow-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: auto;
}

.operations-inline-link {
  color: hsl(var(--primary));
  font-weight: 600;
  text-decoration: none;
}

.operations-inline-link:hover {
  text-decoration: underline;
}

.operations-dashboard-grid {
  align-items: stretch;
}

.operations-shortcuts-panel {
  display: grid;
  gap: 1rem;
  align-content: start;
}

.operations-shortcuts-panel .operations-section-header h3 {
  font-size: 1.2rem;
}

.operations-section-card {
  display: grid;
  gap: 1rem;
  padding: 1.25rem;
}

.operations-section-header {
  margin-bottom: 0.25rem;
}

.operations-section-count {
  white-space: nowrap;
}

.operations-shortcuts-grid,
.recent-order-list {
  display: grid;
  gap: 0.75rem;
}

.operations-link-card,
.recent-order-item {
  display: grid;
  gap: 1rem;
  padding: 1rem;
  border-radius: 12px;
  border: 1px solid hsl(var(--border));
  background: linear-gradient(180deg, hsl(var(--background) / 0.38), hsl(var(--background) / 0.22));
  color: inherit;
  text-decoration: none;
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.operations-link-card:hover,
.recent-order-item:hover {
  border-color: hsl(var(--primary) / 0.45);
  background: hsl(var(--background) / 0.6);
  transform: translateY(-1px);
}

.operations-link-card strong,
.recent-order-item strong {
  display: block;
}

.operations-shortcuts-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.operations-shortcut-card {
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  min-height: 11rem;
  padding: 1.15rem;
  background:
    linear-gradient(180deg, hsl(var(--card)), hsl(220 18% 9%));
  box-shadow: 0 14px 32px -22px rgba(0, 0, 0, 0.75);
}

.operations-shortcut-main {
  display: grid;
  gap: 0.4rem;
  align-content: start;
}

.operations-shortcut-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  gap: 0.5rem;
}

.operations-shortcut-card .operations-inline-link {
  font-size: 0.92rem;
}

@media (max-width: 1279px) {
  .operations-shortcuts-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.recent-order-item {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.recent-order-main,
.recent-order-side,
.recent-order-submeta,
.recent-order-title-row {
  display: flex;
}

.recent-order-main {
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 0.5rem;
}

.recent-order-title-row,
.recent-order-submeta {
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.recent-order-side {
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
  text-align: right;
}

.operations-empty-state {
  padding: 1rem;
  border: 1px dashed hsl(var(--border));
  border-radius: 12px;
  color: hsl(var(--muted-foreground));
  background: hsl(var(--background) / 0.3);
}

.card-row,
.search-row,
.button-row,
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.entity-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.entity-header-main {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.entity-header-identity {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.entity-header-identity code {
  max-width: min(100%, 32rem);
}

.entity-header-badges {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.card-toolbar .card-search-form {
  width: min(100%, 24rem);
}

.card-toolbar .card-search-input {
  width: 100%;
}

.search-row {
  margin-top: 0.75rem;
}

.form-grid {
  margin-top: 0.75rem;
  display: grid;
  gap: 0.75rem;
}

.staff-form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(340px, 1fr);
  gap: 2.5rem;
}

.layout-grid {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 1.5rem !important;
  margin-top: 0 !important;
}

.layout-grid > * {
  min-width: 0;
}

@media (max-width: 1280px) {
  .staff-form-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 1280px) {
  .layout-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

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

  .admin-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(82vw, 300px);
    max-width: 300px;
    height: 100dvh;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 1200;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  }

  .content-header {
    padding: 0 1rem;
    gap: 0.75rem;
  }

  .page-title {
    font-size: 1.05rem;
  }

  .header-right {
    margin-left: auto;
    gap: 0.75rem;
  }

  .breadcrumb {
    display: none;
  }

  .admin-main {
    padding: 1rem;
  }

  .dashboard-split {
    grid-template-columns: 1fr;
  }

  .operations-shortcuts-grid {
    grid-template-columns: 1fr;
  }

  .operations-link-card,
  .recent-order-item,
  .operations-section-header {
    grid-template-columns: 1fr;
    align-items: flex-start;
  }

  .operations-shortcut-meta {
    justify-items: start;
  }

  .recent-order-side {
    align-items: flex-start;
    text-align: left;
  }

  .entity-header {
    align-items: flex-start;
  }

  .entity-header-main {
    width: 100%;
  }

  .card-toolbar {
    align-items: stretch;
  }

  .card-toolbar .card-search-form {
    width: 100%;
  }

  .mobile-nav-toggle {
    display: inline-flex;
  }

  .admin-sidebar-overlay {
    display: block;
    position: fixed;
    inset: 0;
    border: 0;
    padding: 0;
    margin: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    z-index: 1100;
    cursor: pointer;
  }

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

  body.sidebar-open .admin-sidebar-overlay {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
}

.field-invalid {
  border-color: hsl(var(--danger)) !important;
}

.admin-select__options {
  scrollbar-width: thin;
  scrollbar-color: hsl(var(--muted-foreground) / 0.55) hsl(var(--card));
}

.admin-select__options::-webkit-scrollbar {
  width: 10px;
}

.admin-select__options::-webkit-scrollbar-track {
  background: hsl(var(--card));
}

.admin-select__options::-webkit-scrollbar-thumb {
  background: linear-gradient(
    180deg,
    hsl(var(--muted-foreground) / 0.75),
    hsl(var(--muted-foreground) / 0.5)
  );
  border: 2px solid hsl(var(--card));
  border-radius: 999px;
}

.admin-select__options::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(
    180deg,
    hsl(var(--foreground) / 0.45),
    hsl(var(--muted-foreground) / 0.65)
  );
}

.form-error {
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: hsl(var(--danger));
}

.info-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.info-row-label {
  flex: 0 0 auto;
}

.info-row-value {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
}

.info-row-text,
.info-row-code {
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
  text-align: right;
}

.info-row-code {
  display: inline-block;
}

@media (max-width: 1279px) {
  .info-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.4rem;
  }

  .info-row-value {
    width: 100%;
    justify-content: flex-start;
  }

  .info-row-text,
  .info-row-code {
    text-align: left;
  }
}

.role-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

label,
fieldset {
  display: grid;
  gap: 0.35rem;
}

fieldset {
  border: 1px solid hsl(var(--border));
  border-radius: 10px;
  padding: 0.75rem;
}

legend {
  padding: 0 0.3rem;
  color: hsl(var(--muted-foreground));
}

input,
select,
textarea {
  font: inherit;
}

svg {
  display: block;
  vertical-align: middle;
  max-width: 100%;
  max-height: 100%;
}

.w-4 {
  width: 1rem !important;
}

.h-4 {
  height: 1rem !important;
}

input,
select,
textarea {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 1px solid hsl(var(--border));
  border-radius: 8px;
  background: hsl(220 16% 12%);
  color: hsl(var(--foreground));
  transition: all 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: hsl(var(--primary)) !important;
  box-shadow: 0 0 0 3px hsla(var(--primary), 0.2) !important;
}

.check-grid {
  display: grid;
  gap: 0.4rem;
}

.check-grid svg {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.checkbox-label input[type="checkbox"] {
  width: auto;
}

.muted {
  color: hsl(var(--muted-foreground));
}

.badge,
.pill,
.pill-sm,
.pill-lg {
  border: 1px solid hsl(var(--border));
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.1);
  cursor: default;
}

.pill-sm {
  padding: 0.2rem 0.6rem;
  font-size: 0.8125rem;
}

.pill-lg {
  padding: 0.5rem 1.25rem;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.pill:hover,
.pill-sm:hover,
.pill-lg:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.pill.warning, .pill-sm.warning, .pill-lg.warning, .badge.warning {
  color: hsl(var(--warning));
  background: hsla(var(--warning), 0.1);
  border-color: hsla(var(--warning), 0.2);
}

.pill.info, .pill-sm.info, .pill-lg.info, .badge.info {
  color: hsl(var(--info));
  background: hsla(var(--info), 0.1);
  border-color: hsla(var(--info), 0.2);
}

.pill.success, .pill-sm.success, .pill-lg.success, .badge.success {
  color: hsl(var(--success));
  background: hsla(var(--success), 0.1);
  border-color: hsla(var(--success), 0.2);
}

.pill.danger, .pill-sm.danger, .pill-lg.danger, .badge.danger {
  color: hsl(var(--danger));
  background: hsla(var(--danger), 0.1);
  border-color: hsla(var(--danger), 0.2);
}

.pill.neutral, .pill-sm.neutral, .pill-lg.neutral, .badge.neutral {
  color: hsl(var(--muted-foreground));
  background: hsla(var(--muted-foreground), 0.1);
  border-color: hsla(var(--muted-foreground), 0.2);
}

.button {
  border: 1px solid hsl(var(--border));
  border-radius: 8px;
  padding: 0.45rem 0.8rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.button-primary {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border-color: hsl(var(--primary));
}

.button-secondary {
  background: transparent;
  color: hsl(var(--foreground));
}

.button-danger {
  background: hsl(var(--danger));
  color: hsl(var(--primary-foreground));
  border-color: hsl(var(--danger));
}

.alert {
  padding: 0.75rem 0.9rem;
}

.alert.success {
  border-color: hsl(var(--success));
}

.alert.error {
  border-color: hsl(var(--danger));
}

.alert ul {
  margin: 0.4rem 0 0 1rem;
  padding: 0;
}

.table-wrap {
  margin-top: 0.75rem;
  overflow-x: auto;
  max-width: 100%;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  border-bottom: 1px solid hsl(var(--border));
  text-align: left;
  padding: 0.75rem 0.55rem;
  vertical-align: middle;
}

.table th {
  font-size: 0.9rem;
  color: hsl(var(--muted-foreground));
}

.text-link {
  color: hsl(var(--primary));
  text-decoration: none;
}

code {
  background: hsl(220 16% 12%);
  border: 1px solid hsl(var(--border));
  border-radius: 6px;
  padding: 0.1rem 0.35rem;
  font-size: 0.78rem;
}

.separator {
  border: 0;
  border-top: 1px solid hsl(var(--border));
  margin: 1rem 0;
}


.toast-stack {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: min(400px, calc(100vw - 3rem));
  z-index: 2000;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  position: relative;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-radius: 12px;
  background: hsl(var(--card) / 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid hsl(var(--border));
  box-shadow: 
    0 4px 6px -1px rgba(0, 0, 0, 0.2), 
    0 10px 15px -3px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 0 hsla(0, 0%, 100%, 0.05);
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast.is-leaving {
  opacity: 0;
  transform: translateX(20px) scale(0.95);
}

.toast__icon-container {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 10px;
}

.toast__icon {
  width: 1.25rem;
  height: 1.25rem;
}

.toast__content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.toast__title {
  font-size: 0.875rem;
  font-weight: 700;
  color: hsl(var(--foreground));
}

.toast__message {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: hsl(var(--muted-foreground));
}

.toast__close {
  flex-shrink: 0;
  border: none;
  background: transparent;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 6px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toast__close:hover {
  background: hsl(var(--foreground) / 0.1);
  color: hsl(var(--foreground));
}

/* Variants */
.toast--success { 
  background:
    linear-gradient(135deg, hsl(var(--success) / 0.12), hsl(var(--success) / 0.04)),
    hsl(var(--card) / 0.96);
  border: 1px solid hsl(var(--success) / 0.24);
  box-shadow: 0 10px 30px -10px hsl(var(--success) / 0.24);
  border-left: 4px solid hsl(var(--success)); 
}
.toast--success .toast__icon-container { background: hsl(var(--success) / 0.2); color: hsl(var(--success)); }

.toast--warning { 
  background:
    linear-gradient(135deg, hsl(var(--warning) / 0.12), hsl(var(--warning) / 0.04)),
    hsl(var(--card) / 0.96);
  border: 1px solid hsl(var(--warning) / 0.24);
  box-shadow: 0 10px 30px -10px hsl(var(--warning) / 0.24);
  border-left: 4px solid hsl(var(--warning)); 
}
.toast--warning .toast__icon-container { background: hsl(var(--warning) / 0.2); color: hsl(var(--warning)); }

.toast--danger { 
  background:
    linear-gradient(135deg, hsl(var(--danger) / 0.12), hsl(var(--danger) / 0.04)),
    hsl(var(--card) / 0.96);
  border: 1px solid hsl(var(--danger) / 0.24);
  box-shadow: 0 10px 30px -10px hsl(var(--danger) / 0.24);
  border-left: 4px solid hsl(var(--danger)); 
}
.toast--danger .toast__icon-container { background: hsl(var(--danger) / 0.2); color: hsl(var(--danger)); }

.toast--neutral { 
  background:
    linear-gradient(135deg, hsl(var(--muted-foreground) / 0.1), hsl(var(--muted-foreground) / 0.035)),
    hsl(var(--card) / 0.96);
  border: 1px solid hsl(var(--muted-foreground) / 0.22);
  box-shadow: 0 10px 30px -10px hsl(var(--muted-foreground) / 0.2);
  border-left: 4px solid hsl(var(--muted-foreground)); 
}
.toast--neutral .toast__icon-container { background: hsl(var(--muted-foreground) / 0.2); color: hsl(var(--muted-foreground)); }

/* Progress Bar */
.toast__progress {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: hsl(var(--foreground) / 0.025);
}

.toast__progress-bar {
  height: 100%;
  width: 100%;
  transform-origin: left;
  animation: toast-progress linear forwards;
}

.toast--success .toast__progress-bar { background: hsl(var(--success) / 0.25); }
.toast--warning .toast__progress-bar { background: hsl(var(--warning) / 0.25); }
.toast--danger .toast__progress-bar { background: hsl(var(--danger) / 0.25); }
.toast--neutral .toast__progress-bar { background: hsl(var(--muted-foreground) / 0.25); }

@keyframes toast-progress {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

@keyframes toast-enter {
  0% {
    opacity: 0;
    transform: translateX(40px) scale(0.9);
  }
  70% {
    transform: translateX(-4px) scale(1.02);
  }
  100% {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

.toast {
  animation: toast-enter 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
