:root {
  --bg: #efe8dc;
  --ink: #14241c;
  --muted: #6d7c72;
  --card: #fffcf7;
  --line: rgba(28, 52, 40, 0.1);
  --green: #1f4d38;
  --green-2: #3e8a64;
  --leaf: #8fbf9a;
  --warn: #c45c26;
  --bad: #b33b3b;
  --ok: #2f6b4f;
  --side: #143227;
  --side-ink: #eef6ef;
  --shadow: 0 18px 50px rgba(20, 50, 32, 0.08);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: Nunito, "Segoe UI", system-ui, sans-serif;
  font-size: 16px;
  letter-spacing: 0.01em;
  background:
    radial-gradient(900px 420px at 70% -10%, rgba(143, 191, 154, 0.28), transparent 55%),
    var(--bg);
  color: var(--ink);
  min-height: 100vh;
}
h1, h2, .brand strong, .stats b {
  font-family: "Cormorant Garamond", "Times New Roman", serif;
  font-weight: 600;
  letter-spacing: -0.02em;
}
h1 { margin: 0; font-size: 40px; font-weight: 600; display: flex; align-items: center; flex-wrap: wrap; gap: 10px; line-height: 1.1; }
h2 { margin: 0; font-size: 26px; display: inline-flex; align-items: center; gap: 8px; line-height: 1.2; }
a { color: var(--green); }
body:not(.auth) {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}
aside {
  padding: 22px 16px 18px;
  background: var(--side);
  color: var(--side-ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 28px;
  position: sticky;
  top: 0;
  z-index: 30;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  text-decoration: none;
  color: inherit;
  padding: 4px 8px;
}
.brand strong { display: block; font-size: 26px; letter-spacing: -0.03em; font-weight: 600; }
.brand small, .muted { color: var(--muted); }
.brand small { color: #b7cfc0; }
.logo-img {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  object-fit: cover;
  background: #f6f1e8;
  box-shadow: 0 8px 20px rgba(0,0,0,0.18);
}
nav { display: grid; gap: 4px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 2px;
}
.nav-item .info { flex: 0 0 auto; }
nav a, .logout {
  text-decoration: none;
  padding: 11px 12px;
  border-radius: 12px;
  color: #d5e6da;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 14px;
}
nav a { flex: 1; min-width: 0; }
nav a.active, nav a:hover { background: rgba(255,255,255,0.08); color: #fff; }
.nav-ico {
  width: 22px;
  text-align: center;
  opacity: 0.8;
  font-size: 13px;
}
.aside-foot { margin-top: auto; display: grid; gap: 14px; }
.logout { color: #b7cfc0; }
.credit {
  margin: 0;
  font-size: 11px;
  line-height: 1.45;
  color: #8aa394;
}
.credit a { color: #d7eadc; text-decoration: none; }
.credit a:hover { text-decoration: underline; }
.workspace { display: flex; flex-direction: column; min-height: 100vh; }
main { padding: 32px 36px 28px; flex: 1; }
.site-foot {
  padding: 0 36px 22px;
  color: var(--muted);
  font-size: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.page-head { display: flex; justify-content: space-between; gap: 16px; align-items: end; margin-bottom: 22px; flex-wrap: wrap; }
.eyebrow { margin: 0 0 6px; text-transform: uppercase; letter-spacing: 0.16em; font-size: 11px; color: var(--green); font-weight: 800; }
.lede { margin: 8px 0 0; color: var(--muted); max-width: 560px; line-height: 1.5; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.stats-hero { grid-template-columns: 1.4fr 1fr 1fr; }
.stats article, .card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
}
.stats article { padding: 16px 18px; position: relative; overflow: visible; }
.stats b { display: block; font-size: 32px; letter-spacing: -0.03em; }
.stats span { color: var(--muted); font-size: 13px; }
.stats small { display: block; margin-top: 8px; color: var(--green-2); font-size: 12px; font-weight: 700; }
.stat-hero { padding: 22px 24px !important; }
.stat-hero b { font-size: 42px; }
.stat-hero.warn b { color: var(--warn); }
.stat-kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 800;
  font-family: Nunito, sans-serif;
  color: var(--green);
  margin-bottom: 8px;
}
.stat-label { display: block; color: var(--muted); font-size: 13px; }
.stat-hero .stat-label { display: none; }
.stat-extra { display: block; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.card { padding: 22px; margin-bottom: 16px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.card table { width: 100%; border-collapse: collapse; font-size: 14px; }
.card th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12px; }
.card td, .card th { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.btn {
  appearance: none; border: 0; cursor: pointer;
  background: var(--green); color: #fff;
  border-radius: 12px; padding: 12px 16px; font-weight: 700;
  font-family: inherit;
}
.btn:hover { background: #163d2c; }
.btn-sm { padding: 7px 10px; font-size: 12px; border-radius: 10px; }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.actions, .filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters a { text-decoration: none; padding: 6px 10px; border-radius: 999px; background: #efe8db; color: var(--ink); font-size: 13px; }
.filters a.on { background: var(--green); color: #fff; }
.tag { display: inline-block; padding: 3px 8px; border-radius: 999px; font-size: 12px; background: #efe8db; font-style: normal; font-weight: 700; }
.tag-waiting_review, .tag-pending { background: #fbe3d4; color: var(--warn); }
.tag-paid, .tag-published, .tag-done { background: #e7f3ea; color: var(--green); }
.tag-rejected, .tag-cancelled, .tag-removed { background: #f8dede; color: var(--bad); }
.tag-reserved { background: #f7ead0; color: #8a5a12; }
form { margin: 0; }
.more { display: inline-block; font-size: 13px; font-weight: 700; text-decoration: none; }
.plain { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.feed { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.feed li { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.feed b { display: block; }
.feed span { color: var(--muted); font-size: 13px; }
.alert { background: #f8dede; color: var(--bad); padding: 10px 12px; border-radius: 12px; margin-bottom: 12px; }
.alert.ok { background: #e7f3ea; color: var(--green); }
label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; margin: 12px 0; }
input, textarea {
  font: inherit; padding: 10px 12px; border-radius: 12px;
  border: 1px solid var(--line); background: #fff;
  width: 100%;
}
.stack { display: grid; gap: 16px; max-width: 860px; }
.tariff { border: 1px dashed var(--line); border-radius: 16px; padding: 12px 14px; margin: 12px 0; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.thread { display: grid; gap: 10px; }
.thread article { padding: 10px 12px; border-radius: 14px; background: #f7f1e6; }
.thread article.mine { background: #e7f3ea; }
.thread span { color: var(--muted); font-size: 12px; margin-left: 8px; }
.bars { display: grid; gap: 12px; }
.bars div { display: grid; gap: 6px; }
.bars span { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }
.bars i {
  display: block;
  height: 8px;
  border-radius: 99px;
  background: var(--green);
  min-width: 4px;
}
.bars i.bar-warn { background: var(--warn); }
.bars i.bar-ok { background: var(--leaf); }
.bars i.empty { min-width: 0; width: 0 !important; background: #ece6da; }
.bars-card { margin-bottom: 16px; }
.bars-card h2 { margin-bottom: 16px; }
body.auth {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
}
.login {
  width: min(420px, calc(100% - 32px));
  padding: 32px 28px 28px;
  display: grid;
  gap: 8px;
  text-align: center;
}
.login h1 { font-size: 36px; display: block; }
.login-logo { width: 84px; height: 84px; border-radius: 24px; margin: 0 auto 4px; }
.login-lead { margin: 0 0 8px; }
.login label { text-align: left; }
.login .btn { margin-top: 8px; }
.auth-credit { position: absolute; bottom: 24px; }

.info {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  vertical-align: middle;
  cursor: help;
  z-index: 3;
}
.info .info-mark {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.5px solid #8aa394;
  color: #3e5c4c;
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-size: 12px;
  font-weight: 700;
  display: grid;
  place-items: center;
  line-height: 1;
  background: #f4f7f4;
}
.info .tip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%) translateY(4px);
  width: max-content;
  max-width: 260px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #143227;
  color: #f3faf4;
  font-family: Nunito, sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  line-height: 1.4;
  box-shadow: 0 14px 30px rgba(20, 50, 32, 0.22);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
  z-index: 40;
}
.info .tip::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #143227;
}
.info:hover .tip,
.info:focus .tip,
.info:focus-within .tip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
aside .info .info-mark {
  border-color: #9cb5a6;
  color: #e7f3ea;
  background: rgba(255,255,255,0.06);
}
aside .info .tip {
  left: calc(100% + 10px);
  bottom: auto;
  top: 50%;
  transform: translateY(-50%) translateX(-4px);
  max-width: 230px;
}
aside .info .tip::after {
  left: -6px;
  top: 50%;
  transform: translateY(-50%);
  border: 6px solid transparent;
  border-right-color: #143227;
  border-top-color: transparent;
}
aside .info:hover .tip,
aside .info:focus .tip,
aside .info:focus-within .tip {
  transform: translateY(-50%) translateX(0);
}
.stats .info,
.card-head .info,
th .info,
label .info {
  margin-left: 2px;
}
th { white-space: nowrap; }
.aside-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.menu-close {
  display: none;
  appearance: none;
  border: 0;
  background: rgba(255,255,255,0.08);
  color: #eef6ef;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  font-size: 18px;
  cursor: pointer;
}
.topbar { display: none; }
.backdrop { display: none; }

.dyn {
  display: grid;
  grid-template-columns: repeat(14, 1fr);
  gap: 6px;
  align-items: end;
  min-height: 120px;
}
.dyn-col { display: grid; gap: 6px; justify-items: center; }
.dyn-bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 100px;
}
.dyn-bars i {
  width: 7px;
  min-height: 2px;
  border-radius: 6px 6px 0 0;
  display: block;
}
.dyn-bars i.up { background: #3e8a64; }
.dyn-bars i.down { background: #c45c26; }
.dyn-col span { font-size: 10px; color: var(--muted); }
.dyn-legend { display: flex; gap: 14px; align-items: center; margin-top: 12px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.dot.up { background: #3e8a64; }
.dot.down { background: #c45c26; }

.search-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 14px;
  max-width: 720px;
}
.search-bar input[type="search"] {
  flex: 1;
  min-width: 180px;
  margin: 0;
}
.search-bar .btn { width: auto; }
.search-meta { margin: -6px 0 14px; }

@media (max-width: 1100px) {
  .stats, .stats-hero { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 960px) {
  body:not(.auth) { grid-template-columns: 1fr; }
  h1 { font-size: 26px; }
  .lede { display: none; }
  .topbar {
    display: flex;
    align-items: center;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 40;
    background: var(--side);
    color: var(--side-ink);
    padding: 10px 14px;
    box-shadow: 0 8px 24px rgba(12, 28, 20, 0.18);
  }
  .topbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: inherit;
    text-decoration: none;
    font-family: "Cormorant Garamond", serif;
    font-size: 22px;
  }
  .topbar-brand img {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    object-fit: cover;
  }
  .menu-btn {
    appearance: none;
    border: 0;
    background: rgba(255,255,255,0.08);
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: grid;
    place-content: center;
    gap: 5px;
    cursor: pointer;
    padding: 0;
  }
  .menu-btn span {
    display: block;
    width: 18px;
    height: 2px;
    background: #eef6ef;
    border-radius: 2px;
  }
  .menu-close { display: grid; place-items: center; }
  aside {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(320px, 88vw);
    min-height: 100vh;
    height: 100dvh;
    overflow-y: auto;
    transform: translateX(-105%);
    transition: transform 0.22s ease;
    z-index: 70;
    box-shadow: none;
  }
  body.menu-open aside { transform: translateX(0); box-shadow: 16px 0 40px rgba(0,0,0,0.25); }
  .backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(10, 22, 16, 0.5);
    z-index: 60;
    border: 0;
  }
  body.menu-open .backdrop { display: block; }
  body.menu-open { overflow: hidden; }
  .grid-2, .row { grid-template-columns: 1fr; }
  .stats,
  .stats-hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 0 0 12px;
    padding: 0;
    overflow: visible;
  }
  .stats article,
  .stats.stats-hero article {
    min-width: 0;
    max-width: none;
    flex: none;
    padding: 10px 12px;
    border-radius: 14px;
    box-shadow: none;
  }
  .stats.stats-hero article.stat-hero:first-child {
    grid-column: 1 / -1;
    padding: 12px 14px !important;
  }
  .stat-kicker,
  .stat-ico,
  .stats .info,
  .stat-extra,
  .stats small {
    display: none !important;
  }
  .stat-label,
  .stat-hero .stat-label {
    display: block !important;
    margin-top: 2px;
    font-size: 11px;
    line-height: 1.2;
    color: var(--muted);
    font-weight: 600;
  }
  .stats b {
    font-size: 22px;
    line-height: 1.05;
  }
  .stat-hero b {
    font-size: 26px !important;
  }
  h2 { font-size: 20px; }
  .bars-card { padding: 14px; }
  .bars { gap: 8px; }
  .dyn-bars { height: 64px; }
  main { padding: 16px 16px 28px; }
  .card { overflow-x: auto; padding: 16px; }
  .site-foot { padding: 0 16px 20px; }
  .page-head { align-items: start; margin-bottom: 14px; }
  .dyn { grid-template-columns: repeat(7, 1fr); }
  aside .info .tip { max-width: 180px; }
}
@media (max-width: 640px) {
  .filters { width: 100%; }
  .page-head .btn, .page-head form .btn { width: 100%; }
  .search-bar .btn { width: auto; }
}
