* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #f3f5f1;
  --surface: #ffffff;
  --surface-2: #f7f8f5;
  --surface-3: #eef1ec;
  --ink: #111512;
  --ink-2: #2c322d;
  --muted: #6f786f;
  --muted-2: #949c95;
  --line: #e2e6e0;
  --line-strong: #d4d9d3;
  --sidebar: #111512;
  --sidebar-2: #191e1a;
  --accent: #b6f266;
  --accent-strong: #8fd13e;
  --accent-soft: #edf8de;
  --danger: #d15a5a;
  --danger-soft: #fff0f0;
  --shadow: 0 18px 50px rgba(21, 29, 22, 0.07);
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: "Manrope", sans-serif;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

body.modal-open {
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button {
  color: inherit;
}

svg {
  display: block;
}

.app-shell {
  min-height: 100vh;
}

.sidebar {
  width: 260px;
  min-height: 100vh;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 50;
  padding: 26px 18px 20px;
  background:
    radial-gradient(
      circle at 20% 0%,
      rgba(182, 242, 102, 0.09),
      transparent 28%
    ),
    var(--sidebar);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255, 255, 255, 0.04);
}

.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #ffffff;
  text-decoration: none;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  padding-bottom: 8px;
  background: var(--accent);
  box-shadow: 0 8px 20px rgba(182, 242, 102, 0.15);
}

.brand-mark i {
  width: 4px;
  border-radius: 3px;
  background: var(--sidebar);
}

.brand-mark i:nth-child(1) {
  height: 9px;
}

.brand-mark i:nth-child(2) {
  height: 17px;
}

.brand-mark i:nth-child(3) {
  height: 12px;
}

.brand-copy {
  display: flex;
  flex-direction: column;
}

.brand-copy strong {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.09em;
}

.brand-copy small {
  margin-top: 2px;
  color: #818982;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.03em;
}

.sidebar-close {
  display: none;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: #a8aea9;
  place-items: center;
}

.sidebar-close svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.sidebar-nav {
  margin-top: 44px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.nav-caption {
  margin: 0 11px 10px;
  color: #69716b;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.nav-link {
  min-height: 46px;
  padding: 0 12px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #9aa19b;
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  transition: 0.18s ease;
}

.nav-link:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.045);
}

.nav-link.active {
  color: #ffffff;
  background: var(--sidebar-2);
}

.nav-link.active::after {
  content: "";
  width: 6px;
  height: 6px;
  margin-left: auto;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(182, 242, 102, 0.07);
}

.nav-link svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.55;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-footer {
  margin-top: auto;
  padding: 18px 10px 2px;
  border-top: 1px solid #262c27;
}

.sync-status {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sync-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(182, 242, 102, 0.07);
}

.sync-status div {
  display: flex;
  flex-direction: column;
}

.sync-status small {
  color: #747d75;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.13em;
}

.sync-status strong {
  margin-top: 4px;
  color: #c3c9c4;
  font-size: 10px;
  font-weight: 600;
}

.sidebar-footer > p {
  margin: 13px 0 0 18px;
  color: #747c75;
  font-size: 9px;
  line-height: 1.55;
}

.developer-credit {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid #262c27;
  display: flex;
  align-items: center;
  gap: 11px;
}

.developer-logo-wrap {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: #ffffff;
  overflow: hidden;
}

.developer-logo {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.developer-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.developer-info span {
  color: #7f8980;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.developer-info strong {
  margin-top: 4px;
  color: #e1e5e2;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.sidebar-backdrop {
  display: none;
}

.app-main {
  min-height: 100vh;
  margin-left: 260px;
}

.topbar {
  height: 84px;
  padding: 0 34px;
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(243, 245, 241, 0.9);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(212, 217, 211, 0.9);
}

.topbar-left,
.topbar-actions {
  display: flex;
  align-items: center;
}

.topbar-left {
  gap: 13px;
}

.menu-button {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #ffffff;
  place-items: center;
}

.menu-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.7;
  stroke-linecap: round;
}

.page-context {
  display: flex;
  flex-direction: column;
}

.page-context span {
  color: var(--muted-2);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.17em;
}

.page-context strong {
  margin-top: 4px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.topbar-actions {
  gap: 10px;
}

.today {
  padding-right: 5px;
  text-align: right;
}

.today span {
  display: block;
  color: var(--muted-2);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.today strong {
  display: block;
  margin-top: 4px;
  font-family: "DM Mono", monospace;
  font-size: 10px;
  font-weight: 500;
  color: var(--ink-2);
}

.ghost-action,
.primary-action,
.outline-action {
  min-height: 40px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 700;
  transition: 0.18s ease;
}

.ghost-action {
  padding: 0 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
}

.ghost-action:hover {
  background: #ffffff;
  color: var(--ink);
}

.primary-action {
  padding: 0 15px;
  border: 1px solid var(--sidebar);
  background: var(--sidebar);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.primary-action:hover {
  background: #252b26;
}

.primary-action span {
  color: var(--accent);
  font-size: 16px;
  font-weight: 400;
  line-height: 1;
}

.primary-action.full {
  width: 100%;
  min-height: 45px;
  margin-top: 24px;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: var(--sidebar);
  font-family: "DM Mono", monospace;
  font-size: 10px;
  font-weight: 700;
}

.dashboard {
  width: min(1500px, 100%);
  margin: 0 auto;
  padding: 32px 34px 58px;
}

.dashboard-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.eyebrow {
  display: block;
  margin-bottom: 9px;
  color: var(--accent-strong);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.dashboard-heading h1 {
  font-size: clamp(30px, 3vw, 40px);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.055em;
}

.dashboard-heading p {
  margin-top: 11px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.heading-status {
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.65);
}

.status-light {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted-2);
}

.status-light.success {
  background: var(--accent-strong);
  box-shadow: 0 0 0 4px rgba(143, 209, 62, 0.1);
}

.status-light.alert {
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(209, 90, 90, 0.08);
}

.heading-status strong {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.metrics-grid {
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.metric-card {
  min-width: 0;
  min-height: 145px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 1px 0 rgba(17, 21, 18, 0.02);
}

.metric-dark {
  background:
    linear-gradient(
      135deg,
      rgba(182, 242, 102, 0.06),
      transparent 38%
    ),
    var(--sidebar);
  border-color: var(--sidebar);
  color: #ffffff;
}

.metric-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.metric-card-top > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.metric-dark .metric-card-top > span {
  color: #929a94;
}

.metric-card-top small {
  font-family: "DM Mono", monospace;
  color: var(--accent);
  font-size: 9px;
  font-weight: 500;
}

.metric-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.metric-dot.neutral {
  background: #323933;
}

.metric-dot.accent {
  background: var(--accent-strong);
}

.metric-dot.soft {
  background: #b8beba;
}

.metric-number {
  margin-top: 22px;
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.metric-number strong {
  min-width: 0;
  font-family: "DM Mono", monospace;
  font-size: clamp(25px, 2.1vw, 32px);
  line-height: 1;
  font-weight: 500;
  letter-spacing: -0.06em;
  overflow-wrap: anywhere;
}

.metric-number span {
  color: var(--muted-2);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.metric-card p {
  margin-top: 11px;
  color: var(--muted-2);
  font-size: 9px;
  line-height: 1.45;
}

.main-grid {
  margin-top: 15px;
  display: grid;
  grid-template-columns:
    minmax(0, 1.7fr)
    minmax(290px, 0.7fr);
  gap: 15px;
}

.analytics-grid {
  margin-top: 15px;
  display: grid;
  grid-template-columns:
    minmax(0, 1.3fr)
    minmax(330px, 0.7fr);
  gap: 15px;
}

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  overflow: hidden;
}

.panel-header {
  min-height: 66px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.panel-header > div:first-child {
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel-index {
  font-family: "DM Mono", monospace;
  color: var(--accent-strong);
  font-size: 9px;
  font-weight: 500;
}

.panel-header h2 {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.panel-tag {
  padding: 6px 8px;
  border-radius: 5px;
  background: var(--surface-2);
  color: var(--muted-2);
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.13em;
}

.panel-tag.live {
  color: #557b35;
  background: var(--accent-soft);
}

.progress-panel-body {
  min-height: 310px;
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
}

.radial-zone {
  padding: 30px;
  display: grid;
  place-items: center;
  border-right: 1px solid var(--line);
  background:
    radial-gradient(
      circle at 50% 35%,
      rgba(182, 242, 102, 0.06),
      transparent 58%
    ),
    var(--surface);
}

.progress-ring {
  --progress: 0deg;
  width: 198px;
  height: 198px;
  border-radius: 50%;
  position: relative;
  display: grid;
  place-items: center;
  background:
    conic-gradient(
      var(--accent-strong) var(--progress),
      #e9ede7 0deg
    );
  box-shadow:
    inset 0 0 0 1px rgba(17, 21, 18, 0.02);
}

.progress-ring::after {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 12px 34px rgba(21, 29, 22, 0.07);
}

.progress-ring-inner {
  position: relative;
  z-index: 2;
  text-align: center;
}

.progress-ring-inner span {
  display: block;
  color: var(--muted-2);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.progress-ring-inner strong {
  display: block;
  margin-top: 8px;
  font-family: "DM Mono", monospace;
  font-size: 31px;
  font-weight: 500;
  letter-spacing: -0.06em;
}

.progress-ring-inner small {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-family: "DM Mono", monospace;
  font-size: 8px;
}

.goal-zone {
  padding: 30px 28px;
}

.goal-zone > label {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.goal-input-wrap {
  height: 56px;
  margin-top: 10px;
  padding: 0 15px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  display: flex;
  align-items: center;
  background: var(--surface-2);
  transition: 0.18s ease;
}

.goal-input-wrap:focus-within {
  border-color: #aab1aa;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(17, 21, 18, 0.03);
}

.goal-input-wrap input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-family: "DM Mono", monospace;
  font-size: 23px;
  font-weight: 500;
}

.goal-input-wrap input::placeholder {
  color: #b9c0ba;
}

.goal-input-wrap span {
  color: var(--muted-2);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.goal-zone > p {
  margin-top: 9px;
  color: var(--muted-2);
  font-size: 9px;
  line-height: 1.5;
}

.goal-kpis {
  margin-top: 25px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.goal-kpis div {
  min-width: 0;
}

.goal-kpis span {
  display: block;
  color: var(--muted-2);
  font-size: 8px;
  font-weight: 700;
}

.goal-kpis strong {
  display: block;
  margin-top: 7px;
  font-family: "DM Mono", monospace;
  font-size: 12px;
  font-weight: 500;
}

.balance-panel {
  background:
    linear-gradient(
      180deg,
      rgba(182, 242, 102, 0.07),
      transparent 40%
    ),
    var(--surface);
}

.balance-content {
  padding: 28px 24px 24px;
}

.balance-label {
  color: var(--muted-2);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.15em;
}

.balance-value {
  margin-top: 11px;
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.balance-value strong {
  font-family: "DM Mono", monospace;
  font-size: clamp(36px, 4vw, 46px);
  line-height: 1;
  font-weight: 500;
  letter-spacing: -0.075em;
}

.balance-value span {
  color: var(--muted-2);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.balance-content > p {
  min-height: 40px;
  margin-top: 11px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.6;
}

.balance-scale {
  margin-top: 24px;
}

.scale-track {
  height: 6px;
  position: relative;
  border-radius: 999px;
  background:
    linear-gradient(
      90deg,
      #e4b8b8 0%,
      #e8eae7 45%,
      #e8eae7 55%,
      #bde49a 100%
    );
}

.scale-track span {
  width: 13px;
  height: 13px;
  position: absolute;
  top: 50%;
  left: 50%;
  border: 3px solid #ffffff;
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 2px 8px rgba(17, 21, 18, 0.18);
  transform: translate(-50%, -50%);
  transition: left 0.35s ease;
}

.scale-labels {
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
  color: var(--muted-2);
  font-size: 7px;
  font-weight: 700;
}

.distribution-content {
  min-height: 270px;
  padding: 26px 24px;
  display: grid;
  grid-template-columns: 165px minmax(0, 1fr);
  gap: 30px;
}

.distribution-total {
  padding-right: 25px;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.distribution-total span {
  color: var(--muted-2);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.distribution-total strong {
  margin-top: 10px;
  font-family: "DM Mono", monospace;
  font-size: 34px;
  line-height: 1;
  font-weight: 500;
  letter-spacing: -0.07em;
}

.distribution-total small {
  margin-top: 6px;
  color: var(--muted-2);
  font-size: 8px;
  font-weight: 800;
}

.distribution-bars {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 17px;
}

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

.distribution-copy span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
}

.distribution-copy strong {
  font-family: "DM Mono", monospace;
  font-size: 9px;
  font-weight: 500;
}

.bar-track {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-3);
}

.bar-track span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--ink);
  transition: width 0.35s ease;
}

.distribution-item:nth-child(2) .bar-track span {
  background: var(--accent-strong);
}

.distribution-item:nth-child(3) .bar-track span {
  background: #768277;
}

.distribution-item:nth-child(4) .bar-track span {
  background: #b9c2ba;
}

.activity-content {
  min-height: 270px;
  padding: 27px 24px;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 17px;
}

.activity-icon {
  width: 52px;
  height: 52px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: #5f8e35;
}

.activity-icon svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.activity-main > span,
.activity-count span {
  color: var(--muted-2);
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.activity-main > div {
  margin-top: 9px;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.activity-main strong {
  font-family: "DM Mono", monospace;
  font-size: 29px;
  font-weight: 500;
  letter-spacing: -0.06em;
}

.activity-main small {
  color: var(--muted-2);
  font-size: 8px;
  font-weight: 800;
}

.activity-main p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}

.activity-count {
  min-width: 75px;
  padding-left: 19px;
  border-left: 1px solid var(--line);
  text-align: right;
}

.activity-count strong {
  display: block;
  margin-top: 8px;
  font-family: "DM Mono", monospace;
  font-size: 25px;
  font-weight: 500;
}

.records-panel {
  margin-top: 15px;
}

.records-header {
  min-height: 70px;
}

.records-tools {
  display: flex !important;
  align-items: center;
  gap: 10px !important;
}

.filter-group {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  border-radius: 7px;
  background: var(--surface-2);
}

.filter-button {
  min-height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted-2);
  font-size: 8px;
  font-weight: 700;
}

.filter-button.active {
  background: #ffffff;
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(17, 21, 18, 0.08);
}

.outline-action {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  background: #ffffff;
  color: var(--ink-2);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.outline-action:hover {
  background: var(--surface-2);
}

.outline-action span {
  color: var(--accent-strong);
  font-size: 15px;
  line-height: 1;
}

.records-table-head,
.record-row {
  display: grid;
  grid-template-columns:
    minmax(220px, 1.6fr)
    minmax(130px, 0.8fr)
    95px
    105px
    82px;
  align-items: center;
  gap: 12px;
}

.records-table-head {
  min-height: 42px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted-2);
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.records-list {
  min-height: 90px;
}

.record-row {
  min-height: 72px;
  padding: 11px 20px;
  border-bottom: 1px solid var(--line);
  transition: background 0.18s ease;
}

.record-row:last-child {
  border-bottom: 0;
}

.record-row:hover {
  background: #fbfcfa;
}

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

.record-icon {
  width: 35px;
  height: 35px;
  flex: 0 0 auto;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  color: var(--ink-2);
}

.record-icon.exercise {
  background: var(--accent-soft);
  color: #5d8a35;
}

.record-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.record-name div {
  min-width: 0;
}

.record-name strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-name small {
  display: block;
  margin-top: 4px;
  color: var(--muted-2);
  font-size: 8px;
}

.record-category {
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
}

.record-time {
  font-family: "DM Mono", monospace;
  color: var(--muted);
  font-size: 10px;
}

.record-kcal {
  font-family: "DM Mono", monospace;
  color: var(--ink);
  font-size: 10px;
  font-weight: 500;
}

.record-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
}

.icon-button {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: #ffffff;
  color: var(--muted-2);
}

.icon-button:hover {
  color: var(--ink);
  border-color: var(--line-strong);
  background: var(--surface-2);
}

.icon-button.delete:hover {
  color: var(--danger);
  border-color: #ebc9c9;
  background: var(--danger-soft);
}

.icon-button svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.empty-state {
  min-height: 200px;
  padding: 30px;
  display: grid;
  place-items: center;
  text-align: center;
}

.empty-state-inner {
  max-width: 320px;
}

.empty-state-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 13px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  color: var(--muted-2);
}

.empty-state-icon svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.empty-state strong {
  display: block;
  font-size: 11px;
  font-weight: 700;
}

.empty-state p {
  margin-top: 7px;
  color: var(--muted-2);
  font-size: 9px;
  line-height: 1.6;
}

.empty-state button {
  margin-top: 15px;
}

.mobile-nav {
  display: none;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  padding: 18px;
  background: rgba(11, 15, 12, 0.58);
  backdrop-filter: blur(7px);
  display: grid;
  place-items: center;
  opacity: 0;
  visibility: hidden;
  transition: 0.2s ease;
}

.modal-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.modal {
  width: min(540px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  background: #ffffff;
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.25);
  transform: translateY(10px) scale(0.99);
  transition: 0.22s ease;
}

.modal-backdrop.open .modal {
  transform: translateY(0) scale(1);
}

.modal-header {
  min-height: 86px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.modal-header span {
  display: block;
  color: var(--accent-strong);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.15em;
}

.modal-header h2 {
  margin-top: 6px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.modal-close {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--muted);
  display: grid;
  place-items: center;
}

.modal-close:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.modal-close svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
}

#entry-form {
  padding: 24px;
}

.type-switch {
  padding: 4px;
  border-radius: 9px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--surface-2);
}

.type-option {
  min-height: 40px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 700;
}

.type-option.active {
  background: #ffffff;
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(17, 21, 18, 0.08);
}

.form-grid {
  margin-top: 22px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.form-field {
  min-width: 0;
}

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

.form-field label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.form-field input,
.form-field select,
.field-with-unit {
  width: 100%;
  height: 46px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  outline: 0;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 11px;
  font-weight: 600;
  transition: 0.18s ease;
}

.form-field input,
.form-field select {
  padding: 0 12px;
}

.form-field input:focus,
.form-field select:focus,
.field-with-unit:focus-within {
  border-color: #aab1aa;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(17, 21, 18, 0.03);
}

.form-field input::placeholder {
  color: #b8beb9;
}

.field-with-unit {
  padding: 0 12px;
  display: flex;
  align-items: center;
}

.field-with-unit input {
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.field-with-unit input:focus {
  box-shadow: none;
}

.field-with-unit span {
  color: var(--muted-2);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.modal-actions {
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.secondary-modal-action,
.primary-modal-action {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 700;
}

.secondary-modal-action {
  border: 1px solid var(--line-strong);
  background: #ffffff;
  color: var(--muted);
}

.secondary-modal-action:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.primary-modal-action {
  border: 1px solid var(--sidebar);
  background: var(--sidebar);
  color: #ffffff;
}

.primary-modal-action:hover {
  background: #252a26;
}

@media (max-width: 1180px) {
  .metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .main-grid,
  .analytics-grid {
    grid-template-columns: 1fr;
  }

  .balance-panel {
    order: -1;
  }

  .activity-content {
    min-height: 200px;
  }
}

@media (max-width: 900px) {
  .sidebar {
    width: 240px;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    box-shadow: 18px 0 50px rgba(0, 0, 0, 0.18);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-close {
    display: grid;
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgba(12, 16, 13, 0.45);
    backdrop-filter: blur(4px);
  }

  .sidebar-backdrop.open {
    display: block;
  }

  .app-main {
    margin-left: 0;
  }

  .menu-button {
    display: grid;
  }

  .topbar {
    padding: 0 20px;
  }

  .dashboard {
    padding: 28px 20px 82px;
  }

  .progress-panel-body {
    grid-template-columns: 240px minmax(0, 1fr);
  }

  .radial-zone {
    padding: 24px;
  }

  .progress-ring {
    width: 174px;
    height: 174px;
  }

  .records-table-head {
    display: none;
  }

  .record-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "name actions"
      "meta kcal";
    row-gap: 8px;
  }

  .record-name {
    grid-area: name;
  }

  .record-category {
    grid-area: meta;
  }

  .record-time {
    grid-area: meta;
    margin-left: 100px;
  }

  .record-kcal {
    grid-area: kcal;
  }

  .record-actions {
    grid-area: actions;
  }
}

@media (max-width: 700px) {
  .topbar {
    height: 74px;
  }

  .today,
  .ghost-action,
  .top-add {
    display: none;
  }

  .dashboard {
    padding: 24px 14px 94px;
  }

  .dashboard-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .heading-status {
    min-height: 32px;
  }

  .metrics-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .metric-card {
    min-height: 130px;
    padding: 16px;
  }

  .metric-number strong {
    font-size: 24px;
  }

  .progress-panel-body {
    grid-template-columns: 1fr;
  }

  .radial-zone {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .goal-kpis {
    gap: 9px;
  }

  .distribution-content {
    grid-template-columns: 1fr;
  }

  .distribution-total {
    padding: 0 0 19px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .activity-content {
    grid-template-columns: 46px minmax(0, 1fr);
  }

  .activity-count {
    grid-column: 1 / -1;
    padding: 14px 0 0;
    border-left: 0;
    border-top: 1px solid var(--line);
    text-align: left;
  }

  .records-header {
    align-items: flex-start;
    flex-direction: column;
    padding: 15px;
  }

  .records-tools {
    width: 100%;
    justify-content: space-between;
  }

  .filter-group {
    max-width: 100%;
    overflow-x: auto;
  }

  .record-row {
    padding: 13px 15px;
  }

  .mobile-nav {
    height: 70px;
    position: fixed;
    inset: auto 0 0;
    z-index: 35;
    padding: 0 12px max(6px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: center;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(18px);
  }

  .mobile-nav a,
  .mobile-nav button {
    min-width: 0;
    border: 0;
    background: transparent;
    color: var(--muted-2);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    font-size: 8px;
    font-weight: 700;
  }

  .mobile-nav a.active {
    color: var(--ink);
  }

  .mobile-nav svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.55;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .mobile-nav button span {
    width: 40px;
    height: 40px;
    margin-top: -18px;
    border: 4px solid var(--bg);
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: var(--sidebar);
    color: var(--accent);
    font-size: 21px;
    box-shadow: 0 7px 20px rgba(17, 21, 18, 0.18);
  }
}

@media (max-width: 500px) {
  .page-context span {
    display: none;
  }

  .page-context strong {
    margin-top: 0;
  }

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

  .metric-card {
    min-height: 112px;
  }

  .metric-number {
    margin-top: 16px;
  }

  .metric-card p {
    margin-top: 8px;
  }

  .goal-zone {
    padding: 23px 18px;
  }

  .goal-kpis {
    grid-template-columns: 1fr;
  }

  .goal-kpis div {
    display: flex;
    justify-content: space-between;
    gap: 10px;
  }

  .goal-kpis strong {
    margin-top: 0;
  }

  .panel-header {
    padding: 0 15px;
  }

  .distribution-content,
  .activity-content,
  .balance-content {
    padding-left: 17px;
    padding-right: 17px;
  }

  .records-tools {
    align-items: stretch;
    flex-direction: column;
  }

  .outline-action {
    justify-content: center;
  }

  .record-row {
    grid-template-columns: 1fr auto;
  }

  .record-time {
    margin-left: 0;
  }

  .modal-backdrop {
    padding: 0;
    place-items: end center;
  }

  .modal {
    width: 100%;
    max-height: 92vh;
    border-radius: 18px 18px 0 0;
  }

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

  .form-field.full {
    grid-column: auto;
  }
}