:root {
  --ink: #17211b;
  --muted: #66736b;
  --paper: #f5f0e6;
  --card: rgba(255, 252, 243, 0.88);
  --card-solid: #fffaf0;
  --line: rgba(30, 50, 39, 0.16);
  --line-strong: rgba(30, 50, 39, 0.24);
  --accent: #bf5b2c;
  --accent-2: #1f7a64;
  --shadow: 0 24px 80px rgba(30, 50, 39, 0.18);
  --shadow-soft: 0 18px 50px rgba(30, 50, 39, 0.12);
  font-family: ui-serif, Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 14% 12%, rgba(191, 91, 44, 0.16), transparent 30rem),
    radial-gradient(circle at 82% 6%, rgba(31, 122, 100, 0.14), transparent 24rem),
    linear-gradient(135deg, #f8f1df, #e9f0e5 58%, #f5e7d9);
}

.grid-noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.28;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, black, transparent 78%);
}

a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 24px;
  justify-content: space-between;
  padding: 18px clamp(20px, 5vw, 64px);
  backdrop-filter: blur(18px);
  background: rgba(245, 240, 230, 0.72);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  letter-spacing: 0.08em;
}
.brand small { display: block; color: var(--muted); font-size: 12px; }
.nav-links {
  display: flex;
  gap: 8px;
  padding: 5px;
  border: 1px solid rgba(30, 50, 39, 0.1);
  border-radius: 999px;
  background: rgba(255, 252, 243, 0.34);
  color: var(--muted);
}
.nav-links a {
  position: relative;
  padding: 9px 16px;
  border-radius: 999px;
  transition: color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}
.nav-links a:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.38);
}
.nav-links a.is-active {
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(255, 252, 243, 0.48));
  box-shadow:
    0 12px 28px rgba(30, 50, 39, 0.13),
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    inset 0 -1px 0 rgba(30, 50, 39, 0.06);
  backdrop-filter: blur(14px);
}

.page-frame { width: min(1180px, calc(100% - 32px)); margin: 36px auto 64px; position: relative; }
.login-hero { display: grid; grid-template-columns: 1.1fr 420px; gap: 42px; align-items: center; min-height: 70vh; }
.hero-copy h1, .section-heading h1 { font-size: clamp(42px, 7vw, 92px); line-height: 0.92; margin: 0 0 18px; letter-spacing: -0.06em; }
.hero-copy p, .section-heading p { color: var(--muted); font-size: 18px; line-height: 1.7; }
.eyebrow { color: var(--accent); text-transform: uppercase; letter-spacing: 0.18em; font-size: 12px; font-weight: 700; }

.glass-card, .metric-card {
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}
.login-card, .form-card, .list-card { padding: 28px; }
.list-card, .recent-card { padding: 0; overflow: hidden; }
.login-card { transform: rotate(1.2deg); }
.login-card h2, .glass-card h2 { margin-top: 0; font-size: 30px; }

label, .task-form { display: grid; gap: 10px; }
.login-card label { margin-bottom: 16px; color: var(--muted); }
input, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--ink);
  outline: none;
}
input:focus, select:focus { border-color: var(--accent-2); box-shadow: 0 0 0 4px rgba(31, 122, 100, 0.12); }

.primary-button, .ghost-button {
  border: 0;
  border-radius: 999px;
  padding: 12px 19px;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}
.primary-button { background: var(--ink); color: var(--paper); box-shadow: 0 12px 30px rgba(23, 33, 27, 0.24); }
.ghost-button { border: 1px solid var(--line); background: rgba(255, 255, 255, 0.42); color: var(--ink); }
.primary-button:hover, .ghost-button:hover { transform: translateY(-1px); }
.hint { color: var(--muted); font-size: 13px; }

.dashboard, .tasks-layout { display: grid; gap: 24px; }
.tasks-layout { gap: 28px; }
.compact h1 { font-size: clamp(40px, 5vw, 72px); }
.metric-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.metric-card { padding: 24px; }
.metric-card span { color: var(--muted); }
.metric-card strong { display: block; margin-top: 10px; font-size: 42px; }
.recent-card {
  border-radius: 28px;
  background: var(--card);
  box-shadow: var(--shadow);
}
.recent-header {
  grid-template-columns: 1fr;
  align-items: start;
  gap: 14px;
}
.recent-header h2 { margin-bottom: 0; }
.recent-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.card-header {
  display: flex;
  grid-template-columns: minmax(220px, 0.85fr) minmax(0, 1.6fr);
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 30px 32px 22px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(255, 252, 243, 0.96), rgba(246, 239, 224, 0.72)),
    var(--card-solid);
}
.task-panel-heading h2 { margin-bottom: 8px; }
.card-subtitle { max-width: 360px; margin: 0; color: var(--muted); line-height: 1.7; }
.task-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 18px;
}
.table-wrap { overflow-x: auto; padding: 0 22px; background: rgba(255, 252, 243, 0.66); }
table { width: 100%; min-width: 860px; border-collapse: separate; border-spacing: 0; }
thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(255, 252, 243, 0.94);
}
th, td {
  padding: 17px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
tbody tr { transition: background 140ms ease; }
tbody tr:hover { background: rgba(31, 122, 100, 0.055); }
th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
td { font-size: 14px; line-height: 1.55; }
td:nth-child(1), td:nth-child(2), td:nth-child(4), td:nth-child(5), td:nth-child(6) {
  font-weight: 700;
}
td:nth-child(3) { word-break: break-all; }
.task-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.task-form label span, .filters label span {
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.04em;
}
.filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(130px, 1fr)) auto;
  align-items: end;
  gap: 12px;
}
.filters label { gap: 7px; }
.filters input { min-width: 0; }
.task-actions { display: flex; justify-content: flex-end; }
.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 20px 32px 28px;
  background: rgba(255, 252, 243, 0.66);
}
.pagination span { color: var(--muted); font-size: 14px; }
.toast { position: fixed; right: 24px; bottom: 24px; max-width: 360px; padding: 14px 16px; border-radius: 16px; background: var(--ink); color: var(--paper); box-shadow: var(--shadow); }

.task-modal {
  width: min(760px, calc(100% - 32px));
  border: 1px solid var(--line);
  border-radius: 30px;
  padding: 28px;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 0%, rgba(191, 91, 44, 0.16), transparent 18rem),
    rgba(255, 252, 243, 0.96);
  box-shadow: var(--shadow);
}

.task-modal::backdrop {
  background: rgba(23, 33, 27, 0.46);
  backdrop-filter: blur(8px);
}

.modal-header, .modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.modal-header { margin-bottom: 20px; }
.modal-header h2 { margin: 0; font-size: 36px; }
.modal-actions { grid-column: 1 / -1; justify-content: flex-end; margin-top: 8px; }

.icon-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.52);
  color: var(--ink);
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.modal-error {
  margin: 0 0 18px;
  padding: 12px 14px;
  border: 1px solid rgba(191, 91, 44, 0.28);
  border-radius: 16px;
  background: rgba(191, 91, 44, 0.12);
  color: #7d2e15;
}

@media (max-width: 820px) {
  .login-hero, .metric-grid { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .task-form { grid-template-columns: 1fr; }
  .card-header { align-items: flex-start; flex-direction: column; }
  .card-header, .task-toolbar, .filters { grid-template-columns: 1fr; }
  .task-actions, .filters { width: 100%; }
  .filters input { width: 100%; }
}
