:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #eef7f4;
  --ink: #202838;
  --muted: #697386;
  --line: #dbe1ea;
  --teal: #217a76;
  --teal-dark: #175d5a;
  --coral: #d75f56;
  --coral-dark: #b8463e;
  --blue: #315c96;
  --gold: #a66f12;
  --violet: #6c4aa5;
  --shadow: 0 18px 40px rgba(28, 39, 64, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  letter-spacing: 0;
}

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

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  padding: 12px clamp(16px, 4vw, 40px);
  background: rgba(246, 247, 251, 0.92);
  border-bottom: 1px solid rgba(219, 225, 234, 0.85);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--ink);
  font-weight: 800;
}

.brand span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 8px;
  background: var(--teal);
  color: #fff;
  font-weight: 900;
}

.top-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.top-nav a,
.top-nav button {
  min-height: 38px;
  padding: 8px 11px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
}

.top-nav a:hover,
.top-nav button:hover,
.top-nav a:focus-visible,
.top-nav button:focus-visible {
  border-color: var(--line);
  color: var(--ink);
  outline: none;
}

.top-nav form {
  margin: 0;
}

.app-shell {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: clamp(20px, 4vw, 48px) clamp(16px, 4vw, 40px) 56px;
}

.page-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 18px;
  align-items: start;
}

.panel,
.side-panel,
.filters,
.log-entry,
.overview-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel,
.side-panel {
  padding: clamp(18px, 4vw, 28px);
}

.section-title {
  margin-bottom: 20px;
}

.section-title.compact {
  margin-bottom: 14px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--teal-dark);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 6vw, 3.25rem);
  line-height: 1.02;
}

h2 {
  margin-bottom: 0;
  font-size: 1.25rem;
  line-height: 1.2;
}

.field-group {
  margin: 0 0 22px;
  padding: 0;
  border: 0;
}

.field-group legend,
.text-field span,
.filters span {
  display: block;
  margin-bottom: 9px;
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 750;
}

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

.segment-option,
.body-chip {
  position: relative;
  display: block;
}

.segment-option input,
.body-chip input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.segment-option span,
.body-chip span {
  display: grid;
  min-height: 48px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 750;
  transition:
    border-color 140ms ease,
    background 140ms ease,
    color 140ms ease,
    box-shadow 140ms ease;
}

.segment-option.good input:checked + span {
  border-color: rgba(33, 122, 118, 0.55);
  background: var(--surface-2);
  color: var(--teal-dark);
  box-shadow: inset 0 0 0 1px rgba(33, 122, 118, 0.18);
}

.segment-option.bad input:checked + span {
  border-color: rgba(215, 95, 86, 0.5);
  background: #fff1ef;
  color: var(--coral-dark);
  box-shadow: inset 0 0 0 1px rgba(215, 95, 86, 0.16);
}

.segment-option.na input:checked + span {
  border-color: rgba(105, 115, 134, 0.5);
  background: #f1f4f8;
  color: #4f5b6d;
  box-shadow: inset 0 0 0 1px rgba(105, 115, 134, 0.16);
}

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

.body-picker {
  position: relative;
  min-height: 560px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.74), rgba(255, 255, 255, 0.74)),
    repeating-linear-gradient(
      90deg,
      rgba(49, 92, 150, 0.06) 0,
      rgba(49, 92, 150, 0.06) 1px,
      transparent 1px,
      transparent 34px
    ),
    repeating-linear-gradient(
      0deg,
      rgba(33, 122, 118, 0.055) 0,
      rgba(33, 122, 118, 0.055) 1px,
      transparent 1px,
      transparent 34px
    );
}

.body-figure {
  position: absolute;
  top: 106px;
  left: 50%;
  width: 142px;
  height: 410px;
  transform: translateX(-50%);
  pointer-events: none;
}

.body-figure span {
  position: absolute;
  display: block;
  background: rgba(32, 40, 56, 0.08);
  border: 1px solid rgba(32, 40, 56, 0.1);
}

.figure-head {
  top: 0;
  left: 50%;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  transform: translateX(-50%);
}

.figure-neck {
  top: 58px;
  left: 50%;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  transform: translateX(-50%);
}

.figure-torso {
  top: 76px;
  left: 50%;
  width: 92px;
  height: 154px;
  border-radius: 42px 42px 34px 34px;
  transform: translateX(-50%);
}

.figure-arm {
  top: 88px;
  width: 32px;
  height: 178px;
  border-radius: 999px;
}

.figure-arm-left {
  left: 0;
  transform: rotate(10deg);
}

.figure-arm-right {
  right: 0;
  transform: rotate(-10deg);
}

.figure-leg {
  top: 224px;
  width: 38px;
  height: 178px;
  border-radius: 999px;
}

.figure-leg-left {
  left: 35px;
}

.figure-leg-right {
  right: 35px;
}

.body-zones {
  position: absolute;
  inset: 0;
}

.body-chip span {
  min-height: 44px;
  padding: 8px;
  color: var(--muted);
}

.body-chip input:checked + span {
  border-color: rgba(49, 92, 150, 0.5);
  background: #edf3fb;
  color: var(--blue);
  box-shadow: inset 0 0 0 1px rgba(49, 92, 150, 0.12);
}

.body-picker .body-chip {
  position: absolute;
  z-index: 1;
  width: clamp(92px, 22vw, 118px);
}

.body-picker .body-chip span {
  min-height: 40px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 18px rgba(28, 39, 64, 0.08);
}

.body-picker .body-chip input:focus-visible + span {
  border-color: rgba(33, 122, 118, 0.75);
  box-shadow:
    0 0 0 4px rgba(33, 122, 118, 0.13),
    0 8px 18px rgba(28, 39, 64, 0.08);
}

.zone-kozmik {
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
}

.zone-mental {
  top: 66px;
  left: 50%;
  transform: translateX(-50%);
}

.zone-bas {
  top: 118px;
  left: 50%;
  transform: translateX(-50%);
}

.zone-omuz {
  top: 158px;
  left: 8%;
}

.zone-gogus {
  top: 178px;
  right: 8%;
}

.zone-sirt {
  top: 224px;
  left: 6%;
}

.zone-karin {
  top: 246px;
  right: 6%;
}

.zone-kol {
  top: 294px;
  left: 8%;
}

.zone-kalca {
  top: 316px;
  right: 8%;
}

.zone-dirsek {
  top: 346px;
  left: 13%;
}

.zone-bacak {
  top: 370px;
  right: 10%;
}

.zone-el {
  top: 402px;
  left: 7%;
}

.zone-diz {
  top: 426px;
  right: 15%;
}

.zone-genel {
  bottom: 22px;
  left: 8%;
}

.zone-ayak {
  right: 8%;
  bottom: 22px;
}

.zone-mental input:checked + span {
  border-color: rgba(108, 74, 165, 0.5);
  background: #f4f0ff;
  color: var(--violet);
}

.zone-kozmik input:checked + span {
  border-color: rgba(166, 111, 18, 0.5);
  background: #fff6df;
  color: var(--gold);
}

.text-field {
  display: block;
  margin-bottom: 22px;
}

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

.text-field input,
.filters select {
  min-height: 48px;
  padding: 0 13px;
}

.text-field textarea {
  min-height: 112px;
  padding: 12px 13px;
  resize: vertical;
}

.text-field input:focus,
.text-field textarea:focus,
.filters select:focus {
  border-color: rgba(33, 122, 118, 0.75);
  box-shadow: 0 0 0 4px rgba(33, 122, 118, 0.13);
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border-radius: 8px;
  font-weight: 800;
  cursor: pointer;
}

.primary-button {
  width: 100%;
  border: 0;
  background: var(--teal);
  color: #fff;
}

.primary-button:hover,
.primary-button:focus-visible {
  background: var(--teal-dark);
  outline: none;
}

.primary-button:disabled {
  cursor: progress;
  opacity: 0.7;
}

.secondary-button {
  padding: 0 15px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.stat-block {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
}

.stat-block span,
.overview-item span {
  display: block;
  font-size: 1.45rem;
  font-weight: 850;
  line-height: 1;
}

.stat-block small,
.overview-item small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-weight: 650;
}

.entry-list {
  display: grid;
  gap: 10px;
}

.log-entry {
  padding: 14px;
  box-shadow: none;
}

.log-entry.good {
  border-left: 4px solid var(--teal);
}

.log-entry.bad {
  border-left: 4px solid var(--coral);
}

.log-entry.na {
  border-left: 4px solid var(--muted);
}

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

.entry-topline strong {
  font-size: 1rem;
}

.entry-topline time {
  color: var(--muted);
  font-size: 0.88rem;
  text-align: right;
}

.part-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.part-list span {
  padding: 5px 8px;
  border-radius: 8px;
  background: #edf3fb;
  color: var(--blue);
  font-size: 0.84rem;
  font-weight: 750;
}

.entry-note {
  margin: 10px 0 0;
  color: var(--ink);
  line-height: 1.5;
}

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

.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 20;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-weight: 800;
  box-shadow: var(--shadow);
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
  gap: 18px;
  align-items: center;
  min-height: calc(100vh - 180px);
}

.login-copy {
  padding: clamp(8px, 4vw, 32px) 0;
}

.login-copy h1 {
  max-width: 560px;
  margin-bottom: 14px;
}

.login-copy p:last-child {
  max-width: 440px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.6;
}

.login-panel {
  align-self: center;
}

.form-error {
  margin: -6px 0 16px;
  padding: 10px 12px;
  border: 1px solid rgba(215, 95, 86, 0.35);
  border-radius: 8px;
  background: #fff1ef;
  color: var(--coral-dark);
  font-weight: 700;
}

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

.overview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.overview-item {
  padding: 16px;
  box-shadow: none;
}

.filters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 240px));
  gap: 12px;
  margin-bottom: 14px;
  padding: 14px;
  box-shadow: none;
}

.filters label {
  min-width: 0;
}

.admin-list .log-entry {
  padding: 16px;
}

.error-panel {
  max-width: 560px;
  margin: 12vh auto 0;
}

@media (max-width: 860px) {
  .page-grid,
  .login-shell {
    grid-template-columns: 1fr;
  }

  .side-panel {
    order: 2;
  }

  .login-shell {
    align-items: start;
    min-height: 0;
  }
}

@media (max-width: 640px) {
  .topbar {
    min-height: 58px;
    padding: 10px 14px;
  }

  .brand {
    gap: 8px;
  }

  .brand-mark {
    width: 32px;
    height: 32px;
  }

  .top-nav {
    gap: 4px;
  }

  .top-nav a,
  .top-nav button {
    min-height: 34px;
    padding: 7px 8px;
    font-size: 0.92rem;
  }

  .app-shell {
    padding: 18px 12px 44px;
  }

  .panel,
  .side-panel {
    padding: 16px;
  }

  h1 {
    font-size: 2.05rem;
  }

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

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

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

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

  .secondary-button {
    width: 100%;
  }

  .entry-topline {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .entry-topline time {
    text-align: left;
  }
}
