:root {
  --admin-primary: #0d47a1;
  --admin-secondary: #1976d2;
  --admin-accent: #42a5f5;
  --admin-deep: #1a237e;
  --admin-sidebar-text: rgba(236, 239, 241, 0.85);
  --admin-sidebar-text-strong: #fff;
  --admin-border: rgba(13, 71, 161, 0.12);
  --admin-text-muted: #546e7a;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(66, 165, 245, 0.12), transparent 28%),
    linear-gradient(180deg, #f4f7fb 0%, #eef3f9 100%);
  color: #163042;
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
}

.shell-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
}

.sidebar-shell {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1.5rem 1rem;
  background: linear-gradient(180deg, var(--admin-primary), var(--admin-deep));
}

.sidebar-shell-desktop {
  min-height: 100vh;
  position: sticky;
  top: 0;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.75rem;
  background: rgba(66, 165, 245, 0.2);
  color: var(--admin-accent);
  font-size: 1.25rem;
  flex-shrink: 0;
}

.brand-title {
  color: var(--admin-sidebar-text-strong);
  font-weight: 700;
}

.brand-subtitle {
  color: var(--admin-sidebar-text);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-left: 3px solid transparent;
  color: var(--admin-sidebar-text);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.sidebar-link:hover {
  color: var(--admin-sidebar-text-strong);
  background: rgba(255, 255, 255, 0.08);
}

.sidebar-link.active {
  color: var(--admin-sidebar-text-strong);
  background: rgba(66, 165, 245, 0.14);
  border-left-color: var(--admin-accent);
}

.sidebar-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.sidebar-user {
  padding: 0.75rem;
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.06);
}

.sidebar-user-label {
  color: var(--admin-sidebar-text);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.sidebar-user-name {
  color: var(--admin-sidebar-text-strong);
  font-weight: 600;
}

.btn-sidebar-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--admin-sidebar-text-strong);
  background: transparent;
}

.btn-sidebar-ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--admin-sidebar-text-strong);
}

.content-shell {
  padding: 1.5rem;
  min-width: 0;
}

.mobile-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 0.875rem 1rem;
  border: 0;
  border-radius: 1rem;
  background: linear-gradient(180deg, var(--admin-primary), var(--admin-deep));
  box-shadow: 0 2px 12px rgba(13, 71, 161, 0.15);
}

.mobile-topbar .brand-mark {
  background: rgba(66, 165, 245, 0.25);
}

.mobile-nav-toggle {
  flex-shrink: 0;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.9rem;
}

.eyebrow {
  margin: 0 0 0.25rem;
  color: var(--admin-secondary);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.page-title {
  margin: 0 0 1.5rem;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
}

.content-header {
  margin-bottom: 1rem;
}

.content-body {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.panel-icon {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.75rem;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.section-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
}

.section-subtitle {
  color: var(--admin-text-muted);
  margin: 0.25rem 0 0;
  font-size: 0.875rem;
}

.table-shell {
  overflow-x: auto;
  overflow-y: hidden;
}

.table-shell table {
  margin-bottom: 0;
  min-width: 100%;
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus,
.btn:focus {
  border-color: var(--admin-secondary);
  box-shadow: 0 0 0 0.25rem rgba(25, 118, 210, 0.18);
}

.stack-gap {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.preview-frame {
  width: 100%;
  min-height: 22rem;
  border: 1px solid var(--admin-border);
  border-radius: 0.75rem;
  background: #fff;
}

.preformatted-block {
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  background: rgba(13, 71, 161, 0.04);
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.875rem;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem;
}

.auth-main {
  width: min(100%, 460px);
}

.meta-list {
  display: grid;
  grid-template-columns: minmax(0, 10rem) minmax(0, 1fr);
  gap: 0.75rem 1rem;
}

.meta-list dt,
.meta-list dd {
  margin: 0;
}

.meta-list dt {
  color: var(--admin-text-muted);
  font-weight: 600;
}

.meta-list dd {
  word-break: break-word;
}

.table-actions {
  justify-content: flex-end;
}

.pagination-bar {
  margin-top: 1.25rem;
}

.mobile-offcanvas {
  max-width: 20rem;
}

.mobile-offcanvas .offcanvas-header {
  background: linear-gradient(180deg, var(--admin-primary), var(--admin-deep));
  border-bottom: 1px solid rgba(66, 165, 245, 0.2);
}

.mobile-offcanvas .offcanvas-header .btn-close {
  filter: invert(1) brightness(2);
}

.mobile-offcanvas .offcanvas-body {
  background: linear-gradient(180deg, var(--admin-primary), var(--admin-deep));
}

.mobile-offcanvas .sidebar-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1rem;
}

.mobile-offcanvas .btn-outline-secondary {
  border-color: rgba(255, 255, 255, 0.16);
  color: var(--admin-sidebar-text-strong);
}

.mobile-offcanvas .btn-outline-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--admin-sidebar-text-strong);
  border-color: rgba(255, 255, 255, 0.25);
}

@media (max-width: 991.98px) {
  .shell-layout {
    grid-template-columns: 1fr;
  }

  .sidebar-shell-desktop {
    display: none;
  }

  .content-shell {
    padding: 1rem;
  }

  .page-title {
    margin-bottom: 0;
  }

  .table-shell {
    overflow: visible;
    border: 0;
    background: transparent;
  }

  .table-shell .table,
  .table-shell .table tbody,
  .table-shell .table tr,
  .table-shell .table td {
    display: block;
    width: 100%;
  }

  .table-shell .table thead {
    display: none;
  }

  .table-shell .table tr {
    padding: 1rem;
    margin-bottom: 0.85rem;
    border: 1px solid var(--admin-border);
    border-radius: 0.9rem;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 2px 12px rgba(13, 71, 161, 0.06);
  }

  .table-shell .table td {
    padding: 0.35rem 0;
    border: 0;
    text-align: left !important;
  }

  .table-shell .table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 0.18rem;
    color: var(--admin-text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .table-actions {
    justify-content: flex-start;
  }

  .btn-group.table-actions {
    display: flex;
  }

  .meta-list {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }
}

@media (max-width: 575.98px) {
  .content-shell,
  .auth-shell {
    padding: 1rem;
  }

  .mobile-topbar {
    padding: 0.75rem 0.875rem;
  }

  .mobile-topbar .brand-subtitle {
    display: none;
  }

  .table-actions,
  .table-actions > .btn,
  .table-actions > a,
  .table-actions > form {
    width: 100%;
  }

  .table-actions .btn {
    width: 100%;
  }
}
