:root {
  --brand: #7f4f5f;
  --accent: #f7b6c8;
  --ink: #2f2630;
  --muted: #806f78;
  --line: #eadde2;
  --paper: #fffafa;
  --panel: rgba(255, 255, 255, 0.86);
  --shadow: 0 24px 70px rgba(83, 52, 67, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #fff7f8;
}

a {
  color: inherit;
  text-decoration: none;
}

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

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

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(247, 182, 200, 0.22);
}

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

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

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

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

th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.soft-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 12% 8%, rgba(247, 182, 200, 0.55), transparent 28%),
    radial-gradient(circle at 84% 4%, rgba(232, 207, 217, 0.68), transparent 24%),
    linear-gradient(135deg, #fff8f9 0%, #fff1f4 55%, #f9edf1 100%);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--brand);
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

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

.alert,
.success {
  margin: 0 0 16px;
  border-radius: 8px;
  padding: 12px 14px;
  font-weight: 700;
}

.alert {
  background: #fff0f0;
  border: 1px solid #ffcaca;
  color: #9c2e36;
}

.success {
  background: #f1fff7;
  border: 1px solid #bfeccc;
  color: #277645;
}

.primary-btn,
.ghost-btn {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 850;
  min-height: 44px;
  padding: 11px 16px;
}

.primary-btn {
  background: linear-gradient(135deg, var(--brand), #b46b80);
  color: #fff;
  box-shadow: 0 14px 30px rgba(127, 79, 95, 0.22);
}

.primary-btn:disabled,
.ghost-btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.ghost-btn {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--brand);
}

.login-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(247, 182, 200, 0.52), transparent 30%),
    linear-gradient(135deg, #fff8f9, #fbe9ef);
}

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

.login-card {
  width: min(440px, 100%);
  border: 1px solid rgba(255, 255, 255, 0.84);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
  padding: 34px;
}

.login-card h1,
.app-top h1,
.section-head h2,
.admin-top h1 {
  margin: 0;
}

.form-stack {
  display: grid;
  gap: 16px;
}

.app-top,
.admin-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1220px;
  margin: 0 auto;
  padding: 24px;
}

.app-top nav,
.admin-top nav {
  display: flex;
  gap: 10px;
}

.app-top nav a,
.admin-top nav a {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  padding: 10px 12px;
  color: var(--brand);
  font-weight: 800;
}

.app-shell {
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 18px;
  max-width: 1220px;
  margin: 0 auto;
  padding: 0 24px 44px;
}

.sidebar,
.panel,
.quote-card {
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.sidebar {
  align-self: start;
  display: grid;
  gap: 8px;
  padding: 12px;
  position: sticky;
  top: 16px;
}

.tab-btn {
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 850;
  padding: 13px 14px;
  text-align: left;
}

.tab-btn.active {
  background: #fff;
  color: var(--brand);
  box-shadow: 0 10px 28px rgba(127, 79, 95, 0.12);
}

.workspace {
  min-width: 0;
}

.tab-panel {
  display: none;
}

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

.section-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin: 0 0 16px;
}

.section-head select {
  max-width: 220px;
}

.calc-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(340px, 1.05fr);
  gap: 18px;
}

.panel {
  padding: 20px;
}

.panel h3 {
  margin-top: 0;
}

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

.wide {
  grid-column: 1 / -1;
}

.field-title {
  margin: 0 0 9px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.checks,
.link-grid {
  display: grid;
  gap: 10px;
}

.check-card,
.material-link {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  grid-template-columns: auto 1fr auto;
  padding: 12px;
}

.check-card input,
.material-link input[type="checkbox"] {
  width: auto;
}

.material-link {
  grid-template-columns: auto 1fr 110px auto;
}

.result-panel {
  display: grid;
  gap: 16px;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  padding: 18px;
}

.result-price {
  color: var(--brand);
  font-size: clamp(2.4rem, 8vw, 4.5rem);
  font-weight: 900;
  line-height: 1;
}

.metric-row {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
}

.quote-card {
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.94), rgba(255, 247, 249, 0.96)),
    linear-gradient(135deg, var(--accent), #fff);
  padding: 22px;
  text-align: center;
}

.quote-logo {
  display: grid;
  width: 58px;
  height: 58px;
  margin: 0 auto 10px;
  place-items: center;
  border-radius: 999px;
  background: var(--accent);
  color: var(--brand);
  font-size: 1.6rem;
  font-weight: 900;
}

.quote-card p,
.quote-card h3 {
  margin: 0 0 10px;
}

.quote-total {
  color: var(--brand);
  font-size: 2.4rem;
  font-weight: 950;
  margin: 8px 0 16px;
}

.quote-card ul {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
}

.quote-card li {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding: 9px 0;
  text-align: left;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.admin-page {
  background: #f6f7fb;
}

.admin-grid {
  display: grid;
  gap: 18px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px 44px;
}

.table-wrap {
  overflow-x: auto;
}

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

  .sidebar {
    display: flex;
    overflow-x: auto;
    position: static;
  }

  .tab-btn {
    white-space: nowrap;
  }

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

@media (max-width: 560px) {
  .app-top,
  .admin-top,
  .section-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .app-shell,
  .app-top,
  .admin-top,
  .admin-grid {
    padding-left: 14px;
    padding-right: 14px;
  }

  .material-link {
    grid-template-columns: auto 1fr;
  }
}
