:root {
  --bg: #f2f6fb;
  --surface: #ffffff;
  --surface-soft: #eef4fb;
  --border: #d7e1ee;
  --text: #123047;
  --muted: #5f7488;
  --accent: #1f5f8b;
  --accent-soft: #e7f1f8;
  --accent-border: #bfd4e3;
  --accent-strong: #174766;
  --sidebar-bg: #16364d;
  --sidebar-text: #dbe9f4;
  --sidebar-muted: #9cb8cb;
  --sidebar-active: #214f71;
  --success: #166534;
  --warning: #9a3412;
  --danger: #b91c1c;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 10px 30px rgba(15, 23, 42, 0.08);
  --sidebar-width: 272px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Work Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.public-body {
  background:
    radial-gradient(circle at top left, rgba(219, 234, 254, 0.65), transparent 28%),
    linear-gradient(180deg, #f8fbff 0%, #f4f7fb 48%, #eef3f8 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 0.65rem 0.875rem;
  font-size: 0.875rem;
  background: #fff;
  color: var(--text);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #94a3b8;
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.16);
}

.dashboard-body {
  overflow-x: hidden;
}

.dashboard-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 40;
  width: var(--sidebar-width);
  height: 100vh;
  background: linear-gradient(180deg, #16364d 0%, #1b4665 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 12px 34px rgba(7, 26, 40, 0.24);
  transform: translateX(-100%);
  transition: transform 0.2s ease;
}

.dashboard-sidebar__header {
  padding: 1.25rem 1rem 0.5rem;
  border-bottom: 0;
}

.dashboard-sidebar__body {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 0.5rem 1rem 1rem;
  overflow-y: auto;
}

.sidebar-title {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.sidebar-subtitle {
  margin-top: 0.2rem;
  font-size: 0.8rem;
  color: var(--sidebar-muted);
}

.sidebar-nav,
.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logout-form {
  margin: 0;
}

.nav-link {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 46px;
  padding: 0.7rem 0.9rem;
  border: 1px solid transparent;
  border-radius: 0.85rem;
  color: var(--sidebar-text);
  font-size: 0.92rem;
  font-weight: 500;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
}

.nav-link.active {
  background: var(--sidebar-active);
  border-color: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.nav-link-button {
  background: transparent;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
}

.dashboard-layout {
  min-height: 100vh;
}

.dashboard-backdrop {
  position: fixed;
  inset: 0;
  z-index: 35;
  background: rgba(15, 23, 42, 0.38);
  border: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

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

.sidebar-open .dashboard-backdrop {
  opacity: 1;
  visibility: visible;
}

.dashboard-main {
  min-height: 100vh;
}

.dashboard-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(242, 246, 251, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(219, 227, 238, 0.8);
}

.dashboard-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
}

.dashboard-header__left,
.dashboard-header__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.dashboard-header__actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.dashboard-header__eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.dashboard-header__welcome {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.header-link {
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 600;
}

.header-link:hover {
  color: var(--accent-strong);
}

.dashboard-content {
  padding: 1.25rem;
}

.page-shell {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.page-title {
  margin: 0;
  font-size: 1.9rem;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.page-subtitle {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filter-bar {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.summary-grid {
  display: grid;
  gap: 1rem;
}

.stat-card {
  display: block;
  padding: 1.1rem;
}

.stat-card__label {
  color: var(--muted);
  font-size: 0.85rem;
}

.stat-card__value {
  margin-top: 0.35rem;
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.section-card {
  padding: 1.25rem;
}

.section-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.section-card__title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}

.stack-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.stack-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.stack-item:first-child {
  padding-top: 0;
  border-top: 0;
}

.empty-state {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--muted);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1rem;
  box-shadow: var(--shadow-sm);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  min-height: 42px;
  padding: 0.6rem 1rem;
  border-radius: 0.8rem;
  font-size: 0.875rem;
  font-weight: 600;
  border: 1px solid transparent;
  transition: all 0.15s ease-in-out;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.btn-primary:hover {
  background: var(--accent-strong);
}

.btn-outline {
  background: #fff;
  color: var(--text);
  border-color: var(--border);
}

.btn-outline:hover {
  background: var(--surface-soft);
  border-color: var(--accent-border);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}

.btn-sm {
  min-height: 38px;
  padding: 0.45rem 0.85rem;
  font-size: 0.8rem;
}

.link {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.link:hover {
  color: var(--accent-strong);
}

.table-wrap {
  overflow-x: auto;
  width: 100%;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  min-width: 640px;
}

.table thead th {
  text-align: left;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0.85rem 0.75rem;
}

.table tbody td {
  padding: 0.9rem 0.75rem;
  border-top: 1px solid var(--border);
  vertical-align: top;
}

.table tbody tr:hover {
  background: #fbfcfe;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.25rem 0.65rem;
  font-size: 0.75rem;
  border: 1px solid var(--border);
  background: #eef4fb;
  color: var(--muted);
}

.badge-success {
  background: #ecfdf3;
  border-color: #bbf7d0;
  color: var(--success);
}

.badge-warning {
  background: #fff7ed;
  border-color: #fed7aa;
  color: var(--warning);
}

.badge-danger {
  background: #fef2f2;
  border-color: #fecaca;
  color: var(--danger);
}

.alert {
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  padding: 0.9rem 1rem;
  font-size: 0.875rem;
  background: #fff;
}

.alert-success {
  border-color: #bbf7d0;
  background: #ecfdf3;
  color: var(--success);
}

.alert-error {
  border-color: #fecaca;
  background: #fef2f2;
  color: var(--danger);
}

.alert-warning {
  border-color: #fed7aa;
  background: #fff7ed;
  color: var(--warning);
}

.alert-info {
  border-color: #bae6fd;
  background: #eff6ff;
  color: #1d4ed8;
}

.mobile-only {
  display: inline-flex;
}

.public-header {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid rgba(219, 227, 238, 0.8);
  background: rgba(248, 251, 255, 0.92);
  backdrop-filter: blur(10px);
}

.public-header__inner,
.public-container,
.public-footer__inner {
  width: min(1160px, calc(100% - 2rem));
  margin: 0 auto;
}

.public-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
}

.public-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
}

.public-brand__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 0.9rem;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}

.public-brand__title,
.public-brand__subtitle {
  display: block;
}

.public-brand__title {
  font-weight: 700;
  letter-spacing: -0.02em;
}

.public-brand__subtitle,
.public-footer__text {
  color: var(--muted);
  font-size: 0.87rem;
}

.public-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

.public-nav__link {
  color: var(--muted);
  font-size: 0.92rem;
}

.public-nav__link:hover {
  color: var(--text);
}

.public-main {
  padding: 2rem 0 3rem;
}

.hero-section,
.login-shell {
  display: grid;
  gap: 1.5rem;
  align-items: center;
}

.hero-section {
  padding: 1rem 0 2rem;
}

.hero-kicker,
.section-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  background: rgba(226, 232, 240, 0.85);
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-title,
.section-title {
  margin: 0.9rem 0 0;
  font-size: clamp(2rem, 5vw, 3.3rem);
  line-height: 1.08;
  letter-spacing: -0.04em;
  font-weight: 700;
}

.section-title {
  font-size: clamp(1.7rem, 4vw, 2.45rem);
}

.hero-copy {
  max-width: 48rem;
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 1rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.hero-panel,
.login-card,
.content-card,
.feature-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(219, 227, 238, 0.9);
  border-radius: 1.2rem;
  box-shadow: var(--shadow-md);
}

.hero-panel,
.login-card {
  padding: 1.5rem;
}

.hero-panel__title,
.content-card__title,
.feature-card__title,
.public-footer__title {
  font-size: 1.05rem;
  font-weight: 700;
}

.content-card__text,
.feature-card__text {
  margin-top: 0.45rem;
  color: var(--muted);
  font-size: 0.93rem;
}

.feature-grid,
.content-grid {
  display: grid;
  gap: 1rem;
}

.feature-card,
.content-card {
  padding: 1.15rem;
}

.section-block {
  margin-top: 2rem;
}

.section-heading {
  margin-bottom: 1.25rem;
}

.public-footer {
  border-top: 1px solid rgba(219, 227, 238, 0.8);
  background: rgba(255, 255, 255, 0.75);
}

.public-footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 0 2rem;
}

@media (min-width: 1024px) {
  .mobile-only {
    display: none;
  }

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

  .dashboard-main {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
  }

  .dashboard-backdrop {
    display: none;
  }

  .dashboard-content {
    padding: 1.5rem 2rem 2rem;
  }

  .hero-section,
  .login-shell {
    grid-template-columns: 1.2fr 1fr;
  }

  .summary-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .filter-bar {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 1023px) {
  .dashboard-sidebar {
    max-width: calc(100vw - 1.5rem);
  }

  .dashboard-header__inner,
  .page-header {
    flex-direction: column;
    align-items: stretch;
  }

  .dashboard-header__actions {
    justify-content: flex-start;
  }

  .public-header__inner,
  .public-footer__inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .public-nav {
    justify-content: flex-start;
  }
}

@media (max-width: 767px) {
  .dashboard-content {
    padding: 1rem;
  }

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

  .table {
    min-width: 560px;
  }

  .public-header__inner,
  .public-container,
  .public-footer__inner {
    width: min(100% - 1.25rem, 1160px);
  }
}
