:root {
  --bg: #f6f4ef;
  --panel: #fffdf8;
  --ink: #1d1f1c;
  --muted: #606a63;
  --line: #d4cec2;
  --accent: #155e63;
  --warn: #c2461a;
  --ok: #1f7a42;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  font-family: Barlow, sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 10% 10%, #e2ddd1 0%, var(--bg) 45%);
  min-height: 100vh;
}

h1,
h2,
h3,
button {
  font-family: "Space Grotesk", sans-serif;
}

.app-shell {
  width: min(1200px, 94vw);
  margin: 1.2rem auto 2rem;
  position: relative;
  z-index: 2;
  display: grid;
  gap: 0.9rem;
}

.topbar {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.2rem;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.9rem;
  align-items: center;
}

.topbar-logo-wrap {
  grid-column: 1;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.topbar-logo {
  height: clamp(34px, 4vw, 52px);
  width: auto;
  display: block;
}

.topbar-actions {
  grid-column: 3;
  display: flex;
  gap: 0.6rem;
  align-items: center;
  justify-self: end;
}

.topbar-actions .small-btn {
  min-width: 76px;
  min-height: 40px;
  padding: 0.45rem 0.75rem;
}

.hidden {
  display: none !important;
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  letter-spacing: 0.08em;
  font-size: 0.85rem;
  font-weight: 700;
}

h1 {
  margin: 0.4rem 0 0;
  font-size: clamp(1rem, 3.5vw, 1.5rem);
}

h2 {
  margin: 0 0 0.8rem;
  font-size: 1.06rem;
}

h3 {
  margin: 0 0 0.7rem;
  font-size: 1rem;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1rem;
}

.auth-view {
  background:
    radial-gradient(980px 520px at -8% -12%, rgba(31, 86, 163, 0.18) 0%, transparent 58%),
    radial-gradient(760px 420px at 110% 118%, rgba(123, 171, 52, 0.2) 0%, transparent 55%),
    linear-gradient(140deg, #f8f6f1 0%, #f4f7fb 48%, #eff5fb 100%);
}

.auth-view .bg-shape {
  display: none;
}

.auth-view .app-shell {
  width: min(1120px, 94vw);
  min-height: calc(100vh - 3rem);
  margin: 1.5rem auto;
  align-content: center;
  gap: 1.1rem;
}

.auth-view .topbar {
  background: transparent;
  border: 0;
  padding: 0.15rem 0;
  grid-template-columns: 1fr auto 1fr;
}

.auth-view .topbar-brand-block {
  display: none;
}

.auth-view .topbar-logo-wrap {
  grid-column: 2;
  justify-self: center;
}

.auth-view .topbar-logo-wrap {
  background: #ffffff;
  border: 1px solid #d6e1ef;
  border-radius: 999px;
  padding: 0.34rem 0.85rem;
  box-shadow: 0 8px 18px rgba(11, 46, 99, 0.08);
  overflow: hidden;
}

.auth-view .topbar-logo {
  width: clamp(180px, 25vw, 300px);
  height: auto;
}

.auth-view .eyebrow {
  color: #1e4d8f;
}

.auth-view h1 {
  color: #0b2e63;
  letter-spacing: 0.01em;
}

.auth-view .topbar-actions .secondary-btn {
  border-color: #bfd0e8;
  background: #ffffff;
  color: #0b2e63;
  backdrop-filter: blur(2px);
}

.auth-view .topbar-actions .secondary-btn:hover {
  background: #eef4fb;
}

.auth-view .topbar-actions {
  grid-column: 3;
  justify-self: end;
}

.auth-panel {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  overflow: hidden;
  padding: 0;
}

.auth-view .auth-panel {
  border-radius: 24px;
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow:
    0 26px 52px rgba(3, 13, 33, 0.35),
    0 2px 10px rgba(4, 16, 40, 0.2);
  animation: authPanelRise 460ms ease-out both;
}

.auth-hero {
  position: relative;
  isolation: isolate;
  color: #f4f9ff;
  padding: 2.1rem 2rem;
  background:
    radial-gradient(circle at 90% 5%, rgba(127, 178, 53, 0.32) 0%, transparent 40%),
    linear-gradient(145deg, #0a2a59 0%, #124283 55%, #19569d 100%);
}

.auth-kicker {
  margin: 0;
  font-size: 0.76rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 700;
  color: rgba(209, 236, 255, 0.94);
}

.auth-hero-title {
  margin: 0.55rem 0 0;
  font-size: clamp(1.4rem, 2vw + 0.9rem, 2.1rem);
  line-height: 1.15;
}

.auth-hero-text {
  margin: 0.7rem 0 0;
  color: rgba(223, 239, 255, 0.95);
  max-width: 38ch;
  line-height: 1.5;
}

.auth-hero-points {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.auth-hero-points span {
  font-size: 0.8rem;
  color: #ecf6ff;
  border: 1px solid rgba(222, 243, 255, 0.36);
  background: rgba(236, 246, 255, 0.12);
  border-radius: 999px;
  padding: 0.32rem 0.62rem;
}

.auth-hero-art {
  position: absolute;
  inset: auto -40px -56px auto;
  width: 300px;
  height: 170px;
  pointer-events: none;
  z-index: -1;
}

.auth-hero-art span {
  position: absolute;
  display: block;
  border-radius: 999px;
  transform: rotate(-34deg);
  opacity: 0.68;
}

.auth-hero-art span:nth-child(1) {
  width: 190px;
  height: 36px;
  right: 24px;
  bottom: 38px;
  background: linear-gradient(90deg, rgba(105, 157, 49, 0.76), rgba(174, 226, 98, 0.86));
}

.auth-hero-art span:nth-child(2) {
  width: 118px;
  height: 22px;
  right: 92px;
  bottom: 84px;
  background: linear-gradient(90deg, rgba(79, 134, 207, 0.66), rgba(42, 110, 191, 0.88));
}

.auth-hero-art span:nth-child(3) {
  width: 160px;
  height: 20px;
  right: 4px;
  bottom: 16px;
  background: linear-gradient(90deg, rgba(124, 173, 52, 0.6), rgba(30, 101, 186, 0.74));
}

.auth-hero-art span:nth-child(4) {
  width: 76px;
  height: 14px;
  right: 226px;
  bottom: 40px;
  background: linear-gradient(90deg, rgba(103, 151, 220, 0.7), rgba(165, 215, 95, 0.72));
}

.auth-form-pane {
  background: linear-gradient(180deg, #fdfefe 0%, #f6f9ff 100%);
  padding: 2rem 1.7rem 1.5rem;
  display: grid;
  align-content: center;
}

.auth-form-pane h2 {
  margin-bottom: 0.35rem;
}

.auth-form-pane .muted {
  margin-bottom: 0.75rem;
}

.auth-form-pane .form-grid {
  grid-template-columns: 1fr;
  gap: 0.72rem;
}

.auth-view .auth-form-pane input {
  border-radius: 999px;
  border-color: #d2dff4;
  background: #f7fbff;
  min-height: 44px;
}

.auth-view .auth-form-pane input:focus-visible {
  outline: 2px solid rgba(24, 84, 165, 0.46);
  outline-offset: 1px;
}

.auth-view .auth-form-pane .primary-btn {
  position: relative;
  overflow: hidden;
  width: 100%;
  min-width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #0f3f83 0%, #2d6dc1 58%, #7eaa34 130%);
  background-size: 180% 180%;
  box-shadow: 0 10px 24px rgba(15, 63, 131, 0.28);
  transition: transform 180ms ease, box-shadow 220ms ease, filter 220ms ease;
  animation: loginBtnGradient 4.2s ease-in-out infinite;
}

.auth-view .auth-form-pane .primary-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
  box-shadow: 0 14px 30px rgba(21, 74, 145, 0.35);
}

.auth-view .auth-form-pane .primary-btn:active {
  transform: translateY(0);
  filter: brightness(0.98);
}

.auth-view .auth-form-pane .primary-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(110deg, transparent 0%, rgba(255, 255, 255, 0.26) 45%, transparent 70%);
  transform: translateX(-125%);
  animation: loginBtnShine 3.2s ease-in-out infinite;
  pointer-events: none;
}

.auth-view .auth-form-pane .primary-btn:disabled {
  animation: none;
  transform: none;
  box-shadow: none;
  filter: grayscale(0.1);
  cursor: not-allowed;
}

.portal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
}

.action-menu {
  display: grid;
  gap: 0.3rem;
  min-width: 240px;
}

.action-menu-label {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 600;
}

.action-menu-select {
  width: 100%;
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 0.65rem 0.8rem;
  font: inherit;
}

.muted {
  margin: 0;
  color: var(--muted);
}

.primary-btn {
  border: 0;
  background: var(--accent);
  color: #fff;
  border-radius: 12px;
  padding: 0.9rem 1rem;
  font-size: 0.95rem;
  min-width: 180px;
  cursor: pointer;
}

.secondary-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 12px;
  padding: 0.9rem 0.95rem;
  font-size: 0.9rem;
  min-width: 64px;
  cursor: pointer;
}

.small-btn {
  min-width: 0;
  padding: 0.45rem 0.65rem;
  font-size: 0.82rem;
}

.btn-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.text-link {
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  color: var(--accent);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.submission-link.active {
  font-weight: 700;
}

.admin-project-toggle.active,
.admin-order-link.active {
  font-weight: 700;
}

.project-orders-row td {
  background: #fbf9f4;
}

.project-orders-panel {
  border-left: 2px solid var(--line);
  padding: 0.55rem 0.7rem;
}

.project-order-list {
  margin-top: 0.3rem;
}

.submission-divider {
  border-top: 1px solid #ece5da;
  margin: 0.8rem 0;
}

.submission-detail h4 {
  margin: 0.75rem 0 0.45rem;
  font-size: 0.95rem;
}

.submission-detail p {
  margin: 0.25rem 0;
  font-size: 0.92rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

label span {
  color: var(--muted);
  font-size: 0.9rem;
}

input,
select {
  width: 100%;
  padding: 0.8rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
}

.form-actions {
  margin-top: 0.85rem;
}

.status {
  min-height: 1.2rem;
  margin: 0.8rem 0 0;
}

.status.ok {
  color: var(--ok);
}

.status.err {
  color: var(--warn);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
}

.kpi {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.9rem;
}

.kpi-actionable {
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.kpi-actionable:hover {
  border-color: #b9afa0;
  transform: translateY(-1px);
}

.kpi-actionable:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.kpi p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.kpi h3 {
  margin: 0.35rem 0 0;
  font-size: 1.4rem;
}

.kpi-rich-value {
  margin-top: 0.35rem;
}

.kpi-online-value {
  margin: 0.35rem 0 0;
  font-size: 1.4rem;
}

.kpi-select {
  width: 100%;
  min-height: 42px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 0.5rem 0.65rem;
  font: inherit;
}

.kpi-subtext {
  color: var(--muted);
  font-size: 0.84rem;
}

.budget-kpi {
  display: flex;
  gap: 0.7rem;
  align-items: center;
}

.budget-ring {
  --pct: 0;
  width: 58px;
  height: 58px;
  border-radius: 999px;
  background: conic-gradient(var(--accent) calc(var(--pct) * 1%), #e9e2d7 0);
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.budget-ring::before {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 999px;
  background: var(--panel);
}

.budget-ring span {
  position: relative;
  z-index: 1;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--accent);
}

.budget-meta {
  display: grid;
  gap: 0.2rem;
}

.budget-amount {
  font-size: 1.05rem;
  font-weight: 700;
}

.budget-project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.75rem;
}

.budget-project-card {
  border: 1px solid #ece5da;
  border-radius: 12px;
  background: #fbf9f4;
  padding: 0.75rem;
}

.budget-project-head {
  display: flex;
  justify-content: space-between;
  gap: 0.55rem;
  align-items: flex-start;
}

.budget-project-head h4 {
  margin: 0;
  font-size: 0.96rem;
}

.budget-project-body {
  margin-top: 0.55rem;
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.budget-ring-project {
  width: 66px;
  height: 66px;
}

.budget-ring-project::before {
  inset: 8px;
}

.budget-project-meta {
  display: grid;
  gap: 0.15rem;
}

.budget-project-meta p {
  margin: 0;
  font-size: 0.9rem;
}

.panel-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 0.8rem;
  margin-top: 0.8rem;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  border-bottom: 1px solid #ece5da;
  padding: 0.65rem 0.4rem;
  font-size: 0.93rem;
  vertical-align: top;
}

.list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.list li {
  border-bottom: 1px solid #ece5da;
  padding: 0.62rem 0.2rem;
  font-size: 0.92rem;
}

.list li:last-child {
  border-bottom: 0;
}

.list-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
  margin-top: 0.45rem;
}

.list-page-indicator {
  font-size: 0.82rem;
  color: var(--muted);
  min-width: 2.8rem;
  text-align: center;
}

.activity-page-btn {
  width: auto !important;
  min-width: 34px !important;
  min-height: 30px !important;
  padding: 0.2rem 0.45rem !important;
}

.activity-page-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.badge {
  border-radius: 999px;
  padding: 0.22rem 0.55rem;
  font-weight: 700;
  font-size: 0.75rem;
  display: inline-block;
}

.badge.active {
  background: #d9f2e4;
  color: var(--ok);
}

.badge.paused {
  background: #fde9df;
  color: var(--warn);
}

.badge.planning {
  background: #e4ecf8;
  color: #2f5877;
}

.badge.queued {
  background: #fff3d8;
  color: #8c5c00;
}

.empty-state {
  color: var(--muted);
  font-size: 0.92rem;
  padding: 0.4rem 0;
}

.portal-head .primary-btn {
  min-width: 220px;
}

.bg-shape {
  position: fixed;
  z-index: 1;
  pointer-events: none;
  opacity: 0.35;
}

.bg-shape-1 {
  width: 340px;
  height: 340px;
  background: #cadfd1;
  border-radius: 58% 42% 40% 60%;
  top: -70px;
  right: -80px;
}

.bg-shape-2 {
  width: 220px;
  height: 220px;
  background: #e4ccb2;
  border-radius: 42% 58% 63% 37%;
  bottom: -70px;
  left: -50px;
}

@media (max-width: 980px) {
  .topbar {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .topbar-logo-wrap,
  .topbar-actions {
    grid-column: auto;
  }

  .topbar-brand-block,
  .topbar-actions {
    justify-self: center;
  }

  .topbar-actions {
    width: 100%;
  }

  .auth-panel {
    grid-template-columns: 1fr;
  }

  .auth-hero {
    min-height: 230px;
  }

  .auth-form-pane {
    padding: 1.35rem 1.15rem 1.2rem;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

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

  .panel-grid {
    grid-template-columns: 1fr;
  }

  .topbar-actions {
    justify-content: center;
  }

  .portal-head {
    flex-direction: column;
    align-items: stretch;
  }

  .action-menu {
    min-width: 0;
  }

  .primary-btn,
  .secondary-btn {
    width: 100%;
  }

  .portal-head .primary-btn {
    min-width: 0;
  }
}

@keyframes authPanelRise {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes loginBtnGradient {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

@keyframes loginBtnShine {
  0%,
  56% {
    transform: translateX(-125%);
  }
  78% {
    transform: translateX(130%);
  }
  100% {
    transform: translateX(130%);
  }
}
