:root {
  --bg: #f4f1ea;
  --surface: #ffffff;
  --surface-alt: #ece7dc;
  --ink: #1e252b;
  --muted: #5e6a73;
  --line: #d8d1c4;
  --accent: #1f5c5b;
  --accent-dark: #174544;
  --accent-soft: #e3efee;
  --steel: #2f3b45;
  --copper: #b56a3a;
  --danger: #a33a2b;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(30, 37, 43, 0.08);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Segoe UI Variable Text", "Segoe UI", "Trebuchet MS", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 400px at 10% -10%, #e7efe8 0%, transparent 60%),
    radial-gradient(900px 300px at 100% 0%, #efe6d8 0%, transparent 55%),
    var(--bg);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); }
img { max-width: 100%; display: block; }

.container { width: min(1440px, 92vw); margin: 0 auto; }
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(244, 241, 234, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(216, 209, 196, 0.7);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 0.85rem 0;
}
.brand {
  display: flex; align-items: center; gap: 0.7rem;
  font-weight: 700; letter-spacing: 0.02em; color: var(--steel);
}
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(145deg, var(--steel), #455564);
  color: #fff; display: grid; place-items: center;
  font-size: 0.85rem; font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.15);
}
.brand span { display: block; font-size: 0.7rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.main-nav { display: flex; align-items: center; gap: 0.25rem; flex-wrap: wrap; }
.main-nav a {
  padding: 0.45rem 0.7rem; border-radius: 8px; color: var(--steel);
  font-size: 0.95rem; font-weight: 500;
}
.main-nav a:hover, .main-nav a.active { background: var(--surface-alt); color: var(--ink); }
.nav-actions { display: flex; align-items: center; gap: 0.5rem; }
.burger {
  display: none; border: 1px solid var(--line); background: var(--surface);
  border-radius: 8px; width: 38px; height: 38px; padding: 8px; cursor: pointer;
}
.burger span { display: block; height: 2px; background: var(--steel); margin: 4px 0; border-radius: 2px; }

.btn, button.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: 0.55rem 0.95rem; border-radius: 9px; border: 1px solid transparent;
  font: inherit; font-weight: 600; cursor: pointer; transition: .15s ease;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); color: #fff; }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--steel); }
.btn-ghost:hover { background: var(--surface-alt); }
.btn-small { padding: 0.35rem 0.65rem; font-size: 0.9rem; }

.page { padding: 2rem 0 3rem; flex: 1 0 auto; }
.page-header { margin-bottom: 1.5rem; }
.page-header h1 { margin: 0 0 .25rem; font-size: clamp(1.6rem, 2.5vw, 2.1rem); letter-spacing: -0.02em; }
.page-header p { margin: 0; color: var(--muted); }
.eyebrow { color: var(--copper); font-weight: 700; font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; margin-bottom: .3rem; }

.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.1rem 1.2rem; box-shadow: var(--shadow);
}
.card h2, .card h3 { margin: 0 0 .4rem; font-size: 1.1rem; }
.card p { margin: 0.2rem 0; color: var(--muted); }
.stat { font-size: 1.8rem; font-weight: 700; color: var(--steel); margin: .2rem 0; }
.muted { color: var(--muted); }
.tag {
  display: inline-block; padding: .15rem .55rem; border-radius: 999px;
  font-size: .78rem; font-weight: 600; background: var(--accent-soft); color: var(--accent-dark);
}
.tag.warn { background: #f6e7d8; color: #8a4b22; }
.tag.steel { background: #e6eaee; color: var(--steel); }

.hero {
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 1.2rem; align-items: stretch;
  margin-bottom: 1.5rem;
}
.hero-main {
  background: linear-gradient(135deg, var(--steel), #3f5160);
  color: #f7f4ee; border: none; padding: 1.6rem 1.7rem;
}
.hero-main h1 { margin: .2rem 0 .6rem; font-size: clamp(1.8rem, 3vw, 2.4rem); color: #fff; }
.hero-main p { color: #d8e0e6; max-width: 60ch; }
.hero-meta { display: flex; gap: 1.2rem; margin-top: 1.2rem; flex-wrap: wrap; }
.hero-meta div { font-size: .9rem; color: #c7d2db; }
.hero-meta strong { display: block; color: #fff; font-size: 1.1rem; }

.list { list-style: none; padding: 0; margin: 0; }
.list li { padding: .7rem 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list-title { font-weight: 600; color: var(--ink); }
.list-meta { font-size: .9rem; color: var(--muted); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .75rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
tr:hover td { background: #faf8f3; }

.section-title { margin: 1.6rem 0 .7rem; font-size: 1.15rem; }
.split { display: grid; grid-template-columns: 2fr 1fr; gap: 1rem; }
.home-layout { grid-template-columns: 1fr; }
.quick-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

form .field { margin-bottom: .9rem; }
label { display: block; font-weight: 600; margin-bottom: .25rem; color: var(--steel); }
input[type="text"], input[type="email"], input[type="password"], select, textarea {
  width: 100%; padding: .65rem .75rem; border: 1px solid var(--line);
  border-radius: 9px; font: inherit; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid #cfe0df; border-color: var(--accent); }
.form-card { max-width: 420px; margin: 2rem auto; }
.alert { padding: .7rem .85rem; border-radius: 9px; margin-bottom: .9rem; }
.alert-error { background: #f8e6e3; color: var(--danger); border: 1px solid #edc7c1; }
.inline-form { display: inline; }

.profile-head { display: flex; gap: 1rem; align-items: center; margin-bottom: 1rem; }
.avatar {
  width: 64px; height: 64px; border-radius: 16px; background: var(--surface-alt);
  display: grid; place-items: center; font-weight: 700; color: var(--steel); font-size: 1.2rem;
}
.kv { display: grid; grid-template-columns: 160px 1fr; gap: .4rem .8rem; }
.kv div:nth-child(odd) { color: var(--muted); font-size: .9rem; }

.news-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.news-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.news-cover { aspect-ratio: 16 / 9; overflow: hidden; background: var(--surface-alt); }
.news-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s ease; }
.news-card:hover .news-cover img { transform: scale(1.04); }
.news-body { padding: 1rem 1.2rem 1.2rem; }
.news-body h3 { margin-top: .4rem; }

.doc-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.task-row { display: flex; justify-content: space-between; gap: .8rem; align-items: start; }
.task-side { text-align: right; }
.tasks-card .list li { padding: 1.25rem 0; }
.tasks-card .list-title { font-size: 1.15rem; }
.tasks-card .list-meta { font-size: 1rem; line-height: 1.7; }
.tasks-card .list-title + .list-meta { margin-top: .35rem; }
.tasks-card .list-meta + .list-meta { margin-top: .25rem; }
.tasks-card .tag { font-size: .95rem; padding: .3rem .8rem; }
.task-done { opacity: 0.7; }
.task-done .list-title { text-decoration: line-through; }

.site-footer { border-top: 1px solid var(--line); padding: 1.2rem 0 2rem; color: var(--muted); font-size: .9rem; margin-top: auto; }

@media (max-width: 900px) {
  .hero, .split, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .quick-grid { grid-template-columns: 1fr; }
  .news-grid { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .burger { display: inline-block; }
  .main-nav {
    display: none; position: absolute; left: 4vw; right: 4vw; top: calc(100% - 4px);
    flex-direction: column; align-items: stretch; background: var(--surface);
    border: 1px solid var(--line); border-radius: 12px; padding: .5rem; box-shadow: var(--shadow);
  }
  .main-nav.open { display: flex; }
  .main-nav a { padding: .65rem .75rem; }
  .nav-actions .user-label { display: none; }
  .header-inner { position: relative; }
  th.hide-sm, td.hide-sm { display: none; }
  .kv { grid-template-columns: 1fr; }
}
@media (max-width: 550px) {
  .tasks-card .task-row { flex-direction: column; }
  .tasks-card .task-side { order: -1; text-align: left; margin-bottom: .4rem; }
}
@media (max-width: 350px) {
  .brand-name { display: none; }
}
