/* TaskFlow — эстетика «современный гроссбух»: тёплая бумага, чернила,
   бухгалтерская зелень, серифные цифры. Без JS, всё на CSS. */

:root {
  --paper: #f6f3ec;
  --paper-card: #fffdf8;
  --ink: #20281f;
  --ink-soft: #5c655a;
  --hairline: #ddd5c4;
  --green: #1d6b50;
  --green-deep: #14503b;
  --green-soft: #8fb2a3;
  --cream: #f4efe2;
  --serif: "Playfair Display", Georgia, serif;
  --sans: "IBM Plex Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, #fdfbf5 0%, transparent 60%),
    var(--paper);
  min-height: 100vh;
}

/* ── Шапка ─────────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 1.1rem 2rem 0.9rem;
  border-bottom: 1px solid var(--hairline);
}
.wordmark {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.45rem;
  letter-spacing: 0.01em;
}
.wordmark em { font-style: italic; font-weight: 500; color: var(--green); }
.topbar-rule { flex: 1; border-bottom: 1px solid var(--hairline); transform: translateY(-0.35em); }
.topbar-note {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

main { padding: 1.6rem 2rem 3rem; max-width: 1280px; margin: 0 auto; }

/* ── Дашборд ───────────────────────────────────────────── */
.dashboard {
  display: grid;
  grid-template-columns: minmax(260px, 5fr) 7fr;
  gap: 1.2rem;
  margin-bottom: 2.2rem;
}
.cards { display: flex; flex-direction: column; gap: 1.2rem; }

.card {
  background: var(--paper-card);
  border: 1px solid var(--hairline);
  border-top: 3px solid var(--green-soft);
  border-radius: 6px;
  padding: 0.9rem 1.2rem 0.8rem;
  box-shadow: 0 1px 2px rgba(32, 40, 31, 0.05), 0 6px 18px -12px rgba(32, 40, 31, 0.25);
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.card-label {
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.card-value {
  font-family: var(--serif);
  font-size: clamp(1.7rem, 3.2vw, 2.4rem);
  font-weight: 600;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.card-value small { font-size: 0.6em; font-weight: 500; }
.card-sub { font-size: 0.78rem; color: var(--ink-soft); }

.card-accent { background: linear-gradient(160deg, var(--green) 0%, var(--green-deep) 100%); border-color: var(--green-deep); border-top-color: #2e8a6a; }
.card-accent .card-label { color: var(--green-soft); }
.card-accent .card-value { color: var(--cream); }
.card-accent .card-sub { color: var(--green-soft); }

/* ── График ────────────────────────────────────────────── */
.chart-panel {
  background: var(--paper-card);
  border: 1px solid var(--hairline);
  border-radius: 6px;
  padding: 1.1rem 1.4rem 0.9rem;
  box-shadow: 0 1px 2px rgba(32, 40, 31, 0.05), 0 6px 18px -12px rgba(32, 40, 31, 0.25);
}
.panel-title {
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 0.9rem;
}
.chart {
  display: flex;
  align-items: stretch;
  gap: 0.45rem;
  height: 200px;
}
.chart-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 0.3rem;
  min-width: 0;
}
.chart-val {
  font-family: var(--mono);
  font-size: 0.62rem;
  color: var(--ink-soft);
  white-space: nowrap;
}
.chart-bar {
  width: 100%;
  max-width: 44px;
  background: linear-gradient(to top, #cfd9cd, #b9c9bd);
  border-radius: 3px 3px 0 0;
  transition: filter 0.15s ease;
}
.chart-col:hover .chart-bar { filter: brightness(0.92); }
.chart-bar.current { background: linear-gradient(to top, var(--green-deep), var(--green)); }
.chart-lbl {
  font-size: 0.7rem;
  color: var(--ink-soft);
  border-top: 1px solid var(--hairline);
  width: 100%;
  text-align: center;
  padding-top: 0.3rem;
}
.chart-lbl em { font-style: normal; font-family: var(--mono); font-size: 0.85em; display: block; }
.chart-lbl.current { color: var(--green); font-weight: 600; }

/* ── Журнал задач ──────────────────────────────────────── */
.ledger { margin-top: 0.5rem; }

.filters {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.filters select, .filters input, .filters button, .login input, .login button {
  font: inherit;
  font-size: 0.88rem;
  color: var(--ink);
  background: var(--paper-card);
  border: 1px solid var(--hairline);
  border-radius: 4px;
  padding: 0.42rem 0.65rem;
}
.filters select:focus, .filters input:focus, .login input:focus {
  outline: 2px solid var(--green-soft);
  outline-offset: 1px;
}
.filters button, .login button {
  background: var(--ink);
  color: var(--cream);
  border-color: var(--ink);
  cursor: pointer;
  letter-spacing: 0.04em;
}
.filters button:hover, .login button:hover { background: #000; }
.download {
  margin-left: auto;
  color: var(--green);
  font-weight: 500;
  text-decoration-color: var(--green-soft);
  text-underline-offset: 3px;
}
.download:hover { color: var(--green-deep); }

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.88rem;
  background: var(--paper-card);
  border: 1px solid var(--hairline);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(32, 40, 31, 0.05);
}
th, td { padding: 0.55rem 0.8rem; text-align: left; vertical-align: top; }
thead th {
  font-size: 0.68rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--ink);
  background: var(--cream);
}
tbody td { border-bottom: 1px solid var(--hairline); }
tbody tr:hover td { background: #f3efe3; }
td.num, th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
td.num { font-family: var(--mono); font-size: 0.82rem; }
td.mono { font-family: var(--mono); font-size: 0.82rem; white-space: nowrap; }
td.muted { color: var(--ink-soft); }
td.empty { text-align: center; color: var(--ink-soft); padding: 1.6rem; font-style: italic; }
/* Классическая двойная линия гроссбуха перед итогом */
tfoot td {
  font-weight: 600;
  border-top: 3px double var(--ink);
  background: var(--cream);
}
tfoot td.num { font-family: var(--mono); }

/* ── Логин ─────────────────────────────────────────────── */
.login {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  max-width: 320px;
  margin: 14vh auto 0;
  background: var(--paper-card);
  border: 1px solid var(--hairline);
  border-top: 3px solid var(--green);
  border-radius: 6px;
  padding: 1.6rem 1.8rem 1.8rem;
  box-shadow: 0 1px 2px rgba(32, 40, 31, 0.05), 0 14px 34px -18px rgba(32, 40, 31, 0.35);
}
.login-title { font-family: var(--serif); margin: 0 0 0.2rem; font-size: 1.3rem; }
.login label { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.82rem; color: var(--ink-soft); }
.login input { width: 100%; }
.error { color: #a32419; margin: 0; font-size: 0.85rem; }

/* ── Адаптив ───────────────────────────────────────────── */
@media (max-width: 880px) {
  main { padding: 1.2rem 1rem 2.4rem; }
  .topbar { padding: 1rem 1rem 0.8rem; }
  .dashboard { grid-template-columns: 1fr; }
  /* Две компактные карточки в ряд, акцентная «Заработано» — во всю ширину */
  .cards { flex-direction: row; flex-wrap: wrap; }
  .card { padding: 0.8rem 0.9rem; flex: 1 1 40%; }
  .card-accent { flex-basis: 100%; }
  .chart { height: 150px; gap: 0.3rem; }
  .chart-val { display: none; }
  .ledger { overflow-x: auto; }
}
