/* MaraCraft CMS + CRM — DashStack Dark, акцент Tiffany #37BEB0 */
@font-face { font-family: "Nunito Sans"; src: url("/static/fonts/NunitoSans-Variable.ttf") format("truetype"); font-weight: 200 900; font-style: normal; font-display: swap; }
:root {
  --bg: #1B2431; --card: #273142; --card-2: #313D4F; --border: #313D4F; --border-2: #3A4659;
  --text: #FFFFFF; --muted: #A0AEC0; --accent: #37BEB0; --accent-soft: rgba(55,190,176,.16);
  --ink: #082032; --success: #00B69B; --warning: #FFA756; --danger: #F93C65; --radius: 14px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { background: var(--bg); color: var(--text); font-family: "Nunito Sans", system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased; min-height: 100vh; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
svg.i { width: 20px; height: 20px; flex: 0 0 auto; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- каркас ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 240px; flex: 0 0 240px; background: var(--card); border-right: 1px solid var(--border-2); padding: 18px 16px 20px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; z-index: 30; }
.brand { padding: 6px 4px 20px; display: block; }
.brand img { width: 208px; height: auto; display: block; }
.nav { display: flex; flex-direction: column; gap: 3px; }
.nav-label { font-size: 11px; font-weight: 800; letter-spacing: .08em; color: var(--muted); opacity: .75; padding: 14px 16px 6px; text-transform: uppercase; }
.nav a { display: flex; align-items: center; gap: 12px; height: 42px; padding: 0 14px; border-radius: 10px; color: var(--muted); font-size: 14px; font-weight: 600; text-decoration: none; }
.nav a:hover { background: var(--card-2); color: var(--text); }
.nav a.active { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.nav .count { margin-left: auto; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: var(--ink); font-size: 11px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.side-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--border-2); display: flex; flex-direction: column; gap: 8px; }
.side-foot .logout { background: none; border: 0; color: var(--muted); font: inherit; font-weight: 600; display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 14px; border-radius: 10px; cursor: pointer; width: 100%; }
.side-foot .logout:hover { background: var(--card-2); color: var(--text); }
.side-foot .ver { font-size: 11px; color: var(--muted); padding: 0 14px; opacity: .8; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 72px; flex: 0 0 72px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 32px; background: var(--card); border-bottom: 1px solid var(--border-2); position: sticky; top: 0; z-index: 20; }
.site { display: flex; align-items: center; gap: 16px; min-width: 0; }
.site-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.site-name { font-size: 18px; font-weight: 800; }
.site-dot { color: var(--muted); font-weight: 700; margin: 0 6px; }
.site-dom { font-size: 15px; font-weight: 600; color: var(--muted); }
.profile { display: flex; align-items: center; gap: 16px; }
.lic-pill { height: 28px; padding: 0 12px; border-radius: 999px; font-size: 12px; font-weight: 800; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.lic-active { background: rgba(0,182,155,.16); color: var(--success); }
.lic-grace { background: rgba(255,167,86,.16); color: var(--warning); }
.lic-readonly { background: rgba(249,60,101,.16); color: var(--danger); }
.user { display: flex; align-items: center; gap: 12px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: var(--ink); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px; flex: 0 0 40px; }
.who { display: flex; flex-direction: column; gap: 1px; }
.who strong { font-size: 14px; font-weight: 700; white-space: nowrap; }
.who span { font-size: 12px; color: var(--muted); }
.burger { display: none; width: 40px; height: 40px; border-radius: 10px; background: var(--card-2); color: var(--text); align-items: center; justify-content: center; cursor: pointer; flex: 0 0 40px; }
#nav-toggle { position: absolute; opacity: 0; pointer-events: none; }
.scrim { display: none; }
.content { flex: 1; padding: 28px 32px 40px; display: flex; flex-direction: column; gap: 24px; min-width: 0; }

/* ---------- заголовки, кнопки ---------- */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-title h1 { font-size: 28px; font-weight: 800; line-height: 1.15; }
.page-title p { margin-top: 4px; font-size: 14px; color: var(--muted); }
.head-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 18px; border-radius: 8px; border: 0; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; white-space: nowrap; text-decoration: none !important; }
.btn svg.i { width: 16px; height: 16px; }
.btn-primary { background: var(--accent); color: var(--ink); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-secondary { background: transparent; color: var(--accent); border: 1.5px solid var(--accent); }
.btn-secondary:hover { background: var(--accent-soft); }
.btn-ghost { background: var(--card-2); color: var(--text); }
.btn-ghost:hover { background: #3A4659; }
.btn-danger { background: transparent; color: var(--danger); border: 1.5px solid rgba(249,60,101,.6); }
.btn-danger:hover { background: rgba(249,60,101,.12); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.ico-btn { width: 32px; height: 32px; border-radius: 8px; background: var(--card-2); color: var(--muted); display: inline-flex; align-items: center; justify-content: center; flex: 0 0 32px; border: 0; cursor: pointer; }
.ico-btn:hover { color: var(--text); background: #3A4659; }
.ico-btn svg.i { width: 16px; height: 16px; }
.eye-btn { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--border-2); background: var(--bg); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--muted); }
.eye-btn.on { color: var(--accent); border-color: rgba(55,190,176,.45); background: var(--accent-soft); }
.eye-btn svg.i { width: 18px; height: 18px; }
form.inline { display: inline-flex; margin: 0; }

/* ---------- карточки, статистика ---------- */
.card { background: var(--card); border: 1px solid var(--border-2); border-radius: var(--radius); min-width: 0; }
.card-pad { padding: 20px 24px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head h2 { font-size: 18px; font-weight: 800; }
.card-head p { color: var(--muted); font-size: 13px; }
.stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 20px; }
.stat { background: var(--card); border: 1px solid var(--border-2); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 12px; color: var(--text); text-decoration: none !important; }
a.stat:hover { border-color: rgba(55,190,176,.5); }
.stat-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.stat-top span { font-size: 14px; font-weight: 600; color: var(--muted); }
.stat-ico { width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); display: flex; align-items: center; justify-content: center; color: var(--accent); flex: 0 0 44px; }
.stat-ico.warn { background: rgba(255,167,86,.16); color: var(--warning); }
.stat strong { font-size: 28px; font-weight: 800; line-height: 1; }
.stat em { font-size: 13px; font-weight: 600; color: var(--accent); font-style: normal; }
.stat em.warn { color: var(--warning); }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.cols-wide { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.list { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border-2); }
.row:last-child { border-bottom: 0; }
.row .grow { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.row .grow b { font-size: 14px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .grow span { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .date { font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.empty { color: var(--muted); padding: 18px 0; font-size: 14px; }
.badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-info { background: rgba(55,190,176,.18); color: var(--accent); }
.badge-success { background: rgba(0,182,155,.18); color: var(--success); }
.badge-warning { background: rgba(255,167,86,.18); color: var(--warning); }
.badge-danger { background: rgba(249,60,101,.18); color: var(--danger); }
.badge-muted { background: var(--card-2); color: var(--muted); }
.lic-box { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.lic-box .grow { display: flex; flex-direction: column; gap: 4px; }
.lic-box b { font-size: 16px; }
.lic-box span { color: var(--muted); font-size: 13px; }

/* ---------- уведомления ---------- */
.alert { border-radius: 12px; padding: 14px 18px; display: flex; gap: 12px; align-items: flex-start; font-weight: 600; border: 1px solid; }
.alert svg.i { margin-top: 1px; }
.alert-ok { background: rgba(0,182,155,.12); border-color: rgba(0,182,155,.4); color: #7FE3D0; }
.alert-warn { background: rgba(255,167,86,.12); border-color: rgba(255,167,86,.45); color: #FFD1A6; }
.alert-danger { background: rgba(249,60,101,.12); border-color: rgba(249,60,101,.45); color: #FFB3C4; }
.alert b { color: var(--text); }

/* ---------- таблицы ---------- */
.table-wrap { width: 100%; overflow-x: auto; }
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; }
.tbl th { text-align: left; font-size: 12px; font-weight: 700; color: var(--muted); padding: 10px 12px; background: var(--card-2); text-transform: uppercase; letter-spacing: .03em; white-space: nowrap; }
.tbl th:first-child { border-radius: 8px 0 0 8px; }
.tbl th:last-child { border-radius: 0 8px 8px 0; }
.tbl td { padding: 12px; font-size: 13px; font-weight: 600; border-bottom: 1px solid var(--border-2); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td .sub { display: block; font-size: 12px; color: var(--muted); font-weight: 500; margin-top: 2px; word-break: break-all; }
.tbl td b { font-weight: 700; }
.tbl .acts { display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
.tbl tr.off td:not(.keep) { opacity: .55; }
.tree-name { display: flex; align-items: center; gap: 8px; }
.tree-name .ind { display: inline-block; flex: 0 0 auto; }
.d1 .ind { width: 22px; } .d2 .ind { width: 44px; } .d3 .ind { width: 66px; } .d4 .ind { width: 88px; }
.tree-name svg.i { width: 16px; height: 16px; color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }

/* ---------- дерево разделов ---------- */
.split { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 24px; align-items: start; }
.tree { display: flex; flex-direction: column; gap: 2px; }
.tree a { display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 6px 10px; border-radius: 8px; color: var(--text); font-weight: 600; font-size: 13px; text-decoration: none; }
.tree a:hover { background: var(--card-2); }
.tree a.sel { background: var(--accent-soft); color: var(--accent); }
.tree a .n { margin-left: auto; font-size: 11px; color: var(--muted); font-weight: 700; }
.tree a svg.i { width: 16px; height: 16px; color: var(--muted); }
.tree a.sel svg.i { color: var(--accent); }
.tree .t1 { padding-left: 30px; } .tree .t2 { padding-left: 50px; } .tree .t3 { padding-left: 70px; }
.hint { margin-top: 14px; font-size: 12px; color: var(--muted); background: var(--bg); border-radius: 10px; padding: 12px; line-height: 1.5; }

/* ---------- формы ---------- */
.form-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.fields .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field .lab { font-size: 13px; font-weight: 700; display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.field .lab small, .field > label small { font-weight: 600; color: var(--muted); font-size: 12px; }
.field .help { font-size: 12px; color: var(--muted); }
.field .err { font-size: 12px; color: var(--danger); font-weight: 700; }
.input, .field input[type=text], .field input[type=email], .field input[type=password], .field input[type=number], .field input[type=date], .field input[type=url], .field select, .field textarea {
  width: 100%; min-height: 42px; border-radius: 8px; background: var(--bg); border: 1px solid var(--border-2); color: var(--text); font: inherit; font-size: 14px; font-weight: 500; padding: 9px 12px; outline: none; }
.field textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.field textarea.tall { min-height: 220px; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(55,190,176,.18); }
.field.has-err input, .field.has-err textarea, .field.has-err select { border-color: var(--danger); }
.field input[readonly] { color: var(--muted); }
.check { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.form-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.sticky-actions { position: sticky; bottom: 0; background: linear-gradient(180deg, rgba(27,36,49,0) 0%, var(--bg) 35%); padding: 18px 0 4px; }
.section-title { font-size: 16px; font-weight: 800; margin-bottom: 14px; display: flex; align-items: center; gap: 10px; }
.section-title .tag { height: 22px; padding: 0 8px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); font-size: 11px; font-weight: 800; display: inline-flex; align-items: center; }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toolbar .input { width: 260px; min-height: 36px; padding: 6px 12px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { height: 32px; padding: 0 14px; border-radius: 999px; background: var(--card-2); color: var(--muted); font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; border: 1px solid transparent; text-decoration: none !important; white-space: nowrap; }
.chip:hover { color: var(--text); }
.chip.on { background: var(--accent-soft); color: var(--accent); border-color: rgba(55,190,176,.35); }
.chip i { font-style: normal; opacity: .75; }

/* Умное SEO */
.seo-box { display: flex; flex-direction: column; gap: 16px; }
.meter-row { display: flex; flex-direction: column; gap: 6px; }
.meter-row .top { display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; color: var(--muted); }
.meter-row .top b { color: var(--text); }
.meter-row .top .ok { color: var(--success); } .meter-row .top .warn { color: var(--warning); } .meter-row .top .empty { color: var(--danger); }
progress.len { width: 100%; height: 6px; appearance: none; -webkit-appearance: none; border: 0; border-radius: 999px; background: var(--card-2); overflow: hidden; }
progress.len::-webkit-progress-bar { background: var(--card-2); border-radius: 999px; }
progress.len::-webkit-progress-value { background: var(--accent); border-radius: 999px; }
progress.len::-moz-progress-bar { background: var(--accent); }
progress.len.warn::-webkit-progress-value { background: var(--warning); } progress.len.warn::-moz-progress-bar { background: var(--warning); }
.snippet { background: #fff; color: #202124; border-radius: 10px; padding: 14px 16px; font-family: Arial, sans-serif; }
.snippet .u { font-size: 12px; color: #4d5156; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.snippet .t { font-size: 17px; color: #1a0dab; margin: 4px 0 3px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.snippet .d { font-size: 13px; color: #4d5156; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.indep { font-size: 12px; color: var(--muted); line-height: 1.5; background: var(--bg); padding: 10px 12px; border-radius: 8px; }
.vis-box { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-preview { display: flex; gap: 16px; align-items: flex-start; }
.card-preview img { width: 96px; height: 156px; border-radius: 10px; object-fit: cover; background: var(--bg); border: 1px solid var(--border-2); flex: 0 0 96px; }
.thumb { width: 36px; height: 58px; border-radius: 6px; object-fit: cover; background: var(--bg); border: 1px solid var(--border-2); display: block; }
.pager { display: flex; justify-content: space-between; gap: 12px; }

/* Медиатека */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.mcard { background: var(--card); border: 1px solid var(--border-2); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.mcard.noalt { border-color: rgba(249,60,101,.55); }
.mprev { aspect-ratio: 4 / 3; background: var(--bg); display: flex; align-items: center; justify-content: center; }
.mprev img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mmeta { padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.mmeta b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mmeta .sub { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); font-weight: 600; }
.mmeta form { display: flex; gap: 8px; }
.mmeta .input { min-height: 34px; padding: 6px 10px; font-size: 13px; }
.upload { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 14px; align-items: end; }
.upload input[type=file] { width: 100%; color: var(--muted); font: inherit; font-size: 13px; background: var(--bg); border: 1px dashed var(--border-2); border-radius: 8px; padding: 10px; }
.upload input[type=file]::file-selector-button { background: var(--card-2); color: var(--text); border: 0; border-radius: 6px; padding: 6px 12px; margin-right: 12px; font: inherit; font-weight: 700; cursor: pointer; }

/* Логин */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: radial-gradient(1200px 600px at 50% -10%, rgba(55,190,176,.10), transparent 60%), var(--bg); }
.login-card { width: 100%; max-width: 440px; background: var(--card); border: 1px solid var(--border-2); border-radius: 16px; padding: 36px 36px 32px; display: flex; flex-direction: column; gap: 20px; }
.login-card .logo { width: 100%; max-width: 300px; height: auto; display: block; margin: 0 auto; }
.login-site { text-align: center; font-size: 15px; font-weight: 600; color: var(--muted); margin-top: -6px; }
.login-site b { color: var(--text); font-weight: 800; }
.login-card .btn-primary { height: 46px; width: 100%; font-size: 15px; }
.login-foot { text-align: center; font-size: 12px; color: var(--muted); }

.kv { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 10px 16px; font-size: 13px; }
.kv dt { color: var(--muted); font-weight: 600; }
.kv dd { font-weight: 700; word-break: break-word; }
.quote { background: var(--bg); border-radius: 10px; padding: 14px; white-space: pre-wrap; line-height: 1.55; font-weight: 500; }
code { font-family: ui-monospace, Menlo, monospace; font-size: 12px; background: var(--bg); padding: 2px 6px; border-radius: 6px; color: #BFEFEA; }

/* ---------- адаптив ---------- */
@media (max-width: 1280px) {
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .form-grid, .cols-wide { grid-template-columns: minmax(0, 1fr) 320px; }
}
@media (max-width: 1100px) {
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-100%); transition: transform .2s ease; box-shadow: 0 0 40px rgba(0,0,0,.5); }
  #nav-toggle:checked ~ .sidebar { transform: none; }
  #nav-toggle:checked ~ .scrim { display: block; position: fixed; inset: 0; background: rgba(8,12,20,.6); z-index: 25; }
  .burger { display: inline-flex; }
  .topbar { padding: 0 20px; }
  .content { padding: 24px 20px 32px; }
  .cols { grid-template-columns: minmax(0, 1fr); }
  .form-grid, .cols-wide, .split { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .stat { padding: 14px; gap: 8px; }
  .stat strong { font-size: 22px; }
  .stat-ico { width: 36px; height: 36px; flex-basis: 36px; border-radius: 10px; }
  .stat-top span { font-size: 13px; }
  .who, .site-dom, .site-dot, .topbar .open-site span { display: none; }
  .fields { grid-template-columns: minmax(0, 1fr); }
  .upload { grid-template-columns: minmax(0, 1fr); }
  .page-title h1 { font-size: 24px; }
  .toolbar .input { width: 100%; }
  .card-pad { padding: 16px; }
  .topbar { height: 64px; flex-basis: 64px; padding: 0 14px; gap: 10px; }
  .site { gap: 10px; }
  .site-name { font-size: 16px; }
  .content { padding: 20px 14px 28px; gap: 18px; }
  .lic-pill { padding: 0 8px; font-size: 11px; }
  .kv { grid-template-columns: minmax(0, 1fr); gap: 2px 0; }
  .kv dd { margin-bottom: 8px; }
  /* таблицы — карточками */
  .tbl.resp thead { display: none; }
  .tbl.resp, .tbl.resp tbody, .tbl.resp tr, .tbl.resp td { display: block; width: 100%; }
  .tbl.resp tr { border: 1px solid var(--border-2); border-radius: 12px; padding: 6px 12px; margin-bottom: 10px; background: var(--card); }
  .tbl.resp td { border: 0; padding: 6px 0; display: flex; justify-content: space-between; gap: 12px; align-items: center; }
  .tbl.resp td::before { content: attr(data-l); font-size: 11px; color: var(--muted); font-weight: 700; text-transform: uppercase; flex: 0 0 auto; }
  .tbl.resp td.first { display: block; }
  .tbl.resp td.first::before { display: none; }
  .tbl.resp .acts { justify-content: flex-end; }
  .tbl.resp td.ind-cell .ind { display: none; }
}
@media (max-width: 400px) {
  .stats { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .lic-pill .t { display: none; }
}
.grow-1 { flex: 1; min-width: 0; }
.r { text-align: right; }
.mt { margin-top: 16px; }

.tbl td.nowrap, .tbl th.nowrap { white-space: nowrap; }
.mprev img { object-fit: contain; padding: 10px; }
.file-pick { display: flex; align-items: center; gap: 12px; min-height: 42px; background: var(--bg); border: 1px dashed var(--border-2); border-radius: 8px; padding: 4px 6px; }
.file-pick input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.file-pick .fname { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.file-pick:focus-within { border-color: var(--accent); }
body[data-readonly="1"] .ro-hide { display: none !important; }
@media (max-width: 760px) { .stats > .stat:last-child:nth-child(odd) { grid-column: 1 / -1; } }
.field > label.file-pick { justify-content: flex-start; font-weight: 600; }
/* пользователи и доступы */
.copy-row { display: flex; gap: 10px; align-items: stretch; }
.copy-row input { flex: 1 1 auto; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 18px; letter-spacing: .04em; }
.fields.one { grid-template-columns: minmax(0, 1fr); }
.pw-title { font-size: 22px; margin: 4px 0 12px; }
.login-card .btn + .btn { margin-top: 10px; }
.users-new { max-width: 760px; }
.users-new .form-actions { grid-column: 1 / -1; }
.users-acts { flex-wrap: wrap; }
/* единая панель: переключатель проекта, карточки клиентов, календарь */
.proj-switch { padding: 0 0 10px; display: flex; flex-direction: column; gap: 6px; }
.proj-switch label { font-size: 11px; font-weight: 800; letter-spacing: .08em; color: var(--muted); text-transform: uppercase; }
.proj-row { display: flex; gap: 6px; flex-wrap: wrap; }
.proj-row select { flex: 1 1 100%; min-width: 0; min-height: 34px; padding: 4px 8px; border-radius: 10px; border: 1px solid var(--border-2); background: var(--card-2); color: var(--text); font: inherit; font-size: 13px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0 0 16px; font-size: 14px; }
.kv dt { color: var(--muted); font-weight: 700; }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.sec-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.sec-head .section-title { margin: 0; }
.inline-form { display: inline-flex; align-items: center; gap: 6px; }
.inline-form select { min-height: 32px; padding: 2px 6px; border-radius: 8px; border: 1px solid var(--border-2); background: var(--card-2); color: var(--text); font: inherit; font-size: 13px; max-width: 160px; }
.mem { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.mem-add { margin-top: 6px; flex-wrap: wrap; }
.stats.stats-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 16px; }
.section-title.month { margin-top: 18px; }
.section-title.month:first-child { margin-top: 0; }
tr.ev-overdue td.first b { color: var(--danger); }
@media (max-width: 900px) { .stats.stats-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .kv { grid-template-columns: 1fr; } }
.proj-row .btn { flex: 0 0 auto; }
.tbl td.first { min-width: 180px; }

/* поля пароля: глазик, генератор, копирование */
.pw-ctrl { display: flex; flex-wrap: wrap; gap: 8px; align-items: stretch; width: 100%; }
.pw-ctrl input[type=password], .pw-ctrl input[type=text] { flex: 1 1 12rem; min-width: 0; }
.pw-btns { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pw-btn { min-height: 42px; padding: 0 12px; }
.pw-eye { width: 42px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.pw-eye .i { width: 18px; height: 18px; }
.pw-eye .eye-off, .pw-eye.is-on .eye-on { display: none; }
.pw-eye.is-on .eye-off { display: block; }
.login-card .pw-ctrl { flex-wrap: nowrap; }
.login-card .pw-btns { flex: 0 0 auto; }

/* таблица проектов: кнопки не обрезаются */
.tbl-projects { table-layout: auto; }
.tbl-projects td, .tbl-projects th { padding: 10px 10px; }
.tbl-projects td .sub { word-break: break-word; overflow-wrap: anywhere; }
.tbl-projects .col-acts { width: 1%; white-space: nowrap; vertical-align: middle; }
.tbl-projects .acts-stack { flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 6px; min-width: 8.5rem; }
.tbl-projects .acts-stack .btn, .tbl-projects .acts-stack form { width: 100%; }
.tbl-projects .acts-stack .btn { justify-content: center; }
.card:has(.tbl-projects) { overflow: visible; }
.table-wrap:has(.tbl-projects) { overflow-x: auto; }
