/* Message Center Portal — estilos (marca T-Systems: magenta #E20074) */
:root {
  --magenta: #E20074; --magenta-dark: #A30052; --magenta-soft: #fde7f2;
  --bg: #f3f3f4; --surface: #ffffff; --surface-2: #fafafa; --surface-3: #f1f1f2; --hover: #f6f6f7;
  --text: #1f1f21; --text-2: #5c5c63; --text-3: #8a8a92; --border: #e2e2e5; --border-strong: #cfcfd4;
  --high: #c62828; --high-bg: #fdecec; --med: #b85c00; --med-bg: #fff3e3; --norm: #A30052; --norm-bg: #fde7f2; --low: #2e7d32; --low-bg: #e9f5ea;
  --ok: #1b7f3b; --warn: #b85c00; --info: #2f55a4; --info-bg: #eaf0fb;
  --sum-bg: #fdf3f8; --orig-bg: #fbf8ef; --orig-bd: #c9a227;
  --radius: 6px; --radius-lg: 10px;
  --shadow: 0 1px 2px rgba(20,20,30,.06), 0 4px 16px rgba(20,20,30,.06);
  --shadow-lg: 0 12px 40px rgba(20,20,30,.18);
  --font: "Segoe UI", "TeleNeo", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  --t-xs: 11px; --t-sm: 12.5px; --t-md: 14px; --t-lg: 16px; --t-xl: 20px;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #151517; --surface: #1f1f22; --surface-2: #242428; --surface-3: #2b2b30; --hover: #2a2a2f;
  --text: #ececef; --text-2: #b4b4bc; --text-3: #8b8b95; --border: #34343a; --border-strong: #46464e;
  --magenta-soft: #3b1a2b; --high: #ff8a80; --high-bg: #3a1716; --med: #ffb74d; --med-bg: #362511; --norm: #ff7ab8; --norm-bg: #3b1a2b; --low: #81c784; --low-bg: #16301a;
  --info: #9db7ef; --info-bg: #1b2640; --ok: #6fcf8b; --warn: #ffb74d;
  --sum-bg: #2c1d26; --orig-bg: #2a261a; --orig-bd: #a68a2a;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 16px rgba(0,0,0,.3); --shadow-lg: 0 12px 40px rgba(0,0,0,.6);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); font-size: var(--t-md); line-height: 1.45; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--magenta); }
a:hover { color: var(--magenta-dark); }
[data-theme="dark"] a:hover { color: #ff7ab8; }
:focus-visible { outline: 2px solid var(--magenta); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hidden { display: none !important; }
.muted { color: var(--text-2); }
.small { font-size: var(--t-sm); }
.mono { font-family: var(--mono); font-size: 12px; }
svg.i { width: 16px; height: 16px; flex: none; vertical-align: -3px; }

/* ---------- Top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 50; background: var(--surface); border-top: 4px solid var(--magenta); border-bottom: 1px solid var(--border); }
.topbar-inner { max-width: 1480px; margin: 0 auto; padding: 0 20px; height: 60px; display: flex; align-items: center; gap: 20px; }
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--text); flex: none; }
.brand img { height: 26px; width: auto; display: block; }
[data-theme="dark"] .brand img { filter: brightness(0) invert(1); }
.brand-sep { width: 1px; height: 26px; background: var(--border-strong); }
.brand-name { font-weight: 600; font-size: 15px; letter-spacing: -.01em; line-height: 1.1; }
.brand-name small { display: block; font-weight: 500; font-size: 11px; color: var(--text-2); letter-spacing: .02em; }
.nav { display: flex; gap: 2px; height: 100%; margin-left: 8px; }
.nav a { display: flex; align-items: center; gap: 7px; padding: 0 14px; text-decoration: none; color: var(--text-2); font-weight: 600; font-size: 13.5px; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.nav a:hover { color: var(--text); background: var(--hover); }
.nav a[aria-current="page"] { color: var(--magenta); border-bottom-color: var(--magenta); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); cursor: pointer; color: var(--text-2); }
.icon-btn:hover { color: var(--magenta); border-color: var(--magenta); }
.lang-select { height: 34px; padding: 0 8px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); font-weight: 600; font-size: 13px; cursor: pointer; }
.user-btn { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px 0 4px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); cursor: pointer; }
.avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--magenta); color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.user-btn .role { font-size: 11px; color: var(--text-2); }
.menu { position: absolute; z-index: 80; min-width: 220px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 6px; }
.menu button, .menu a, .menu label { display: flex; width: 100%; align-items: center; gap: 8px; padding: 8px 10px; border: 0; background: none; border-radius: var(--radius); text-align: left; cursor: pointer; font-size: 13px; color: var(--text); text-decoration: none; }
.menu button:hover, .menu a:hover, .menu label:hover { background: var(--hover); }
.menu hr { border: 0; border-top: 1px solid var(--border); margin: 6px 0; }
.menu .menu-title { font-size: 11px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; padding: 6px 10px 4px; }
.menu button[disabled] { opacity: .45; cursor: not-allowed; }

/* ---------- Layout ---------- */
main { max-width: 1480px; margin: 0 auto; padding: 20px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: var(--t-xl); letter-spacing: -.015em; }
.page-head p { margin: 2px 0 0; color: var(--text-2); font-size: 13px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.panel + .panel { margin-top: 14px; }
.panel-pad { padding: 16px; }
.panel h2 { margin: 0 0 12px; font-size: var(--t-lg); }

/* ---------- KPIs ---------- */
.kpis { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 10px 12px; border-top: 3px solid var(--border-strong); cursor: pointer; text-align: left; transition: border-color .15s, transform .15s; }
.kpi:hover { transform: translateY(-1px); border-color: var(--magenta); }
.kpi .n { display: block; font-size: 22px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi .l { font-size: 11.5px; color: var(--text-2); font-weight: 600; }
.kpi.k-high { border-top-color: var(--high); } .kpi.k-high .n { color: var(--high); }
.kpi.k-med { border-top-color: var(--med); } .kpi.k-med .n { color: var(--med); }
.kpi.k-norm { border-top-color: var(--norm); } .kpi.k-norm .n { color: var(--norm); }
.kpi.k-low { border-top-color: var(--low); } .kpi.k-low .n { color: var(--low); }
.kpi.k-mag { border-top-color: var(--magenta); } .kpi.k-mag .n { color: var(--magenta); }
.kpi.k-warn { border-top-color: var(--warn); } .kpi.k-info { border-top-color: var(--info); }

/* ---------- Filters ---------- */
.filters { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.frow { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.search { flex: 1 1 320px; position: relative; }
.search input { width: 100%; height: 38px; padding: 0 12px 0 36px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); font-size: 14px; }
.search input:focus { border-color: var(--magenta); outline: none; box-shadow: 0 0 0 3px var(--magenta-soft); }
.search svg { position: absolute; left: 11px; top: 11px; color: var(--text-3); }
.seg { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); height: 38px; }
.seg > span { padding: 0 10px; font-size: 12px; font-weight: 700; color: var(--text-2); border-right: 1px solid var(--border); height: 100%; display: flex; align-items: center; }
.seg button { border: 0; background: none; padding: 0 10px; height: 100%; cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.seg button:hover { color: var(--magenta); background: var(--hover); }
.seg button.on { background: var(--magenta); color: #fff; }
.seg input[type="date"] { border: 0; border-left: 1px solid var(--border); height: 100%; padding: 0 8px; background: none; font-size: 12.5px; }
.dd { position: relative; }
.dd-btn { height: 38px; display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); cursor: pointer; font-weight: 600; font-size: 13px; white-space: nowrap; }
.dd-btn:hover { border-color: var(--border-strong); }
.dd-btn .count { background: var(--magenta); color: #fff; border-radius: 999px; font-size: 11px; padding: 0 6px; min-width: 18px; text-align: center; }
.dd-panel { position: absolute; top: 42px; left: 0; z-index: 60; min-width: 240px; max-height: 360px; overflow: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 6px; }
.dd-panel label { display: flex; gap: 8px; align-items: center; padding: 6px 8px; border-radius: var(--radius); cursor: pointer; font-size: 13px; }
.dd-panel label:hover { background: var(--hover); }
.dd-panel .dd-tools { display: flex; justify-content: space-between; padding: 4px 8px 8px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.dd-panel .dd-tools button { border: 0; background: none; color: var(--magenta); cursor: pointer; font-size: 12px; font-weight: 600; padding: 0; }
.chip-toggle { height: 32px; display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.chip-toggle:hover { border-color: var(--magenta); color: var(--magenta); }
.chip-toggle[aria-pressed="true"] { background: var(--magenta-soft); border-color: var(--magenta); color: var(--magenta-dark); }
[data-theme="dark"] .chip-toggle[aria-pressed="true"] { color: #ffb3d6; }
select.sel { height: 38px; padding: 0 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); font-size: 13px; font-weight: 600; max-width: 280px; }
.btn { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); cursor: pointer; font-weight: 600; font-size: 13px; color: var(--text); white-space: nowrap; }
.btn:hover { border-color: var(--border-strong); background: var(--hover); }
.btn-primary { background: var(--magenta); border-color: var(--magenta); color: #fff; }
.btn-primary:hover { background: var(--magenta-dark); border-color: var(--magenta-dark); color: #fff; }
.btn-danger { color: var(--high); }
.btn-danger:hover { border-color: var(--high); background: var(--high-bg); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding-top: 10px; border-top: 1px solid var(--border); }
.toolbar .grow { flex: 1; }
.result-line { display: flex; justify-content: space-between; align-items: center; margin: 14px 2px 8px; font-size: 13px; color: var(--text-2); flex-wrap: wrap; gap: 8px; }
.result-line strong { color: var(--text); }
.active-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.af { display: inline-flex; align-items: center; gap: 4px; padding: 2px 4px 2px 8px; background: var(--surface-3); border-radius: 999px; font-size: 12px; }
.af button { border: 0; background: none; cursor: pointer; color: var(--text-3); padding: 0 4px; font-size: 14px; line-height: 1; }
.af button:hover { color: var(--high); }

/* ---------- Groups & messages ---------- */
.group { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 10px; box-shadow: var(--shadow); }
.group-head { width: 100%; display: flex; align-items: center; gap: 10px; padding: 12px 16px; border: 0; background: var(--surface-2); cursor: pointer; font-weight: 700; font-size: 14px; text-align: left; border-left: 5px solid var(--border-strong); }
.group-head:hover { background: var(--hover); }
.group-head .chev { transition: transform .15s; color: var(--text-3); }
.group-head[aria-expanded="true"] .chev { transform: rotate(90deg); }
.group-head .cnt { margin-left: auto; font-size: 12px; background: var(--surface); border: 1px solid var(--border); padding: 1px 9px; border-radius: 999px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.g-Alta .group-head { border-left-color: var(--high); color: var(--high); }
.g-Media .group-head { border-left-color: var(--med); color: var(--med); }
.g-Normal .group-head { border-left-color: var(--norm); color: var(--norm); }
.g-Baja .group-head { border-left-color: var(--low); color: var(--low); }
.msg { display: flex; gap: 14px; padding: 14px 16px; border-top: 1px solid var(--border); position: relative; }
.msg:hover { background: var(--hover); }
.msg.is-reviewed { background: var(--surface-2); }
.msg.is-reviewed .msg-title { color: var(--text-2); }
.msg.is-selected { box-shadow: inset 4px 0 0 var(--magenta); }
.checks { display: flex; flex-direction: column; gap: 6px; min-width: 86px; padding-right: 12px; border-right: 1px solid var(--border); }
.ck { display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; color: var(--text-2); cursor: pointer; user-select: none; }
.ck input { width: 15px; height: 15px; accent-color: var(--magenta); cursor: pointer; margin: 0; }
.ck input:disabled { cursor: not-allowed; }
.ck.c-xls { color: var(--ok); } .ck.c-sel { color: var(--magenta); }
.msg-main { flex: 1; min-width: 0; }
.msg-title { font-weight: 700; font-size: 14.5px; margin: 0 0 6px; line-height: 1.35; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.msg-title a { color: inherit; text-decoration: none; }
.msg-title a:hover { color: var(--magenta); text-decoration: underline; }
.badges { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; }
.b { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 4px; font-size: 11.5px; font-weight: 600; background: var(--surface-3); color: var(--text-2); border: 1px solid transparent; white-space: nowrap; }
.b-id { font-family: var(--mono); background: var(--magenta-soft); color: var(--magenta-dark); }
[data-theme="dark"] .b-id { color: #ffb3d6; }
.b-Alta { background: var(--high-bg); color: var(--high); } .b-Media { background: var(--med-bg); color: var(--med); }
.b-Normal { background: var(--norm-bg); color: var(--norm); } .b-Baja { background: var(--low-bg); color: var(--low); }
.b-manual::after { content: "•"; margin-left: 2px; }
.b-svc { background: var(--info-bg); color: var(--info); }
.b-new { background: var(--magenta); color: #fff; }
.b-upd { background: var(--info); color: #fff; }
[data-theme="dark"] .b-upd { color: #10182b; }
.b-warn { background: var(--med-bg); color: var(--med); border-color: var(--med); }
.b-dl { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.b-dl.overdue { border-color: var(--high); color: var(--high); background: var(--high-bg); }
.b-dl.soon { border-color: var(--med); color: var(--med); background: var(--med-bg); }
.b-st-pending { background: var(--surface-3); } .b-st-analysis { background: var(--info-bg); color: var(--info); }
.b-st-planned { background: var(--med-bg); color: var(--med); } .b-st-done { background: var(--low-bg); color: var(--low); } .b-st-na { background: var(--surface-3); color: var(--text-3); text-decoration: line-through; }
.msg-actions { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; font-size: 12.5px; }
.link-btn { border: 0; background: none; padding: 0; color: var(--magenta); cursor: pointer; font-weight: 600; font-size: 12.5px; display: inline-flex; align-items: center; gap: 4px; }
.link-btn:hover { color: var(--magenta-dark); text-decoration: underline; }
.summary { margin-top: 8px; padding: 10px 12px; background: var(--sum-bg); border-left: 3px solid var(--magenta); border-radius: 0 var(--radius) var(--radius) 0; font-size: 13.5px; line-height: 1.55; white-space: pre-wrap; }
.empty { padding: 48px 20px; text-align: center; color: var(--text-2); }
.empty h3 { margin: 0 0 6px; color: var(--text); font-size: 16px; }
.skeleton { height: 74px; border-top: 1px solid var(--border); background: linear-gradient(90deg, var(--surface) 0%, var(--surface-3) 50%, var(--surface) 100%); background-size: 200% 100%; animation: sk 1.2s infinite linear; }
@keyframes sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.more-row { padding: 12px; text-align: center; border-top: 1px solid var(--border); }

/* ---------- Drawer ---------- */
.overlay { position: fixed; inset: 0; background: rgba(15,15,20,.45); z-index: 90; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(820px, 100vw); background: var(--surface); z-index: 95; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; border-left: 4px solid var(--magenta); }
.drawer-head { padding: 16px 20px 12px; border-bottom: 1px solid var(--border); display: flex; gap: 12px; align-items: flex-start; }
.drawer-head h2 { margin: 4px 0 0; font-size: 17px; line-height: 1.35; }
.drawer-body { padding: 16px 20px 40px; overflow: auto; flex: 1; }
.sec { margin-bottom: 20px; }
.sec h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--text-3); margin: 0 0 8px; display: flex; align-items: center; gap: 8px; }
.meta { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px 16px; font-size: 13px; }
.meta div span { display: block; font-size: 11px; color: var(--text-3); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.manage .field-checks { grid-column: span 2; }
.manage { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; align-items: end; padding: 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--text-2); }
.field input, .field select, .field textarea { height: 36px; padding: 0 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); font-size: 13.5px; font-weight: 400; color: var(--text); }
.field textarea { height: auto; padding: 8px 10px; resize: vertical; min-height: 70px; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--magenta); outline: none; box-shadow: 0 0 0 3px var(--magenta-soft); }
.tabs { display: flex; gap: 4px; margin-bottom: 8px; }
.tabs button { border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius); padding: 4px 10px; font-size: 12px; font-weight: 700; cursor: pointer; color: var(--text-2); }
.tabs button.on { background: var(--magenta); border-color: var(--magenta); color: #fff; }
.orig { padding: 12px; background: var(--orig-bg); border-left: 3px solid var(--orig-bd); border-radius: 0 var(--radius) var(--radius) 0; font-size: 13px; white-space: pre-wrap; line-height: 1.55; max-height: 420px; overflow: auto; }
.links { display: flex; gap: 16px; margin-top: 8px; font-size: 12.5px; font-weight: 600; flex-wrap: wrap; }
.version { border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 8px; }
.version summary { padding: 8px 12px; cursor: pointer; font-size: 13px; font-weight: 600; }
.version .vbody { padding: 0 12px 12px; }
.diff { font-family: var(--mono); font-size: 12px; white-space: pre-wrap; max-height: 360px; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius); padding: 8px; background: var(--surface-2); }
.diff .add { background: rgba(46,125,50,.16); display: block; } .diff .del { background: rgba(198,40,40,.14); display: block; text-decoration: line-through; opacity: .85; }
.diff .ctx { display: block; color: var(--text-3); }
.timeline { list-style: none; padding: 0; margin: 0 0 12px; border-left: 2px solid var(--border); }
.timeline li { padding: 4px 0 10px 14px; position: relative; font-size: 13px; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 9px; width: 10px; height: 10px; border-radius: 50%; background: var(--border-strong); }
.timeline li.t-comment::before { background: var(--magenta); }
.timeline .who { font-weight: 700; } .timeline .when { color: var(--text-3); font-size: 12px; margin-left: 6px; }
.timeline .txt { white-space: pre-wrap; margin-top: 2px; }
.timeline li.t-event .txt { color: var(--text-2); }

/* ---------- Tables ---------- */
.table-wrap { overflow: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
table.t th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); padding: 10px 12px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; position: sticky; top: 0; }
table.t td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.t tr:hover td { background: var(--hover); }
table.t td.num { text-align: right; font-variant-numeric: tabular-nums; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700; }
.pill-ok { background: var(--low-bg); color: var(--low); } .pill-warning { background: var(--med-bg); color: var(--med); } .pill-error { background: var(--high-bg); color: var(--high); } .pill-running { background: var(--info-bg); color: var(--info); }
.pill-role { background: var(--surface-3); color: var(--text-2); }

/* ---------- Calendar ---------- */
.cal-month { margin-bottom: 16px; }
.cal-month h3 { margin: 0 0 8px; font-size: 14px; display: flex; gap: 8px; align-items: center; }
.cal-item { display: grid; grid-template-columns: 90px 1fr auto; gap: 12px; align-items: center; padding: 10px 14px; border-top: 1px solid var(--border); cursor: pointer; }
.cal-item:hover { background: var(--hover); }
.cal-date { font-weight: 700; font-variant-numeric: tabular-nums; }
.cal-date small { display: block; font-weight: 600; color: var(--text-3); font-size: 11px; }
.cal-item .ttl { font-weight: 600; font-size: 13.5px; }

/* ---------- Modal / toast ---------- */
.modal { position: fixed; inset: 0; z-index: 120; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(15,15,20,.5); }
.modal-card { width: min(460px, 100%); background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); border-top: 4px solid var(--magenta); padding: 20px; }
.modal-card h2 { margin: 0 0 6px; font-size: 18px; }
.modal-card p { margin: 0 0 14px; color: var(--text-2); font-size: 13.5px; }
.modal-card .field { margin-bottom: 12px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.secret { font-family: var(--mono); font-size: 15px; padding: 10px 12px; background: var(--surface-3); border-radius: var(--radius); user-select: all; word-break: break-all; }
.form-error { color: var(--high); font-size: 13px; min-height: 18px; margin-top: 4px; }
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: #222226; color: #fff; padding: 10px 16px; border-radius: var(--radius); font-size: 13.5px; box-shadow: var(--shadow-lg); max-width: 520px; }
.toast.err { background: var(--high); }
.notice { padding: 10px 14px; border-radius: var(--radius); background: var(--info-bg); color: var(--info); font-size: 13px; margin-bottom: 12px; }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art { background: linear-gradient(150deg, #E20074 0%, #A30052 58%, #5c002e 100%); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-art img { height: 30px; width: auto; filter: brightness(0) invert(1); align-self: flex-start; }
.login-art h1 { font-size: 34px; line-height: 1.15; margin: 0 0 14px; letter-spacing: -.02em; max-width: 520px; }
.login-art p { font-size: 15px; opacity: .88; max-width: 460px; margin: 0; }
.login-art ul { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 10px; font-size: 14px; opacity: .92; }
.login-art li { display: flex; gap: 10px; align-items: center; }
.login-art .grid-deco { position: absolute; right: -80px; bottom: -80px; width: 420px; height: 420px; opacity: .12; }
.login-art .foot { font-size: 12px; opacity: .7; }
.login-form { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: var(--surface); }
.login-card { width: min(380px, 100%); }
.login-card h2 { font-size: 22px; margin: 0 0 4px; }
.login-card > p { margin: 0 0 24px; color: var(--text-2); font-size: 14px; }
.login-card .field { margin-bottom: 14px; }
.login-card .field input { height: 42px; font-size: 14.5px; }
.login-card .btn-primary { width: 100%; justify-content: center; height: 42px; font-size: 14.5px; }
.login-top { display: flex; justify-content: flex-end; gap: 8px; margin-bottom: 40px; }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) { .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  .nav a span { display: none; }
  .brand-name small { display: none; }
  .user-btn .uname, .user-btn .role { display: none; }
  .login-wrap { grid-template-columns: 1fr; }
  .login-art { padding: 28px; min-height: auto; }
  .login-art h1 { font-size: 24px; } .login-art ul, .login-art .grid-deco { display: none; }
}
@media (max-width: 640px) {
  main { padding: 12px; }
  .topbar-inner { padding: 0 12px; gap: 10px; }
  .brand-sep, .brand-name { display: none; }
  .nav { margin-left: 0; } .nav a { padding: 0 10px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .msg { flex-direction: column; gap: 10px; }
  .checks { flex-direction: row; border-right: 0; border-bottom: 1px solid var(--border); padding: 0 0 8px; gap: 14px; }
  .seg { flex-wrap: wrap; height: auto; } .seg button { height: 34px; }
  .cal-item { grid-template-columns: 70px 1fr; } .cal-item > :last-child { grid-column: 2; }
  .lang-select { padding: 0 4px; }
}
@media (max-width: 480px) {
  .brand img { height: 16px; }
  .topbar-inner { gap: 6px; padding: 0 8px; }
  .nav a { padding: 0 7px; }
  #themeBtn { display: none; }
  .user-btn { padding: 2px; }
  #auditQ { min-width: 0 !important; width: 100%; }
}
@media print {
  .topbar, .filters, .toolbar, .checks, .msg-actions { display: none !important; }
  .group { break-inside: avoid; box-shadow: none; }
}

/* v1.1 operations and onboarding */
.run-controls{display:flex;gap:10px;align-items:center;flex-wrap:wrap;justify-content:flex-end}
.run-progress progress{width:100%;height:14px;accent-color:var(--accent,#e20074);margin-top:14px}
.run-progress p{margin:8px 0}.pill-queued{background:#fff0cf;color:#805000}
.guide-dialog{max-width:740px!important}.guide-head{margin-bottom:24px}.guide-head h2{margin:12px 0}
.guide-steps{list-style:none;padding:0;display:grid;gap:20px}.guide-steps li{display:flex;gap:16px}
.guide-steps li>span{flex:0 0 32px;height:32px;border-radius:50%;display:grid;place-items:center;background:#e20074;color:white;font-weight:700}
.guide-steps h3{margin:0 0 5px}.guide-steps p{margin:0;line-height:1.6}
.diagnostics article{border-bottom:1px solid var(--border,#ddd);padding:12px 0}.diagnostics p,.diagnostic{white-space:pre-wrap;overflow-wrap:anywhere}
.release-list li{margin:16px 0;line-height:1.6}
@media(max-width:760px){.topbar-right{flex-wrap:wrap}.run-controls{justify-content:flex-start}.page-head{flex-wrap:wrap;gap:12px}}
.modal-card{max-height:calc(100dvh - 40px);overflow-y:auto;overscroll-behavior:contain}
.guide-dialog{width:min(740px,100%)}
@media(max-width:1100px){.topbar-inner{height:auto;min-height:60px;flex-wrap:wrap;padding-top:10px;padding-bottom:10px}.topbar-right{flex-wrap:wrap}.nav{order:3;width:100%;justify-content:center}}
@media(max-width:480px){.topbar-right{margin-left:0;width:100%;justify-content:space-between}.modal{padding:12px}.modal-card{max-height:calc(100dvh - 24px)}}
