:root {
  color-scheme: dark;
  --bg: #091522;
  --panel: #101f30;
  --panel-raised: #192d42;
  --panel-soft: #0d1a29;
  --line: #263b50;
  --text: #e6edf3;
  --muted: #91a2b2;
  --accent: #5b8eb2;
  --accent-strong: #3e7398;
  --blue: #78a5c3;
  --amber: #f0bf6b;
  --red: #f07777;
  --green: #6ed6a7;
  --shadow: 0 18px 50px #0005;
  font-family: "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: radial-gradient(ellipse at 72% -18%, #18314a 0, transparent 46%), var(--bg); }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
.boot-screen { display:grid; min-height:100vh; place-content:center; justify-items:center; gap:16px; color:var(--muted); }
.brand-mark { display:block; flex:0 0 auto; width:50px; height:50px; object-fit:contain; }

.login-wrap { display:grid; place-items:center; min-height:100vh; padding:24px; }
.login-panel { width:min(440px,100%); padding:36px; border:1px solid var(--line); border-radius:23px; background:linear-gradient(150deg,#14263a,#0d1a29); box-shadow:var(--shadow); }
.login-panel .brand-mark { width:92px; height:92px; margin-bottom:24px; }
.login-panel h1 { margin:0; font:600 30px "Segoe UI",Arial,sans-serif; letter-spacing:-.04em; }
.login-panel p { margin:10px 0 27px; color:var(--muted); line-height:1.55; }
.login-note { margin-top:20px; color:var(--muted); font-size:12px; line-height:1.55; }

.shell { min-height:100vh; }
.sidebar { position:fixed; z-index:5; inset:0 auto 0 0; display:flex; flex-direction:column; width:250px; padding:22px 15px 16px; border-right:1px solid var(--line); background:#0d1b2bf2; backdrop-filter:blur(16px); }
.brand-row { display:flex; align-items:center; gap:12px; padding:3px 8px 26px; }
.brand-name { min-width:0; }
.brand-name strong { display:block; font:600 14px "Segoe UI",Arial,sans-serif; letter-spacing:.015em; }
.brand-name span { display:block; margin-top:3px; color:var(--muted); font-size:11px; }
.sidebar-nav { flex:1 1 auto; min-height:0; overflow-y:auto; scrollbar-width:thin; scrollbar-color:#34454b transparent; }
.nav-caption { padding:17px 11px 8px; color:#63757b; font-size:10px; font-weight:700; letter-spacing:.15em; text-transform:uppercase; }
.nav-list { display:grid; gap:4px; }
.nav-link { display:flex; align-items:center; gap:12px; min-height:43px; padding:0 12px; border:1px solid transparent; border-radius:11px; color:#aab8bc; font-size:13px; font-weight:600; transition:.16s ease; }
.nav-link:hover { background:#17252b; color:var(--text); }
.nav-link.active { border-color:#456d8c; background:linear-gradient(90deg,#1a334a,#1a2a3a); color:#d9e8f2; }
.nav-link svg { width:17px; height:17px; color:#82949a; }
.nav-link.active svg { color:var(--blue); }
.nav-badge { margin-left:auto; padding:2px 7px; border-radius:20px; background:#293a3f; color:#c6d5d8; font-size:10px; }
.sidebar-bottom { flex:0 0 auto; margin-top:auto; }
.connection-card { margin:14px 4px; padding:13px; border:1px solid var(--line); border-radius:13px; background:#101f2e; }
.connection-top { display:flex; align-items:center; gap:8px; font-size:12px; font-weight:600; }
.connection-card p { margin:8px 0 0; color:var(--muted); font-size:11px; line-height:1.4; }
.connection-dot,.status-dot { flex:0 0 auto; width:8px; height:8px; border-radius:50%; background:#64757a; }
.connection-dot.online,.status-dot.online { background:var(--green); box-shadow:0 0 0 4px #6ed6a71a; }
.connection-dot.offline,.status-dot.offline { background:var(--amber); }
.user-chip { display:flex; align-items:center; gap:10px; padding:13px 8px 3px; border-top:1px solid var(--line); }
.avatar { display:grid; flex:0 0 auto; width:35px; height:35px; place-items:center; border-radius:11px; background:linear-gradient(140deg,#6e9bb8,#345d7d); color:#f1f6fa; font:700 12px "Segoe UI",Arial,sans-serif; }
.user-meta { flex:1; min-width:0; }
.user-meta strong { display:block; overflow:hidden; font-size:12px; text-overflow:ellipsis; white-space:nowrap; }
.user-meta span { display:block; margin-top:3px; color:var(--muted); font-size:10px; }
.icon-button { display:grid; width:34px; height:34px; place-items:center; border:1px solid transparent; border-radius:10px; background:transparent; color:var(--muted); cursor:pointer; }
.icon-button:hover { border-color:var(--line); background:var(--panel-raised); color:var(--text); }

.main { min-height:100vh; margin-left:250px; }
.topbar { position:sticky; z-index:4; top:0; display:flex; align-items:center; min-height:68px; gap:18px; padding:0 34px; border-bottom:1px solid var(--line); background:#091522e8; backdrop-filter:blur(16px); }
.mobile-menu { display:none; }
.crumbs { display:flex; align-items:center; gap:9px; color:var(--muted); font-size:12px; }
.crumbs strong { color:var(--text); font-weight:600; }
.topbar-right { display:flex; align-items:center; gap:10px; margin-left:auto; }
.clock { color:var(--muted); font:500 11px "Segoe UI",Arial,sans-serif; }
.content { width:min(1500px,100%); margin:0 auto; padding:30px 34px 50px; }
.page-heading { display:flex; align-items:flex-end; justify-content:space-between; gap:20px; margin-bottom:23px; }
.eyebrow { margin:0 0 7px; color:var(--accent); font-size:10px; font-weight:700; letter-spacing:.14em; text-transform:uppercase; }
h1,h2,h3,p { margin-top:0; }
.page-heading h1 { margin:0; font:600 clamp(24px,3vw,32px) "Segoe UI",Arial,sans-serif; letter-spacing:-.045em; }
.page-heading .sub { margin:7px 0 0; color:var(--muted); font-size:13px; }
.toolbar { display:flex; flex-wrap:wrap; align-items:center; gap:10px; margin:0 0 15px; }
.grow { flex:1; }
.report-tabs { display:flex; width:max-content; max-width:100%; gap:3px; margin:0 0 12px; padding:4px; overflow:auto; border:1px solid var(--line); border-radius:12px; background:#0b1525; }
.report-tab { display:inline-flex; align-items:center; gap:7px; min-height:30px; padding:0 11px; border:0; border-radius:9px; background:transparent; color:var(--muted); font-size:10px; font-weight:600; white-space:nowrap; cursor:pointer; }
.report-tab.active { background:#27334a; color:var(--text); }
.report-tab span { color:inherit; opacity:.72; }
.settings-tabs { display:flex; width:max-content; max-width:100%; gap:4px; margin:0 0 14px; padding:5px; overflow-x:auto; border:1px solid var(--line); border-radius:12px; background:#0b1525; }
.settings-tab { display:inline-flex; align-items:center; gap:7px; min-height:34px; padding:0 12px; border:0; border-radius:9px; background:transparent; color:var(--muted); font-size:11px; font-weight:600; white-space:nowrap; cursor:pointer; }
.settings-tab svg { width:14px; height:14px; }
.settings-tab:hover { color:var(--text); }
.settings-tab.active { background:#27334a; color:var(--text); }
.settings-layout { display:grid; grid-template-columns:minmax(0,1.35fr) minmax(270px,.9fr); gap:14px; }
.settings-copy { margin:12px 0 0; font-size:11px; line-height:1.55; }
.settings-copy code,.settings-steps code { color:#b6d5f2; font:10px Consolas,monospace; }
.settings-steps { display:grid; gap:12px; margin:0; padding-left:20px; color:var(--muted); font-size:11px; line-height:1.55; }
.settings-theme-card { max-width:760px; }
.settings-theme-preview { display:flex; align-items:center; gap:16px; padding:14px; border:1px solid var(--line); border-radius:11px; background:#0d1a29; }
.settings-theme-preview img { width:58px; height:58px; object-fit:contain; }
.settings-theme-preview strong { font-size:12px; }
.settings-theme-preview p { margin:5px 0 0; }
.settings-danger-card { border-color:#694148; background:linear-gradient(145deg,#2c2029,#151d2d); }
.settings-danger-card p { margin:0; color:var(--muted); font-size:12px; line-height:1.6; }
.report-layout { display:grid; grid-template-columns:minmax(220px,245px) minmax(0,1fr); gap:12px; height:min(68vh,720px); min-height:480px; }
.report-list-panel { padding:8px; overflow:auto; }
.report-list-item { display:grid; width:100%; gap:6px; padding:12px 10px; border:1px solid transparent; border-radius:10px; background:transparent; color:var(--text); text-align:left; cursor:pointer; }
.report-list-item:hover { background:#18263c; }
.report-list-item.selected { border-color:#3a536e; background:#26344c; }
.report-list-top { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.report-list-top strong { overflow:hidden; font-size:11px; text-overflow:ellipsis; white-space:nowrap; }
.report-list-top .pill { min-height:21px; padding:0 7px; font-size:9px; }
.report-list-player,.report-list-preview { overflow:hidden; color:var(--muted); font-size:10px; text-overflow:ellipsis; white-space:nowrap; }
.report-list-empty { padding:14px 10px; color:var(--muted); font-size:11px; }
.report-detail-panel { display:flex; min-width:0; min-height:0; flex-direction:column; padding:0; overflow:hidden; }
.report-detail-header { display:flex; align-items:center; justify-content:space-between; gap:14px; padding:15px 16px; border-bottom:1px solid var(--line); }
.report-detail-header h2 { margin:0; font:600 14px "Segoe UI",Arial,sans-serif; }
.report-detail-header p { margin:5px 0 0; color:var(--muted); font-size:10px; }
.report-conversation { display:flex; min-height:0; flex:1; flex-direction:column; gap:12px; padding:16px; overflow:auto; background:linear-gradient(145deg,#111b31,#0e172a); }
.report-message { width:fit-content; max-width:min(78%,900px); padding:10px 12px; border:1px solid #293650; border-radius:12px; background:#273247; }
.report-message small { display:block; color:#98a7be; font-size:9px; }
.report-message p { margin:5px 0 0; color:#e0e6f0; font-size:11px; line-height:1.5; overflow-wrap:anywhere; white-space:pre-wrap; }
.report-message-staff { align-self:flex-end; border-color:#315899; background:#244987; }
.report-message-staff small { color:#b5c9e8; }
.report-delivery { margin-top:5px; }
.report-delivery.failed { color:#f3a5a5; }
.report-delivery.sent { color:#9fe2bb; }
.report-composer { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:8px; padding:11px 12px; border-top:1px solid var(--line); background:#10192b; }
.report-composer small { grid-column:1/-1; color:var(--muted); font-size:9px; }
.report-conversation-empty { display:grid; flex:1; place-items:center; }
.grid { display:grid; gap:14px; }
.grid-4 { grid-template-columns:repeat(4,minmax(0,1fr)); }
.grid-3 { grid-template-columns:repeat(3,minmax(0,1fr)); }
.grid-2 { grid-template-columns:repeat(2,minmax(0,1fr)); }
.span-2 { grid-column:span 2; }
.card { min-width:0; padding:18px; border:1px solid var(--line); border-radius:12px; background:linear-gradient(145deg,#122337,#0e1b2a); box-shadow:0 4px 16px #0000000c; }
.card-heading { display:flex; align-items:center; gap:10px; margin-bottom:15px; }
.card-heading h2,.card-heading h3 { margin:0; font:600 14px "Segoe UI",Arial,sans-serif; letter-spacing:-.02em; }
.card-heading .icon { display:grid; width:32px; height:32px; place-items:center; border-radius:10px; background:#1b3044; color:var(--accent); }
.card-heading .icon.blue { background:#1c303b; color:var(--blue); }
.card-heading .icon.amber { background:#342b1d; color:var(--amber); }
.kpi { position:relative; min-height:122px; padding:17px; overflow:hidden; }
.kpi label { display:block; color:var(--muted); font-size:11px; font-weight:600; }
.kpi strong { display:block; margin-top:13px; font:600 27px "Segoe UI",Arial,sans-serif; letter-spacing:-.04em; }
.kpi small { display:block; margin-top:6px; color:var(--muted); font-size:10px; }
.kpi-icon { position:absolute; top:15px; right:15px; display:grid; width:32px; height:32px; place-items:center; border-radius:9px; background:#1b3155; color:var(--accent); }
.kpi-icon.blue { background:#1e303b; color:var(--blue); }
.kpi-icon.amber { background:#382f21; color:var(--amber); }
.kpi-icon.red { background:#382323; color:var(--red); }
.section-spacer { margin-top:14px; }
.feed { display:grid; }
.feed-row { display:flex; align-items:flex-start; gap:10px; padding:11px 0; border-top:1px solid #27343b9c; }
.feed-row:first-child { padding-top:0; border-top:0; }
.feed-icon { display:grid; flex:0 0 auto; width:29px; height:29px; place-items:center; border-radius:9px; background:#1a3043; color:var(--accent); font-size:12px; }
.feed-copy { flex:1; min-width:0; color:#bdc9cb; font-size:11px; line-height:1.5; }
.feed-copy strong { color:var(--text); }
.feed-copy small { display:block; margin-top:3px; color:var(--muted); font-size:10px; }
.feed-time { flex:0 0 auto; color:#718288; font-size:10px; white-space:nowrap; }
.server-summary { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.server-summary label { display:block; color:var(--muted); font-size:10px; }
.server-summary strong { display:block; margin-top:5px; font:600 16px "Segoe UI",Arial,sans-serif; }
.list-row { display:flex; align-items:center; gap:11px; min-height:50px; padding:9px 0; border-top:1px solid #27343b9c; }
.list-row:first-child { border-top:0; }
.list-row .row-main { flex:1; min-width:0; }
.list-row strong { display:block; overflow:hidden; font-size:12px; text-overflow:ellipsis; white-space:nowrap; }
.list-row small { display:block; margin-top:4px; color:var(--muted); font-size:10px; }
.pill { display:inline-flex; align-items:center; gap:6px; min-height:24px; padding:0 9px; border:1px solid #334249; border-radius:20px; background:#182329; color:#b9c7ca; font-size:10px; font-weight:600; white-space:nowrap; }
.pill.green { border-color:#285442; background:#17352a; color:#8ee4b8; }
.pill.amber { border-color:#5b4826; background:#372e1e; color:#f0c77d; }
.pill.red { border-color:#5b3030; background:#3a2323; color:#f29898; }
.pill.blue { border-color:#294b60; background:#1b303a; color:#99d3f2; }
.table-wrap { width:100%; overflow:auto; border:1px solid var(--line); border-radius:12px; background:#10182b; }
table { width:100%; border-collapse:collapse; text-align:left; }
th { padding:12px 15px; color:#718288; font-size:9px; font-weight:700; letter-spacing:.1em; text-transform:uppercase; white-space:nowrap; }
td { padding:13px 15px; border-top:1px solid #26333a; color:#cbd5d7; font-size:11px; vertical-align:middle; }
tbody tr:hover { background:#172328; }
.person { display:flex; align-items:center; gap:10px; min-width:180px; }
.person strong { display:block; color:var(--text); font-size:11px; }
.person small { display:block; margin-top:4px; color:var(--muted); font-size:9px; }
.mono { color:#b8c5c8; font-family:ui-monospace,Consolas,monospace; }
.actions { display:flex; flex-wrap:wrap; gap:6px; }
.btn { display:inline-flex; align-items:center; justify-content:center; gap:8px; min-height:36px; padding:0 12px; border:1px solid #34495c; border-radius:9px; background:#18293a; color:#d5e0e2; font-size:11px; font-weight:600; cursor:pointer; transition:.14s ease; }
.btn svg { flex:0 0 auto; width:15px; height:15px; }
.btn:hover { border-color:#557894; background:#21384d; }
.btn:disabled { opacity:.5; cursor:not-allowed; }
.btn-primary { border-color:#5686a7; background:linear-gradient(110deg,#5d91b5,#3d7093); color:#f7fbff; }
.btn-primary:hover { border-color:#82afd0; background:linear-gradient(110deg,#73a5c6,#4f82a5); color:#fff; }
.btn-danger { border-color:#6a3434; background:#3b2425; color:#f6aaaa; }
.btn-danger:hover { background:#522b2b; }
.btn-ghost { background:transparent; }
.btn-sm { min-height:29px; padding:0 9px; font-size:10px; }
.input,.select,.textarea { width:100%; min-height:38px; padding:9px 11px; border:1px solid #33495d; border-radius:9px; outline:0; background:#0b1927; color:var(--text); font-size:12px; }
.textarea { min-height:96px; resize:vertical; line-height:1.5; }
.input:focus,.select:focus,.textarea:focus { border-color:var(--accent); box-shadow:0 0 0 3px #5b8eb226; }
.input::placeholder,.textarea::placeholder { color:#62747a; }
.search { width:min(300px,100%); }
.field { display:grid; gap:7px; color:#b6c3c6; font-size:11px; font-weight:600; }
.form-grid { display:grid; grid-template-columns:1fr 1fr; gap:13px; }
.form-grid .full { grid-column:1/-1; }
.empty { display:grid; min-height:160px; place-content:center; justify-items:center; gap:8px; color:var(--muted); text-align:center; font-size:11px; }
.empty strong { color:#c5d0d2; font-size:12px; }
.empty-icon { display:grid; width:38px; height:38px; place-items:center; margin-bottom:3px; border:1px solid #34495c; border-radius:13px; background:#192b3c; color:var(--blue); }
.bar { height:6px; overflow:hidden; border-radius:8px; background:#27353a; }
.bar i { display:block; height:100%; border-radius:8px; background:linear-gradient(90deg,#3e7398,#78a5c3); }
.modal-bg { position:fixed; z-index:20; inset:0; display:grid; place-items:center; padding:20px; background:#02090bcc; backdrop-filter:blur(6px); }
.modal { width:min(510px,100%); max-height:min(86vh,760px); overflow:auto; padding:22px; border:1px solid #384e63; border-radius:17px; background:#14263a; box-shadow:var(--shadow); }
.modal h2 { margin:0; font:600 20px "Segoe UI",Arial,sans-serif; letter-spacing:-.03em; }
.modal>p { margin:8px 0 18px; color:var(--muted); font-size:12px; line-height:1.5; }
.modal-form { display:grid; gap:14px; }
.modal-actions { display:flex; justify-content:flex-end; gap:8px; margin-top:7px; }
.check-grid { display:grid; grid-template-columns:1fr 1fr; gap:8px; max-height:240px; overflow:auto; padding:10px; border:1px solid var(--line); border-radius:10px; }
.permission-groups { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; max-height:420px; overflow:auto; padding:10px; border:1px solid var(--line); border-radius:10px; }
.permission-group { display:grid; align-content:start; gap:8px; padding:10px; border:1px solid var(--line); border-radius:10px; background:#101f2e; }
.permission-group h3 { margin:0 0 3px; color:var(--accent); font-size:10px; text-transform:uppercase; letter-spacing:.08em; }
.permission-group .check-line { line-height:1.35; }
.role-management { display:grid; gap:14px; }
.role-directory { padding:16px; }
.role-directory-heading { display:flex; align-items:center; justify-content:space-between; gap:14px; margin-bottom:11px; }
.role-directory-heading h2,.role-permissions-header h2 { margin:0; font-size:13px; }
.role-directory-heading p,.role-permissions-header p { margin:5px 0 0; color:var(--muted); font-size:10px; line-height:1.5; }
.role-directory-list { display:grid; gap:6px; }
.role-entry { display:flex; align-items:center; justify-content:space-between; gap:14px; width:100%; min-height:58px; padding:10px 13px; border:1px solid transparent; border-radius:10px; background:#101f2e; color:var(--text); text-align:left; cursor:pointer; transition:.14s ease; }
.role-entry:hover { border-color:#344b5c; background:#172a3a; }
.role-entry.selected { border-color:#426783; background:#1b3347; box-shadow:inset 2px 0 #80afcb; }
.role-entry-main { display:flex; align-items:center; gap:11px; min-width:0; }
.role-entry-main>span { display:grid; gap:4px; min-width:0; }
.role-entry-main strong { overflow:hidden; font-size:11px; text-overflow:ellipsis; white-space:nowrap; }
.role-entry-main small { color:var(--muted); font-size:9px; }
.role-entry-meta { display:flex; flex:0 0 auto; align-items:center; gap:18px; color:var(--muted); font-size:9px; }
.role-entry-meta>span:first-child { display:grid; justify-items:end; gap:2px; }
.role-entry-meta strong { color:#dce7e8; font-size:11px; }
.role-entry-arrow { color:#86a8bd; font-size:19px; }
.role-dot { flex:0 0 auto; width:9px; height:9px; border-radius:50%; background:#80afcb; }
.role-dot.role-color-owner { background:#b9a2ff; }
.role-dot.role-color-admin { background:#77c9ff; }
.role-dot.role-color-moderator { background:#7ce0bb; }
.role-dot.role-color-helper { background:#f4c779; }
.role-dot.role-color-custom { background:#80afcb; }
.role-editor { display:grid; min-width:0; gap:12px; }
.role-config { display:grid; gap:14px; padding:17px; }
.role-config-overview { display:flex; align-items:center; justify-content:space-between; gap:18px; }
.role-config-title { display:flex; align-items:flex-start; gap:13px; min-width:0; }
.role-config-title>.role-dot { width:11px; height:11px; margin-top:5px; }
.role-config-title .eyebrow { color:var(--accent); font-size:9px; font-weight:700; letter-spacing:.1em; text-transform:uppercase; }
.role-config-title h2 { margin:4px 0 5px; font-size:19px; }
.role-config-title p { margin:0; color:var(--muted); font-size:10px; line-height:1.5; }
.role-config-stats { display:flex; flex:0 0 auto; gap:20px; }
.role-config-stats span { display:grid; gap:3px; color:var(--muted); font-size:9px; text-align:right; }
.role-config-stats strong { color:var(--text); font-size:17px; }
.role-config-stats small { color:var(--muted); font-size:9px; }
.role-details-form { display:grid; grid-template-columns:minmax(0,1fr) 120px auto; align-items:end; gap:10px; padding-top:13px; border-top:1px solid #293c4b; }
.role-details-form .field { font-size:10px; }
.role-color-input { min-height:38px; padding:5px; cursor:pointer; }
.role-locked-note { display:flex; align-items:center; gap:8px; padding-top:11px; border-top:1px solid #293c4b; color:#c2b6f3; font-size:10px; }
.role-locked-note svg { width:14px; height:14px; }
.role-permissions-section { display:grid; gap:10px; }
.role-permissions-header { display:flex; align-items:center; gap:10px; padding:2px 1px; }
.role-permissions-header>div { flex:1; min-width:0; }
.role-search { width:min(270px,100%); }
.role-search .input { min-height:36px; }
.role-permission-groups { display:grid; gap:10px; }
.role-permission-group { overflow:hidden; padding:0; }
.role-permission-group[hidden] { display:none; }
.role-permission-group>summary { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:13px 15px; color:#dce7e8; cursor:pointer; list-style:none; }
.role-permission-group>summary::-webkit-details-marker { display:none; }
.role-permission-group>summary>span:first-child { display:flex; align-items:center; gap:10px; min-width:0; }
.role-permission-group>summary strong { font-size:11px; }
.role-permission-group>summary small { color:var(--muted); font-size:9px; }
.role-group-chevron { color:var(--muted); font-size:16px; transition:transform .15s ease; }
.role-permission-group:not([open]) .role-group-chevron { transform:rotate(-90deg); }
.role-group-actions { display:flex; gap:6px; padding:0 15px 10px; }
.role-group-actions .btn { min-height:27px; font-size:9px; }
.role-permission-list { border-top:1px solid #293c4b; }
.role-permission { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:12px 15px; border-top:1px solid #273744a6; cursor:pointer; }
.role-permission:first-child { border-top:0; }
.role-permission:hover { background:#152737; }
.role-permission[hidden] { display:none; }
.role-permission-copy { display:grid; gap:3px; min-width:0; }
.role-permission-copy strong { color:#d5e0e2; font-size:10px; font-weight:600; }
.role-permission-copy strong em { display:inline-flex; align-items:center; width:max-content; margin-left:7px; padding:2px 5px; border:1px solid #725d31; border-radius:5px; background:#30291d; color:#e7ca83; font-size:8px; font-style:normal; font-weight:500; }
.role-permission-copy small { color:var(--muted); font-size:9px; line-height:1.45; }
.role-permission-copy code { color:#718892; font:9px Consolas,monospace; }
.role-permission-toggle { position:relative; flex:0 0 auto; width:36px; height:20px; margin:0; appearance:none; border:1px solid #405161; border-radius:20px; background:#202f3d; cursor:pointer; transition:.15s ease; }
.role-permission-toggle::before { position:absolute; top:2px; left:2px; width:14px; height:14px; border-radius:50%; background:#8798a0; content:""; transition:.15s ease; }
.role-permission-toggle:checked { border-color:#5285a7; background:#396b8d; }
.role-permission-toggle:checked::before { transform:translateX(16px); background:#eef8fc; }
.role-permission-toggle:disabled { opacity:.5; cursor:not-allowed; }
.role-permission-toggle:focus-visible { outline:2px solid var(--accent); outline-offset:3px; }
.template-row { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px 0; border-top:1px solid #27343b9c; }
.template-row:first-of-type { border-top:0; }
.template-row>div:first-child { min-width:0; }
.template-row strong,.template-row small { display:block; }
.template-row strong { font-size:12px; }
.template-row small { margin-top:5px; color:var(--muted); font-size:10px; line-height:1.5; }
.template-card { min-height:276px; }
.performance-bar { display:flex; align-items:center; gap:9px; min-width:130px; }
.performance-bar i { display:block; width:var(--bar-width,50%); height:5px; border-radius:10px; background:linear-gradient(90deg,#3e7398,#78a5c3); }
.performance-bar span { color:var(--muted); font-size:10px; }
.period-select { width:auto; min-width:110px; }
.suggestion-list { display:grid; gap:12px; }
.suggestion-card { display:flex; align-items:flex-start; gap:14px; }
.suggestion-vote { display:grid; justify-items:center; gap:4px; }
.suggestion-vote .btn svg { width:14px; height:14px; transform:rotate(-45deg); }
.suggestion-vote strong { font-size:12px; }
.suggestion-body { flex:1; min-width:0; }
.suggestion-body .card-heading { flex-wrap:wrap; margin-bottom:8px; }
.suggestion-body .card-heading h2 { margin-right:4px; }
.suggestion-body .suggestion-status { width:auto; min-width:125px; }
.suggestion-body p { margin:0 0 10px; color:#bdc9cb; font-size:12px; line-height:1.55; }
.check-line { display:flex; align-items:center; gap:8px; color:#bdc9cb; font-size:10px; }
.check-line input { accent-color:var(--accent); }
.toasts { position:fixed; z-index:30; right:20px; bottom:20px; display:grid; gap:8px; width:min(340px,calc(100vw - 40px)); }
.toast { padding:12px 14px; border:1px solid #36554a; border-radius:11px; background:#14241f; color:#c7f0dc; box-shadow:var(--shadow); font-size:12px; }
.toast.error { border-color:#673638; background:#2b1d1e; color:#ffc0bf; }
.muted { color:var(--muted); }
.nowrap { white-space:nowrap; }
.hidden { display:none!important; }
.sparkline { display:block; width:100%; height:130px; }
.sparkline .gridline { stroke:#29363c; stroke-dasharray:3 5; }
.sparkline .line { fill:none; stroke:#78a5c3; stroke-width:2.5; vector-effect:non-scaling-stroke; }
.sparkline .area { fill:url(#fill); }

@media (max-width:1100px) {
  .grid-4 { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .content { padding:25px 24px 40px; }
  .topbar { padding:0 24px; }
}
@media (max-width:760px) {
  .sidebar { width:280px; transform:translateX(-100%); transition:transform .2s ease; box-shadow:var(--shadow); }
  .sidebar.open { transform:translateX(0); }
  .permission-groups { grid-template-columns:1fr; }
  .role-config-overview { align-items:flex-start; flex-direction:column; }
  .role-config-stats { width:100%; justify-content:flex-start; }
  .role-config-stats span { text-align:left; }
  .role-details-form { grid-template-columns:minmax(0,1fr) 100px; }
  .role-details-form>.btn { grid-column:1/-1; }
  .role-permissions-header { flex-wrap:wrap; }
  .role-permissions-header>div { flex-basis:100%; }
  .main { margin-left:0; }
  .topbar { min-height:60px; padding:0 16px; }
  .mobile-menu { display:grid; }
  .content { padding:22px 16px 35px; }
  .grid-3,.grid-2 { grid-template-columns:1fr; }
  .settings-layout { grid-template-columns:1fr; }
  .report-layout { height:auto; min-height:0; grid-template-columns:1fr; }
  .report-list-panel { max-height:240px; }
  .report-detail-panel { min-height:460px; }
  .template-card { min-height:0; }
  .span-2 { grid-column:auto; }
  .page-heading { align-items:flex-start; }
  .page-heading>.btn { align-self:center; }
}
@media (max-width:480px) {
  .grid-4 { grid-template-columns:1fr 1fr; gap:9px; }
  .kpi { min-height:108px; padding:13px; }
  .kpi strong { font-size:23px; }
  .kpi-icon { top:11px; right:11px; width:27px; height:27px; }
  .clock { display:none; }
  .content { padding-right:12px; padding-left:12px; }
  .card { padding:14px; }
  .page-heading h1 { font-size:24px; }
  .form-grid { grid-template-columns:1fr; }
  .form-grid .full { grid-column:auto; }
  .report-detail-header { align-items:flex-start; flex-direction:column; }
  .report-message { max-width:94%; }
  .role-directory-heading { align-items:flex-start; flex-direction:column; }
  .role-entry-meta { gap:9px; }
  .role-entry-meta>span:first-child { text-align:right; }
  .role-config-stats { gap:12px; }
  .role-details-form { grid-template-columns:minmax(0,1fr) 82px; }
  .role-permissions-header .role-search { width:100%; }
  .role-permissions-header>.btn { flex:1; }
  .role-group-actions { flex-wrap:wrap; padding-right:11px; padding-left:11px; }
  .role-permission { gap:10px; padding:11px; }
  .role-permission-copy small { max-width:235px; }
}
