:root {
  --bg: #f4f6f9;
  --card: #ffffff;
  --ink: #1c2430;
  --muted: #6b7683;
  --line: #dde3ea;
  --accent: #1f5fa9;
  --danger: #c0392b;
}
* { box-sizing: border-box; }
/* Атрибут hidden должен перекрывать любые display из классов ниже. */
[hidden] { display: none !important; }
body {
  margin: 0;
  font: 15px/1.5 -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
}
.screen { min-height: 100vh; }
.muted { color: var(--muted); }
.error { color: var(--danger); }
.spacer { flex: 1; }

header {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 20px; background: var(--card); border-bottom: 1px solid var(--line);
}
main { display: flex; gap: 16px; padding: 16px 20px; align-items: flex-start; flex-wrap: wrap; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 16px; }
.grow { flex: 1; min-width: 480px; }
aside { width: 300px; }
h1, h2, h3 { margin: 0 0 12px; font-size: 18px; }
h1 { font-size: 22px; }
h3 { font-size: 15px; margin-top: 16px; }

.auth { width: 340px; margin: 12vh auto; }
.public-link { text-align: center; margin: 16px 0 0; }
.public-link a { color: var(--accent); }
label { display: block; margin-bottom: 12px; font-size: 13px; color: var(--muted); }
input, select, textarea {
  width: 100%; margin-top: 4px; padding: 8px 10px; font: inherit;
  border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink);
}
label.inline { display: flex; align-items: center; gap: 6px; margin: 0; white-space: nowrap; }
label.inline input { width: auto; margin: 0; }
button, .ghost {
  padding: 8px 14px; font: inherit; border-radius: 6px; cursor: pointer;
  border: 1px solid var(--accent); background: var(--accent); color: #fff; text-decoration: none;
}
.ghost { background: transparent; color: var(--accent); }

.stats { display: flex; gap: 12px; padding: 16px 20px 0; flex-wrap: wrap; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 10px 16px; }
.stat b { display: block; font-size: 22px; }

.toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.toolbar input, .toolbar select { width: auto; margin: 0; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); font-size: 14px; }
th { color: var(--muted); font-weight: 500; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: #f7f9fc; }
.badge { padding: 2px 8px; border-radius: 10px; font-size: 12px; background: #eef2f7; }
.badge.critical, .badge.overdue { background: #fbe6e3; color: var(--danger); }
.badge.high { background: #fdf1e0; color: #9a5b12; }

.tabs { display: flex; gap: 8px; padding: 16px 20px 0; }
.tab {
  background: transparent; color: var(--muted); border: 1px solid transparent;
  border-bottom: 2px solid transparent; border-radius: 6px 6px 0 0;
}
.tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

.attach-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.attach-row input[type="file"] { width: auto; margin: 0; border: none; padding: 0; }
.file { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.file a { color: var(--accent); }

.article { border-bottom: 1px solid var(--line); padding: 10px 0; }
.article h4 { margin: 0 0 4px; font-size: 15px; }
.article-body { white-space: pre-wrap; margin: 6px 0 0; }

.status-item { border-bottom: 1px solid var(--line); padding: 10px 0; }
.status-item .status-name { width: 200px; margin: 0; }
.status-item .status-position { width: 80px; margin: 0; }
.status-item .attach-row { margin-bottom: 4px; }

.modal {
  position: fixed; inset: 0; background: rgba(20, 28, 38, .45);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal-body { width: 640px; max-height: 84vh; overflow: auto; }
.comment { border-left: 3px solid var(--line); padding: 4px 0 4px 10px; margin-bottom: 10px; }
.comment.internal { border-color: #d9a441; background: #fffaf0; }
.staff-controls { display: flex; gap: 8px; margin: 12px 0; }
.staff-controls select { width: auto; margin: 0; }

.product-page { background: #f5f7fb; }
.product-header { position: sticky; top: 0; z-index: 2; }
.product-main { display: block; max-width: 1120px; margin: 0 auto; padding: 0 24px 56px; }
.product-hero { padding: 76px 0 64px; max-width: 820px; }
.product-hero h1 { font-size: clamp(34px, 6vw, 58px); line-height: 1.08; margin-bottom: 22px; }
.eyebrow { color: var(--accent); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.product-lead { font-size: 20px; color: var(--muted); max-width: 760px; }
.product-actions { display: flex; gap: 10px; margin-top: 28px; flex-wrap: wrap; }
.primary-link { padding: 9px 15px; border-radius: 6px; background: var(--accent); color: #fff; text-decoration: none; }
.product-section { padding: 28px 0; }
.product-section > h2, .split-section h2 { font-size: 26px; }
.feature-grid, .pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.feature-grid .card, .pricing-grid .card { min-height: 138px; }
.feature-grid p, .pricing-grid p { margin-bottom: 0; }
.split-section { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; align-items: start; }
.legal-card { border-top: 4px solid var(--accent); }
.company-activity { font-size: 16px; }
.price { font-size: 25px; font-weight: 700; color: var(--accent); }
.contact-card { margin-top: 24px; padding: 28px; border-radius: 10px; background: #eaf2fc; }
.contact-card a { color: var(--accent); font-weight: 600; }
.documentation-main { padding-top: 56px; max-width: 820px; }
.documentation-main h1 { font-size: 38px; }
.document-list { list-style: none; padding: 0; display: grid; gap: 10px; }
.document-list a { display: block; padding: 15px 18px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--accent); text-decoration: none; }
.document-list a:hover { border-color: var(--accent); }

@media (max-width: 820px) {
  aside, .grow { width: 100%; min-width: 0; }
  .feature-grid, .pricing-grid, .split-section { grid-template-columns: 1fr; }
  .product-main { padding-inline: 18px; }
  .product-hero { padding: 48px 0 36px; }
}
