:root {
  --bg: #f6f4ef;
  --paper: #fffdf7;
  --ink: #17201d;
  --muted: #67726d;
  --line: #ddd7ca;
  --brand: #0f766e;
  --brand-strong: #0b4f4a;
  --accent: #b8872d;
  --danger: #af2f2f;
  --success: #2f7b4f;
  --info: #315f93;
  --shadow: 0 18px 50px rgba(23, 32, 29, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(15, 118, 110, 0.14), transparent 34rem),
    linear-gradient(135deg, #f8f6f0 0%, #eef2ee 100%);
  color: var(--ink);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

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

button,
a,
select {
  min-height: 44px;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 28px;
  height: 100vh;
  padding: 28px;
  border-right: 1px solid var(--line);
  background: rgba(255, 253, 247, 0.86);
  backdrop-filter: blur(18px);
}

.brand {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 12px;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 10px;
  background: var(--brand);
  color: white;
  font-weight: 800;
  letter-spacing: 0;
}

.brand strong {
  display: block;
  font-size: 18px;
}

.brand small {
  color: var(--muted);
}

.nav-links {
  display: grid;
  gap: 8px;
}

.nav-links a {
  display: flex;
  align-items: center;
  padding: 0 14px;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 700;
}

.nav-links a.active,
.nav-links a:hover {
  background: #e7f2ef;
  color: var(--brand-strong);
}

.trust-panel {
  margin-top: auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8f2e5;
}

.trust-icon {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  font-weight: 900;
}

.trust-panel p {
  margin: 14px 0 0;
  color: #5d5648;
  line-height: 1.45;
}

.main-content {
  padding: 28px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  max-width: 1280px;
  margin: 0 auto 26px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--brand);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

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

h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1.1;
}

h2 {
  margin: 0;
  font-size: 26px;
  line-height: 1.15;
}

h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
}

.language-switcher {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

select,
input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  outline: none;
}

select,
input {
  height: 46px;
  padding: 0 12px;
}

textarea {
  min-height: 96px;
  padding: 12px;
  resize: vertical;
}

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

.view {
  max-width: 1280px;
  margin: 0 auto;
}

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

.grid.two {
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
}

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

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.92);
  box-shadow: var(--shadow);
}

.panel-header,
.panel-body {
  padding: 18px;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
}

.panel-header p,
.panel-body p {
  color: var(--muted);
}

.panel-header p {
  margin: 8px 0 0;
}

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

.product-card {
  display: grid;
  gap: 14px;
  min-height: 168px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease;
}

.product-card:hover,
.product-card.active {
  transform: translateY(-2px);
  border-color: var(--product-accent, var(--brand));
  box-shadow: 0 12px 28px rgba(23, 32, 29, 0.13);
}

.product-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--product-accent, var(--brand)) 16%, white);
  color: var(--product-accent, var(--brand));
  font-weight: 900;
}

.product-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.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;
}

.field label,
.field legend {
  color: #303934;
  font-weight: 800;
}

.field small {
  color: var(--muted);
}

.required {
  color: var(--danger);
}

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

fieldset.field {
  min-inline-size: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.choice-row label,
.checkbox-field {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  cursor: pointer;
}

.choice-row input,
.checkbox-field input {
  width: 18px;
  height: 18px;
}

.checkbox-field {
  align-items: flex-start;
  line-height: 1.45;
}

.checkbox-field span {
  flex: 1;
  text-align: left;
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 120px;
  min-height: 46px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--brand);
  color: white;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
}

.button:hover {
  background: var(--brand-strong);
}

.button.secondary {
  border-color: var(--line);
  background: white;
  color: var(--ink);
}

.button.secondary:hover {
  border-color: var(--brand);
  background: #e7f2ef;
}

.button.warning {
  background: var(--accent);
}

.button.danger {
  background: var(--danger);
}

.message {
  padding: 12px 14px;
  border-radius: 8px;
  background: #e7f2ef;
  color: var(--brand-strong);
  font-weight: 800;
}

.message.error {
  background: #f8e4e0;
  color: #8a2a1f;
}

.summary-list {
  display: grid;
  gap: 12px;
}

.summary-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--line);
}

.summary-item span {
  color: var(--muted);
}

.summary-item strong {
  text-align: right;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: #e7f2ef;
  color: var(--brand-strong);
  font-size: 13px;
  font-weight: 900;
}

.status-pill.pending {
  background: #fff2c8;
  color: #835e00;
}

.status-pill.rejected {
  background: #f8e4e0;
  color: #8a2a1f;
}

.status-pill.approved {
  background: #dff2e6;
  color: #2d6844;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 16px;
}

.toolbar .field {
  min-width: 220px;
}

.application-table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 8px;
}

.application-table th,
.application-table td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.application-table th {
  background: #f3efe5;
  color: #565144;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.application-table tr:hover td {
  background: #fbf8ef;
}

.detail-stack {
  display: grid;
  gap: 12px;
}

.comment {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.comment p {
  margin: 0 0 8px;
  color: var(--ink);
}

.comment small {
  color: var(--muted);
}

.timeline {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline li {
  display: grid;
  grid-template-columns: 16px 1fr;
  gap: 10px;
}

.timeline li::before {
  content: "";
  width: 12px;
  height: 12px;
  margin-top: 5px;
  border-radius: 999px;
  background: var(--brand);
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 320px;
  padding: 32px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.7);
  text-align: center;
}

.empty-visual {
  width: 92px;
  height: 92px;
  border: 12px solid #e6ddc9;
  border-top-color: var(--brand);
  border-radius: 50%;
}

.quick-help {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 18px;
  border-radius: 8px;
  background: linear-gradient(135deg, #0f766e 0%, #1f7a8c 100%);
  color: white;
}

.quick-help p {
  margin: 0;
  color: rgba(255, 255, 255, 0.88);
}

.quick-help strong {
  font-size: 20px;
}

@media (max-width: 1080px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 18px;
  }

  .nav-links {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .trust-panel {
    display: none;
  }

  .grid.two,
  .grid.three,
  .product-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .main-content {
    padding: 16px;
  }

  .topbar,
  .panel-header,
  .toolbar {
    display: grid;
  }

  h1 {
    font-size: 28px;
  }

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

  .application-table {
    display: block;
    overflow-x: auto;
  }
}
