:root {
  --sidebar: #16212f;
  --sidebar-text: #c9d3df;
  --accent: #2f6fde;
  --page: #f4f6f9;
}

body { background: var(--page); font-size: 0.95rem; }
a { color: var(--accent); }

.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 250px; flex-shrink: 0; background: var(--sidebar); color: var(--sidebar-text);
  display: flex; flex-direction: column; padding: 1.25rem 0.75rem; position: sticky; top: 0; height: 100vh;
}
.brand, .brand-lg { font-weight: 700; font-size: 1.35rem; color: #fff; text-decoration: none; padding: 0 0.75rem; }
.brand span, .brand-lg span { color: #6fa1ff; }
.brand-lg { color: #16212f; padding: 0; display: block; margin-bottom: 1rem; }
.org { font-size: 0.8rem; opacity: 0.7; padding: 0 0.75rem 1rem; }
.sidebar .nav-link { color: var(--sidebar-text); border-radius: 6px; padding: 0.45rem 0.75rem; }
.sidebar .nav-link:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
.sidebar .nav-link.active { background: var(--accent); color: #fff; }
.sidebar-foot { margin-top: auto; padding: 0.75rem; border-top: 1px solid rgba(255, 255, 255, 0.1); font-size: 0.85rem; }
.sidebar-foot .user { color: #fff; text-decoration: none; display: block; }
.sidebar-foot .role { opacity: 0.6; margin-bottom: 0.35rem; }
.sidebar-foot .logout { color: var(--sidebar-text); }

.content { flex: 1; min-width: 0; padding: 1.75rem 2rem 3rem; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.page-title { font-size: 1.45rem; font-weight: 600; margin-bottom: 1.25rem; }
.page-head .page-title { margin-bottom: 0; }
.section-title { font-size: 1rem; font-weight: 600; margin-bottom: 0.75rem; }
.section-title a { font-weight: 400; font-size: 0.85rem; margin-left: 0.5rem; }
.card { border: 1px solid #e3e7ee; border-radius: 10px; }

.stat { background: #fff; border: 1px solid #e3e7ee; border-radius: 10px; padding: 1rem 1.15rem; height: 100%; }
.stat-label { font-size: 0.8rem; color: #6b7686; }
.stat-value { font-size: 1.9rem; font-weight: 600; line-height: 1.2; }
.stat-value.small-value { font-size: 1.4rem; }
.stat-note { font-size: 0.8rem; color: #6b7686; }
.stat-bad .stat-value { color: #c62828; }

.filters { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.filters .form-control, .filters .form-select { width: auto; min-width: 200px; }
.process { margin-bottom: 1.75rem; }
.process-head { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 0.5rem; padding: 0 0.25rem; }
.rules { table-layout: fixed; min-width: 760px; }
.rules .c-switch { width: 56px; }
.rules .c-time { width: 27%; }
.rules .c-status { width: 120px; }
.rules .c-last { width: 130px; }
.rules td { overflow: hidden; }
.toggle-form .form-switch .form-check-input { width: 2.4em; height: 1.25em; cursor: pointer; }
.prewrap { white-space: pre-wrap; }
.check { width: 1.6rem; height: 1.6rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; }
.check-ok { background: #e3f4e8; color: #2e9d4b; }
.check-bad { background: #fde7e7; color: #c62828; }
.check-warn { background: #fff4d6; color: #b07800; }
.check-unknown { background: #eceff3; color: #6b7686; }
.log { background: #16212f; color: #dfe6ee; border-radius: 8px; padding: 0.85rem 1rem; font-size: 0.78rem; max-height: 420px; overflow: auto; white-space: pre-wrap; word-break: break-word; }
.fix-steps li::marker { font-weight: 600; }
.launches td { vertical-align: top; }
.facts dt { font-size: 0.8rem; color: #6b7686; font-weight: 400; }
.facts dd { margin-bottom: 0.75rem; }
.journal-mini .list-group-item { font-size: 0.85rem; }
.details { max-width: 420px; word-break: break-word; }

.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.perm-section { border: 1px solid #e3e7ee; border-radius: 8px; padding: 0.75rem 1rem; }
.perm-section legend { font-size: 0.9rem; font-weight: 600; float: none; width: auto; padding: 0 0.25rem; margin: 0; }

.filter-box { gap: 0.5rem; }
.filter-row { display: grid; grid-template-columns: 1.2fr 0.8fr 1.5fr; gap: 0.5rem; }
.data-grid { max-height: 70vh; }
.data-grid table { font-size: 0.82rem; }
.data-grid th { position: sticky; top: 0; background: #fff; white-space: nowrap; }
.data-grid td { white-space: nowrap; max-width: 360px; overflow: hidden; text-overflow: ellipsis; }
.data-grid td.null { color: #a0a8b4; }

.dot { display: inline-block; width: 0.7rem; height: 0.7rem; border-radius: 50%; background: #a0a8b4; vertical-align: middle; }
.dot-ok { background: #2e9d4b; }
.dot-warn { background: #e0a106; }
.dot-error { background: #c62828; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 0.25rem 1rem; margin: 0; font-size: 0.9rem; }
.kv dt { font-weight: 400; color: #6b7686; }
.kv dd { margin: 0; text-align: right; }

.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.auth { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 1rem; }
.auth-card { background: #fff; border: 1px solid #e3e7ee; border-radius: 12px; padding: 2rem; width: 100%; max-width: 420px; }

@media (max-width: 900px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; }
  .sidebar .nav { flex-direction: row !important; flex-wrap: wrap; }
  .content { padding: 1.25rem 1rem 2rem; }
  .filter-row { grid-template-columns: 1fr; }
}
