:root {
  --bg: #f3efe7;
  --bg-strong: #fffdf8;
  --bg-soft: rgba(255, 252, 246, 0.9);
  --bg-hover: #f6f0e6;
  --bg-sidebar: rgba(44, 49, 46, 0.92);
  --border: rgba(95, 84, 68, 0.16);
  --border-strong: rgba(50, 57, 53, 0.12);
  --text: #22201c;
  --text2: #6f685d;
  --text3: #a49a8b;
  --green: #2f7f66;
  --green-bg: #d8efe6;
  --yellow: #8c6700;
  --yellow-bg: #f4e7ba;
  --red: #b44d45;
  --red-bg: #f6ddda;
  --blue: #2e6a8d;
  --blue-bg: #d7e8f1;
  --purple: #6e5d93;
  --purple-bg: #e8e1f3;
  --orange: #b66a2e;
  --orange-bg: #f6ddc8;
  --radius-sm: 10px;
  --radius: 18px;
  --radius-lg: 26px;
  --shadow-soft: 0 22px 50px rgba(52, 43, 28, 0.08);
  --shadow-card: 0 10px 24px rgba(42, 35, 24, 0.06);
  --shadow-hover: 0 16px 32px rgba(42, 35, 24, 0.09);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Avenir Next", "Helvetica Neue", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.72), transparent 34%),
    radial-gradient(circle at bottom right, rgba(181, 212, 199, 0.26), transparent 28%),
    linear-gradient(180deg, #f6f1e7 0%, #efe8dd 100%);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a,
button,
input,
select,
textarea {
  transition:
    color 0.18s ease,
    background-color 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease,
    opacity 0.18s ease;
}

.app {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 280px;
  padding: 26px 18px 18px;
  position: fixed;
  inset: 0 auto 0 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
  background:
    linear-gradient(180deg, rgba(58, 67, 63, 0.97), rgba(34, 39, 37, 0.98)),
    var(--bg-sidebar);
  color: #f3ede1;
  border-right: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.04);
}

.sidebar-brand {
  padding: 10px 12px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-kicker {
  display: inline-block;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(229, 220, 203, 0.7);
  margin-bottom: 10px;
}

.sidebar h1 {
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.05;
  color: #fff8ea;
  margin-bottom: 10px;
}

.sidebar-brand p {
  font-size: 13px;
  color: rgba(239, 231, 216, 0.72);
  line-height: 1.5;
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar nav a {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 0 14px;
  color: rgba(242, 234, 220, 0.76);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border-radius: 14px;
  border: 1px solid transparent;
}

.sidebar nav a:hover {
  color: #fff8ea;
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.07);
}

.sidebar nav a.active {
  color: #fff8ea;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.14), rgba(191, 224, 213, 0.1));
  border-color: rgba(255, 255, 255, 0.09);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-section-title {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: rgba(247, 240, 229, 0.35);
  padding: 4px 10px 6px;
}

.sidebar-link {
  display: block;
  padding: 5px 10px;
  font-size: 13px;
  color: rgba(247, 240, 229, 0.55);
  text-decoration: none;
  border-radius: 4px;
  transition: background .1s, color .1s;
}

.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(247, 240, 229, 0.9);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 12px;
}

.sidebar-logout {
  width: 100%;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.08);
  color: rgba(247, 240, 229, 0.82);
}

.sidebar-logout:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff8ea;
}

.main {
  margin-left: 280px;
  flex: 1;
  width: calc(100% - 280px);
  max-width: none;
  padding: 34px 36px 72px;
  position: relative;
}

.main > * {
  max-width: 1440px;
  width: 100%;
}

.main h2 {
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: clamp(30px, 3.1vw, 42px);
  font-weight: 700;
  margin-bottom: 22px;
  letter-spacing: -0.04em;
  line-height: 1;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin-bottom: 30px;
}

.stat-card {
  padding: 16px 16px 14px;
  background: rgba(255, 252, 247, 0.84);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(92, 79, 59, 0.12);
  border-radius: 16px;
  box-shadow: var(--shadow-card);
}

.stat-card .label {
  font-size: 11px;
  color: var(--text2);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.stat-card .value {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.05em;
  color: var(--text);
}

.stat-card .value.warn {
  color: var(--orange);
}

.stat-card .value.danger {
  color: var(--red);
}

.stat-card .value.good {
  color: var(--green);
}

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

.section-header:first-child {
  margin-top: 0;
}

.section-header h3 {
  font-size: 12px;
  font-weight: 700;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.areas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin-bottom: 12px;
}

.area-card {
  border: 1px solid rgba(92, 79, 59, 0.12);
  border-radius: 18px;
  padding: 16px;
  cursor: pointer;
  position: relative;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 251, 245, 0.78));
  box-shadow: var(--shadow-card);
}

.area-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(249, 242, 232, 0.86));
}

.area-card:hover .row-actions {
  opacity: 1;
}

.area-card .header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.area-card .header .icon {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
  border-radius: 12px;
  background: rgba(34, 32, 28, 0.05);
}

.area-card .header .name {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.area-card .vision {
  font-size: 13px;
  color: var(--text2);
  margin-top: 10px;
  line-height: 1.55;
}

.area-card .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: var(--text2);
  margin-top: 14px;
}

.area-card .meta span {
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(34, 32, 28, 0.05);
}

.area-card .progress-bar {
  height: 8px;
  background: rgba(75, 65, 53, 0.08);
  border-radius: 999px;
  margin-top: 14px;
  overflow: hidden;
}

.area-card .progress-bar .fill {
  height: 100%;
  border-radius: inherit;
  transition: width 0.3s ease;
}

.item-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.item-row {
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(92, 79, 59, 0.12);
  border-radius: 16px;
  background: rgba(255, 252, 247, 0.74);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-card);
  position: relative;
}

.item-row:first-child {
  border-top: 1px solid rgba(92, 79, 59, 0.12);
}

.item-row:hover {
  background: rgba(255, 252, 247, 0.94);
  transform: translateY(-1px);
  box-shadow: var(--shadow-hover);
}

.item-row:hover .row-actions {
  opacity: 1;
}

.item-row .title {
  flex: 1;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.01em;
  min-width: 0;
}

.item-row .meta-info {
  font-size: 12px;
  color: var(--text2);
  line-height: 1.45;
}

.item-row .meta-info.danger {
  color: var(--red);
  font-weight: 600;
}

.row-actions {
  display: flex;
  gap: 4px;
  opacity: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.badge.active {
  background: var(--green-bg);
  color: var(--green);
}

.badge.paused {
  background: var(--yellow-bg);
  color: var(--yellow);
}

.badge.done {
  background: var(--blue-bg);
  color: var(--blue);
}

.badge.draft {
  background: var(--bg-hover, #f7f7f5);
  color: var(--text2, #9b9a97);
}

.badge.dropped,
.badge.critical {
  background: var(--red-bg);
  color: var(--red);
}

.badge.high {
  background: var(--orange-bg);
  color: var(--orange);
}

.badge.medium {
  background: var(--yellow-bg);
  color: var(--yellow);
}

.badge.low {
  background: rgba(34, 32, 28, 0.06);
  color: var(--text2);
}

.badge.weekly {
  background: var(--blue-bg);
  color: var(--blue);
}

.badge.monthly {
  background: var(--purple-bg);
  color: var(--purple);
}

.badge.quarterly {
  background: var(--orange-bg);
  color: var(--orange);
}

.skill-level {
  display: flex;
  gap: 4px;
  align-items: center;
}

.skill-level .dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: rgba(34, 32, 28, 0.1);
}

.skill-level .dot.filled {
  background: linear-gradient(180deg, #2f7f66, #24614f);
}

.progress-sm {
  width: 72px;
  height: 6px;
  background: rgba(75, 65, 53, 0.09);
  border-radius: 999px;
  overflow: hidden;
  display: inline-block;
  vertical-align: middle;
}

.progress-sm .fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #8fc3ae, #2f7f66);
}

.btn {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid rgba(92, 79, 59, 0.12);
  background: rgba(255, 252, 247, 0.86);
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  line-height: 1;
  display: inline-flex;
  align-items: center;
}

.btn:hover {
  background: #fff8ef;
  border-color: rgba(92, 79, 59, 0.16);
}

.btn.primary {
  background: linear-gradient(135deg, #2c5447, #203a32);
  color: #fff9ee;
  border-color: rgba(24, 50, 42, 0.5);
  box-shadow: 0 10px 20px rgba(32, 58, 50, 0.16);
}

.btn.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 24px rgba(32, 58, 50, 0.2);
}

.btn.danger {
  color: var(--red);
  border-color: transparent;
  background: transparent;
}

.btn.danger:hover {
  background: var(--red-bg);
}

.btn.sm {
  min-height: 28px;
  padding: 0 8px;
  font-size: 11px;
  border-color: transparent;
  color: var(--text2);
  background: transparent;
}

.btn.sm:hover {
  background: rgba(34, 32, 28, 0.06);
  color: var(--text);
}

.modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(18, 22, 20, 0.42);
  backdrop-filter: blur(4px);
  display: none;
  align-items: flex-start;
  justify-content: center;
  z-index: 100;
  padding-top: 8vh;
}

.modal-bg.open {
  display: flex;
}

.modal {
  background: linear-gradient(180deg, #fffdf8, #f8f2e8);
  border-radius: 26px;
  padding: 28px;
  width: min(560px, calc(100vw - 24px));
  max-height: 84vh;
  overflow-y: auto;
  border: 1px solid rgba(92, 79, 59, 0.12);
  box-shadow: 0 24px 60px rgba(17, 20, 19, 0.2);
}

.modal h3 {
  margin-bottom: 18px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 11px;
  color: var(--text2);
  margin-bottom: 6px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(92, 79, 59, 0.14);
  border-radius: 12px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: rgba(47, 127, 102, 0.5);
  box-shadow: 0 0 0 4px rgba(47, 127, 102, 0.12);
  background: #fffdf9;
}

.form-group textarea {
  min-height: 90px;
  resize: vertical;
}

.form-group input[type="range"] {
  padding: 0;
  border: none;
  background: transparent;
  min-height: auto;
}

.form-group input[type="range"]:focus {
  box-shadow: none;
}

.form-group input[type="color"] {
  padding: 4px;
  height: 42px;
}

.form-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 18px;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.tab {
  padding: 8px 12px;
  cursor: pointer;
  color: var(--text2);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid rgba(92, 79, 59, 0.12);
  border-radius: 999px;
  background: rgba(255, 252, 247, 0.7);
}

.tab:hover {
  color: var(--text);
  background: rgba(255, 248, 239, 0.94);
}

.tab.active {
  color: #fff8ea;
  border-color: transparent;
  background: linear-gradient(135deg, #2c5447, #203a32);
  box-shadow: 0 10px 18px rgba(32, 58, 50, 0.16);
}

.note-body {
  font-size: 13px;
  color: var(--text2);
  margin-top: 5px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.note-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.mood {
  font-size: 18px;
}

.empty {
  text-align: center;
  padding: 42px 24px;
  color: var(--text2);
  font-size: 14px;
  background: rgba(255, 252, 247, 0.56);
  border: 1px dashed rgba(92, 79, 59, 0.18);
  border-radius: 22px;
}

.login-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.9), transparent 28%),
    radial-gradient(circle at 80% 80%, rgba(181, 212, 199, 0.28), transparent 22%),
    linear-gradient(180deg, #f4ede0, #ece2d4);
}

.login-box {
  background: rgba(255, 252, 247, 0.86);
  border-radius: 28px;
  padding: 34px 30px;
  width: min(380px, 100%);
  border: 1px solid rgba(92, 79, 59, 0.12);
  box-shadow: 0 26px 54px rgba(36, 31, 24, 0.12);
  backdrop-filter: blur(12px);
}

.login-box h3 {
  text-align: center;
  margin-bottom: 10px;
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.05em;
  color: var(--text);
}

.login-subtitle {
  text-align: center;
  margin-bottom: 22px;
  color: var(--text2);
  font-size: 14px;
}

@media (min-width: 1100px) {
  .main {
    padding: 28px 32px 56px;
  }

  .main > * {
    max-width: none;
  }

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

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

  .item-row {
    min-height: 58px;
  }

  .progress-sm {
    width: 88px;
  }
}

@media (min-width: 1440px) {
  .sidebar {
    width: 296px;
  }

  .main {
    margin-left: 296px;
    width: calc(100% - 296px);
    padding: 28px 40px 64px;
  }

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

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

@media (max-width: 980px) {
  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    min-height: auto;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .main {
    margin-left: 0;
    width: 100%;
    padding: 26px 20px 56px;
  }

  .app {
    flex-direction: column;
  }
}

@media (max-width: 720px) {
  .stats-grid,
  .areas-grid {
    grid-template-columns: 1fr;
  }

  .item-row {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .row-actions {
    opacity: 1;
    width: 100%;
    justify-content: flex-end;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .main {
    padding-inline: 16px;
  }

  .modal {
    padding: 22px;
  }
}
