:root {
  color-scheme: light;
  --ink: #121f1a;
  --muted: #617069;
  --line: #dbe6df;
  --paper: #ffffff;
  --soft: #f4f8f5;
  --brand: #17784e;
  --brand-dark: #092d22;
  --electric: #78f22f;
  --blue: #29abe2;
  --gold: #d99a28;
  --danger: #9c2f1f;
  --shadow: 0 20px 55px rgba(7, 16, 13, 0.14);
  --soft-shadow: 0 14px 34px rgba(7, 16, 13, 0.08);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 0;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 0%, rgba(120, 242, 47, 0.16), transparent 28rem),
    radial-gradient(circle at 92% 8%, rgba(41, 171, 226, 0.12), transparent 24rem),
    linear-gradient(180deg, #f8fbf9 0%, #eef5f1 48%, #f8fbf9 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(19, 32, 27, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(19, 32, 27, 0.04) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.55), transparent 82%);
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
.button-link,
.topbar-actions a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), #46b51d);
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

button:hover,
.button-link:hover,
.topbar-actions a:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(7, 16, 13, 0.16);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(120, 242, 47, 0.65);
  outline-offset: 3px;
}

.shell {
  min-height: 100vh;
}

.login-panel {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.back-link {
  position: fixed;
  top: 24px;
  left: 24px;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(23, 120, 78, 0.18);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--brand-dark);
  background: rgba(255, 255, 255, 0.72);
  font-weight: 900;
  text-decoration: none;
  backdrop-filter: blur(14px);
}

.login-card,
.panel,
.stat-card {
  border: 1px solid rgba(219, 230, 223, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.login-card {
  width: min(100%, 560px);
  padding: clamp(24px, 5vw, 42px);
}

.login-brand,
.brand-mark {
  display: grid;
  place-items: center;
  color: #fff;
  background:
    radial-gradient(circle at 30% 20%, rgba(120, 242, 47, 0.55), transparent 38%),
    var(--brand-dark);
  border-radius: 8px;
  font-weight: 950;
}

.login-brand {
  width: 58px;
  height: 58px;
  margin-bottom: 24px;
  font-size: 1.1rem;
}

.brand-mark {
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1;
}

h1 {
  font-size: clamp(2.25rem, 5vw, 3.45rem);
}

h2 {
  font-size: clamp(1.45rem, 3vw, 2rem);
}

h3 {
  font-size: 1rem;
}

.login-copy,
.panel-heading p,
.detail-empty p,
.recent-list p,
.submission-meta,
.submission-body,
.stat-card small {
  color: var(--muted);
  line-height: 1.55;
}

form {
  display: grid;
  gap: 14px;
  margin-top: 26px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-weight: 900;
}

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid #c9d7cf;
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--ink);
  background: var(--paper);
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease;
}

input:hover,
select:hover,
textarea:hover {
  border-color: rgba(23, 120, 78, 0.42);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(23, 120, 78, 0.1);
}

.status {
  min-height: 22px;
  margin: 0;
  color: var(--brand-dark);
  font-weight: 800;
}

.status.is-error {
  color: var(--danger);
}

.dashboard {
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
  padding: clamp(18px, 4vw, 42px) 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid rgba(219, 230, 223, 0.9);
  border-radius: 8px;
  background:
    radial-gradient(circle at 78% 10%, rgba(120, 242, 47, 0.16), transparent 18rem),
    rgba(255, 255, 255, 0.86);
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(18px);
}

.brand-lockup,
.topbar-actions,
.panel-heading,
.form-actions,
.detail-actions,
.card-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-lockup {
  min-width: 0;
}

.topbar-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.topbar-actions a,
.topbar-actions button {
  min-height: 42px;
  padding: 9px 13px;
}

.topbar-actions button:last-child,
.quiet-button,
.ghost-button {
  color: var(--brand-dark);
  background: var(--paper);
  border-color: var(--line);
}

.workspace-tabs {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
  padding: 8px;
  border: 1px solid rgba(219, 230, 223, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(16px);
}

.workspace-tabs button {
  flex: 1 1 140px;
  color: var(--muted);
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.workspace-tabs button.is-active {
  color: #fff;
  background: var(--brand-dark);
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.stat-card {
  min-height: 148px;
  padding: 18px;
  box-shadow: var(--soft-shadow);
}

.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 950;
  text-transform: uppercase;
}

.stat-card strong {
  display: block;
  margin-top: 8px;
  color: var(--brand-dark);
  font-size: 2.45rem;
  line-height: 1;
}

.stat-card small {
  display: block;
  margin-top: 10px;
}

.stat-card.priority {
  color: #fff;
  background:
    radial-gradient(circle at 90% 18%, rgba(120, 242, 47, 0.28), transparent 12rem),
    linear-gradient(135deg, var(--brand-dark), #11593c);
}

.stat-card.priority span,
.stat-card.priority small {
  color: rgba(255, 255, 255, 0.72);
}

.stat-card.priority strong {
  color: var(--electric);
}

.tab-panel {
  display: none;
}

.tab-panel.is-active {
  display: block;
}

.overview-grid,
.inbox-layout,
.settings-grid {
  display: grid;
  gap: 16px;
  align-items: start;
}

.overview-grid {
  grid-template-columns: minmax(0, 0.95fr) minmax(320px, 0.62fr);
}

.inbox-layout {
  grid-template-columns: minmax(0, 0.95fr) minmax(360px, 0.62fr);
}

.panel {
  padding: clamp(18px, 3vw, 26px);
}

.panel-heading {
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 18px;
}

.panel-heading p {
  max-width: 64ch;
  margin: 8px 0 0;
}

.result-count {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(23, 120, 78, 0.18);
  border-radius: 8px;
  padding: 7px 10px;
  color: var(--brand-dark);
  background: rgba(23, 120, 78, 0.08);
  font-weight: 900;
}

.status-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.status-tile {
  min-height: 118px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.status-tile strong {
  color: var(--brand-dark);
  font-size: 2rem;
  line-height: 1;
}

.status-tile span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 950;
  text-transform: uppercase;
}

.recent-list,
.submission-list {
  display: grid;
  gap: 12px;
}

.recent-item,
.submission-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: none;
}

.recent-item {
  display: grid;
  gap: 6px;
  padding: 14px;
}

.recent-item strong {
  color: var(--brand-dark);
}

.recent-item p {
  margin: 0;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(150px, 0.32fr) minmax(150px, 0.32fr);
  gap: 10px;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid rgba(219, 230, 223, 0.9);
  border-radius: 8px;
  background: var(--soft);
}

.submission-card {
  width: 100%;
  display: grid;
  gap: 12px;
  padding: 16px;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.submission-card:hover,
.submission-card.is-selected {
  transform: translateY(-2px);
  border-color: rgba(23, 120, 78, 0.42);
  box-shadow: var(--soft-shadow);
}

.submission-card.is-selected {
  background:
    linear-gradient(90deg, rgba(120, 242, 47, 0.12), transparent 34%),
    var(--paper);
}

.submission-card-head,
.submission-card-foot {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.submission-card h3 {
  margin-bottom: 6px;
}

.submission-meta,
.submission-body {
  display: grid;
  gap: 5px;
  margin: 0;
}

.pill {
  min-width: 92px;
  border: 1px solid rgba(23, 120, 78, 0.2);
  border-radius: 8px;
  padding: 7px 10px;
  color: var(--brand-dark);
  background: rgba(23, 120, 78, 0.08);
  font-size: 0.82rem;
  font-weight: 950;
  text-align: center;
  text-transform: capitalize;
}

.pill.new {
  color: #07100d;
  border-color: rgba(120, 242, 47, 0.6);
  background: rgba(120, 242, 47, 0.28);
}

.pill.cancelled,
.pill.archived {
  color: var(--danger);
  border-color: rgba(156, 47, 31, 0.2);
  background: rgba(156, 47, 31, 0.08);
}

.type-chip {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 950;
  text-transform: uppercase;
}

.empty-state {
  margin: 18px 0 0;
  color: var(--muted);
  font-weight: 800;
}

.detail-panel {
  position: sticky;
  top: 86px;
  min-height: 520px;
}

.detail-empty {
  min-height: 450px;
  display: grid;
  align-content: center;
  gap: 10px;
  text-align: center;
}

.detail-header {
  display: grid;
  gap: 14px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.detail-header-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.detail-grid {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.detail-row {
  display: grid;
  grid-template-columns: minmax(110px, 0.35fr) minmax(0, 1fr);
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.detail-row span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
}

.detail-row strong,
.detail-row p {
  margin: 0;
  color: var(--ink);
  font-weight: 800;
  line-height: 1.5;
}

.detail-actions {
  flex-wrap: wrap;
  margin-top: 18px;
}

.detail-actions a,
.detail-actions button {
  flex: 1 1 130px;
}

.status-control {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

fieldset {
  min-width: 0;
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

legend {
  padding: 0 8px;
  color: var(--brand-dark);
  font-weight: 950;
}

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

.form-actions {
  justify-content: flex-end;
}

@media (max-width: 1120px) {
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .overview-grid,
  .inbox-layout {
    grid-template-columns: 1fr;
  }

  .detail-panel {
    position: static;
    min-height: auto;
  }

  .detail-empty {
    min-height: 260px;
  }
}

@media (max-width: 760px) {
  .dashboard {
    width: min(100% - 20px, 1440px);
    padding-top: 12px;
  }

  .topbar,
  .panel-heading,
  .submission-card-head,
  .submission-card-foot,
  .detail-header-top {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions,
  .detail-actions,
  .form-actions {
    width: 100%;
  }

  .topbar-actions a,
  .topbar-actions button,
  .detail-actions a,
  .detail-actions button,
  .form-actions button {
    flex: 1 1 100%;
  }

  .stats,
  .status-board,
  .toolbar,
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .workspace-tabs {
    position: static;
  }

  .detail-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

@media (max-width: 520px) {
  .login-panel {
    padding: 76px 12px 18px;
  }

  .back-link {
    top: 12px;
    left: 12px;
  }

  .login-card,
  .panel,
  .stat-card {
    box-shadow: 0 12px 28px rgba(7, 16, 13, 0.1);
  }

  .panel,
  .topbar,
  .toolbar {
    padding: 14px;
  }
}
