:root {
  color-scheme: light;
  --sidebar-width: 17.5rem;
  --sidebar-compact-width: 5.25rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

* {
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(59, 130, 246, 0.12), transparent 34rem),
    linear-gradient(180deg, #f8fafc 0%, #eef4fb 100%);
  overflow-x: hidden;
}

.auth-body {
  background:
    linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(2, 6, 23, 0.98)),
    #020617;
}

.auth-particles {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.auth-card {
  position: relative;
}

.auth-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
}

svg,
canvas,
img {
  max-width: 100%;
}

.app-shell {
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  max-width: 100vw;
  transition: width 260ms cubic-bezier(0.22, 1, 0.36, 1), transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

.sidebar nav {
  min-height: 0;
  overflow-y: auto;
  padding-right: 0.125rem;
}

.content-wrap {
  margin-left: var(--sidebar-width);
  transition: margin-left 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

body.sidebar-compact .sidebar {
  width: var(--sidebar-compact-width);
}

body.sidebar-compact .content-wrap {
  margin-left: var(--sidebar-compact-width);
}

body.sidebar-compact .sidebar-label,
body.sidebar-compact .sidebar-brand-text,
body.sidebar-compact .sidebar-section {
  display: none;
}

body.sidebar-compact .nav-item {
  justify-content: center;
}

.glass-panel {
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(226, 232, 240, 0.82);
}

.soft-card {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: 0 16px 42px rgba(15, 23, 42, 0.055);
  transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease, background-color 220ms ease;
}

.soft-card:hover {
  border-color: rgba(191, 219, 254, 0.95);
  box-shadow: 0 22px 56px rgba(15, 23, 42, 0.075);
}

.dashboard-hero,
.metric-card {
  transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease, background-color 220ms ease;
}

.dashboard-hero:hover,
.metric-card:hover {
  border-color: rgba(191, 219, 254, 0.95);
  box-shadow: 0 18px 46px rgba(15, 23, 42, 0.07);
}

.metric-card:hover {
  transform: translateY(-2px);
}

.metric-icon {
  display: grid;
  width: 2.75rem;
  height: 2.75rem;
  place-items: center;
  border-radius: 1rem;
}

.metric-blue {
  color: #2563eb;
  background: #eff6ff;
}

.metric-sky {
  color: #0284c7;
  background: #f0f9ff;
}

.metric-emerald {
  color: #059669;
  background: #ecfdf5;
}

.metric-amber {
  color: #d97706;
  background: #fffbeb;
}

.metric-slate {
  color: #334155;
  background: #f8fafc;
}

.btn-primary,
.btn-secondary,
.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 0.875rem;
  padding: 0.7rem 1rem;
  font-weight: 700;
  transition: transform 180ms ease, box-shadow 180ms ease, background-color 180ms ease, border-color 180ms ease, color 180ms ease;
}

.btn-primary {
  background: #2563eb;
  color: #fff;
  box-shadow: 0 12px 30px rgba(37, 99, 235, 0.22);
}

.btn-primary:hover,
.btn-secondary:hover,
.btn-danger:hover {
  transform: translateY(-2px);
}

.btn-primary:active,
.btn-secondary:active,
.btn-danger:active {
  transform: translateY(0);
}

.btn-secondary {
  background: #fff;
  color: #334155;
  border: 1px solid #dbe4ef;
}

.btn-danger {
  background: #fee2e2;
  color: #b91c1c;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  border-radius: 0.875rem;
  border: 1px solid #dbe4ef;
  background: rgba(255, 255, 255, 0.92);
  color: #0f172a;
  outline: none;
  font-size: 1rem;
  transition: border-color 180ms ease, box-shadow 180ms ease, background-color 180ms ease, transform 180ms ease;
}

.form-input,
.form-select {
  min-height: 2.85rem;
  padding: 0.65rem 0.85rem;
}

.form-textarea {
  min-height: 8rem;
  padding: 0.85rem;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.18);
  background: #fff;
}

.auth-input {
  border-color: rgba(148, 163, 184, 0.25);
  background: rgba(15, 23, 42, 0.78);
  color: #f8fafc;
}

.auth-input::placeholder {
  color: #64748b;
}

.auth-input:focus {
  border-color: rgba(96, 165, 250, 0.8);
  background: rgba(15, 23, 42, 0.92);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.18);
}

.password-eye {
  position: absolute;
  right: 0.35rem;
  top: 50%;
  display: grid;
  width: 2.35rem;
  height: 2.35rem;
  transform: translateY(-50%);
  place-items: center;
  border-radius: 0.85rem;
  color: #94a3b8;
  transition: color 180ms ease, background-color 180ms ease;
}

.password-eye:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #dbeafe;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.25rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 800;
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  min-width: 760px;
  border-collapse: separate;
  border-spacing: 0;
}

.data-table th {
  color: #64748b;
  font-size: 0.72rem;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0;
  padding: 0.9rem 1rem;
  background: #f8fafc;
}

.data-table td {
  border-top: 1px solid #e2e8f0;
  padding: 0.95rem 1rem;
  color: #334155;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.data-table tr:hover td {
  background: #f8fbff;
}

.nav-item {
  transition: background-color 180ms ease, color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.nav-item:hover {
  transform: translateX(2px);
}

.form-actions {
  transition: box-shadow 220ms ease, border-color 220ms ease, background-color 220ms ease;
}

@media (prefers-reduced-motion: no-preference) {
  main > * {
    animation: fade-up 260ms ease both;
  }

  @keyframes fade-up {
    from {
      opacity: 0;
      transform: translateY(6px);
    }

    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

@media (max-width: 1024px) {
  body.sidebar-open [data-sidebar-close] {
    display: block;
  }

  .sidebar {
    transform: translateX(-105%);
    width: min(var(--sidebar-width), calc(100vw - 1rem));
  }

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

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

  body.sidebar-compact .content-wrap {
    margin-left: 0;
  }
}

@media (max-width: 640px) {
  body {
    background: linear-gradient(180deg, #f8fafc 0%, #eef4fb 100%);
  }

  .soft-card {
    border-radius: 1.25rem;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
  }

  .btn-primary,
  .btn-secondary,
  .btn-danger {
    min-height: 2.75rem;
    padding: 0.65rem 0.85rem;
    white-space: nowrap;
  }

  .form-input,
  .form-select {
    min-height: 3rem;
  }

  .form-textarea {
    min-height: 7rem;
  }

  .table-wrap {
    margin-left: -1rem;
    margin-right: -1rem;
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .data-table {
    min-width: 680px;
  }

  .data-table th,
  .data-table td {
    padding: 0.8rem;
  }
}

@media (max-width: 420px) {
  .btn-primary,
  .btn-secondary,
  .btn-danger {
    width: 100%;
  }

  .data-table .btn-primary,
  .data-table .btn-secondary,
  .data-table .btn-danger {
    width: auto;
  }

  .data-table {
    min-width: 620px;
  }
}
