html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.form-check-input {
  width: 1.50rem !important;
  margin-left: -0.2rem !important;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

:root {
  --auth-brand: #e14b1d;
  --auth-brand-2: #ff7a3a;
  --auth-accent: #147f78;
  --auth-bg-1: #f6f2ea;
  --auth-bg-2: #eef3ff;
  --auth-bg-3: #fff3e9;

  --auth-font-body: "Space Grotesk", "Segoe UI", sans-serif;
  --auth-font-display: "Zilla Slab", "Times New Roman", serif;

  --theme-surface-1: rgba(255, 255, 255, 0.9);
  --theme-surface-2: rgba(255, 255, 255, 0.98);
  --theme-border-1: rgba(17, 20, 32, 0.14);
  --theme-text-1: rgba(17, 20, 32, 0.95);
  --theme-text-2: rgba(17, 20, 32, 0.68);
}

.auth-body {
  margin-bottom: 0;
  min-height: 100vh;
  position: relative;
  font-family: var(--auth-font-body);
  background:
    radial-gradient(1200px 700px at 8% 12%, rgba(20, 127, 120, 0.16), transparent 60%),
    radial-gradient(900px 600px at 90% 18%, rgba(255, 122, 58, 0.18), transparent 58%),
    radial-gradient(800px 460px at 20% 90%, rgba(31, 111, 235, 0.12), transparent 60%),
    linear-gradient(160deg, var(--auth-bg-1), var(--auth-bg-2));

  color: var(--theme-text-1);
}

.auth-body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(120deg, rgba(17, 20, 32, 0.04) 0 1px, transparent 1px 12px),
    repeating-linear-gradient(0deg, rgba(17, 20, 32, 0.03) 0 1px, transparent 1px 18px);
  opacity: 0.6;
  z-index: 0;
}

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

main[role="main"] {
  position: relative;
  z-index: 1;
}

.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 32px 0;
}

.auth-container {
  display: flex;
  justify-content: center;
}

.auth-card {
  border: 0;
  border-radius: 24px;
  overflow: hidden;
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.86));
  backdrop-filter: blur(10px);
  position: relative;
  box-shadow:
    0 26px 70px rgba(17, 20, 32, 0.16),
    0 0 0 1px var(--theme-border-1) inset;
  animation: auth-rise 700ms ease both;
}

.auth-card::after {
  content: "";
  position: absolute;
  inset: -40% 45% 55% -30%;
  background: radial-gradient(closest-side, rgba(255, 122, 58, 0.22), transparent 70%);
  opacity: 0.6;
  pointer-events: none;
}

.auth-aside {
  background:
    linear-gradient(160deg, rgba(255, 243, 233, 0.92), rgba(240, 246, 255, 0.78));
  color: var(--theme-text-1);
  border-right: 1px solid rgba(17, 20, 32, 0.08);
}

.auth-aside-inner {
  width: 100%;
  padding: 48px 42px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-logo {
  width: 200px;
  height: auto;
  filter: none;
}

.auth-logo-sm {
  width: 84px;
  filter: none;
}

.auth-title {
  margin: 10px 0 0;
  font-family: var(--auth-font-display);
  font-size: 2.1rem;
  letter-spacing: -0.015em;
}

.auth-subtitle {
  margin: 0;
  opacity: 0.9;
  line-height: 1.45;
}

.auth-badges {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.auth-badges .badge {
  padding: 0.45rem 0.75rem;
  border: 1px solid rgba(255, 122, 58, 0.35);
  background: rgba(255, 255, 255, 0.8);
  color: rgba(17, 20, 32, 0.75);
}

.auth-aside-footer {
  margin-top: auto;
  opacity: 0.85;
}

.auth-form {
  background: transparent;
}

.auth-form-title {
  font-weight: 700;
  font-size: 1.55rem;
  letter-spacing: -0.01em;
  color: var(--theme-text-1);
}

.auth-form-subtitle {
  color: var(--theme-text-2);
}

.auth-primary-btn {
  --auth-btn-from: var(--auth-brand);
  --auth-btn-to: var(--auth-brand-2);
  --auth-btn-shadow: rgba(225, 75, 29, 0.28);
  border: 0;
  padding: 12px 16px;
  font-weight: 600;
  background: linear-gradient(135deg, var(--auth-btn-from), var(--auth-btn-to));
  box-shadow: 0 12px 22px var(--auth-btn-shadow);
  transition: transform 200ms ease, box-shadow 200ms ease, filter 200ms ease;
}

.auth-primary-btn:hover {
  filter: brightness(1.03);
  transform: translateY(-1px);
  box-shadow: 0 14px 26px color-mix(in srgb, var(--auth-btn-shadow) 80%, transparent);
}

.auth-google-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid rgba(17, 20, 32, 0.12);
  background: rgba(255, 255, 255, 0.96);
  color: #1f1f1f;
  font-weight: 600;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  transition: transform 200ms ease, box-shadow 200ms ease, background-color 200ms ease, border-color 200ms ease;
}

.auth-google-btn:hover {
  background: #fff;
  border-color: rgba(66, 133, 244, 0.28);
  color: #1f1f1f;
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.12);
}

.auth-google-btn:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 0.25rem rgba(66, 133, 244, 0.18), 0 14px 28px rgba(15, 23, 42, 0.12);
}

.auth-google-icon {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 22px;
}

.auth-google-icon svg {
  width: 20px;
  height: 20px;
  display: block;
}

.auth-google-label {
  line-height: 1.2;
}

.auth-system-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 16px;
  text-align: left;
  position: relative;
  overflow: hidden;
  color: #fff;
  text-decoration: none;
}

.auth-system-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.22) 45%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 450ms ease;
}

.auth-system-btn:hover::after {
  transform: translateX(120%);
}

.auth-system-name {
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.auth-system-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.22);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
  font-size: 1.1rem;
}

.auth-system-arrow {
  font-size: 1.2rem;
  opacity: 0.85;
  transform: translateX(0);
  transition: transform 200ms ease, opacity 200ms ease;
}

.auth-system-btn:hover .auth-system-arrow {
  transform: translateX(4px);
  opacity: 1;
}

.auth-system-btn.btn-primary {
  --auth-btn-from: #e14b1d;
  --auth-btn-to: #ff7a3a;
  --auth-btn-shadow: rgba(225, 75, 29, 0.3);
}

.auth-system-btn.btn-secondary {
  --auth-btn-from: #5f6270;
  --auth-btn-to: #8a8f9f;
  --auth-btn-shadow: rgba(95, 98, 112, 0.28);
}

.auth-system-btn.btn-success {
  --auth-btn-from: #1b7a4f;
  --auth-btn-to: #35b070;
  --auth-btn-shadow: rgba(27, 122, 79, 0.28);
}

.auth-system-btn.btn-danger {
  --auth-btn-from: #b2312b;
  --auth-btn-to: #e35a4b;
  --auth-btn-shadow: rgba(178, 49, 43, 0.28);
}

.auth-system-btn.btn-warning {
  --auth-btn-from: #b86a0f;
  --auth-btn-to: #f1b04b;
  --auth-btn-shadow: rgba(184, 106, 15, 0.28);
}

.auth-system-btn.btn-info {
  --auth-btn-from: #127a92;
  --auth-btn-to: #38b9d6;
  --auth-btn-shadow: rgba(18, 122, 146, 0.28);
}

.auth-system-btn.btn-dark {
  --auth-btn-from: #232733;
  --auth-btn-to: #4a5164;
  --auth-btn-shadow: rgba(35, 39, 51, 0.3);
}

.auth-secondary-btn {
  padding: 11px 14px;
}

.auth-link {
  color: var(--auth-brand);
  text-decoration: none;
  font-weight: 600;
}

.auth-link:hover {
  text-decoration: underline;
}

.auth-divider {
  position: relative;
  text-align: center;
}

.auth-divider::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 1px;
  background: var(--theme-border-1);
}

.auth-divider span {
  position: relative;
  display: inline-block;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--theme-text-2);
  font-size: 0.9rem;
}

.auth-bottom small {
  color: rgba(15, 23, 42, 0.72) !important;
}

.auth-form .form-control {
  border-radius: 14px;
  border-color: rgba(17, 20, 32, 0.14);
  background: rgba(255, 255, 255, 0.95);
  color: var(--theme-text-1);
  padding: 0.7rem 0.9rem;
  transition: border-color 200ms ease, box-shadow 200ms ease, transform 200ms ease;
}

.auth-form .form-control::placeholder {
  color: rgba(15, 23, 42, 0.45);
}

.auth-form .form-control:focus {
  border-color: rgba(20, 127, 120, 0.55);
  box-shadow: 0 0 0 0.25rem rgba(20, 127, 120, 0.18);
  transform: translateY(-1px);
}

.auth-form .form-label {
  font-weight: 600;
  color: var(--theme-text-2);
}

.auth-form .alert {
  border-radius: 14px;
  border: 1px solid rgba(17, 20, 32, 0.08);
  background: rgba(255, 255, 255, 0.9);
}

@keyframes auth-rise {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 991.98px) {
  .auth-card {
    border-radius: 20px;
  }

  .auth-aside {
    border-right: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-card {
    animation: none;
  }

  .auth-primary-btn,
  .auth-form .form-control {
    transition: none;
  }
}
/* Dark theme rules kept for optional use */
.theme-dark .container,
.theme-dark .container-fluid {
  color: var(--theme-text-1);
}

.theme-dark .card {
  background: var(--theme-surface-2);
  color: var(--theme-text-1);
  border: 1px solid var(--theme-border-1);
}

.theme-dark .card-footer {
  background: rgba(13, 17, 23, 0.35);
  border-top: 1px solid var(--theme-border-1);
}

.theme-dark .table {
  color: var(--theme-text-1);
}

.theme-dark .table > :not(caption) > * > * {
  background-color: rgba(22, 27, 34, 0.72);
  border-bottom-color: var(--theme-border-1);
}

.theme-dark .table-striped > tbody > tr:nth-of-type(odd) > * {
  background-color: rgba(13, 17, 23, 0.72);
}

.theme-dark .text-muted {
  color: var(--theme-text-2) !important;
}

.theme-dark .form-label {
  color: var(--theme-text-2);
}

.theme-dark .form-control,
.theme-dark textarea.form-control {
  background-color: rgba(13, 17, 23, 0.7);
  color: var(--theme-text-1);
  border-color: rgba(240, 246, 252, 0.14);
}

.theme-dark .form-control:focus,
.theme-dark textarea.form-control:focus {
  background-color: rgba(13, 17, 23, 0.85);
  color: var(--theme-text-1);
}

.auth-token-input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-weight: 700;
  letter-spacing: 0.35em;
  text-align: center;
}

/* Bootstrap overrides */
.btn-primary {
  --bs-btn-color: #fff;
  --bs-btn-bg: var(--auth-brand);
  --bs-btn-border-color: var(--auth-brand);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: var(--auth-brand-2);
  --bs-btn-hover-border-color: var(--auth-brand-2);
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: var(--auth-brand-2);
  --bs-btn-active-border-color: var(--auth-brand-2);
  --bs-btn-disabled-color: #fff;
  --bs-btn-disabled-bg: var(--auth-brand);
  --bs-btn-disabled-border-color: var(--auth-brand);
}

.btn-primary:focus,
.btn-primary:active:focus {
  box-shadow: 0 0 0 0.25rem rgba(214, 58, 10, 0.35);
}

.admin-sidebar-toggle {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 1035;
  display: none;
  align-items: center;
  gap: 12px;
  border: 0;
  border-radius: 999px;
  padding: 0.8rem 1rem;
  background: linear-gradient(135deg, #172033, #24324d);
  color: #f8fafc;
  box-shadow: 0 18px 36px rgba(11, 18, 32, 0.28);
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: transform 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}

.admin-sidebar-toggle:hover {
  transform: translateY(-1px);
  box-shadow: 0 22px 40px rgba(11, 18, 32, 0.34);
}

.admin-sidebar-toggle:focus-visible,
.admin-sidebar-close:focus-visible,
.admin-sidebar-link:focus-visible,
.admin-sidebar-logout-btn:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 0.25rem rgba(20, 127, 120, 0.25);
}

.admin-sidebar-toggle-icon,
.admin-sidebar-toggle-shortcut {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.admin-sidebar-toggle-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 1rem;
}

.admin-sidebar-toggle-shortcut {
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.45rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: rgba(248, 250, 252, 0.88);
  font-size: 0.86rem;
}

.admin-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 1040;
  width: min(92vw, 320px);
}

.admin-sidebar-panel {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1.25rem;
  overflow: hidden;
  background:
    radial-gradient(circle at top right, rgba(255, 122, 58, 0.14), transparent 36%),
    linear-gradient(180deg, #fffdf8, #f6f8fc);
  border-right: 1px solid rgba(17, 20, 32, 0.08);
  box-shadow: 24px 0 48px rgba(17, 20, 32, 0.16);
}

.admin-sidebar-header,
.admin-sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
}

.admin-sidebar-brand {
  justify-content: flex-start;
}

.admin-sidebar-brand-icon {
  width: 3rem;
  height: 3rem;
  flex: 0 0 3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  background: linear-gradient(135deg, #e14b1d, #ff7a3a);
  color: #fff;
  box-shadow: 0 12px 24px rgba(225, 75, 29, 0.24);
  font-size: 1.15rem;
}

.admin-sidebar-brand-eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(17, 20, 32, 0.52);
}

.admin-sidebar-brand-title,
.admin-sidebar-title-text {
  font-family: var(--auth-font-display);
  letter-spacing: -0.02em;
}

.admin-sidebar-brand-title {
  font-size: 1.15rem;
}

.admin-sidebar-close {
  width: 2.5rem;
  height: 2.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 14px;
  background: rgba(23, 32, 51, 0.08);
  color: rgba(17, 20, 32, 0.75);
}

.admin-sidebar-intro {
  padding: 1rem;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(20, 127, 120, 0.1), rgba(36, 50, 77, 0.06));
  border: 1px solid rgba(20, 127, 120, 0.12);
}

.admin-sidebar-title-text {
  margin: 0;
  font-size: 1.45rem;
  color: rgba(17, 20, 32, 0.96);
}

.admin-sidebar-subtitle {
  margin: 0.45rem 0 0;
  color: rgba(17, 20, 32, 0.66);
  line-height: 1.5;
}

.admin-sidebar-nav {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  gap: 0.65rem;
  overflow-y: auto;
  padding-right: 0.3rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(23, 32, 51, 0.24) transparent;
}

.admin-sidebar-nav::-webkit-scrollbar {
  width: 0.45rem;
}

.admin-sidebar-nav::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(23, 32, 51, 0.24);
}

.admin-sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}

.admin-sidebar-link {
  display: grid;
  grid-template-columns: 2.75rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.85rem;
  padding: 0.9rem 1rem;
  border-radius: 18px;
  color: rgba(17, 20, 32, 0.86);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(17, 20, 32, 0.08);
  box-shadow: 0 8px 20px rgba(17, 20, 32, 0.05);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease, background-color 180ms ease;
}

.admin-sidebar-link:hover {
  transform: translateX(4px);
  border-color: rgba(20, 127, 120, 0.24);
  box-shadow: 0 12px 24px rgba(17, 20, 32, 0.08);
  color: rgba(17, 20, 32, 0.96);
}

.admin-sidebar-link.is-active {
  background: linear-gradient(135deg, rgba(225, 75, 29, 0.12), rgba(255, 122, 58, 0.08));
  border-color: rgba(225, 75, 29, 0.22);
  box-shadow: 0 16px 26px rgba(225, 75, 29, 0.1);
}

.admin-sidebar-link-icon,
.admin-sidebar-link-arrow,
.admin-sidebar-shortcut-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.admin-sidebar-link-icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 16px;
  background: rgba(23, 32, 51, 0.08);
  color: #172033;
  font-size: 1rem;
}

.admin-sidebar-link-label {
  font-weight: 700;
}

.admin-sidebar-link-arrow {
  color: rgba(17, 20, 32, 0.36);
}

.admin-sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 1rem;
}

.admin-sidebar-shortcut-hint {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: rgba(17, 20, 32, 0.62);
  font-size: 0.95rem;
}

.admin-sidebar-shortcut-key {
  min-width: 2.2rem;
  height: 2.2rem;
  padding: 0 0.5rem;
  border-radius: 12px;
  background: rgba(23, 32, 51, 0.08);
  font-weight: 800;
  color: rgba(17, 20, 32, 0.9);
}

.admin-sidebar-logout-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  width: 100%;
  padding: 0.95rem 1rem;
  border-radius: 16px;
  border: 1px solid rgba(17, 20, 32, 0.1);
  background: #172033;
  color: #f8fafc;
  font-weight: 700;
  box-shadow: 0 16px 28px rgba(23, 32, 51, 0.18);
}

.admin-sidebar-logout-btn:hover {
  color: #fff;
  background: #24324d;
}

.admin-sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1030;
  background: rgba(15, 23, 42, 0.34);
  backdrop-filter: blur(4px);
}

.app-main-shell {
  transition: padding-left 220ms ease;
}

@media (min-width: 992px) {
  body.admin-sidebar-open .app-main-shell {
    padding-left: 320px;
  }

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

@media (max-width: 991.98px) {
  body.admin-sidebar-open {
    overflow: hidden;
  }

  .admin-sidebar-toggle {
    display: inline-flex;
    top: 14px;
    left: 14px;
    padding: 0.72rem 0.9rem;
  }

  .admin-sidebar-toggle-label {
    display: none;
  }

  .admin-sidebar {
    width: min(100vw, 340px);
  }

  .admin-sidebar-panel {
    padding: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .admin-sidebar-toggle,
  .admin-sidebar-link,
  .app-main-shell {
    transition: none;
  }
}

.crud-page {
  max-width: 1280px;
}

.crud-page-narrow {
  max-width: 920px;
}

.crud-hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  padding: clamp(1.35rem, 2vw, 1.9rem);
  border-radius: 28px;
  overflow: hidden;
  background:
    radial-gradient(circle at top right, rgba(255, 122, 58, 0.18), transparent 32%),
    linear-gradient(145deg, rgba(255, 253, 248, 0.94), rgba(240, 246, 255, 0.92));
  border: 1px solid rgba(17, 20, 32, 0.08);
  box-shadow: 0 24px 48px rgba(17, 20, 32, 0.1);
}

.crud-hero::before,
.crud-hero::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.crud-hero::before {
  inset: auto auto -35% -8%;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(20, 127, 120, 0.18), transparent 70%);
}

.crud-hero::after {
  inset: 0;
  background: repeating-linear-gradient(120deg, rgba(17, 20, 32, 0.03) 0 1px, transparent 1px 18px);
  opacity: 0.55;
}

.crud-hero > * {
  position: relative;
  z-index: 1;
}

.crud-hero-danger {
  background:
    radial-gradient(circle at top right, rgba(225, 75, 29, 0.2), transparent 30%),
    linear-gradient(145deg, rgba(255, 249, 245, 0.96), rgba(255, 244, 239, 0.9));
}

.crud-hero-copy {
  min-width: 0;
}

.crud-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.65rem;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(17, 20, 32, 0.56);
}

.crud-title {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-family: var(--auth-font-display);
  font-size: clamp(1.7rem, 2vw, 2.3rem);
  letter-spacing: -0.02em;
  color: rgba(17, 20, 32, 0.96);
}

.crud-title i {
  width: 3rem;
  height: 3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(225, 75, 29, 0.18), rgba(20, 127, 120, 0.14));
  color: #172033;
  font-size: 1.2rem;
  box-shadow: inset 0 0 0 1px rgba(17, 20, 32, 0.05);
}

.crud-hero-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.crud-stats {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.crud-stat {
  min-width: 112px;
  padding: 0.9rem 1rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(17, 20, 32, 0.08);
  box-shadow: 0 14px 24px rgba(17, 20, 32, 0.06);
}

.crud-stat-value,
.crud-stat-label {
  display: block;
}

.crud-stat-value {
  font-family: var(--auth-font-display);
  font-size: 1.5rem;
  line-height: 1;
  color: rgba(17, 20, 32, 0.96);
}

.crud-stat-label {
  margin-top: 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(17, 20, 32, 0.5);
}

.crud-panel {
  position: relative;
  padding: 1.25rem;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(17, 20, 32, 0.08);
  box-shadow: 0 20px 38px rgba(17, 20, 32, 0.08);
}

.crud-panel + .crud-panel {
  margin-top: 1rem;
}

.crud-success-alert,
.crud-validation,
.crud-delete-alert {
  border: 0;
  border-radius: 18px;
  padding: 1rem 1.1rem;
}

.crud-success-alert {
  background: linear-gradient(135deg, rgba(28, 133, 88, 0.14), rgba(53, 176, 112, 0.1));
  color: #135034;
}

.crud-validation {
  margin: 0;
  background: linear-gradient(135deg, rgba(178, 49, 43, 0.12), rgba(227, 90, 75, 0.1));
  color: #7c1f19;
}

.crud-delete-alert {
  background: linear-gradient(135deg, rgba(225, 75, 29, 0.12), rgba(255, 122, 58, 0.08));
  color: #8b391a;
}

.crud-table {
  margin-bottom: 0;
  --bs-table-bg: transparent;
  --bs-table-striped-bg: rgba(246, 242, 234, 0.62);
}

.crud-table thead th {
  padding: 0.95rem 0.85rem;
  border-bottom-width: 1px;
  border-bottom-color: rgba(17, 20, 32, 0.08);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(17, 20, 32, 0.54);
}

.crud-table tbody td {
  padding: 1rem 0.85rem;
  border-bottom-color: rgba(17, 20, 32, 0.06);
}

.crud-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.8);
}

.crud-actions {
  display: inline-flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.crud-actions .btn,
.crud-primary-btn,
.crud-secondary-btn {
  border-radius: 14px;
  padding-inline: 1rem;
  font-weight: 700;
}

.crud-empty-state {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: 18px;
  color: rgba(17, 20, 32, 0.62);
  background: linear-gradient(135deg, rgba(23, 32, 51, 0.05), rgba(20, 127, 120, 0.04));
}

.crud-empty-state i {
  width: 2.5rem;
  height: 2.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: rgba(23, 32, 51, 0.08);
}

.status-pill,
.crud-tag,
.crud-code {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 700;
}

.status-pill::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.85;
}

.status-pill.is-active {
  background: rgba(27, 122, 79, 0.12);
  color: #1b7a4f;
}

.status-pill.is-inactive {
  background: rgba(95, 98, 112, 0.12);
  color: #5f6270;
}

.crud-tag {
  background: rgba(23, 32, 51, 0.08);
  color: #24324d;
}

.crud-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  background: rgba(23, 32, 51, 0.08);
  color: #172033;
}

.crud-link {
  color: #0f6f92;
  text-decoration: none;
  font-weight: 600;
}

.crud-link:hover {
  text-decoration: underline;
}

.crud-form {
  display: grid;
  gap: 1.25rem;
}

.crud-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.crud-field {
  display: grid;
  gap: 0.45rem;
}

.crud-field-full {
  grid-column: 1 / -1;
}

.crud-form .form-label {
  margin-bottom: 0;
  font-size: 0.88rem;
  font-weight: 700;
  color: rgba(17, 20, 32, 0.68);
}

.crud-form .form-control,
.crud-form .form-select {
  border-radius: 16px;
  border-color: rgba(17, 20, 32, 0.12);
  background: rgba(255, 255, 255, 0.96);
  color: var(--theme-text-1);
  padding: 0.85rem 1rem;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.crud-form textarea.form-control {
  min-height: 132px;
}

.crud-form .form-control:focus,
.crud-form .form-select:focus {
  border-color: rgba(20, 127, 120, 0.4);
  box-shadow: 0 0 0 0.25rem rgba(20, 127, 120, 0.12);
  transform: translateY(-1px);
}

.crud-form .form-control:disabled {
  background: rgba(23, 32, 51, 0.05);
  color: rgba(17, 20, 32, 0.72);
}

.crud-form .form-text {
  color: rgba(17, 20, 32, 0.54);
}

.crud-form .text-danger,
.crud-form .field-validation-error {
  font-size: 0.85rem;
}

.crud-toggle-card {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 1rem 1.1rem;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(20, 127, 120, 0.08), rgba(36, 50, 77, 0.05));
  border: 1px solid rgba(20, 127, 120, 0.12);
}

.crud-toggle-card .form-check-input {
  margin-top: 0;
  width: 2.7rem;
  height: 1.45rem;
}

.crud-toggle-card .form-check-label {
  font-weight: 700;
  color: rgba(17, 20, 32, 0.84);
}

.crud-form-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.crud-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.9rem;
}

.crud-meta-item {
  padding: 1rem;
  border-radius: 18px;
  background: rgba(23, 32, 51, 0.04);
  border: 1px solid rgba(17, 20, 32, 0.06);
}

.crud-meta-label,
.crud-meta-value {
  display: block;
}

.crud-meta-label {
  margin-bottom: 0.4rem;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(17, 20, 32, 0.52);
}

.crud-meta-value {
  color: rgba(17, 20, 32, 0.9);
  font-weight: 600;
}

.crud-details {
  display: grid;
  grid-template-columns: minmax(140px, 220px) minmax(0, 1fr);
  gap: 0.8rem 1rem;
  margin: 0;
}

.crud-details dt,
.crud-details dd {
  margin: 0;
}

.crud-details dt {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(17, 20, 32, 0.5);
}

.crud-details dd {
  padding-bottom: 0.8rem;
  border-bottom: 1px solid rgba(17, 20, 32, 0.06);
  color: rgba(17, 20, 32, 0.9);
  font-weight: 600;
}

@media (max-width: 991.98px) {
  .crud-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .crud-hero-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 767.98px) {
  .crud-form-grid,
  .crud-details {
    grid-template-columns: 1fr;
  }

  .crud-table thead {
    display: none;
  }

  .crud-table,
  .crud-table tbody,
  .crud-table tr,
  .crud-table td {
    display: block;
    width: 100%;
  }

  .crud-table tbody tr {
    padding: 0.85rem 0;
    border-bottom: 1px solid rgba(17, 20, 32, 0.08);
  }

  .crud-table tbody td {
    padding: 0.45rem 0;
    border-bottom: 0;
  }

  .crud-table tbody td.text-end {
    text-align: left !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .crud-hero,
  .crud-panel,
  .crud-form .form-control,
  .crud-form .form-select {
    transition: none;
  }
}