:root {
  --bg: #07111f;
  --bg-elevated: rgba(9, 23, 43, 0.82);
  --panel: rgba(13, 29, 54, 0.72);
  --panel-strong: rgba(16, 39, 72, 0.92);
  --line: rgba(173, 210, 255, 0.16);
  --text: #eef5ff;
  --muted: rgba(238, 245, 255, 0.72);
  --accent: #7bddff;
  --accent-2: #8affd0;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

html {
  font-size: 16px;
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: "Manrope", system-ui, sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #081323 0%, #0d1c35 48%, #081220 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

.shell-background {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at top left, rgba(123, 221, 255, 0.12), transparent 36%),
    radial-gradient(circle at right 20%, rgba(138, 255, 208, 0.12), transparent 28%),
    linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0));
  pointer-events: none;
}

.shell-container {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
}

.shell-header {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(22px);
  background: rgba(4, 12, 24, 0.74);
  border-bottom: 1px solid var(--line);
}

.shell-header .shell-container {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1.5rem;
  min-height: 80px;
}

.shell-branding {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.shell-brand {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.5rem;
  letter-spacing: 0.03em;
}

.shell-tagline,
.footer-copy,
.lede,
.stack-card p,
.feature-card p,
.metric-card p,
.table-muted {
  color: var(--muted);
}

.shell-nav,
.shell-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.shell-nav {
  justify-content: center;
  flex-wrap: wrap;
}

.shell-link {
  color: rgba(238, 245, 255, 0.78);
  transition: color 160ms ease, transform 160ms ease;
}

.shell-link:hover {
  color: white;
  transform: translateY(-1px);
}

.shell-main {
  padding: 2rem 0 4rem;
}

.shell-footer {
  border-top: 1px solid var(--line);
  background: rgba(1, 8, 18, 0.55);
  padding: 1.5rem 0 2.25rem;
}

.footer-grid {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}

.footer-title,
.section-heading h2,
.hero-title,
.portal-heading h1,
.stack-card h3,
.feature-card h3,
.metric-card strong,
.table-card h3,
.admin-card h3 {
  font-family: "Fraunces", Georgia, serif;
}

.footer-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-content: flex-start;
}

.shell-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 999px;
  padding: 0.85rem 1.25rem;
  border: 1px solid transparent;
  background: linear-gradient(135deg, var(--accent), #9ce9ff);
  color: #05111e;
  font-weight: 800;
  box-shadow: 0 14px 30px rgba(123, 221, 255, 0.25);
}

.shell-button.ghost {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border-color: var(--line);
  box-shadow: none;
}

.hero-panel,
.content-section,
.portal-shell,
.table-card,
.admin-card,
.login-card,
.gallery-card,
.contact-card {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.hero-panel {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 2rem;
  padding: 2.5rem;
  margin-bottom: 2rem;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 0.85rem;
  color: var(--accent);
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
}

.hero-title {
  font-size: clamp(2.4rem, 5vw, 4.75rem);
  line-height: 1.02;
  margin-bottom: 1rem;
}

.hero-description,
.portal-heading p {
  font-size: 1.05rem;
  max-width: 60ch;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

.hero-card-grid,
.feature-grid,
.dashboard-stats,
.gallery-grid,
.admin-grid {
  display: grid;
  gap: 1rem;
}

.hero-card-grid,
.dashboard-stats {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.metric-card,
.feature-card,
.stack-card,
.dashboard-stat,
.resident-card,
.gallery-card,
.admin-card,
.login-card,
.contact-card,
.table-card {
  border-radius: 22px;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  padding: 1.25rem;
}

.metric-label,
.stack-meta,
.panel-label {
  color: var(--accent-2);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
}

.content-section {
  padding: 2rem;
  margin-bottom: 2rem;
}

.section-heading {
  margin-bottom: 1.5rem;
}

.section-heading.compact {
  margin-bottom: 1rem;
}

.section-heading h2,
.portal-heading h1 {
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  margin-bottom: 0.35rem;
}

.feature-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.split-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.stack-list,
.portal-list,
.admin-stack {
  display: grid;
  gap: 1rem;
}

.portal-shell {
  padding: 2rem;
  margin-bottom: 2rem;
}

.portal-heading {
  margin-bottom: 1.5rem;
}

.dashboard-grid,
.contact-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1.5rem;
}

.dashboard-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

.dashboard-stat strong {
  display: block;
  margin-top: 0.45rem;
  font-size: 2rem;
}

.portal-subnav,
.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.pill {
  border-radius: 999px;
  padding: 0.55rem 0.95rem;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
  color: var(--muted);
}

.pill.active {
  background: rgba(123, 221, 255, 0.18);
  color: white;
}

.table-card table {
  width: 100%;
}

.table-card th,
.table-card td {
  padding: 0.8rem 0.65rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.table-card tr:last-child td {
  border-bottom: 0;
}

.table-card .table {
  color: var(--text);
  margin-bottom: 0;
  --bs-table-bg: transparent;
  --bs-table-striped-bg: transparent;
  --bs-table-hover-bg: rgba(255, 255, 255, 0.04);
  --bs-table-color: var(--text);
  --bs-table-border-color: var(--line);
}

.table-card .table th {
  color: var(--muted);
  font-weight: 600;
}

.table-card .table a.shell-button.ghost {
  color: var(--accent);
  border-color: rgba(123, 221, 255, 0.3);
}

.table-card .table a.shell-button.ghost:hover {
  color: white;
  border-color: var(--accent);
  background: rgba(123, 221, 255, 0.12);
}

.row-actions .shell-button.ghost {
  font-size: 0.88rem;
  padding: 0.45rem 0.85rem;
}

.row-actions form .shell-button.ghost {
  color: #ff7b7b;
  border-color: rgba(255, 123, 123, 0.3);
}

.row-actions form .shell-button.ghost:hover {
  color: white;
  background: rgba(255, 80, 80, 0.18);
  border-color: #ff7b7b;
}

.resident-grid,
.gallery-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.resident-card ul,
.gallery-card ul,
.admin-card ul {
  padding-left: 1rem;
  margin-bottom: 0;
}

.gallery-thumb {
  aspect-ratio: 4 / 3;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  margin-bottom: 0.75rem;
}

.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.login-wrap {
  display: flex;
  justify-content: center;
  padding: 3rem 0;
}

.login-card {
  width: min(520px, 100%);
  padding: 2rem;
}

.form-label,
.form-check-label,
.form-text {
  color: var(--muted);
}

.form-control,
.form-select,
textarea {
  border-radius: 16px !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  background: rgba(255, 255, 255, 0.04) !important;
  color: var(--text) !important;
}

.form-select option {
  background: #0d1c35;
  color: #eef5ff;
}

.form-select option:checked,
.form-select option:hover {
  background: rgba(123, 221, 255, 0.22);
  color: white;
}

.form-check-input {
  border-color: rgba(255, 255, 255, 0.25) !important;
  background-color: rgba(255, 255, 255, 0.06) !important;
}

.form-check-input:checked {
  background-color: var(--accent) !important;
  border-color: var(--accent) !important;
}

.form-control::placeholder,
textarea::placeholder {
  color: rgba(255, 255, 255, 0.4) !important;
}

.form-control:focus,
.form-select:focus {
  box-shadow: 0 0 0 0.25rem rgba(123, 221, 255, 0.15) !important;
  border-color: rgba(123, 221, 255, 0.45) !important;
}

.form-check-input:focus {
  box-shadow: 0 0 0 0.25rem rgba(123, 221, 255, 0.15) !important;
  border-color: var(--accent) !important;
}

.portal-alert {
  margin-bottom: 1rem;
  padding: 1rem 1.25rem;
  border-radius: 18px;
  border: 1px solid rgba(138, 255, 208, 0.28);
  background: rgba(138, 255, 208, 0.08);
}

.admin-toolbar,
.row-actions {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
  align-items: center;
}

.admin-grid {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  margin-bottom: 1.5rem;
}

.narrow-section {
  max-width: 760px;
  margin-inline: auto;
}

code {
  color: var(--accent);
}

.form-select[multiple] {
  min-height: 8rem;
}

.form-select[multiple] option {
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  margin-bottom: 2px;
}

.form-select[multiple] option:checked {
  background: rgba(123, 221, 255, 0.22);
  color: white;
}

@media (max-width: 991px) {
  .shell-header .shell-container,
  .hero-panel,
  .split-section,
  .dashboard-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .shell-header {
    position: static;
  }
}

@media (max-width: 767px) {
  .shell-header .shell-container {
    grid-template-columns: 1fr;
    padding: 1rem 0;
  }

  .shell-nav {
    justify-content: flex-start;
  }

  .shell-actions {
    justify-content: flex-start;
  }

  .hero-panel,
  .content-section,
  .portal-shell {
    padding: 1.5rem;
  }
}
