:root {
  --app-bg: #f5f7fa;
  --app-surface: #ffffff;
  --app-alt: #eef3f7;
  --app-ink: #17202a;
  --app-muted: #64748b;
  --app-line: #d8e1ea;
  --app-primary: #19324a;
  --app-primary-2: #244765;
  --app-accent: #16807a;
  --app-accent-soft: #e4f5f2;
  --app-success: #247a4f;
  --app-warning: #b7791f;
  --app-danger: #b42318;
  --app-info: #1f6feb;
  --app-shadow: 0 16px 38px rgba(23, 32, 42, .08);
  --app-header-height: 68px;
}

* {
  box-sizing: border-box;
}

body.app-body {
  background: var(--app-bg);
  color: var(--app-ink);
  font-family: Inter, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  letter-spacing: 0;
  margin: 0;
}

a {
  color: var(--app-accent);
  text-decoration: none;
}

a:hover {
  color: #0f6c66;
}

.app-main {
  min-height: calc(100vh - 72px);
  padding-top: var(--app-header-height);
}

.app-header {
  align-items: center;
  background: #102233;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
  box-shadow: 0 10px 30px rgba(16, 34, 51, .18);
  display: flex;
  height: var(--app-header-height);
  left: 0;
  position: fixed;
  right: 0;
  top: 0;
  z-index: 1000;
}

.app-header__inner {
  align-items: center;
  display: flex;
  gap: 22px;
  height: 100%;
  padding: 0 24px;
  width: 100%;
}

.app-brand {
  align-items: center;
  color: #fff;
  display: inline-flex;
  flex: 0 0 auto;
  gap: 10px;
  min-width: 0;
}

.app-brand:hover {
  color: #fff;
}

.app-brand__mark {
  align-items: center;
  background: var(--app-accent);
  border-radius: 8px;
  color: #fff;
  display: inline-flex;
  height: 36px;
  justify-content: center;
  width: 36px;
}

.app-brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.12;
}

.app-brand__name {
  color: #fff;
  font-size: .98rem;
  font-weight: 800;
}

.app-brand__tagline {
  color: rgba(255, 255, 255, .58);
  font-size: .66rem;
  font-weight: 750;
  text-transform: uppercase;
}

.app-navbar {
  align-items: center;
  display: flex;
  flex: 1;
  height: 100%;
  min-width: 0;
}

.app-navbar ul {
  align-items: center;
  display: flex;
  gap: 3px;
  height: 100%;
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
}

.app-navbar li {
  align-items: center;
  display: flex;
  height: 100%;
  position: relative;
}

.app-navbar .nav-link,
.app-navbar > ul > li > a {
  align-items: center;
  border-bottom: 2px solid transparent;
  color: rgba(255, 255, 255, .82);
  display: inline-flex;
  font-size: .86rem;
  font-weight: 700;
  gap: 7px;
  height: 100%;
  padding: 0 13px;
  white-space: nowrap;
}

.app-navbar .nav-link:hover,
.app-navbar > ul > li > a:hover,
.app-navbar li:hover > a {
  background: rgba(255, 255, 255, .06);
  border-bottom-color: var(--app-accent);
  color: #fff;
}

.app-navbar .dropdown ul {
  background: #fff;
  border: 1px solid var(--app-line);
  border-radius: 8px;
  box-shadow: 0 18px 42px rgba(13, 33, 55, .2);
  display: block;
  height: auto;
  min-width: 230px;
  opacity: 0;
  padding: 7px 0;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  transform: translateY(6px);
  transition: opacity .16s ease, transform .16s ease, visibility .16s ease;
  visibility: hidden;
  width: auto;
  z-index: 1200;
}

.app-navbar .dropdown:hover > ul,
.app-navbar .dropdown:focus-within > ul {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
}

.app-navbar .dropdown ul li {
  display: block;
  height: auto;
}

.app-navbar .dropdown ul a {
  align-items: center;
  color: var(--app-primary);
  display: flex;
  font-size: .86rem;
  font-weight: 650;
  gap: 9px;
  min-height: 38px;
  padding: 8px 16px;
}

.app-navbar .dropdown ul a:hover {
  background: var(--app-alt);
  color: var(--app-accent);
}

.app-navbar hr {
  border-color: var(--app-line);
  margin: 5px 0;
}

.dropdown-label {
  color: #8a99aa;
  display: block;
  font-size: .68rem;
  font-weight: 800;
  padding: 8px 16px 4px;
  text-transform: uppercase;
}

.dropdown-uid {
  background: var(--app-alt);
  border: 1px solid var(--app-line);
  border-radius: 6px;
  color: #475569;
  display: block;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: .74rem;
  font-weight: 700;
  margin: 3px 12px 8px;
  overflow: hidden;
  padding: 6px 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-avatar {
  align-items: center;
  background: var(--app-accent);
  border: 2px solid rgba(255, 255, 255, .28);
  border-radius: 50%;
  color: #fff;
  display: inline-flex;
  font-size: .76rem;
  font-weight: 800;
  height: 32px;
  justify-content: center;
  width: 32px;
}

.user-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.18;
}

.user-meta__name {
  color: #fff;
  font-size: .82rem;
  font-weight: 750;
}

.user-meta__role {
  color: rgba(255, 255, 255, .52);
  font-size: .65rem;
  font-weight: 750;
  text-transform: uppercase;
}

.btn-login {
  align-items: center;
  background: var(--app-accent);
  border-radius: 8px;
  color: #fff;
  display: inline-flex;
  font-weight: 750;
  gap: 7px;
  min-height: 40px;
  padding: 8px 16px;
}

.btn-login:hover {
  background: #0f6c66;
  color: #fff;
}

.mobile-nav-toggle {
  background: transparent;
  border: 0;
  color: #fff;
  display: none;
  font-size: 1.45rem;
  line-height: 1;
  margin-left: auto;
  padding: 5px;
}

.app-page {
  padding: 34px 0 56px;
}

.app-section {
  padding: 50px 0;
}

.app-hero {
  background: linear-gradient(90deg, rgba(16, 34, 51, .94), rgba(16, 34, 51, .7)), url("img/heroimg.601b69fa397b.png") right center / contain no-repeat, #102233;
  color: #fff;
  min-height: 72vh;
  padding: 112px 0 80px;
}

.app-hero h1 {
  color: #fff;
  font-size: 3.9rem;
  font-weight: 850;
  letter-spacing: 0;
  line-height: 1.02;
  margin-bottom: 18px;
  max-width: 760px;
}

.app-hero p {
  color: #dbe7ef;
  font-size: 1.08rem;
  line-height: 1.75;
  max-width: 720px;
}

.app-eyebrow,
.app-kicker {
  color: var(--app-accent);
  display: block;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .08em;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.app-hero .app-eyebrow {
  color: #8bded5;
}

.app-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.app-btn,
.btn.app-btn,
button.app-btn,
a.app-btn {
  align-items: center;
  border-radius: 8px;
  display: inline-flex;
  font-weight: 750;
  gap: 8px;
  justify-content: center;
  min-height: 42px;
  padding: 10px 16px;
}

.app-btn-primary {
  background: var(--app-primary);
  border: 1px solid var(--app-primary);
  color: #fff;
}

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

.app-btn-secondary {
  background: #fff;
  border: 1px solid var(--app-line);
  color: var(--app-primary);
}

.app-btn-secondary:hover {
  border-color: var(--app-accent);
  color: var(--app-accent);
}

.app-btn-danger {
  background: #fff;
  border: 1px solid #f1b8b2;
  color: var(--app-danger);
}

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

.app-card {
  background: var(--app-surface);
  border: 1px solid var(--app-line);
  border-radius: 8px;
  box-shadow: var(--app-shadow);
  color: inherit;
  height: 100%;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

a.app-card:hover {
  border-color: rgba(22, 128, 122, .35);
  box-shadow: 0 20px 46px rgba(23, 32, 42, .12);
  color: inherit;
  transform: translateY(-2px);
}

.app-card__body {
  padding: 24px;
}

.app-card__icon {
  align-items: center;
  background: var(--app-accent-soft);
  border-radius: 8px;
  color: var(--app-accent);
  display: inline-flex;
  font-size: 1.25rem;
  height: 44px;
  justify-content: center;
  margin-bottom: 16px;
  width: 44px;
}

.app-card h1,
.app-card h2,
.app-card h3,
.app-panel h1,
.app-panel h2,
.app-panel h3 {
  color: var(--app-primary);
}

.app-page-title,
.app-page-heading {
  align-items: flex-end;
  display: flex;
  gap: 20px;
  justify-content: space-between;
  margin-bottom: 24px;
}

.app-page-title h1,
.app-page-heading h1 {
  color: var(--app-primary);
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0;
}

.app-page-title p,
.app-page-heading p,
.app-meta {
  color: var(--app-muted);
}

.app-page-title p,
.app-page-heading p {
  margin: 8px 0 0;
  max-width: 760px;
}

.app-meta {
  font-size: .92rem;
  line-height: 1.6;
}

.app-panel,
.app-form-panel,
.auth-panel,
.report-panel,
.process-panel,
.app-table-wrap,
.app-chart-panel {
  background: #fff;
  border: 1px solid var(--app-line);
  border-radius: 8px;
  box-shadow: var(--app-shadow);
}

.app-panel,
.app-form-panel,
.auth-panel,
.report-panel,
.process-panel {
  padding: 26px;
}

.app-grid {
  display: grid;
  gap: 18px;
}

.app-grid--two {
  grid-template-columns: minmax(280px, .85fr) minmax(0, 1.15fr);
}

.auth-shell {
  align-items: stretch;
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr);
}

.auth-feature {
  align-items: flex-start;
  display: flex;
  gap: 14px;
  margin-top: 20px;
}

.auth-feature i,
.process-node__icon {
  align-items: center;
  background: var(--app-accent-soft);
  border-radius: 8px;
  color: var(--app-accent);
  display: inline-flex;
  flex: 0 0 42px;
  height: 42px;
  justify-content: center;
  width: 42px;
}

.app-form label,
.app-form-panel label {
  color: var(--app-primary);
  display: block;
  font-weight: 700;
  margin-bottom: 6px;
}

.app-form input,
.app-form select,
.app-form textarea,
.app-form-panel input,
.app-form-panel select,
.app-form-panel textarea,
.modal input,
.modal select,
.modal textarea {
  border: 1px solid #cbd6e2;
  border-radius: 8px;
  box-shadow: none;
  min-height: 42px;
  padding: 9px 11px;
  width: 100%;
}

.app-form textarea,
.app-form-panel textarea,
.modal textarea {
  min-height: 120px;
}

.app-table-wrap {
  overflow: auto;
}

.app-table {
  margin: 0;
  min-width: 760px;
}

.app-table thead th,
.table thead th {
  background: #eef3f7;
  color: var(--app-primary);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.app-table td,
.app-table th {
  padding: 14px 16px;
  vertical-align: middle;
}

.app-empty {
  align-items: center;
  background: #fff;
  border: 1px dashed var(--app-line);
  border-radius: 8px;
  color: var(--app-muted);
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 44px 24px;
  text-align: center;
}

.app-stat-grid,
.metric-strip {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.app-stat,
.metric-strip .metric {
  background: #fff;
  border: 1px solid var(--app-line);
  border-radius: 8px;
  padding: 18px;
}

.app-stat strong,
.metric strong {
  color: var(--app-primary);
  display: block;
  font-size: 1.8rem;
  line-height: 1;
}

.metric span {
  color: var(--app-muted);
  font-size: .84rem;
  font-weight: 800;
  text-transform: uppercase;
}

.compliance-bar {
  background: #edf2f7;
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
}

.compliance-bar__fill {
  background: var(--app-accent);
  height: 100%;
}

.workproduct-grid,
.template-grid,
.process-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.workproduct,
.template-tile,
.process-node {
  background: #fff;
  border: 1px solid var(--app-line);
  border-radius: 8px;
  padding: 18px;
}

.process-node {
  display: flex;
  gap: 14px;
}

.process-node--done {
  border-color: #b8e2cf;
}

.process-node--pending {
  border-color: #f3d48b;
}

.process-node--missing {
  border-color: #f5b7b1;
}

.badge-status {
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 800;
  padding: 6px 10px;
}

.badge-status--review {
  background: #e6f4ef;
  color: var(--app-success);
}

.badge-status--pending {
  background: #fff4db;
  color: var(--app-warning);
}

.badge-status--unassigned {
  background: #edf2f7;
  color: #475467;
}

.modal-content {
  border: 0;
  border-radius: 8px;
  box-shadow: var(--app-shadow);
}

.app-message-stack {
  padding-top: 18px;
}

.alert {
  border: 0;
  border-left: 4px solid transparent;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(23, 32, 42, .06);
  font-weight: 650;
}

.alert-success {
  background: #edfdf4;
  border-left-color: #10b981;
  color: #065f46;
}

.alert-warning {
  background: #fffbeb;
  border-left-color: #f59e0b;
  color: #92400e;
}

.alert-danger,
.alert-error {
  background: #fef2f2;
  border-left-color: #ef4444;
  color: #991b1b;
}

.alert-info {
  background: #eff6ff;
  border-left-color: #3b82f6;
  color: #1e40af;
}

.ai-content,
.analysis-result,
.ai-result-box,
.ai-modal-result,
.ai-result-cell,
.summary-box,
.result-box {
  background: #fbfcfd;
  border: 1px solid var(--app-line);
  border-radius: 8px;
  color: #22303e;
  font-family: inherit;
  font-size: .96rem;
  line-height: 1.72;
  overflow-wrap: anywhere;
  padding: 18px;
  white-space: normal;
}

.analysis-result,
.ai-modal-result {
  background: #fff;
  border: 0;
  padding: 22px;
}

.ai-content p,
.analysis-result p,
.ai-result-box p,
.ai-modal-result p,
.ai-result-cell p,
.summary-box p,
.result-box p {
  margin: 0 0 .85rem;
}

.ai-content p:last-child,
.analysis-result p:last-child,
.ai-result-box p:last-child,
.ai-modal-result p:last-child,
.ai-result-cell p:last-child,
.summary-box p:last-child,
.result-box p:last-child {
  margin-bottom: 0;
}

.ai-h {
  color: var(--app-primary);
  font-weight: 800;
  letter-spacing: 0;
  margin: 1rem 0 .4rem;
}

.ai-list {
  margin: .35rem 0 .9rem 1.25rem;
  padding: 0;
}

.ai-list li {
  margin: .22rem 0;
  padding-left: .15rem;
}

.ai-content code,
.analysis-result code,
.ai-result-box code,
.ai-modal-result code,
.ai-result-cell code,
.summary-box code,
.result-box code {
  background: #eef3f7;
  border: 1px solid #dce5ee;
  border-radius: 6px;
  color: #39475a;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: .88em;
  padding: .12rem .32rem;
}

.ai-content pre,
.analysis-result pre,
.ai-result-box pre,
.ai-modal-result pre,
.ai-result-cell pre,
.summary-box pre,
.result-box pre {
  background: #122032;
  border-radius: 8px;
  color: #e5edf5;
  overflow: auto;
  padding: 14px;
  white-space: pre-wrap;
}

.ai-content pre code,
.analysis-result pre code,
.ai-result-box pre code,
.ai-modal-result pre code,
.ai-result-cell pre code,
.summary-box pre code,
.result-box pre code {
  background: transparent;
  border: 0;
  color: inherit;
  padding: 0;
}

.app-footer {
  background: #102233;
  color: rgba(255, 255, 255, .58);
  margin-top: 56px;
}

.footer-body {
  display: grid;
  gap: 34px;
  grid-template-columns: 1.35fr 1fr 1fr 1fr;
  margin: 0 auto;
  max-width: 1200px;
  padding: 42px 32px 34px;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-brand-logo {
  align-items: center;
  color: #fff;
  display: inline-flex;
  gap: 10px;
}

.footer-brand-logo:hover {
  color: #fff;
}

.footer-brand-logo .mark {
  align-items: center;
  background: var(--app-accent);
  border-radius: 8px;
  color: #fff;
  display: inline-flex;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.footer-brand-logo .name {
  color: #fff;
  font-weight: 800;
}

.footer-brand p {
  color: rgba(255, 255, 255, .48);
  font-size: .86rem;
  line-height: 1.65;
  margin: 0;
  max-width: 290px;
}

.footer-badge {
  align-items: center;
  background: rgba(22, 128, 122, .16);
  border: 1px solid rgba(143, 224, 212, .32);
  border-radius: 6px;
  color: #8bded5;
  display: inline-flex;
  font-size: .73rem;
  font-weight: 800;
  gap: 6px;
  padding: 5px 10px;
  text-transform: uppercase;
  width: fit-content;
}

.footer-col h6 {
  color: rgba(255, 255, 255, .42);
  font-size: .72rem;
  font-weight: 850;
  letter-spacing: .09em;
  margin: 0 0 14px;
  text-transform: uppercase;
}

.footer-col ul {
  display: flex;
  flex-direction: column;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-col a {
  align-items: center;
  color: rgba(255, 255, 255, .62);
  display: flex;
  font-size: .86rem;
  font-weight: 650;
  gap: 7px;
}

.footer-col a:hover {
  color: #8bded5;
}

.footer-bottom {
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, .08);
  color: rgba(255, 255, 255, .36);
  display: flex;
  font-size: .78rem;
  justify-content: space-between;
  margin: 0 auto;
  max-width: 1200px;
  padding: 16px 32px;
}

#preloader {
  display: none;
}

@media (max-width: 1080px) {
  .app-navbar .nav-link,
  .app-navbar > ul > li > a {
    padding: 0 9px;
  }
}

@media (max-width: 991px) {
  :root {
    --app-header-height: 62px;
  }

  .app-header__inner {
    padding: 0 16px;
  }

  .mobile-nav-toggle {
    display: inline-flex;
  }

  .app-navbar {
    background: rgba(16, 34, 51, .98);
    display: none;
    height: auto;
    inset: var(--app-header-height) 0 0 0;
    overflow-y: auto;
    padding: 16px;
    position: fixed;
  }

  .app-navbar.mobile-open {
    display: block;
  }

  .app-navbar ul {
    align-items: stretch;
    flex-direction: column;
    gap: 4px;
    height: auto;
  }

  .app-navbar li {
    display: block;
    height: auto;
  }

  .app-navbar .nav-link,
  .app-navbar > ul > li > a {
    border-bottom: 0;
    border-radius: 8px;
    height: auto;
    justify-content: flex-start;
    min-height: 44px;
    padding: 11px 12px;
  }

  .app-navbar .dropdown ul {
    background: rgba(255, 255, 255, .06);
    border-color: rgba(255, 255, 255, .12);
    box-shadow: none;
    margin: 4px 0 4px 12px;
    opacity: 1;
    position: static;
    transform: none;
    visibility: visible;
  }

  .app-navbar .dropdown ul a {
    color: rgba(255, 255, 255, .82);
  }

  .dropdown-label,
  .dropdown-uid {
    color: rgba(255, 255, 255, .72);
  }

  .user-meta {
    display: none;
  }

  .app-page-title,
  .app-page-heading,
  .app-header__inner,
  .app-footer__inner {
    align-items: flex-start;
  }

  .app-page-title,
  .app-page-heading {
    flex-direction: column;
  }

  .app-hero {
    background: linear-gradient(90deg, rgba(16, 34, 51, .95), rgba(16, 34, 51, .9)), url("img/heroimg.601b69fa397b.png") center bottom / 72% auto no-repeat, #102233;
    min-height: auto;
    padding: 88px 0 210px;
  }

  .app-hero h1 {
    font-size: 3rem;
  }

  .auth-shell,
  .app-grid--two,
  .app-stat-grid,
  .metric-strip,
  .footer-body {
    grid-template-columns: 1fr;
  }

  .footer-body {
    padding: 32px 20px 26px;
  }

  .footer-bottom {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    padding: 16px 20px;
  }
}

@media (max-width: 560px) {
  .app-page {
    padding: 24px 0 42px;
  }

  .app-hero h1 {
    font-size: 2.35rem;
  }

  .app-card__body,
  .app-panel,
  .app-form-panel,
  .auth-panel,
  .report-panel,
  .process-panel {
    padding: 20px;
  }
}

@media print {
  .app-header,
  .app-footer,
  .print-actions {
    display: none !important;
  }

  .app-main {
    padding-top: 0;
  }

  .report-panel,
  .process-panel,
  .workproduct,
  .template-tile,
  .app-card {
    box-shadow: none;
  }
}

/* django-allauth pages (templates/allauth/layouts/base.html) */
.auth-card {
  margin: 48px auto;
  max-width: 520px;
}

.auth-card h1 {
  color: var(--app-primary);
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 12px;
  text-align: center;
}

.auth-card h2 {
  color: var(--app-primary);
  font-size: 1.15rem;
  margin-top: 20px;
}

.auth-card > p,
.auth-card form > p:not(:has(input)) {
  color: var(--app-muted);
  text-align: center;
}

.auth-card label {
  color: var(--app-primary);
  display: block;
  font-weight: 700;
  margin-bottom: 4px;
}

.auth-card input:not([type="checkbox"]):not([type="radio"]),
.auth-card select,
.auth-card textarea {
  border: 1px solid var(--app-line);
  border-radius: 8px;
  padding: 10px 12px;
  width: 100%;
}

.auth-card input[type="checkbox"] + label,
.auth-card input[type="radio"] + label {
  display: inline;
  font-weight: 400;
  margin-left: 6px;
}

.auth-card form {
  margin-top: 16px;
}

.auth-card button,
.auth-card form a[href] {
  background: #37517e;
  border: 0;
  border-radius: 28px;
  color: #fff;
  display: inline-block;
  font-size: 1.05rem;
  font-weight: 700;
  margin: 8px 4px 0 0;
  padding: 10px 24px;
  text-decoration: none;
}

.auth-card button:hover,
.auth-card form a[href]:hover {
  background: var(--app-accent);
  color: #fff;
}

.auth-card ul {
  list-style: none;
  padding: 0;
}

.auth-card hr {
  margin: 24px 0;
}
