/* Сайт CODEGRID — тот же вид, что у программы: цвета, кнопки, поля, вкладки, панели (styles.css CODEGRID). */
:root {
  color-scheme: dark;
  --bg: #171b20; --panel: #20252c; --panel2: #252b33; --surface: #1c2128; --hover: #303842; --active: #354252;
  --border: #3a424d; --border-soft: #303740; --text: #edf1f5; --muted: #9aa6b5; --muted-2: #66717e;
  --accent: #4d8fe8; --accent-hover: #5e9df1; --accent2: #3d7fce; --danger: #e05b65; --warning: #e79b4a; --good: #55b889;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: #181a1f; color: var(--text); font-family: Inter, Segoe UI, Arial, sans-serif; font-size: 13px; }
a { color: #8fb8f0; text-decoration: none; }
a:hover { color: #b5d0f7; }
button, input, select, textarea { font: inherit; }
button, .btn { display: inline-flex; align-items: center; gap: 6px; color: var(--text); background: #30343d; border: 1px solid #444a56; border-radius: 5px; padding: 7px 11px; cursor: pointer; white-space: nowrap; line-height: 1.2; }
button:hover, .btn:hover { background: #3a3f49; color: var(--text); }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
button.primary, .btn.primary { background: var(--accent2); border-color: #4f97e2; }
button.primary:hover, .btn.primary:hover { background: var(--accent); }
button.danger { border-color: #714343; color: #ffcaca; }
button.danger:hover { background: #3d2a2c; }
input, select, textarea { width: 100%; background: #171a20; color: var(--text); border: 1px solid var(--border); border-radius: 4px; padding: 7px 8px; }
textarea { resize: vertical; }
input[type=checkbox] { width: auto; accent-color: var(--accent); }
input[type=file] { padding: 5px; }

/* каркас */
.app-shell { min-height: 100vh; display: grid; grid-template-rows: 48px auto 1fr 28px; }
.topbar { display: grid; grid-template-columns: 220px minmax(0, 1fr) auto; gap: 12px; align-items: center; height: 48px; padding: 0 12px 0 16px; background: #111318; border-bottom: 1px solid #333842; position: sticky; top: 0; z-index: 10; }
.brand { height: 48px; display: flex; align-items: center; gap: 8px; white-space: nowrap; font-weight: 800; letter-spacing: 1.8px; font-size: 17px; color: var(--text); }
.brand:hover { color: var(--text); }
.brand-name { display: block; line-height: 1; }
.app-version { font-size: 10px; letter-spacing: .6px; font-weight: 600; color: #8f98a6; background: #23272e; border: 1px solid #343944; border-radius: 3px; padding: 2px 5px; }
.project-title { justify-self: center; color: #c7ccd5; font-size: 13px; max-width: 520px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-actions { display: flex; align-items: center; gap: 8px; justify-self: end; }
.who { color: var(--muted); font-size: 12px; }
.tabs { display: flex; align-items: end; gap: 3px; padding: 6px 8px 0; background: #1c1f25; border-bottom: 1px solid #343944; overflow-x: auto; }
.tab { color: var(--text); background: #30343d; border: 1px solid #444a56; border-bottom-color: #343944; border-radius: 5px 5px 0 0; padding: 8px 17px; white-space: nowrap; }
.tab:hover { background: #3a3f49; color: var(--text); }
.tab.active { background: #2c313a; border-bottom-color: #2c313a; color: #fff; }
.work { padding: 18px 20px 30px; min-width: 0; }
.statusbar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 9px; background: #101217; border-top: 1px solid #313640; color: #959eab; font-size: 11px; }
.statusbar .r { justify-self: end; }
.statusbar a { color: #aab6c6; } .statusbar a:hover { color: #d5deea; }
.statusbar .legal, .statusbar .seller { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.statusbar .seller { padding: 0 12px; }
/* юридические страницы (оферта, персональные данные) — обычный читаемый текст */
.card.doc { max-width: 860px; margin: 0 auto 14px; padding: 18px 22px 20px; font-size: 14px; line-height: 1.55; color: #dfe4ea; }
.card.doc h1 { font-size: 20px; margin-bottom: 4px; }
.card.doc h2 { text-transform: none; letter-spacing: 0; font-size: 15px; font-weight: 700; color: var(--text); margin: 22px 0 8px; }
.card.doc p { margin: 0 0 8px; }
.card.doc ul { margin: 0 0 8px; padding-left: 22px; } .card.doc li { margin: 3px 0; }
.card.doc .tbl th { white-space: normal; width: 34%; font-size: 12px; vertical-align: top; }
.card.doc .tbl td { overflow-wrap: anywhere; }
.chk.oferta { margin: 6px 0 0; }
.row .chk.oferta { margin: 0; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; }
.row .chk.oferta > input[type=checkbox] { margin: 0; }

/* панели — как секции боковой панели программы */
h1 { font-size: 18px; font-weight: 700; margin: 0 0 14px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
h2, h3 { font-size: 11px; letter-spacing: .8px; text-transform: uppercase; color: #d7dbe2; font-weight: 600; margin: 0 0 10px; }
h3 { margin-top: 14px; color: #bbc1cb; }
.card { background: var(--panel); border: 1px solid #363b46; border-radius: 6px; padding: 12px 14px 14px; margin-bottom: 14px; min-width: 0; }
.card.narrow { max-width: 420px; margin: 40px auto; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 14px; align-items: start; }
.cols > .card { margin-bottom: 0; }
.cols + .card, .cols + section { margin-top: 14px; }
.row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 8px 0; }
.muted { color: var(--muted); }
.small { font-size: 11px; }
.mono { font-family: Consolas, 'Cascadia Mono', monospace; font-size: 12px; letter-spacing: .3px; }
.empty { color: var(--muted-2); padding: 14px; text-align: center; border: 1px dashed var(--border-soft); border-radius: 5px; }
.flash { background: #24476e; border: 1px solid #3c77b5; color: #e6f0fb; padding: 9px 12px; border-radius: 5px; margin-bottom: 14px; }
.inline { display: inline; margin: 0; }
form.inline.row { display: inline-flex; margin: 0; flex-wrap: nowrap; }
.row select, .row input { width: auto; }
td .row { margin: 0; }

/* формы */
.frm { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.frm.grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); align-items: end; }
.frm > button { justify-self: start; }
.fld { display: grid; gap: 5px; color: #bbc1cb; font-size: 12px; }
.chk { display: block; font-size: 13px; line-height: 1.45; color: #cbd3dd; }
.chk > input[type=checkbox] { margin: 0 8px 0 0; vertical-align: -2px; }
.search { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; align-items: center; }
.search input[name=q] { flex: 1 1 260px; width: auto; }
.search select, .search input[type=date] { width: auto; }
dl { display: grid; grid-template-columns: 150px 1fr; gap: 5px 10px; margin: 0 0 8px; }
dt { color: var(--muted); }
dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* таблицы — как списки программы */
.tbl { overflow-x: auto; border: 1px solid #333843; border-radius: 5px; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11px; letter-spacing: .5px; color: #aab3bf; font-weight: 600; background: #23272e; padding: 7px 9px; border-bottom: 1px solid #343944; white-space: nowrap; }
td { padding: 7px 9px; border-bottom: 1px solid #2a2f37; vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #2a2e36; }

/* метки — как .tag программы */
.badge { display: inline-block; min-width: 22px; padding: 2px 6px; border-radius: 3px; background: #3c424d; color: #dce1e8; font-size: 10.5px; white-space: nowrap; font-weight: 500; vertical-align: middle; }
.badge.good { background: #24503d; color: #cdf3df; }
.badge.warn { background: #5b4b26; color: #ffe6c2; }
.badge.bad { background: #5a2a2f; color: #ffd3d6; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.dot.bad { background: var(--danger); }

/* обзор */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.stat { display: grid; gap: 3px; padding: 12px 14px; background: #181b21; border: 1px solid #333843; border-radius: 5px; color: var(--text); }
.stat:hover { border-color: #3c77b5; color: var(--text); }
.stat b { font-size: 24px; font-weight: 700; }
.stat span { color: var(--muted); font-size: 12px; }

/* компьютеры лицензии */
.pc { border: 1px solid #333843; border-radius: 5px; padding: 9px 10px; margin-bottom: 8px; background: #1c2128; }
.pc.unbound { opacity: .6; }
.pc-h { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; flex-wrap: wrap; }
.pc-h form { margin-left: auto; }
.pc dl { grid-template-columns: 130px 1fr; }
.key { white-space: pre-wrap; background: #171a20; border: 1px solid var(--border); border-radius: 4px; padding: 8px; font-size: 11px; color: #c7ccd5; }

/* загрузка файла */
.bar { height: 4px; background: #171a20; border-radius: 2px; overflow: hidden; grid-column: 1 / -1; display: none; }
.bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.bar.on { display: block; }

/* главная */
.hero { max-width: 720px; margin: 60px auto; text-align: center; }
.hero h1 { font-size: 34px; letter-spacing: 3px; font-weight: 800; justify-content: center; }
.hero p { color: #c7ccd5; font-size: 15px; line-height: 1.5; }
.hero .row { justify-content: center; margin-top: 22px; }

@media (max-width: 700px) {
  .topbar { grid-template-columns: auto 1fr; }
  .project-title { display: none; }
  .who { display: none; }
  .work { padding: 12px; }
  dl, .pc dl { grid-template-columns: 1fr; }
  .card.narrow { margin: 16px auto; }
  .card { padding: 12px; }
  input, select, textarea { font-size: 16px; }
  .card.doc { padding: 14px 12px; font-size: 14px; }
}
@media (max-width: 960px) { .statusbar { grid-template-columns: 1fr auto; } .statusbar .seller { display: none; } }
h2.acc { text-transform: none; letter-spacing: 0; font-size: 13px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.break { overflow-wrap: anywhere; word-break: break-all; }
span.bad { color: #ff9ea6; }
details { margin: 4px 0 0; } details summary { cursor: pointer; margin-bottom: 8px; } details[open] { display: grid; gap: 10px; }
