:root {
  --background: #0b0d0f;
  --sidebar: #101215;
  --surface: #15181c;
  --surface-secondary: #1c2025;
  --surface-raised: #22272d;
  --border: #2a3037;
  --border-strong: #39414a;
  --text-primary: #f2f3f4;
  --text-secondary: #929aa4;
  --text-muted: #68717c;
  --accent: #d62839;
  --accent-hover: #ed3348;
  --success: #35a56c;
  --warning: #d9902f;
  --danger: #e04d5d;
  --radius-sm: 4px;
  --radius-md: 7px;
  --shadow-subtle: 0 10px 30px rgb(0 0 0 / 16%);
}

html { background: var(--background); }
body.control-room { min-width: 1024px; background: var(--background); color: var(--text-primary); font-size: 14px; }
body.control-room * { scrollbar-color: var(--border-strong) var(--background); }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0, 1fr); }
.app-sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 20px 12px; border-right: 1px solid var(--border); background: var(--sidebar); }
.app-brand { display: block; padding: 0 10px 18px; color: var(--text-primary); letter-spacing: .12em; font-size: 15px; font-weight: 800; text-decoration: none; }
.app-brand small { display: block; margin-top: 4px; color: var(--text-muted); font-size: 10px; font-weight: 600; letter-spacing: .16em; }
.nav-group { margin: 0 0 16px; }
.nav-group__label { margin: 0 10px 6px; color: var(--text-muted); font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.nav-link { display: flex; align-items: center; gap: 10px; min-height: 34px; margin: 1px 0; padding: 7px 10px; border-left: 2px solid transparent; border-radius: var(--radius-sm); color: var(--text-secondary); font-size: 13px; text-decoration: none; transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease; }
.nav-link:hover { background: var(--surface-secondary); color: var(--text-primary); }
.nav-link.is-active { border-left-color: var(--accent); background: var(--surface-secondary); color: var(--text-primary); }
.nav-link__icon { width: 17px; color: var(--text-muted); font-size: 11px; font-weight: 800; text-align: center; }
.nav-link.is-active .nav-link__icon { color: var(--accent-hover); }
.app-content { min-width: 0; padding: 22px 30px 36px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 40px; margin-bottom: 22px; }
.topbar__eyebrow { margin-bottom: 3px; color: var(--text-muted); font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.topbar h1 { margin: 0; color: var(--text-primary); font-size: 22px; font-weight: 650; letter-spacing: -.02em; }
.session-chip { display: flex; align-items: center; gap: 8px; color: var(--text-secondary); font-size: 12px; }
.session-chip__status { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px rgb(53 165 108 / 12%); }
.btn, button.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 34px; padding: 7px 11px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface-secondary); color: var(--text-primary); font-size: 12px; font-weight: 650; line-height: 1; transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease; }
.btn:hover { border-color: #505a65; background: var(--surface-raised); }
.btn--primary { border-color: var(--accent); background: var(--accent); color: #fff; }
.btn--primary:hover { border-color: var(--accent-hover); background: var(--accent-hover); }
.btn--danger { border-color: rgb(224 77 93 / 60%); color: #ffb3bc; }
.btn--danger:hover { background: rgb(214 40 57 / 14%); }
.btn--quiet { border-color: transparent; background: transparent; color: var(--text-secondary); }
.btn--quiet:hover { border-color: var(--border); background: var(--surface-secondary); color: var(--text-primary); }
.ui-card { border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-subtle); }
.ui-card__header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--border); }
.ui-card__body { padding: 16px; }
.stat-chip { min-width: 140px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); }
.stat-chip__label { color: var(--text-muted); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.stat-chip__value { margin-top: 5px; color: var(--text-primary); font-size: 20px; font-weight: 650; line-height: 1; }
.stat-chip__meta { margin-top: 5px; color: var(--text-secondary); font-size: 11px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.search-input { min-width: 260px; flex: 1 1 320px; }
.control-room input:not([type="checkbox"]):not([type="radio"]), .control-room select, .control-room textarea { border-color: var(--border) !important; border-radius: var(--radius-sm) !important; background-color: #0e1114 !important; color: var(--text-primary) !important; box-shadow: none !important; }
.control-room input:focus, .control-room select:focus, .control-room textarea:focus { outline: 2px solid rgb(214 40 57 / 45%); outline-offset: 1px; border-color: var(--accent) !important; }
.control-room input::placeholder, .control-room textarea::placeholder { color: var(--text-muted); }
.filter-pill { display: inline-flex; min-height: 30px; align-items: center; border: 1px solid var(--border); border-radius: 999px; padding: 5px 10px; background: transparent; color: var(--text-secondary); font-size: 11px; font-weight: 650; }
.filter-pill:hover { border-color: var(--border-strong); color: var(--text-primary); }
.filter-pill.is-active { border-color: rgb(214 40 57 / 70%); background: rgb(214 40 57 / 13%); color: #ffd2d7; }
.status-badge { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--border); border-radius: 999px; padding: 3px 8px; color: var(--text-secondary); font-size: 10px; font-weight: 700; line-height: 1.2; text-transform: uppercase; }
.status-badge::before { width: 5px; height: 5px; border-radius: 50%; background: currentColor; content: ""; }
.status-badge--active { border-color: rgb(53 165 108 / 50%); color: #77ce9b; }
.status-badge--warning { border-color: rgb(217 144 47 / 55%); color: #efb767; }
.status-badge--inactive { color: var(--text-muted); }
.data-table { width: 100%; border-collapse: collapse; }
.data-table--wide { min-width: 74rem; }
.data-table th { height: 38px; border-bottom: 1px solid var(--border); color: var(--text-muted); font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.data-table td { height: 48px; border-bottom: 1px solid rgb(42 48 55 / 72%); color: var(--text-secondary); vertical-align: middle; }
.data-table tbody tr { transition: background-color 100ms ease; }
.data-table tbody tr:hover { background: rgb(255 255 255 / 2.5%); }
.data-table a { color: #f1c2c8; }
.data-table a:hover { color: #fff; }
.toggle { position: relative; display: inline-flex; width: 32px; height: 18px; vertical-align: middle; }
.toggle input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.toggle span { width: 100%; border: 1px solid var(--border-strong); border-radius: 99px; background: var(--border); transition: .14s ease; }
.toggle span::after { position: absolute; top: 3px; left: 3px; width: 10px; height: 10px; border-radius: 50%; background: #d5d9dd; content: ""; transition: .14s ease; }
.toggle input:checked + span { border-color: var(--accent); background: var(--accent); }
.toggle input:checked + span::after { transform: translateX(14px); background: #fff; }
.toggle input:focus-visible + span { outline: 2px solid rgb(214 40 57 / 55%); outline-offset: 2px; }
.accordion-summary { list-style: none; }
.accordion-summary::-webkit-details-marker { display: none; }
.empty-state { padding: 36px 18px; color: var(--text-secondary); text-align: center; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; color: var(--text-secondary); font-size: 12px; }
.pagination > div { display: flex; gap: 6px; }
.action-menu { position: relative; }
.action-menu > summary { list-style: none; }
.action-menu > summary::-webkit-details-marker { display: none; }
.action-menu__panel { position: absolute; z-index: 30; right: 0; min-width: 172px; margin-top: 6px; padding: 6px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-raised); box-shadow: var(--shadow-subtle); }
.action-menu__item { display: block; width: 100%; min-height: 30px; padding: 7px 8px; border-radius: var(--radius-sm); color: var(--text-secondary); font-size: 12px; text-align: left; }
.action-menu__item:hover { background: rgb(255 255 255 / 5%); color: var(--text-primary); }
.action-menu__item--danger { color: #ffadb7; }
.modal-shell { position: fixed; z-index: 70; inset: 0; overflow-y: auto; padding: 24px; background: rgb(0 0 0 / 74%); }
.modal-shell.flex { align-items: center; justify-content: center; }
.modal-panel { width: min(960px, 100%); max-height: calc(100vh - 48px); margin: 0 auto; overflow-y: auto; }
.planning-indicator { display: inline-flex; align-items: center; gap: 6px; color: var(--text-secondary); font-size: 11px; }
.planning-indicator::before { width: 6px; height: 6px; border-radius: 50%; background: var(--success); content: ""; }
.planning-indicator--late { color: #f0b25f; }
.planning-indicator--late::before { background: var(--warning); }
.planning-indicator--idle::before { background: var(--text-muted); }
.tab-list { display: flex; flex-wrap: wrap; gap: 4px; padding: 5px; border: 1px solid var(--border); border-radius: var(--radius-md); background: #0e1114; }
.tab-button { min-height: 32px; padding: 7px 11px; border: 1px solid transparent; border-radius: var(--radius-sm); color: var(--text-secondary); font-size: 12px; font-weight: 650; }
.tab-button:hover { background: var(--surface-secondary); color: var(--text-primary); }
.tab-button.is-active { border-color: var(--border-strong); background: var(--surface-raised); color: var(--text-primary); }
.summary-strip { display: grid; grid-template-columns: minmax(220px, 1.35fr) repeat(4, minmax(120px, .7fr)); overflow: hidden; }
.summary-strip__item { min-width: 0; padding: 13px 16px; border-right: 1px solid var(--border); }
.summary-strip__item:last-child { border-right: 0; }
.summary-strip__label, .key-value__label { color: var(--text-muted); font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.summary-strip__value { margin-top: 5px; overflow: hidden; color: var(--text-primary); font-size: 14px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.summary-strip__meta { margin-top: 3px; overflow: hidden; color: var(--text-secondary); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.key-value-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; background: var(--border); }
.key-value { min-width: 0; padding: 11px 12px; background: var(--surface); }
.key-value__value { margin-top: 4px; overflow-wrap: anywhere; color: var(--text-primary); font-size: 12px; }
.section-heading { color: var(--text-primary); font-size: 14px; font-weight: 650; }
.section-kicker { color: var(--text-muted); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.copy-button { display: inline-flex; align-items: center; min-height: 25px; margin-left: 6px; padding: 4px 7px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); color: var(--text-secondary); font-size: 10px; }
.copy-button:hover { background: var(--surface-secondary); color: var(--text-primary); }

/* Explorer, bulk action and side-drawer primitives */
.explorer-layout { display: grid; grid-template-columns: 238px minmax(0, 1fr); min-height: 590px; overflow: hidden; }
.explorer-sidebar { display: flex; min-width: 0; flex-direction: column; border-right: 1px solid var(--border); background: #111417; }
.explorer-sidebar__header { display: flex; min-height: 62px; align-items: center; justify-content: space-between; gap: 10px; padding: 12px; border-bottom: 1px solid var(--border); }
.explorer-sidebar__note { margin-top: auto; padding: 12px; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 10px; line-height: 1.45; }
.explorer-nav { display: grid; padding: 7px; }
.explorer-nav__row { display: grid; grid-template-columns: minmax(0, 1fr) 28px; align-items: center; }
.explorer-nav__item { display: flex; width: 100%; min-width: 0; min-height: 34px; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 9px; border-left: 2px solid transparent; border-radius: var(--radius-sm); color: var(--text-secondary); font-size: 12px; text-align: left; }
.explorer-nav__item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.explorer-nav__item strong { color: var(--text-muted); font-size: 10px; font-weight: 650; }
.explorer-nav__item:hover { background: var(--surface-secondary); color: var(--text-primary); }
.explorer-nav__item.is-active { border-left-color: var(--accent); background: var(--surface-secondary); color: var(--text-primary); }
.explorer-nav__more { display: grid; min-height: 28px; cursor: pointer; place-items: center; list-style: none; border-radius: var(--radius-sm); color: var(--text-muted); font-size: 11px; }
.explorer-nav__more:hover { background: var(--surface-secondary); color: var(--text-primary); }
.explorer-content { min-width: 0; overflow: hidden; }
.bulk-bar { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 7px 12px; border-bottom: 1px solid rgb(214 40 57 / 38%); background: rgb(214 40 57 / 8%); color: var(--text-secondary); font-size: 11px; }
.bulk-bar strong { margin-right: auto; color: #ffd2d7; }
.drawer-shell { position: fixed; z-index: 60; inset: 0; }
.drawer-backdrop { position: absolute; inset: 0; width: 100%; border: 0; background: rgb(0 0 0 / 65%); }
.drawer-panel { position: absolute; top: 0; right: 0; width: min(560px, calc(100vw - 280px)); height: 100%; overflow-y: auto; border-left: 1px solid var(--border); background: var(--surface); box-shadow: -22px 0 55px rgb(0 0 0 / 35%); }
.drawer-header { position: sticky; z-index: 2; top: 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 16px; border-bottom: 1px solid var(--border); background: rgb(21 24 28 / 97%); backdrop-filter: blur(8px); }
.drawer-body { display: grid; gap: 13px; padding: 16px; }
.drawer-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 2px; }
.drawer-notice { padding: 10px 12px; border-left: 3px solid var(--warning); background: rgb(217 144 47 / 8%); color: #efc687; font-size: 11px; line-height: 1.45; }
.usage-list { display: grid; gap: 6px; }
.usage-list__item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 9px; border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-secondary); font-size: 11px; }
.usage-list__item:hover { border-color: var(--border-strong); background: var(--surface-secondary); }
.usage-list__item strong, .usage-list__item small { display: block; }
.usage-list__item strong { color: var(--text-primary); font-weight: 650; }
.usage-list__item small { margin-top: 2px; color: var(--text-muted); }
.usage-list__item em { color: var(--text-secondary); font-style: normal; white-space: nowrap; }

.database-page { display: grid; gap: 12px; }
.database-page__notice { padding: 10px 13px; border-left: 3px solid var(--warning); color: var(--text-secondary); font-size: 12px; }
.database-technical > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 14px; }
.database-technical > summary::after { color: var(--text-muted); content: "Afficher"; font-size: 10px; font-weight: 700; text-transform: uppercase; }
.database-technical[open] > summary::after { content: "Masquer"; }
.database-technical__body { padding: 0 14px 14px; }
.database-workspace { overflow: hidden; }
.database-workspace__tabs { padding: 12px 14px 0; }
.database-workspace__pane { padding: 14px; }
.database-table-link { color: #f3c3c9; font-weight: 650; }
.database-table-link:hover { color: #fff; text-decoration: underline; }
.database-modal-header { position: sticky; z-index: 4; top: 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 16px; border-bottom: 1px solid var(--border); background: rgb(21 24 28 / 97%); backdrop-filter: blur(8px); }
.database-modal-body { display: grid; gap: 14px; padding: 14px 16px 18px; }
.database-modal-summary { display: flex; flex-wrap: wrap; gap: 16px 24px; margin-top: 8px; color: var(--text-secondary); font-size: 11px; }
.database-modal-summary strong { color: var(--text-primary); font-weight: 650; }
.database-section { border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); }
.database-section__header { padding: 11px 13px; border-bottom: 1px solid var(--border); }
.database-section__body { padding: 13px; }
.database-two-column { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.survival-stat-chip { min-width: 132px; flex: 1 1 132px; }

/* Master/detail workspaces */
.master-detail { display: grid; grid-template-columns: minmax(280px, .72fr) minmax(560px, 1.45fr); min-height: 590px; }
.master-detail__master { min-width: 0; border-right: 1px solid var(--border); background: #111417; }
.master-detail__detail { min-width: 0; background: var(--surface); }
.master-list { max-height: 660px; overflow-y: auto; }
.master-list__item { display: block; width: 100%; padding: 13px 15px; border-bottom: 1px solid var(--border); border-left: 3px solid transparent; color: var(--text-secondary); text-align: left; transition: background-color 110ms ease, border-color 110ms ease; }
.master-list__item:hover { background: rgb(255 255 255 / 3%); color: var(--text-primary); }
.master-list__item.is-active { border-left-color: var(--accent); background: var(--surface-secondary); color: var(--text-primary); }
.master-list__title { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--text-primary); font-size: 13px; font-weight: 650; }
.master-list__meta { display: flex; flex-wrap: wrap; gap: 5px 9px; margin-top: 6px; color: var(--text-muted); font-size: 10px; }
.detail-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 15px 16px; border-bottom: 1px solid var(--border); }
.detail-body { display: grid; gap: 14px; padding: 16px; }
.detail-section { border: 1px solid var(--border); border-radius: var(--radius-md); background: #121519; }
.detail-section__header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.detail-section__body { padding: 12px; }
.compact-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
.compact-form-grid label { display: grid; gap: 5px; color: var(--text-secondary); font-size: 11px; }
.compact-form-grid .span-2 { grid-column: span 2; }
.form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding-top: 2px; }
.accordion-card > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; padding: 11px 14px; }
.accordion-card > summary::after { color: var(--text-muted); content: "Afficher"; font-size: 10px; font-weight: 700; text-transform: uppercase; }
.accordion-card[open] > summary::after { content: "Masquer"; }
.accordion-card__body { border-top: 1px solid var(--border); }
.modal-panel--compact { width: min(720px, 100%); }
.modal-header { position: sticky; z-index: 2; top: 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 15px 16px; border-bottom: 1px solid var(--border); background: rgb(21 24 28 / 97%); }
.modal-body { padding: 16px; }
.rewards-page { display: grid; gap: 14px; }
.rewards-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.rewards-stats { display: grid; grid-template-columns: repeat(7, minmax(105px, 1fr)); gap: 8px; }
.rewards-stats .stat-chip { min-width: 0; padding: 10px 12px; }
.rewards-stats .stat-chip__value { font-size: 17px; }
.rewards-toolbar select { min-width: 130px; min-height: 34px; padding: 6px 9px; font-size: 11px; }
.rewards-results { margin-left: auto; color: var(--text-muted); font-size: 11px; white-space: nowrap; }
.reward-detail-empty { display: grid; min-height: 520px; place-items: center; padding: 32px; color: var(--text-secondary); text-align: center; }
.reward-link-list { display: flex; flex-wrap: wrap; gap: 7px; }
.reward-link-chip { display: inline-flex; align-items: center; gap: 7px; min-height: 30px; padding: 5px 7px 5px 9px; border: 1px solid var(--border); border-radius: 999px; color: var(--text-secondary); font-size: 11px; }
.reward-link-chip button { color: #ffadb7; font-weight: 700; }
.reward-link-form { display: grid; grid-template-columns: minmax(180px, 1fr) auto; gap: 8px; margin-top: 10px; }
.reward-history-stack { display: grid; gap: 10px; }
.reward-history-stack .ui-card { box-shadow: none; }
.zones-page { display: grid; gap: 14px; }
.zones-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.zones-stats { display: grid; grid-template-columns: repeat(5, minmax(110px, 1fr)); gap: 8px; }
.zones-stats .stat-chip { min-width: 0; padding: 10px 12px; }
.zones-stats .stat-chip__value { font-size: 18px; }
.zones-toolbar select { min-height: 34px; padding: 6px 8px; font-size: 11px; }
.zones-table { min-width: 900px; }
.zones-table__name { max-width: 260px; overflow: hidden; color: #f1c2c8; font-size: 12px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.zones-table__name:hover { color: #fff; }
.zones-table__id { max-width: 260px; margin-top: 3px; overflow: hidden; color: var(--text-muted); font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }

/* Shared folder explorer used by Passive Events and Dynamic Quests. */
.explorer-page { display: grid; width: min(100%, 1660px); margin-inline: auto; gap: 12px; }
.explorer-page__header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.explorer-page__header h1 { margin-top: 3px; color: var(--text-primary); font-size: 20px; font-weight: 700; }
.explorer-page__header p { margin-top: 4px; color: var(--text-muted); font-size: 12px; }
.explorer-page__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.status-summary { display: flex; flex-wrap: wrap; gap: 6px; color: var(--text-muted); font-size: 11px; }
.status-summary span { padding: 6px 9px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); }
.status-summary strong { color: var(--text-primary); }
.alert { padding: 10px 13px; border: 1px solid; border-radius: var(--radius-md); font-size: 12px; }
.alert--success { border-color: #237b59; background: rgb(24 92 66 / 36%); color: #b8f2d9; }
.alert--danger { border-color: #8d2b39; background: rgb(105 25 38 / 40%); color: #ffc2ca; }

/* Dashboard audit control room */
.dashboard-page { display: grid; gap: 14px; }
.health-strip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.health-strip__item { min-width: 0; padding: 9px 12px; border-right: 1px solid var(--border); }
.health-strip__item:last-child { border-right: 0; }
.health-strip__heading { display: flex; align-items: center; gap: 7px; font-size: 12px; }
.health-strip__detail { display: flex; min-height: 25px; align-items: center; gap: 5px; margin: 2px 0 0 14px; }
.health-strip__item small { min-width: 0; overflow: hidden; color: var(--text-muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.health-strip__item .btn { min-height: 24px; margin-left: auto; padding: 3px 6px; font-size: 9px; }
.health-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-muted); }
.health-dot--ok { background: var(--success); box-shadow: 0 0 0 3px rgb(53 165 108 / 12%); }
.health-dot--error { background: var(--danger); box-shadow: 0 0 0 3px rgb(224 77 93 / 12%); }
.health-dot--idle, .health-dot--unknown { background: var(--warning); }
.test-result { display: inline-block; margin-left: 5px; font-size: 10px; }
.test-result--ok { color: #77ce9b; }
.test-result--error { color: #ff9aa6; }
.dashboard-columns { display: grid; grid-template-columns: minmax(0, 4fr) minmax(220px, 1fr); gap: 14px; }
.dashboard-side { display: grid; align-content: start; gap: 14px; }
.dashboard-activity__header { min-height: 55px; padding-block: 9px; }
.activity-live-controls { display: flex; align-items: center; gap: 8px; }
.activity-updated { color: var(--text-muted); font-size: 9px; }
.activity-auto-toggle { min-height: 28px; padding: 5px 8px; font-size: 10px; }
.activity-filters { border-bottom: 1px solid var(--border); }
.activity-filters__main { display: grid; grid-template-columns: minmax(260px, 1.8fr) repeat(3, minmax(125px, 1fr)) auto; gap: 8px; padding: 9px 12px; }
.activity-filter { display: grid; min-width: 0; gap: 4px; color: var(--text-muted); font-size: 9px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.activity-filters input, .activity-filters select { min-width: 0; height: 31px; padding: 5px 7px; font-size: 11px; }
.activity-filters__actions { display: flex; align-items: end; gap: 5px; }
.activity-filters__actions .btn { min-height: 31px; padding-inline: 9px; }
.activity-filters__advanced { border-top: 1px solid rgb(42 48 55 / 60%); }
.activity-filters__advanced > summary { width: max-content; padding: 7px 12px; cursor: pointer; color: var(--text-secondary); font-size: 10px; font-weight: 650; list-style-position: inside; }
.activity-filters__advanced-grid { display: grid; grid-template-columns: repeat(5, minmax(120px, 1fr)); gap: 8px; padding: 0 12px 10px; }
.activity-active-filters { display: flex; flex-wrap: wrap; gap: 5px; padding: 7px 12px; border-bottom: 1px solid var(--border); }
.activity-active-filters .filter-pill { min-height: 25px; padding: 3px 8px; font-size: 9px; text-transform: none; }
.activity-table-wrap { width: 100%; overflow-x: auto; }
.activity-table { width: 100%; table-layout: fixed; border-collapse: collapse; }
.activity-table th { height: 30px; padding: 0 9px; border-bottom: 1px solid var(--border); color: var(--text-muted); font-size: 9px; font-weight: 700; letter-spacing: .06em; text-align: left; text-transform: uppercase; }
.activity-table th:nth-child(1) { width: 76px; }
.activity-table th:nth-child(2) { width: 145px; }
.activity-table th:nth-child(3) { width: 125px; }
.activity-table th:nth-child(4) { width: 160px; }
.activity-table th:nth-child(6) { width: 100px; text-align: right; }
.activity-table td { height: 47px; padding: 5px 9px; border-bottom: 1px solid rgb(42 48 55 / 72%); color: var(--text-secondary); font-size: 11px; }
.activity-table__row { cursor: pointer; transition: background-color 100ms ease; }
.activity-table__row:hover, .activity-table__row:focus-visible { outline: none; background: rgb(255 255 255 / 3%); }
.activity-table__time { color: var(--text-muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px !important; white-space: nowrap; }
.activity-table__actor, .activity-table__actor-label, .activity-table__module, .activity-table__action, .activity-table__target { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.activity-table__actor { color: #f1c2c8; font-weight: 700; text-align: left; }
.activity-table__actor:hover { color: #fff; text-decoration: underline; }
.activity-table__actor-label { color: var(--text-primary); font-weight: 700; }
.activity-table__module { color: var(--text-secondary); }
.activity-table__action { color: var(--text-primary); font-size: 11px; font-weight: 650; }
.activity-table__target { color: #c4c9cf; }
.activity-table__status-cell { text-align: right; }
.activity-status { display: inline-flex; align-items: center; gap: 5px; color: var(--text-secondary); font-size: 10px; font-weight: 650; white-space: nowrap; }
.activity-status__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--text-muted); }
.activity-status--success { color: #77ce9b; }
.activity-status--success .activity-status__dot { background: var(--success); }
.activity-status--failed, .activity-status--denied { color: #ff9aa6; }
.activity-status--failed .activity-status__dot, .activity-status--denied .activity-status__dot { background: var(--danger); }
.activity-status--partial, .activity-status--expired, .activity-status--cancelled { color: #efb767; }
.activity-status--partial .activity-status__dot, .activity-status--expired .activity-status__dot, .activity-status--cancelled .activity-status__dot { background: var(--warning); }
.activity-pagination { padding-block: 8px; }
.active-team-card__header { min-height: 46px; padding: 10px 12px; }
.active-team { display: grid; padding: 4px; }
.active-team__row { display: flex; width: 100%; min-width: 0; align-items: flex-start; gap: 8px; padding: 8px; border-radius: var(--radius-sm); color: var(--text-secondary); text-align: left; }
.active-team__row:hover { background: var(--surface-secondary); }
.active-team__row .session-chip__status { margin-top: 4px; flex: 0 0 auto; }
.active-team__content { min-width: 0; }
.active-team__content strong, .active-team__content small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.active-team__content strong { color: var(--text-primary); font-size: 11px; }
.active-team__content small { margin-top: 2px; color: var(--text-muted); font-size: 9px; }
.empty-state--compact { padding: 14px 12px; font-size: 11px; }
.audit-description { padding: 11px 12px; border-left: 3px solid var(--accent); background: rgb(214 40 57 / 7%); color: var(--text-secondary); font-size: 12px; }
.audit-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--border); gap: 1px; }
.audit-summary > div { min-width: 0; padding: 9px 10px; background: var(--surface); }
.audit-summary span, .audit-summary strong { display: block; }
.audit-summary span { color: var(--text-muted); font-size: 9px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.audit-summary strong { margin-top: 3px; overflow-wrap: anywhere; color: var(--text-primary); font-size: 11px; }
.audit-changes h3 { margin-bottom: 7px; color: var(--text-primary); font-size: 11px; font-weight: 700; }
.audit-changes__table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-md); }
.audit-changes__table { width: 100%; border-collapse: collapse; font-size: 10px; }
.audit-changes__table th, .audit-changes__table td { padding: 8px 9px; border-bottom: 1px solid var(--border); text-align: left; }
.audit-changes__table thead th { color: var(--text-muted); font-size: 9px; text-transform: uppercase; }
.audit-changes__table tbody th { color: var(--text-secondary); font-weight: 650; }
.audit-changes__table tr.is-changed td:last-child { background: rgb(53 165 108 / 8%); color: #a7e1c0; }
.audit-technical { border: 1px solid var(--border); border-radius: var(--radius-md); }
.audit-technical > summary { padding: 9px 11px; cursor: pointer; color: var(--text-secondary); font-size: 10px; font-weight: 650; }
.audit-technical__body { padding: 0 11px 11px; color: var(--text-muted); font-size: 10px; }
.audit-technical__body dl { display: grid; gap: 5px; margin-bottom: 8px; }
.audit-technical__body dl div { display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: 8px; }
.audit-technical__body dt { color: var(--text-secondary); }
.audit-technical__body dd { overflow-wrap: anywhere; }

@media (max-width: 1500px) {
  .activity-filters__main { grid-template-columns: minmax(240px, 1.6fr) repeat(3, minmax(110px, 1fr)); }
  .activity-filters__actions { grid-column: -2 / -1; justify-content: flex-end; }
}

@media (max-width: 1280px) {
  .dashboard-columns { grid-template-columns: 1fr; }
  .dashboard-side { grid-row: 2; }
  .active-team { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .activity-filters__main { grid-template-columns: minmax(240px, 2fr) repeat(3, minmax(120px, 1fr)) auto; }
  .activity-filters__actions { grid-column: auto; }
}

@media (max-width: 1100px) {
  .health-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .health-strip__item:nth-child(3) { border-right: 0; }
  .health-strip__item:nth-child(n+4) { border-top: 1px solid var(--border); }
  .activity-filters__main { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .activity-filter--search { grid-column: 1 / -1; }
  .activity-filters__actions { justify-content: flex-end; }
  .activity-filters__advanced-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .activity-table th:nth-child(3), .activity-table td:nth-child(3) { display: none; }
}
.explorer-nav__section { display: grid; gap: 2px; padding: 4px 0 8px; }
.explorer-nav__section + .explorer-nav__section { border-top: 1px solid var(--border); }
.explorer-nav__heading { padding: 8px 9px 4px; color: var(--text-muted); font-size: 9px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.explorer-nav__heading--action { display: flex; align-items: center; justify-content: space-between; }
.explorer-nav__folder { display: grid; grid-template-columns: minmax(0, 1fr) 28px; align-items: center; }
.explorer-nav__item--system span::before { margin-right: 7px; color: var(--text-muted); content: "◇"; }
.explorer-nav__empty { padding: 8px 9px; color: var(--text-muted); font-size: 10px; }
.icon-button { display: grid; width: 24px; height: 24px; place-items: center; border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-secondary); }
.icon-button:hover { border-color: var(--border-strong); color: var(--text-primary); }
.explorer-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; color: var(--text-muted); font-size: 11px; }
.explorer-summary strong { color: var(--text-primary); font-weight: 700; }
.explorer-content__header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.explorer-toolbar { flex-wrap: nowrap; }
.explorer-toolbar .search-input { min-width: 230px; flex: 1 1 300px; }
.explorer-toolbar select { min-width: 130px; }
.explorer-table { min-width: 980px; }
.explorer-table th, .explorer-table td { padding-inline: 10px; }
.explorer-table__name { display: inline-block; max-width: 260px; overflow: hidden; color: #f1c2c8; font-size: 12px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.explorer-table__meta { max-width: 270px; margin-top: 3px; overflow: hidden; color: var(--text-muted); font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.explorer-table__title { color: #f1c2c8; font-size: 12px; font-weight: 650; }
.explorer-table__title:hover { color: #fff; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
.form-grid .span-2 { grid-column: span 2; }
.form-label { display: grid; gap: 5px; color: var(--text-secondary); font-size: 11px; }
.form-label input, .form-label textarea, .form-label select { width: 100%; }
.toggle-label { display: inline-flex; align-items: center; gap: 7px; color: var(--text-secondary); font-size: 11px; }
.modal-footer { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border); }
.accordion { border: 1px solid var(--border); border-radius: var(--radius-md); background: #111418; }
.accordion > summary { padding: 10px 12px; cursor: pointer; color: var(--text-secondary); font-size: 11px; font-weight: 650; }
.accordion__body { padding: 12px; border-top: 1px solid var(--border); }
.compact-list { display: grid; gap: 6px; }
.compact-list__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.compact-list__row strong, .compact-list__row span { display: block; }
.compact-list__row strong { color: var(--text-primary); font-size: 11px; }
.compact-list__row span { margin-top: 2px; color: var(--text-muted); font-size: 9px; }
.row-actions { display: flex; min-width: 112px; align-items: center; justify-content: flex-end; gap: 7px; }
.row-actions__more { display: grid; width: 30px; min-height: 30px; cursor: pointer; place-items: center; list-style: none; border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-muted); }
.row-actions__more::-webkit-details-marker { display: none; }
.row-actions__more:hover { border-color: var(--border-strong); color: var(--text-primary); }
.action-menu__form { padding: 6px 8px; }
.action-menu__form label { display: grid; gap: 5px; color: var(--text-muted); font-size: 10px; text-transform: uppercase; }
.action-menu__form select { width: 100%; min-height: 30px; padding: 4px 7px; font-size: 11px; text-transform: none; }
.toolbar-more { position: relative; }
.toolbar-more > summary { list-style: none; white-space: nowrap; }
.toolbar-more > summary::-webkit-details-marker { display: none; }
.toolbar-more__panel { position: absolute; z-index: 35; top: calc(100% + 6px); right: 0; display: grid; min-width: 260px; gap: 10px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-raised); box-shadow: var(--shadow-subtle); }
.toolbar-more__panel label { display: grid; gap: 5px; color: var(--text-muted); font-size: 10px; text-transform: uppercase; }
.modal-panel--wide { width: min(1180px, 100%); }
.modal-stack { display: grid; gap: 10px; }
.secondary-data-row { display: flex; min-height: 48px; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #111417; color: var(--text-secondary); font-size: 11px; }
.secondary-data-row strong, .secondary-data-row small { display: block; }
.secondary-data-row strong { color: var(--text-primary); font-size: 12px; }
.secondary-data-row small { margin-top: 3px; color: var(--text-muted); }
.secondary-data-row p { margin-top: 5px; color: var(--text-secondary); }
.secondary-data-row time { color: var(--text-muted); white-space: nowrap; }

@media (max-width: 1439px) {
  .explorer-layout { grid-template-columns: 210px minmax(0, 1fr); }
  .explorer-toolbar { flex-wrap: wrap; }
  .explorer-toolbar .search-input { flex-basis: calc(100% - 310px); }
}

@media (max-width: 900px) {
  .explorer-page__header { flex-direction: column; }
  .explorer-layout { grid-template-columns: 1fr; min-height: 0; overflow: visible; }
  .explorer-sidebar { border-right: 0; border-bottom: 1px solid var(--border); }
  .explorer-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .explorer-sidebar__note { display: none; }
  .explorer-content { overflow: visible; }
  .bulk-bar { flex-wrap: wrap; }
  .bulk-bar strong { width: 100%; }
  .key-value-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
  .explorer-nav { grid-template-columns: 1fr; }
  .explorer-toolbar > * { width: 100%; }
  .toolbar-more__panel { position: static; min-width: 0; margin-top: 6px; }
  .secondary-data-row { align-items: flex-start; flex-direction: column; }
}
.usage-badge { display: inline-flex; min-height: 25px; align-items: center; border: 1px solid rgb(217 144 47 / 45%); border-radius: 999px; padding: 3px 8px; color: #efb767; font-size: 10px; font-weight: 700; }
.compact-form-grid label.flex-row { display: flex; align-items: center; gap: 8px; }
.tpe-page { display: grid; gap: 14px; }
.tpe-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.tpe-stats { display: grid; grid-template-columns: repeat(4, minmax(140px, 1fr)); gap: 8px; }
.tpe-stats .stat-chip { min-width: 0; padding: 10px 12px; }
.tpe-stats .stat-chip__value { font-size: 18px; }
.tpe-toolbar select { min-height: 34px; padding: 6px 9px; font-size: 11px; }
.tpe-search { min-width: 240px; flex: 1 1 360px; }
.tpe-search .search-input { width: 100%; }
.tpe-identity-list, .tpe-transaction-list { display: grid; }
.tpe-identity-row { display: grid; grid-template-columns: minmax(150px, .55fr) minmax(260px, 1.2fr) minmax(220px, .85fr) auto; align-items: center; gap: 14px; min-width: 0; padding: 12px 16px; border-bottom: 1px solid rgb(42 48 55 / 72%); color: var(--text-secondary); }
.tpe-identity-row:hover, .tpe-transaction-row:hover { background: rgb(255 255 255 / 2.5%); }
.tpe-identity-row__action, .tpe-transaction-row__action { justify-self: end; }
.tpe-row-label { display: block; margin-bottom: 4px; color: var(--text-muted); font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.tpe-copy-line { display: flex; min-width: 0; align-items: center; gap: 7px; }
.tpe-steam-id { margin-top: 4px; }
.tpe-copy-line > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.copy-button--icon { display: inline-flex; width: 26px; height: 26px; flex: 0 0 26px; align-items: center; justify-content: center; margin: 0; padding: 0; border: 1px solid transparent; border-radius: var(--radius-sm); color: var(--text-muted); font-size: 13px; }
.copy-button--icon:hover { border-color: var(--border); background: var(--surface-secondary); color: var(--text-primary); }
.tpe-public-id { color: #fff; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 22px; font-weight: 750; letter-spacing: .14em; }
.tpe-target-id { color: #f4b7bf; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-weight: 750; letter-spacing: .08em; }
.tpe-transaction-row { display: grid; grid-template-columns: minmax(115px, .7fr) minmax(75px, .4fr) minmax(220px, 1.3fr) minmax(100px, .55fr) minmax(135px, .7fr) minmax(175px, .85fr) auto; align-items: center; gap: 12px; min-width: 0; padding: 12px 16px; border-bottom: 1px solid rgb(42 48 55 / 72%); color: var(--text-secondary); }
.tpe-party { overflow: hidden; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.tpe-modal { width: min(520px, calc(100vw - 48px)); max-height: calc(100vh - 48px); margin: auto; padding: 0; overflow: hidden; color: var(--text-primary); }
.tpe-modal::backdrop { background: rgb(0 0 0 / 76%); }
.tpe-modal-summary.key-value-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tpe-modal-summary .key-value__value { overflow-wrap: anywhere; }
.tpe-modal-warning { padding: 9px 10px; border-left: 3px solid var(--warning); background: rgb(217 144 47 / 8%); color: #efc687; font-size: 11px; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }

@media (max-width: 1500px) {
  .summary-strip { grid-template-columns: minmax(220px, 1.2fr) repeat(4, minmax(105px, .7fr)); }
  .key-value-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .explorer-layout { grid-template-columns: 190px minmax(0, 1fr); }
  .zones-toolbar .search-input { min-width: 200px; flex-basis: 100%; }
  .zones-table { min-width: 790px; }
}
@media (max-width: 1100px) {
  .summary-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary-strip__item { border-bottom: 1px solid var(--border); }
  .key-value-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .database-two-column { grid-template-columns: 1fr; }
  .master-detail { grid-template-columns: 1fr; }
  .master-detail__master { border-right: 0; border-bottom: 1px solid var(--border); }
  .master-list { max-height: 340px; }
  .rewards-stats { grid-template-columns: repeat(4, minmax(105px, 1fr)); }
  .tpe-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tpe-identity-row { grid-template-columns: minmax(140px, .65fr) minmax(240px, 1.2fr) minmax(180px, .8fr) auto; }
  .tpe-transaction-row { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }
  .tpe-transaction-row__action { justify-self: start; }
}

@media (max-width: 767px) {
  body.control-room.tpe-responsive-page { min-width: 0; }
  .tpe-responsive-page .app-shell { display: block; min-width: 0; }
  .tpe-responsive-page .app-sidebar { position: static; height: auto; max-height: 220px; border-right: 0; border-bottom: 1px solid var(--border); }
  .tpe-responsive-page .app-content { padding: 14px 12px 24px; }
  .tpe-responsive-page .topbar { align-items: flex-start; margin-bottom: 14px; }
  .tpe-page { gap: 10px; }
  .tpe-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .tpe-stats .stat-chip { padding: 9px; }
  .tpe-stats .stat-chip__meta { display: none; }
  .tpe-identities-heading { align-items: flex-start; }
  .tpe-toolbar { align-items: stretch; padding: 10px; }
  .tpe-toolbar > * { width: 100%; }
  .tpe-search { min-width: 0; flex-basis: 100%; }
  .tpe-identity-row, .tpe-transaction-row { grid-template-columns: 1fr; align-items: start; gap: 10px; padding: 13px 12px; }
  .tpe-identity-row__action, .tpe-transaction-row__action { width: 100%; justify-self: stretch; }
  .tpe-identity-row__action .btn, .tpe-transaction-row__action .btn { width: 100%; }
  .tpe-transaction-row__action form { width: 100%; }
  .tpe-modal { width: calc(100vw - 24px); max-height: calc(100vh - 24px); overflow-y: auto; }
  .tpe-modal-summary.key-value-grid { grid-template-columns: 1fr; }
  .pagination { align-items: stretch; flex-direction: column; }
}

/* Migration layer for active legacy modules.
   It deliberately targets visual utility patterns only: functional attributes,
   field names and module-specific JavaScript contracts remain untouched. */
.module-page { min-width: 0; color: var(--text-primary); }
.module-page > :first-child { margin-top: 0 !important; }
.module-page :is(.space-y-6, .space-y-5) > :not([hidden]) ~ :not([hidden]) { margin-top: 16px !important; }
.module-page :is(.gap-6) { gap: 16px !important; }
.module-page :is(.mb-6) { margin-bottom: 16px !important; }
.module-page :is(.mt-6) { margin-top: 16px !important; }
.module-page :is(.p-6) { padding: 16px !important; }
.module-page :is(.p-5) { padding: 16px !important; }
.module-page :is(.px-5) { padding-left: 16px !important; padding-right: 16px !important; }
.module-page :is(.py-5) { padding-top: 16px !important; padding-bottom: 16px !important; }

.module-page :is(section, article, div, form, details)[class*="border-slate-8"][class*="bg-slate-9"],
.module-page :is(section, article, div, form, details)[class*="border-slate-7"][class*="bg-slate-9"] {
  border-color: var(--border) !important;
  border-radius: var(--radius-md) !important;
  background-color: var(--surface) !important;
  box-shadow: none !important;
}
.module-page :is(div, form, pre, code)[class*="bg-slate-950"] {
  border-color: var(--border) !important;
  background-color: #0e1114 !important;
}
.module-page [class*="divide-slate-8"] > :not([hidden]) ~ :not([hidden]),
.module-page [class*="border-slate-8"] { border-color: var(--border) !important; }
.module-page [class*="border-slate-7"] { border-color: var(--border-strong) !important; }
.module-page [class*="text-slate-50"],
.module-page [class*="text-slate-100"],
.module-page [class*="text-slate-200"] { color: var(--text-primary) !important; }
.module-page [class*="text-slate-300"],
.module-page [class*="text-slate-400"] { color: var(--text-secondary) !important; }
.module-page [class*="text-slate-500"] { color: var(--text-muted) !important; }
.module-page [class*="text-cyan"],
.module-page [class*="text-sky"],
.module-page [class*="text-blue"],
.module-page [class*="text-indigo"] { color: #f1a3ad !important; }

.module-page :is(h2, h3, h4) { color: var(--text-primary); letter-spacing: -.01em; }
.module-page h2 { font-size: 16px; font-weight: 650; }
.module-page h3 { font-size: 14px; font-weight: 650; }
.module-page h4 { font-size: 13px; font-weight: 650; }
.module-page :is(h1, h2)[class*="text-2xl"],
.module-page :is(h1, h2)[class*="text-xl"] { font-size: 16px !important; }
.module-page [class*="text-3xl"] { font-size: 20px !important; line-height: 1.1 !important; font-weight: 650 !important; }

.module-page :is(button, a)[class*="bg-slate-7"],
.module-page :is(button, a)[class*="bg-slate-8"] {
  min-height: 34px;
  border: 1px solid var(--border-strong) !important;
  border-radius: var(--radius-sm) !important;
  background: var(--surface-secondary) !important;
  color: var(--text-primary) !important;
  font-size: 12px !important;
  font-weight: 650;
}
.module-page :is(button, a)[class*="bg-emerald"],
.module-page :is(button, a)[class*="bg-green"] {
  min-height: 34px;
  border: 1px solid var(--accent) !important;
  border-radius: var(--radius-sm) !important;
  background: var(--accent) !important;
  color: #fff !important;
  font-size: 12px !important;
  font-weight: 650;
}
.module-page :is(button, a)[class*="bg-emerald"]:hover,
.module-page :is(button, a)[class*="bg-green"]:hover { background: var(--accent-hover) !important; }
.module-page :is(button, a)[class*="bg-blue"],
.module-page :is(button, a)[class*="bg-cyan"],
.module-page :is(button, a)[class*="bg-sky"],
.module-page :is(button, a)[class*="bg-indigo"] {
  min-height: 34px;
  border: 1px solid var(--border-strong) !important;
  border-radius: var(--radius-sm) !important;
  background: var(--surface-secondary) !important;
  color: var(--text-primary) !important;
  font-size: 12px !important;
  font-weight: 650;
}
.module-page :is(button, a)[class*="bg-blue"]:hover,
.module-page :is(button, a)[class*="bg-cyan"]:hover,
.module-page :is(button, a)[class*="bg-sky"]:hover,
.module-page :is(button, a)[class*="bg-indigo"]:hover { background: var(--surface-raised) !important; }
.module-page :is(button, a)[class*="bg-red"] {
  min-height: 34px;
  border: 1px solid rgb(224 77 93 / 60%) !important;
  border-radius: var(--radius-sm) !important;
  background: rgb(214 40 57 / 13%) !important;
  color: #ffb3bc !important;
  font-size: 12px !important;
  font-weight: 650;
}
.module-page :is(button, a):focus-visible,
.module-page summary:focus-visible {
  outline: 2px solid rgb(214 40 57 / 55%);
  outline-offset: 2px;
}
.module-page :is(button, a)[disabled],
.module-page :is(button, a).disabled { cursor: not-allowed; opacity: .5; }

.module-page table { width: 100%; border-collapse: collapse; font-size: 13px; }
.module-page table thead { background: #0e1114 !important; }
.module-page table th {
  height: 38px;
  border-bottom: 1px solid var(--border) !important;
  color: var(--text-muted) !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.module-page table td {
  height: 46px;
  border-color: rgb(42 48 55 / 72%) !important;
  color: var(--text-secondary);
}
.module-page table tbody tr { transition: background-color 100ms ease; }
.module-page table tbody tr:hover { background: rgb(255 255 255 / 2.5%) !important; }
.module-page :is(th, td)[class*="p-4"] { padding: 10px 12px !important; }
.module-page :is(th, td)[class*="p-3"] { padding: 9px 12px !important; }

.module-page label { color: var(--text-secondary); }
.module-page fieldset { border-color: var(--border); }
.module-page legend { color: var(--text-primary); }
.module-page input[type="checkbox"],
.module-page input[type="radio"] { accent-color: var(--accent); }
.module-page :is(input, select, textarea):disabled { cursor: not-allowed; opacity: .55; }

.module-page [class*="border-emerald"][class*="bg-emerald"] {
  border-color: rgb(53 165 108 / 45%) !important;
  background: rgb(53 165 108 / 9%) !important;
}
.module-page [class*="border-amber"][class*="bg-amber"] {
  border-color: rgb(217 144 47 / 48%) !important;
  background: rgb(217 144 47 / 9%) !important;
}
.module-page [class*="border-red"][class*="bg-red"],
.module-page [class*="border-rose"][class*="bg-rose"] {
  border-color: rgb(224 77 93 / 48%) !important;
  background: rgb(214 40 57 / 9%) !important;
}
.module-page details > summary { cursor: pointer; }
.module-page details[open] > summary { border-bottom-color: var(--border); }
.module-page pre { border-radius: var(--radius-sm) !important; font-size: 11px; line-height: 1.45; }

.module-page .module-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}
.module-page .module-toolbar > form { display: flex; flex-wrap: wrap; gap: 8px; }
.module-page .module-section-title {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* Shared workflow editors: a stable structure navigator and one focused editor. */
.workflow-shell {
  width: min(100%, 1520px);
  margin-inline: auto;
}
.workflow-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.workflow-header__main { display: flex; min-width: 0; align-items: flex-start; gap: 12px; }
.workflow-header__actions { display: flex; flex: 0 0 auto; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.workflow-header__title { margin: 2px 0 0; font-size: 18px; font-weight: 680; }
.workflow-header__meta { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 6px; color: var(--text-muted); font-size: 11px; }
.workflow-editor {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  align-items: start;
  gap: 16px;
  height: auto;
  min-height: 0;
  max-height: none;
  overflow: visible;
}
.workflow-editor__nav {
  position: sticky;
  top: 16px;
  min-width: 0;
  min-height: 0;
  overflow: visible;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}
.workflow-nav__header { padding: 14px 14px 10px; border-bottom: 1px solid var(--border); }
.workflow-nav__eyebrow { color: var(--text-muted); font-size: 9px; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
.workflow-nav__title { margin-top: 3px; color: var(--text-primary); font-size: 13px; font-weight: 680; }
.workflow-nav__group { padding: 8px; }
.workflow-nav__group.is-long { max-height: calc(100vh - 150px); overflow-y: auto; }
.workflow-nav__label { padding: 8px 8px 5px; color: var(--text-muted); font-size: 9px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.workflow-nav__item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 42px;
  padding: 7px 9px;
  border: 0;
  border-left: 2px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  text-align: left;
  cursor: pointer;
}
.workflow-nav__item:hover { background: rgb(255 255 255 / 3%); color: var(--text-primary); }
.workflow-nav__item.is-active { border-left-color: var(--accent); background: var(--surface-secondary); color: var(--text-primary); }
.workflow-nav__item-title { display: block; overflow: hidden; font-size: 12px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.workflow-nav__item-meta { display: block; margin-top: 2px; overflow: hidden; color: var(--text-muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.workflow-nav__count { min-width: 22px; color: var(--text-muted); font-size: 10px; text-align: right; }
.workflow-editor__detail { min-width: 0; min-height: 0; overflow: visible; }
.workflow-panel { min-height: 0; padding: 18px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); }
.workflow-panel--plain { padding: 0; border: 0; background: transparent; }
.workflow-panel[hidden] { display: none !important; }
.workflow-panel__header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.workflow-panel__title { font-size: 15px; font-weight: 680; }
.workflow-panel__help { max-width: 740px; margin-top: 3px; color: var(--text-muted); font-size: 11px; line-height: 1.45; }
.workflow-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.workflow-form-grid > .is-wide { grid-column: 1 / -1; }
.workflow-subsection { padding: 13px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.workflow-subsection + .workflow-subsection { margin-top: 12px; }
.workflow-sticky-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.workflow-action-list { display: grid; gap: 8px; }
.workflow-action-card { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.workflow-action-card > summary { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 48px; padding: 9px 12px; list-style: none; }
.workflow-action-card > summary::-webkit-details-marker { display: none; }
.workflow-action-card[open] > summary { border-bottom: 1px solid var(--border); background: var(--surface-secondary); }
.workflow-action-card__body { padding: 12px; }
.workflow-notice { padding: 10px 12px; border-left: 3px solid var(--warning); background: rgb(217 144 47 / 8%); color: #e7c28d; font-size: 11px; line-height: 1.5; }
.workflow-section + .workflow-section { margin-top: 16px; }
.workflow-section__header { margin-bottom: 10px; }
.workflow-section__title { color: var(--text-primary); font-size: 13px; font-weight: 680; }
.workflow-section__help { margin-top: 3px; color: var(--text-muted); font-size: 11px; line-height: 1.45; }
.workflow-master-detail { display: grid; grid-template-columns: minmax(280px, 320px) minmax(0, 1fr); align-items: start; gap: 16px; }
.workflow-master-detail__nav { position: sticky; top: 16px; min-width: 0; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); }
.workflow-master-detail__list { display: grid; gap: 4px; padding: 8px; }
.workflow-master-detail__list.is-long { max-height: calc(100vh - 150px); overflow-y: auto; }
.workflow-master-detail__content { min-width: 0; overflow: visible; }
.workflow-master-panel { padding: 18px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); }
.workflow-master-panel[hidden] { display: none !important; }
.workflow-message-list { display: grid; gap: 6px; }
.workflow-message-row { border: 1px solid var(--border); border-radius: var(--radius-sm); background: #0e1114; }
.workflow-message-row > summary { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 10px; min-height: 42px; padding: 8px 11px; list-style: none; cursor: pointer; }
.workflow-message-row > summary::-webkit-details-marker { display: none; }
.workflow-message-row[open] > summary { border-bottom: 1px solid var(--border); background: var(--surface-secondary); }
.workflow-message-row__body { display: grid; grid-template-columns: minmax(0, 4fr) minmax(120px, 1fr); align-items: end; gap: 12px; padding: 12px; }
.workflow-message-row__body label { display: grid; gap: 6px; color: var(--text-secondary); font-size: 11px; }
.workflow-message-row__body textarea { width: 100%; min-height: 104px; resize: vertical; }
.workflow-message-row__body input[type="number"] { width: min(100%, 140px); }
.workflow-message-row__delay-control { display: flex; align-items: center; gap: 8px; color: var(--text-muted); }
.workflow-message-row__state { color: var(--text-muted); font-size: 10px; }
.workflow-dialogue { display: grid; gap: 10px; margin-top: 16px; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-secondary); }
.workflow-dialogue__header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.workflow-dialogue__continuation { display: flex; align-items: flex-start; gap: 9px; padding: 9px 11px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #0e1114; color: var(--text-secondary); font-size: 11px; }
.workflow-dialogue__continuation[hidden] { display: none !important; }
.workflow-dialogue__continuation input { margin-top: 2px; }
.workflow-dialogue__continuation span { display: grid; gap: 2px; }
.workflow-dialogue__continuation strong { color: var(--text-primary); font-size: 11px; }
.workflow-dialogue__continuation small { color: var(--text-muted); font-size: 10px; }
.workflow-dialogue__empty { padding: 14px; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); color: var(--text-muted); font-size: 11px; text-align: center; }
.workflow-dialogue__empty[hidden] { display: none; }
.workflow-dialogue__list { display: grid; gap: 7px; }
.workflow-dialogue__actions { display: flex; justify-content: flex-end; }
.workflow-dialogue-item { border: 1px solid var(--border); border-radius: var(--radius-sm); background: #0e1114; }
.workflow-dialogue-item > summary { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 44px; padding: 8px 11px; list-style: none; cursor: pointer; }
.workflow-dialogue-item > summary::-webkit-details-marker { display: none; }
.workflow-dialogue-item[open] > summary { border-bottom: 1px solid var(--border); background: var(--surface); }
.workflow-dialogue-item__order { display: inline-grid; width: 24px; height: 24px; place-items: center; border: 1px solid var(--border-strong); border-radius: 999px; color: var(--text-secondary); font-size: 10px; font-weight: 700; }
.workflow-dialogue-item__summary { overflow: hidden; color: var(--text-primary); font-size: 12px; font-weight: 620; text-overflow: ellipsis; white-space: nowrap; }
.workflow-dialogue-item__delay { color: var(--text-muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.workflow-dialogue-item__body { display: grid; gap: 12px; padding: 12px; }
.workflow-dialogue-item__message { display: grid; gap: 6px; color: var(--text-secondary); font-size: 11px; }
.workflow-dialogue-item__message textarea { width: 100%; min-height: 112px; resize: vertical; }
.workflow-dialogue-item__settings { display: flex; align-items: end; justify-content: space-between; gap: 16px; }
.workflow-dialogue-item__settings > label { display: grid; gap: 6px; color: var(--text-secondary); font-size: 11px; }
.workflow-dialogue-item__delay-control { display: flex; align-items: center; gap: 8px; color: var(--text-muted); }
.workflow-dialogue-item__delay-control input { width: 96px; }
.workflow-dialogue-item__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.workflow-automation-list { display: grid; gap: 6px; }
.workflow-automation-item { border: 1px solid var(--border); border-radius: var(--radius-sm); background: #0e1114; }
.workflow-automation-item > summary { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 44px; padding: 9px 11px; list-style: none; cursor: pointer; }
.workflow-automation-item > summary::-webkit-details-marker { display: none; }
.workflow-automation-item[open] > summary { border-bottom: 1px solid var(--border); background: var(--surface-secondary); }
.workflow-automation-item__body { padding: 12px; }

@media (max-width: 1365px) {
  .workflow-editor { grid-template-columns: 220px minmax(0, 1fr); }
  .workflow-master-detail { grid-template-columns: 270px minmax(0, 1fr); }
  .workflow-form-grid { grid-template-columns: 1fr; }
  .workflow-form-grid > .is-wide { grid-column: auto; }
}
@media (max-width: 1100px) {
  .workflow-editor, .workflow-master-detail { grid-template-columns: 1fr; }
  .workflow-editor__nav, .workflow-master-detail__nav { position: static; }
  .workflow-nav__group { display: flex; flex-wrap: wrap; gap: 4px; }
  .workflow-nav__group.is-long { max-height: none; overflow: visible; }
  .workflow-nav__label { width: 100%; }
  .workflow-nav__item { width: auto; min-width: 180px; flex: 1 1 180px; }
  .workflow-master-detail__list { display: flex; flex-wrap: wrap; }
  .workflow-master-detail__list .workflow-nav__item { flex: 1 1 220px; }
  .workflow-master-detail__list.is-long { max-height: none; overflow: visible; }
}
@media (max-width: 700px) {
  .workflow-header { align-items: flex-start; }
  .workflow-header__actions { justify-content: flex-start; }
  .workflow-message-row__body { grid-template-columns: 1fr; }
  .workflow-dialogue__header, .workflow-dialogue-item__settings { align-items: stretch; flex-direction: column; }
  .workflow-dialogue-item__actions { justify-content: flex-start; }
}

@media (max-width: 1500px) {
  .notifications-message-column { display: none; }
  .notifications-table { min-width: 66rem; }
  .notifications-table th { width: auto !important; }
}
@media (max-width: 1365px) { .app-shell { grid-template-columns: 208px minmax(0, 1fr); } .app-content { padding: 20px; } .app-sidebar { padding-inline: 8px; } }

/* Admin users */
.admin-users-page { display: grid; gap: 14px; }
.admin-users-alert { padding: 10px 12px; border: 1px solid; border-radius: var(--radius-sm); font-size: 12px; }
.admin-users-alert--success { border-color: rgb(53 165 108 / 45%); background: rgb(53 165 108 / 10%); color: #8addac; }
.admin-users-alert--error { border-color: rgb(224 77 93 / 55%); background: rgb(224 77 93 / 10%); color: #ffb3bc; }
.admin-users-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.admin-users-header h2 { margin-top: 3px; font-size: 18px; font-weight: 680; }
.admin-users-header p { margin-top: 4px; color: var(--text-secondary); font-size: 11px; }
.admin-users-workspace { grid-template-columns: minmax(245px, 300px) minmax(560px, 1fr); min-height: 680px; overflow: hidden; }
.admin-users-master { position: relative; }
.admin-users-search { position: sticky; z-index: 2; top: 0; display: grid; gap: 9px; padding: 12px; border-bottom: 1px solid var(--border); background: #111417; }
.admin-users-search .search-input { min-width: 0; width: 100%; }
.admin-users-filters { display: flex; flex-wrap: wrap; gap: 5px; }
.admin-users-filters .filter-pill { min-height: 25px; padding: 3px 8px; }
.admin-users-list { max-height: calc(100vh - 255px); min-height: 500px; }
.admin-user-detail-header h2 { margin-top: 3px; font-size: 18px; font-weight: 680; }
.admin-user-detail-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 7px; color: var(--text-muted); font-size: 11px; }
.admin-users-help { color: var(--text-muted); font-size: 10px; line-height: 1.45; }
.admin-users-owner-note, .admin-users-protection { padding: 9px 11px; border-left: 3px solid var(--warning); background: rgb(217 144 47 / 8%); color: #e7c28d; font-size: 11px; }
.admin-permission-groups { display: grid; gap: 12px; }
.admin-permission-group { min-width: 0; padding: 0; }
.admin-permission-group legend { margin-bottom: 7px; color: var(--text-muted); font-size: 10px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.admin-permission-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
.admin-permission-grid label { display: flex; min-width: 0; align-items: center; gap: 7px; min-height: 32px; padding: 6px 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #0e1114; color: var(--text-secondary); font-size: 11px; }
.admin-permission-grid label:hover { border-color: var(--border-strong); color: var(--text-primary); }
.admin-permission-grid input:disabled + span { color: var(--text-muted); }
.admin-users-savebar { position: sticky; z-index: 5; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 12px; border: 1px solid var(--border); border-radius: var(--radius-md); background: rgb(21 24 28 / 96%); box-shadow: 0 -8px 24px rgb(0 0 0 / 18%); }
.admin-users-savebar span { color: var(--text-muted); font-size: 10px; }
.admin-users-history { margin: 0 16px 14px; box-shadow: none; }
.admin-users-history > summary { cursor: pointer; }
.admin-users-history > summary > span { color: var(--text-muted); font-size: 10px; }
.admin-users-history .compact-list { padding: 12px; }
.admin-users-danger-zone { margin: 0 16px 16px; border-color: rgb(224 77 93 / 35%); }
.admin-users-actions { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.admin-users-actions strong { font-size: 12px; }
.admin-users-actions p { margin-top: 3px; color: var(--text-muted); font-size: 10px; }
.admin-users-actions .btn:disabled, .admin-users-danger-zone .btn:disabled { cursor: not-allowed; opacity: .42; }

@media (max-width: 1500px) {
  .admin-users-workspace { grid-template-columns: 255px minmax(560px, 1fr); }
  .admin-permission-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1180px) {
  .admin-users-workspace { grid-template-columns: 1fr; }
  .admin-users-workspace .master-detail__master { border-right: 0; border-bottom: 1px solid var(--border); }
  .admin-users-list { display: flex; min-height: 0; max-height: 250px; overflow: auto; }
  .admin-users-list .master-list__item { min-width: 230px; border-right: 1px solid var(--border); }
}
