:root {
  --bg: #f7faf9;
  --panel: #ffffff;
  --panel-soft: #eef6f3;
  --ink: #17211f;
  --muted: #697875;
  --line: #dbe5e2;
  --line-strong: #b8c7c3;
  --teal: #0f766e;
  --teal-dark: #0b534e;
  --teal-soft: #d9f3ef;
  --amber: #b7791f;
  --amber-soft: #fff2d6;
  --red: #b42318;
  --red-soft: #ffe4e0;
  --green: #227648;
  --green-soft: #e1f6ea;
  --shadow: 0 18px 50px rgba(23, 33, 31, 0.08);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  color: var(--ink);
  background: var(--bg);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
}

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

button {
  border: 0;
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, var(--teal), #243f3b);
  font-weight: 800;
  letter-spacing: 0;
}

.brand-title {
  margin: 0;
  font-size: 18px;
  line-height: 1.1;
}

.brand-subtitle {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.tabs {
  display: inline-flex;
  padding: 4px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.tab {
  min-height: 34px;
  padding: 0 14px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.tab.active {
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(23, 33, 31, 0.08);
}

.locked-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.main {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 24px;
}

.screen {
  display: none;
}

.screen.active {
  display: block;
}

.split {
  display: grid;
  grid-template-columns: minmax(340px, 0.9fr) minmax(520px, 1.4fr);
  gap: 20px;
  align-items: start;
}

.customer-layout {
  width: min(860px, 100%);
  margin: 0 auto;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel-header {
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--line);
}

.panel-title {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
}

.panel-copy {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.form-body,
.dashboard-body {
  padding: 18px;
}

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

.field {
  display: grid;
  gap: 7px;
}

.field.full {
  grid-column: 1 / -1;
}

label,
.label {
  color: #394743;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  padding: 10px 11px;
  outline: none;
}

textarea {
  resize: vertical;
  min-height: 84px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.13);
}

.section-title {
  margin: 22px 0 12px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--teal-dark);
}

.section-title.first {
  margin-top: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.retailer-choice {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 0;
  margin: 0 0 20px;
  border: 0;
}

.retailer-option {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
}

.retailer-option input {
  position: absolute;
  inset: 0;
  width: 100%;
  min-height: 100%;
  opacity: 0;
  cursor: pointer;
}

.retailer-option:has(input:checked) {
  border-color: var(--teal);
  background: var(--teal-soft);
  color: var(--teal-dark);
}

.terms-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px;
  background: #fbfdfc;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.check-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 12px;
  color: #3d4c48;
  font-size: 13px;
  line-height: 1.45;
}

.check-row input {
  width: 18px;
  min-height: 18px;
  margin-top: 1px;
}

.account-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
  margin-top: 12px;
}

.account-card.hidden {
  display: none;
}

.account-card h4 {
  margin: 0 0 12px;
  font-size: 15px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.btn {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 7px;
  padding: 0 14px;
  color: var(--ink);
  background: var(--panel-soft);
  font-size: 14px;
  font-weight: 800;
}

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

.btn.danger {
  color: var(--red);
  background: var(--red-soft);
}

.btn.ghost {
  background: transparent;
  border: 1px solid var(--line);
}

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

.notice {
  display: none;
  margin-top: 14px;
  border-radius: 8px;
  padding: 12px;
  font-size: 14px;
  line-height: 1.45;
}

.notice.show {
  display: block;
}

.notice.success {
  color: var(--green);
  background: var(--green-soft);
}

.notice.error {
  color: var(--red);
  background: var(--red-soft);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 18px;
}

.sidebar {
  border-right: 1px solid var(--line);
  padding-right: 18px;
}

.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.search {
  min-height: 38px;
}

.user-list {
  display: grid;
  gap: 8px;
  max-height: 660px;
  overflow: auto;
  padding-right: 4px;
}

.user-row {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px;
  background: #fff;
  text-align: left;
}

.user-row.active {
  border-color: var(--teal);
  background: var(--teal-soft);
}

.user-name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 800;
}

.user-meta {
  display: block;
  color: var(--muted);
  margin-top: 2px;
  font-size: 12px;
}

.count-pill,
.status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.count-pill {
  color: var(--teal-dark);
  background: var(--teal-soft);
}

.status-chip.pending {
  color: var(--amber);
  background: var(--amber-soft);
}

.status-chip.done {
  color: var(--green);
  background: var(--green-soft);
}

.selected-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.selected-head h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.15;
}

.selected-head p {
  margin: 5px 0 0;
  color: var(--muted);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.retailer-tabs {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-bottom: 14px;
}

.retailer-tab {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  text-align: left;
  padding: 0 12px;
}

.retailer-tab.active {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
}

.filter {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.filter.active {
  color: #fff;
  background: var(--teal);
  border-color: var(--teal);
}

.submission {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  margin-bottom: 12px;
}

.submission-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
  background: #fbfdfc;
  border-bottom: 1px solid var(--line);
}

.submission-title {
  margin: 0;
  font-size: 15px;
}

.timestamp {
  color: var(--muted);
  font-size: 12px;
}

.account-review {
  border-top: 1px solid var(--line);
}

.account-review:first-child {
  border-top: 0;
}

.account-review summary {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 13px 14px;
  cursor: pointer;
}

.summary-name {
  font-weight: 900;
}

.summary-meta {
  color: var(--muted);
  font-size: 12px;
}

.account-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 0 14px 14px;
}

.detail {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px;
  background: #fbfdfc;
  min-width: 0;
}

.detail span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.detail strong {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
  font-size: 13px;
}

.empty {
  padding: 42px 18px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  text-align: center;
  color: var(--muted);
}

.file-input {
  display: none;
}

.login-wrap {
  min-height: calc(100vh - 120px);
  display: grid;
  place-items: center;
}

.login-card {
  width: min(430px, 100%);
}

.login-button {
  width: 100%;
  margin-top: 18px;
}

.security-note {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

@media (max-width: 980px) {
  .topbar,
  .selected-head {
    align-items: stretch;
    flex-direction: column;
  }

  .split,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding-right: 0;
    padding-bottom: 16px;
  }
}

@media (max-width: 640px) {
  .main {
    padding: 14px;
  }

  .form-grid,
  .retailer-choice,
  .account-details,
  .account-review summary {
    grid-template-columns: 1fr;
  }

  .tabs {
    width: 100%;
  }

  .tab {
    flex: 1;
  }
}
