/* 07:15 COFFEE — айдентика: крупная жирная типографика, яркие акценты, полукруглые арки, много воздуха.
   Шрифты: Archivo (заголовки, цифры) + Golos Text (текст). */
:root {
  --crimson: #D2555D;
  --orange: #DD873B;
  --sunny: #F4D140;
  --sky: #9BD0E4;
  --ink: #141414;
  --bg: #FBFAF7;
  --surface: #FFFFFF;
  --line: #E9E5DD;
  --muted: #6B6760;
  --good: #2F8F5B;
  --bad: #C2413F;
  --f-display: "Archivo", "Arial Black", system-ui, sans-serif;
  --f-body: "Golos Text", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 18px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 16px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
[hidden] { display: none !important; }
.num { font-family: var(--f-display); font-variant-numeric: tabular-nums; }

/* ---- Логотип: текстовый, место под официальный файл (заменить .logo на <img>) ---- */
.logo {
  font-family: var(--f-display); font-weight: 900; letter-spacing: -0.02em; text-decoration: none;
  display: inline-flex; align-items: baseline; gap: 0.35em; font-size: 1.25rem; white-space: nowrap;
}
.logo b { font-weight: 900; }
.logo span { font-weight: 800; letter-spacing: 0.08em; font-size: 0.72em; }

/* ---- Лендинг ---- */
.landing { min-height: 100vh; display: flex; flex-direction: column; background: var(--ink); color: #fff; overflow: hidden; }
.landing header { display: flex; justify-content: space-between; align-items: center; padding: 22px max(20px, env(safe-area-inset-left)); }
.landing .hero {
  flex: 1; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 32px; align-items: center;
  padding: 24px max(20px, env(safe-area-inset-left)) 56px; max-width: 1200px; width: 100%; margin: 0 auto;
}
.hero h1 { font-family: var(--f-display); font-weight: 900; line-height: 0.86; letter-spacing: -0.045em; margin: 0; font-size: clamp(4.5rem, 15vw, 11rem); }
.hero h1 .coffee { display: block; color: var(--sunny); font-size: 0.42em; letter-spacing: 0.06em; margin-top: 0.12em; }
.hero .tagline { font-family: var(--f-display); font-weight: 700; font-size: clamp(1.15rem, 2.4vw, 1.6rem); margin: 28px 0 10px; max-width: 26ch; }
.hero .lead { color: #CFCAC2; max-width: 46ch; margin: 0 0 28px; }
.login-box { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.login-box .note { color: #A9A49B; font-size: 0.9rem; max-width: 44ch; margin: 0; }
.alert { background: var(--crimson); color: #fff; border-radius: 12px; padding: 10px 14px; font-weight: 500; }
.facts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; padding: 0; list-style: none; }
.facts li { border: 1.5px solid #3A3833; border-radius: 999px; padding: 6px 14px; font-size: 0.9rem; color: #E8E3DA; }
.facts b { font-family: var(--f-display); color: #fff; }

/* Фирменные арки: полукруги разных цветов, сложенные как солнце/чашка */
.arches { position: relative; aspect-ratio: 1 / 1; width: 100%; max-width: 520px; justify-self: center; }
.arch { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); border-radius: 999px 999px 0 0; }
.arch.a1 { width: 100%; height: 50%; background: var(--crimson); }
.arch.a2 { width: 78%; height: 39%; background: var(--orange); }
.arch.a3 { width: 56%; height: 28%; background: var(--sunny); }
.arch.a4 { width: 34%; height: 17%; background: var(--sky); }
.arches .time { position: absolute; top: 8%; left: 0; right: 0; text-align: center; font-family: var(--f-display); font-weight: 900; font-size: clamp(2rem, 6vw, 3.4rem); color: var(--sky); letter-spacing: -0.02em; }
@media (prefers-reduced-motion: no-preference) {
  .arch { animation: rise 0.9s cubic-bezier(.2,.8,.2,1) both; }
  .arch.a2 { animation-delay: .08s; } .arch.a3 { animation-delay: .16s; } .arch.a4 { animation-delay: .24s; }
  @keyframes rise { from { transform: translate(-50%, 30%); opacity: .4; } to { transform: translate(-50%, 0); opacity: 1; } }
}
@media (max-width: 820px) {
  .landing .hero { grid-template-columns: 1fr; }
  .arches { max-width: 340px; order: -1; aspect-ratio: 2 / 1; }
  .arch.a1 { height: 100%; } .arch.a2 { height: 78%; } .arch.a3 { height: 56%; } .arch.a4 { height: 34%; }
  .arches .time { display: none; }
}

/* ---- Приложение ---- */
.topbar {
  position: sticky; top: 0; z-index: 10; background: var(--ink); color: #fff;
  display: flex; align-items: center; gap: 18px; padding: 12px max(16px, env(safe-area-inset-left)); flex-wrap: wrap;
}
.topbar nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.topbar nav a { text-decoration: none; padding: 6px 12px; border-radius: 999px; font-weight: 500; color: #DDD8CF; }
.topbar nav a.active { background: var(--sunny); color: var(--ink); }
.topbar .me { display: flex; align-items: center; gap: 10px; font-size: 0.92rem; color: #DDD8CF; }
.topbar .me img { width: 28px; height: 28px; border-radius: 50%; }
.btn-ghost { background: transparent; border: 1.5px solid #4A4740; color: #fff; border-radius: 999px; padding: 5px 12px; }
.btn-ghost:hover { border-color: var(--sunny); }

main { max-width: 1240px; margin: 0 auto; padding: 28px max(16px, env(safe-area-inset-left)) 64px; display: grid; gap: 28px; }
.page-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px; }
.page-head h1 { font-family: var(--f-display); font-weight: 900; letter-spacing: -0.03em; font-size: clamp(2rem, 5vw, 3.2rem); line-height: 1; margin: 0; }
.page-head .sub { color: var(--muted); margin: 6px 0 0; }
h2 { font-family: var(--f-display); font-weight: 800; letter-spacing: -0.01em; font-size: 1.35rem; margin: 0 0 12px; }

.period { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.seg { display: inline-flex; background: var(--surface); border: 1.5px solid var(--line); border-radius: 999px; padding: 3px; }
.seg button { border: 0; background: transparent; padding: 7px 16px; border-radius: 999px; font-weight: 600; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.period input[type="date"] { font: inherit; border: 1.5px solid var(--line); border-radius: 999px; padding: 6px 12px; background: var(--surface); }
.period .until { color: var(--muted); font-size: 0.9rem; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); gap: 14px; }
.kpi { position: relative; overflow: hidden; background: var(--surface); border-radius: var(--radius); padding: 18px 18px 16px; border: 1.5px solid var(--line); min-width: 0; }
.kpi::after { content: ""; position: absolute; right: -26px; bottom: -40px; width: 92px; height: 92px; border-radius: 50%; background: var(--c, var(--sky)); opacity: .9; }
.kpi .label { font-size: 0.78rem; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.kpi .value { font-family: var(--f-display); font-weight: 800; font-size: clamp(1.45rem, 2.6vw, 1.95rem); letter-spacing: -0.02em; margin: 6px 0 4px; position: relative; z-index: 1; font-variant-numeric: tabular-nums; }
.delta { font-size: 0.85rem; font-weight: 600; position: relative; z-index: 1; }
.delta.up { color: var(--good); } .delta.down { color: var(--bad); } .delta .vs { color: var(--muted); font-weight: 400; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 14px; }
.card {
  display: grid; gap: 10px; text-decoration: none; background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px 18px; transition: border-color .15s, transform .15s; min-width: 0;
}
.card:hover { border-color: var(--ink); transform: translateY(-2px); }
.card .name { font-family: var(--f-display); font-weight: 800; font-size: 1.15rem; display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.card .rev { font-family: var(--f-display); font-weight: 900; font-size: 1.6rem; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.card dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 0; }
.card dt { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.card dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.pill { display: inline-block; border-radius: 999px; padding: 2px 9px; font-size: 0.78rem; font-weight: 700; font-family: var(--f-body); }
.pill.up { background: #E3F2E8; color: var(--good); } .pill.down { background: #FBE6E4; color: var(--bad); } .pill.flat { background: #EFEDE8; color: var(--muted); }

.panel { background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 18px; min-width: 0; }
.chart { width: 100%; height: auto; display: block; }
.chart text { font-family: var(--f-body); font-size: 11px; fill: var(--muted); }
.chart .bar { fill: var(--crimson); } .chart .bar:hover { fill: var(--orange); }
.chart .grid { stroke: var(--line); }
.grid2 { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 18px; }
@media (max-width: 900px) { .grid2 { grid-template-columns: 1fr; } }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
thead th { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; }
td.wrap { white-space: normal; text-align: left; }

.cat { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; margin-bottom: 12px; }
.cat .bar { grid-column: 1 / -1; height: 8px; border-radius: 999px; background: var(--sunny); }
.cat:nth-child(4n+2) .bar { background: var(--orange); } .cat:nth-child(4n+3) .bar { background: var(--crimson); } .cat:nth-child(4n+4) .bar { background: var(--sky); }

.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 0.8rem; font-weight: 600; background: #EFEDE8; }
.badge.approved { background: #E3F2E8; color: var(--good); } .badge.pending { background: #FFF4CC; color: #8A6A00; } .badge.blocked { background: #FBE6E4; color: var(--bad); }
.hint { color: var(--muted); margin: 0; }

/* Экран ожидания */
.pending { min-height: calc(100vh - 64px); display: grid; place-items: center; text-align: center; padding: 32px 16px; }
.pending .arches { max-width: 300px; aspect-ratio: 2 / 1; margin: 0 auto 28px; }
.pending .arch.a1 { height: 100%; } .pending .arch.a2 { height: 78%; } .pending .arch.a3 { height: 56%; } .pending .arch.a4 { height: 34%; }
.pending h1 { font-family: var(--f-display); font-weight: 900; font-size: clamp(1.8rem, 5vw, 2.8rem); letter-spacing: -0.03em; margin: 0 0 12px; text-wrap: balance; }
.pending p { color: var(--muted); max-width: 46ch; margin: 0 auto 8px; }
.loading { color: var(--muted); }
