:root {
  color-scheme: light;
  --ink: #17201f;
  --muted: #53615f;
  --paper: #f7f4ee;
  --white: #ffffff;
  --line: #d8ded7;
  --teal: #0f4c4c;
  --teal-dark: #0b2e30;
  --green: #6ea85f;
  --amber: #f0b44c;
  --blue: #467aa3;
  --danger: #a9382f;
  --shadow: 0 22px 70px rgba(18, 30, 28, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--paper);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(110, 168, 95, 0.08), transparent 300px),
    var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

.trap-field {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

a {
  color: inherit;
}

.button-link {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 9px 15px;
  border: 1px solid var(--teal);
  border-radius: 8px;
  color: var(--teal);
  font-weight: 750;
  text-decoration: none;
}

.catalog-grid {
  display: grid;
  grid-template-columns: minmax(260px, .7fr) minmax(360px, 1.3fr);
  gap: 24px;
  align-items: start;
}

.catalog-grid h3 {
  margin: 0 0 12px;
}

.catalog-editor {
  display: grid;
  gap: 10px;
  margin: 0 0 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
}

.catalog-editor.catalog-new {
  border-color: color-mix(in srgb, var(--teal) 45%, var(--line));
  background: color-mix(in srgb, var(--green) 8%, var(--white));
}

.catalog-editor textarea {
  resize: vertical;
}

@media (max-width: 820px) {
  .catalog-grid {
    grid-template-columns: 1fr;
  }
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 22px clamp(18px, 4vw, 54px);
  color: var(--white);
  background:
    radial-gradient(circle at 14% 0, rgba(110, 168, 95, 0.25), transparent 32%),
    linear-gradient(135deg, var(--teal), var(--teal-dark));
  box-shadow: 0 12px 34px rgba(11, 46, 48, 0.16);
}

.topbar > div {
  position: relative;
  padding-left: 58px;
}

.topbar > div::before {
  position: absolute;
  top: 1px;
  left: 0;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
  content: "RC";
  font-size: 0.82rem;
  font-weight: 800;
}

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

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  color: var(--white);
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  line-height: 1;
}

h2 {
  margin-bottom: 18px;
  color: var(--teal-dark);
  font-size: clamp(1.35rem, 2vw, 1.8rem);
  line-height: 1.1;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

nav a,
button,
.primary {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--white);
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.topbar nav a {
  border-color: rgba(255, 255, 255, 0.26);
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.08);
}

.topbar nav a:hover {
  border-color: rgba(255, 255, 255, 0.55);
  color: var(--white);
  background: rgba(255, 255, 255, 0.14);
}

a:hover,
button:hover,
.primary:hover {
  transform: translateY(-1px);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(240, 180, 76, 0.42);
  outline-offset: 2px;
}

.primary {
  width: 100%;
  border-color: var(--teal);
  color: var(--white);
  background: var(--teal);
  box-shadow: 0 8px 18px rgba(15, 76, 76, 0.16);
}

.primary:hover {
  background: var(--teal-dark);
}

.layout {
  display: grid;
  grid-template-columns: minmax(340px, 430px) minmax(0, 1fr);
  gap: 18px;
  width: min(1600px, calc(100% - 36px));
  margin: 0 auto;
  padding: 26px 0 48px;
}

.panel,
.login-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 12px 34px rgba(22, 34, 31, 0.07);
}

.panel {
  align-self: start;
  padding: clamp(20px, 2.4vw, 30px);
}

.login-page {
  display: grid;
  min-height: 100svh;
  place-items: center;
  padding: 24px;
  color: var(--white);
  background:
    radial-gradient(circle at 18% 8%, rgba(110, 168, 95, 0.28), transparent 34%),
    linear-gradient(135deg, var(--teal), var(--teal-dark));
}

.login-card {
  position: relative;
  width: min(460px, 100%);
  padding: clamp(26px, 5vw, 42px);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.login-card::before {
  display: grid;
  width: 48px;
  height: 48px;
  margin-bottom: 26px;
  place-items: center;
  border-radius: 8px;
  color: var(--white);
  background: var(--teal);
  content: "RC";
  font-size: 0.86rem;
  font-weight: 900;
}

.login-card h1 {
  max-width: 12ch;
  margin-bottom: 26px;
  color: var(--teal-dark);
  font-size: clamp(2rem, 7vw, 3.1rem);
  line-height: 0.98;
}

form {
  margin: 0;
}

.license-form,
.tenant-form,
.login-card form {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 800;
}

input,
textarea,
select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #bcc8c4;
  border-radius: 8px;
  color: var(--ink);
  background: #fbfcfa;
  font: inherit;
  font-weight: 600;
}

input:hover,
textarea:hover,
select:hover {
  border-color: #95aaa3;
}

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

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

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

.alert {
  margin-bottom: 14px;
  padding: 11px 13px;
  border: 1px solid #d6a29d;
  border-radius: 8px;
  color: #6f211b;
  background: #fff0ee;
  font-weight: 800;
}

.alert.ok {
  border-color: #a7c9a0;
  color: #245b28;
  background: #eef7eb;
}

.hint {
  max-width: 780px;
  margin: -4px 0 16px;
  color: var(--muted);
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover td {
  background: #f8faf7;
}

th {
  color: var(--teal-dark);
  background: #e8f0ea;
  font-size: 0.75rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

code {
  color: var(--teal);
  font-weight: 800;
}

.badge {
  display: inline-flex;
  padding: 5px 9px;
  border-radius: 999px;
  color: #735515;
  background: #fff1cf;
  font-size: 0.82rem;
  font-weight: 900;
}

.badge.ok {
  color: #245b28;
  background: #e6f4e3;
}

.badge.bad {
  color: #7b2822;
  background: #f9e1de;
}

.badge.draft {
  color: #735515;
  background: #fff1cf;
}

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

.empty-state {
  padding: 34px 18px;
  color: var(--muted);
  text-align: center;
}

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

.compact-form {
  display: grid;
  gap: 14px;
  max-width: 760px;
}

.detail-layout {
  display: grid;
  gap: 18px;
  width: min(1120px, calc(100% - 36px));
  margin: 0 auto;
  padding: 26px 0 48px;
}

.status-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.module-grid {
  display: grid;
  gap: 10px;
}

.module-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  cursor: pointer;
}

.module-card input {
  width: 20px;
  min-height: 20px;
  accent-color: var(--teal);
}

.module-card small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-weight: 600;
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

legend {
  padding: 0 6px;
  color: var(--teal-dark);
  font-weight: 900;
}

.price {
  color: var(--teal);
  font-size: 0.9rem;
  font-weight: 900;
  white-space: nowrap;
}

.price-input {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--teal);
  font-weight: 900;
  white-space: nowrap;
}

.price-input input {
  width: 96px;
}

.check-line {
  grid-template-columns: auto 1fr;
  align-items: start;
}

.check-line input {
  width: 20px;
  min-height: 20px;
  margin-top: 2px;
}

.order-page {
  max-width: 980px;
}

.hero-panel {
  color: var(--white);
  background: linear-gradient(135deg, var(--teal), var(--teal-dark));
}

.hero-panel h2,
.hero-panel .eyebrow {
  color: var(--white);
}

.purchase-form {
  margin-top: 22px;
}

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

.actions form {
  display: inline;
}

.actions > a,
.actions button,
.actions .mini {
  min-height: 34px;
  padding: 6px 9px;
  font-size: 0.76rem;
}

.actions > a {
  border-color: #b9c9d5;
  color: #234964;
  background: #eef5fa;
}

.actions .green {
  border-color: #a7c9a0;
  color: #245b28;
  background: #e6f4e3;
}

.actions .blue {
  border-color: #b9c9d5;
  color: #234964;
  background: #e8f1f8;
}

.actions .red {
  border-color: #d6a29d;
  color: #7b2822;
  background: #f9e1de;
}

@media (max-width: 1000px) {
  .layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 20px 18px;
  }

  .topbar > div {
    min-height: 44px;
  }

  nav {
    width: 100%;
  }

  nav a {
    flex: 1 1 auto;
  }

  .layout {
    width: min(100% - 24px, 1600px);
    padding-top: 14px;
  }

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

  .panel {
    padding: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
