/* Bald BOT · Gris neutro y azul apagado. Presentation only; controls keep their behavior. */
:root {
  color-scheme: dark;
  --bg: #171717;
  --panel: #222222;
  --line: #3b3b3b;
  --muted: #b3b3b3;
  --ink: #eeeeee;
  --accent: #89a8c7;
  --danger: #f1a4a0;
  --surface-low: #1a1a1a;
  --surface-high: #2b2b2b;
  --navigation-active: #26384b;
  --primary: #2c435b;
  --primary-hover: #365473;
  --primary-border: #526d89;
}

body {
  background: var(--bg);
  font: 14px/1.6 'Segoe UI', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
::selection { background: #385673; color: #fff; }
h1, h2, h3 { color: var(--ink); font-weight: 650; }
h1 { font-size: 28px; letter-spacing: -.65px; margin-bottom: 8px; }
h2 { font-size: 19px; letter-spacing: -.25px; }
h3 { font-size: 16px; letter-spacing: -.15px; }
p { margin-bottom: 16px; }
.small, .help { font-size: 12px; }
.eyebrow { color: var(--muted); font-size: 10px; letter-spacing: 1.7px; }
label { color: #d2d2d2; gap: 8px; font-size: 13px; }
input, select, textarea, button {
  background: var(--surface-low);
  border-color: #454545;
  border-radius: 7px;
}
input, select, textarea { min-height: 42px; padding: 10px 12px; }
textarea { min-height: 104px; line-height: 1.65; }
select { cursor: pointer; }
input::placeholder, textarea::placeholder { color: #999999; }
input:focus, select:focus, textarea:focus, button:focus-visible,
summary:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
button { min-height: 40px; padding: 9px 16px; transition: background .15s, border-color .15s; }
button:hover { border-color: #727272; background: var(--surface-high); }
button:disabled { opacity: .5; cursor: not-allowed; }
button.primary, .module-card .module-configure { background: var(--primary); color: #eef3f8; border-color: var(--primary-border); font-weight: 650; }
button.primary:hover, .module-card .module-configure:hover { background: var(--primary-hover); border-color: #7693af; }
.quiet { background: transparent; border-color: transparent; color: var(--muted); padding: 6px 0; }
.quiet:hover { background: transparent; color: var(--ink); border-color: transparent; }

/* Navigation stays quiet; only the current section receives a colored surface. */
aside { width: 248px; padding: 26px 20px 18px; background: #1d1d1d; border-color: var(--line); }
.brand { gap: 14px; margin: 0 10px 34px; flex-shrink: 0; font-size: 20px; line-height: 1.35; }
.brand-mark { width: 44px; height: 44px; border-radius: 10px; background: #2c435b; color: #e8eef5; flex-shrink: 0; font-size: 26px; }
.brand small { margin-top: 4px; color: #b5b5b5; font-size: 9px; letter-spacing: 1.8px; font-weight: 400; }
.server-label { margin: 0 10px 26px; flex-shrink: 0; }
.server-label select { margin-top: 1px; font-size: 12px; min-height: 40px; }
.server-label, .nav-label { color: var(--muted); font-size: 10px; letter-spacing: 1.4px; }
.nav-label { margin: 4px 10px 8px; flex-shrink: 0; }
nav { min-height: 0; gap: 3px; scrollbar-width: thin; scrollbar-color: #4b4b4b transparent; }
nav button { flex-shrink: 0; border: 1px solid transparent; padding: 10px 16px; min-height: 42px; font-size: 13px; border-radius: 8px; }
nav button:hover { background: #2a2a2a; border-color: transparent; }
nav button.active { background: var(--navigation-active); color: #edf2f7; border-color: #3b536b; }
.sidebar-bottom { flex-shrink: 0; gap: 4px; padding: 22px 10px 0; color: var(--muted); }

main { margin-left: 248px; max-width: 1850px; padding: 32px 32px 56px; min-width: 0; }
header { gap: 20px; margin-bottom: 28px; }
header p:last-child { margin-bottom: 0; }
.badge { font-size: 11px; padding: 5px 10px; border-color: #484848; color: #b6b6b6; background: transparent; }
.badge.online { color: #b7cbe0; border-color: #4c647d; }
.panel { border-color: var(--line); background: var(--panel); border-radius: 13px; padding: 24px; margin-bottom: 20px; box-shadow: none; }
.grid { gap: 4px 24px; }
.grid > *, .row-editor, .panel, form { min-width: 0; }
.row-editor { background: var(--surface-low); border-color: var(--line); padding: 18px; border-radius: 9px; }
.remove { color: var(--danger); }
.help { line-height: 1.65; }
.preview { background: var(--surface-low); border-left-color: #6585a7; border-radius: 0 7px 7px 0; color: #cdcdcd; }

/* The six module cards lead the overview. Technical counters become a quiet footer. */
main:has(.module-grid) > header { align-items: center; margin-bottom: 18px; }
main:has(.module-grid) > header .eyebrow,
main:has(.module-grid) > header #page-description { display: none; }
main:has(.module-grid) > header h1 { color: var(--muted); font-size: 13px; font-weight: 400; letter-spacing: 0; margin: 0; }
#content:has(> .module-grid) { display: flex; flex-direction: column; }
#content:has(> .module-grid) > .panel { order: 0; padding: 24px; }
#content:has(> .module-grid) > .panel h2 { font-size: 24px; margin-bottom: 10px; }
#content:has(> .module-grid) > .panel .small { font-size: 12px; margin: 0; }
#content:has(> .module-grid) > .module-grid { order: 1; }
#content:has(> .module-grid) > .module-master-note { order: 2; margin-top: 18px; }
#content:has(> .module-grid) > .stats { order: 3; }
.module-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.module-card { padding: 22px 24px 20px; min-height: 204px; border-color: var(--line); border-radius: 13px; background: var(--panel); }
.module-card h3 { font-size: 16px; margin: 0; }
.module-card p { font-size: 13px; line-height: 1.7; margin: 14px 0 4px; }
.module-card .bald-switch-row { margin: auto 0 10px; padding-top: 16px; }
.module-card .module-configure { margin: 0; font-size: 13px; min-height: 38px; padding: 7px 17px; }
.stats { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 22px 0 0; padding: 16px 2px 0; border-top: 1px solid var(--line); }
.stat { display: flex; gap: 9px; align-items: baseline; border: 0; border-radius: 0; padding: 0; background: transparent; color: #afafaf; font-size: 11px; }
.stat strong { display: inline; font-size: 12px; font-weight: 500; color: #dedede; margin: 0; }

.bald-switch { padding: 5px 4px; min-height: 42px; background: transparent; }
.bald-switch:hover { background: transparent; border-color: #667c93; }
.bald-switch-track { width: 46px; height: 26px; background: #4a4a4a; box-shadow: inset 0 0 0 1px #727272; }
.bald-switch-track:after { top: 3px; left: 3px; width: 20px; height: 20px; background: #f2f2f2; }
.bald-switch[aria-checked=true] .bald-switch-track { background: #4f7459; box-shadow: inset 0 0 0 1px #7da387; }
.bald-switch[aria-checked=true] .bald-switch-state { color: #acd0b5; }
.bald-switch-state { color: #b8b8b8; font-size: 12px; min-width: 80px; }
.bald-switch-label { font-size: 13px; }
.module-master-note { color: var(--muted); line-height: 1.7; }
.bald-confirm { border-color: #4d5967; background: #272727; border-radius: 14px; padding: 28px; }
.bald-confirm::backdrop { background: #090909d9; }
.bald-confirm p { color: #cccccc; }

footer, .pc-actions { background: #292929; border-color: #505050; border-radius: 10px; padding: 14px 18px; box-shadow: 0 8px 30px #0003; }
footer { bottom: 16px; z-index: 2; }
#save-state { color: #d5d5d5; }
#notice { background: #2b2b2b; color: #eeeeee; border-color: #637c97; max-width: min(510px, calc(100vw - 32px)); right: 16px; top: 16px; padding: 14px 18px; font-size: 13px; overflow-wrap: anywhere; box-shadow: 0 8px 30px #0003; }
#notice.error { background: #30211f; color: var(--danger); border-color: #9c625b; }

/* Bring all existing modules into the same palette. */
.exclusion-picker { background: var(--surface-low); border-color: var(--line); border-radius: 9px; }
.exclusion-list li { background: #272727; border-color: #454545; border-radius: 7px; }
.exclusion-list button { font-size: 12px; min-height: 36px; }
.exclusion-manual summary { padding: 4px 0; }
.inherited-exclusions { color: #c3c3c3; }
.pc-top { gap: 24px; flex-wrap: wrap; }
.pc-top > div:first-child { flex: 1 1 330px; }
.pc-top > .bald-switch-row { flex: 0 1 240px; margin: 0; gap: 6px; }
.pc-top > .bald-switch-row .bald-switch-label { flex-basis: 100%; color: var(--muted); font-size: 12px; }
.pc-top .pc-hint { margin-top: 12px; }
.pc-previews .panel { background: #252525; border-color: #444444; }
.pc-member { background: #1a1a1a; border-color: #444444; border-radius: 10px; padding: 16px; }
.pc-avatar { background: #2b4055; color: #c6d7e9; border-radius: 17px; }
.pc-avatar.large { border-radius: 22px; }
.pc-avatar-wrap > .pc-dot { border-color: #1a1a1a; }
.pc-dot[data-status=online], .pc-dot:not([data-status]) { background: #7eaa89; }
.pc-bot-label { background: #365472; color: #edf2f7; border-radius: 3px; }
.pc-global { border-color: #485c71; color: #bbcee0; background: #273340; font-size: 9px; }
.pc-section-head span { border-color: #526173; color: #afc7df; border-radius: 7px; font-size: 11px; }
.pc-results li { background: var(--surface-low); border-left-color: #606060; border-radius: 0 6px 6px 0; }
.pc-results li[data-state=applied] { border-left-color: #7499bc; }
.pc-results li[data-state=error] { border-left-color: var(--danger); }
.pc-live { color: #aec8e2; }
.pc-profile-name { font-weight: 600; }
.pc-history { background: transparent; }
.pc-actions .pc-dirty[data-dirty=true] { color: #bdd5ed; }
.table-wrap { border-radius: 8px; }
th { color: #c5c5c5; letter-spacing: .7px; }
td { color: #d6d6d6; }
tbody tr:hover { background: #2d2d2d; }
details pre { background: var(--surface-low); border: 1px solid var(--line); border-radius: 7px; padding: 12px; }

.login-screen { background: var(--bg); padding: 28px 0; }
.login-card { width: min(420px, calc(100vw - 32px)); background: #222222; border-color: #454545; padding: 34px; border-radius: 16px; box-shadow: 0 24px 80px #0003; }
.login-card h1 { font-size: 30px; }
.login-card .brand-mark { margin-bottom: 28px; }
.login-card .eyebrow { color: #b8cde0; }

@media (max-width: 1100px) {
  aside { width: 224px; padding-inline: 16px; }
  main { margin-left: 224px; padding: 26px 24px 44px; }
  .brand { margin-inline: 6px; font-size: 19px; gap: 10px; }
  .brand small { letter-spacing: 1.3px; }
  .module-card { padding: 20px; }
  .module-card .bald-switch-row { flex-wrap: wrap; gap: 0; padding-top: 12px; }
  .module-card .bald-switch-label { flex-basis: 100%; }
  .grid .bald-switch-row { align-content: start; }
}
@media (max-width: 900px) {
  .module-grid { grid-template-columns: 1fr; }
  .module-card { min-height: 0; padding: 22px; }
  .module-card .bald-switch-row { flex-wrap: nowrap; padding-top: 10px; }
  .module-card .bald-switch-label { flex-basis: auto; }
  .pc-top > div:first-child { flex-basis: 100%; }
  .pc-top > .bald-switch-row { flex-basis: 100%; flex-wrap: nowrap; }
  .pc-top > .bald-switch-row .bald-switch-label { flex-basis: auto; }
  .pc-previews { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  aside { position: static; width: auto; display: grid; grid-template-columns: minmax(0, 1fr) minmax(125px, 155px); column-gap: 16px; padding: 20px 16px 12px; }
  .brand { margin: 0; font-size: 17px; gap: 10px; align-self: center; }
  .brand-mark { width: 38px; height: 38px; font-size: 24px; border-radius: 9px; }
  .brand small { font-size: 7px; letter-spacing: 1px; }
  .server-label { margin: 0; font-size: 9px; gap: 4px; }
  .server-label select { min-height: 38px; font-size: 11px; padding: 8px; }
  .nav-label { display: none; }
  nav { grid-column: 1 / -1; margin-top: 18px; display: flex; flex-direction: row; flex-wrap: nowrap; overflow-x: auto; padding: 0 0 8px; gap: 4px; }
  nav button { min-height: 40px; padding: 8px 12px; font-size: 12px; }
  .sidebar-bottom { grid-column: 1 / -1; display: flex; flex-direction: row; justify-content: space-between; align-items: center; padding: 8px 2px 0; border-top: 1px solid var(--line); gap: 10px; }
  .sidebar-bottom .quiet { min-height: 32px; font-size: 11px; }
  main { margin: 0; padding: 24px 16px 40px; }
  h1 { font-size: 25px; }
  header { margin-bottom: 22px; }
  header .badge { margin-top: 12px; }
  main:has(.module-grid) > header { display: flex; flex-wrap: wrap; gap: 12px; }
  main:has(.module-grid) > header .badge { margin-top: 0; }
  #content:has(> .module-grid) > .panel { padding: 22px 20px; }
  #content:has(> .module-grid) > .panel h2 { font-size: 21px; }
  .panel { padding: 20px; border-radius: 11px; }
  .module-card { padding: 20px; border-radius: 11px; }
  .module-card h3 { font-size: 16px; }
  .module-card .bald-switch-row { flex-wrap: wrap; gap: 4px; }
  .module-card .bald-switch-label { flex-basis: 100%; }
  .bald-switch-row { gap: 8px; }
  .stats { gap: 8px 18px; }
  footer { flex-wrap: wrap; gap: 10px; bottom: 10px; padding: 13px; }
  footer #save-state { flex-basis: 100%; font-size: 12px; }
  footer button { flex: 1; font-size: 12px; padding-inline: 10px; }
  .pc-top { align-items: stretch; gap: 18px; }
  .pc-top > div:first-child, .pc-top > .bald-switch-row { flex: 0 1 auto; width: 100%; }
  .pc-actions { padding: 13px; }
  .pc-actions button { font-size: 12px; padding-inline: 10px; }
  .pc-actions .pc-dirty { flex-basis: 100%; }
  .pc-member { padding: 13px; }
  .exclusion-picker { padding: 12px; }
  .bald-confirm { padding: 24px; }
  .login-card { padding: 28px; }
}
@media (max-width: 370px) {
  aside { grid-template-columns: 1fr; }
  .server-label { margin-top: 18px; }
  .bald-switch-row { flex-wrap: wrap; }
  .bald-switch-label { flex-basis: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}


/* Brand assets */
.brand { align-items: center; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text strong { color: var(--ink); font-size: 18px; line-height: 1.1; font-weight: 700; letter-spacing: -0.02em; }
.sidebar-brand-image {
  display: block;
  width: 168px;
  max-width: 100%;
  height: auto;
  filter: drop-shadow(0 3px 10px rgba(0, 0, 0, 0.18));
}
.brand .brand-mark { display: none; }
.login-brand-image {
  display: block;
  width: min(250px, 72%);
  height: auto;
  margin: 0 0 22px;
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.28));
}
.login-card {
  position: relative;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
.login-screen {
  position: relative;
  background:
    linear-gradient(180deg, rgba(11,12,14,0.80), rgba(11,12,14,0.88)),
    url('/static/brand/login-bg.png') center center / cover no-repeat,
    var(--bg);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 38%, rgba(175,197,216,0.08), rgba(0,0,0,0) 42%);
  pointer-events: none;
}
.login-card {
  background: rgba(25, 25, 27, 0.92);
  border-color: rgba(95, 116, 136, 0.55);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
}
.login-card h1 { margin-top: 2px; }
.login-card .small.muted { margin-top: 18px; }
@media (max-width: 640px) {
  .sidebar-brand-image { width: 132px; }
  .brand-text strong { font-size: 16px; }
  .login-brand-image { width: min(220px, 78%); margin-bottom: 20px; }
  .login-screen { padding: 24px 16px; }
}
