:root {
  font-family: Inter, "Segoe UI", "Microsoft YaHei UI", system-ui, sans-serif;
  color: #172033;
  background: #f3f6fb;
  font-synthesis: none;
  --ink: #172033;
  --muted: #6e7b91;
  --line: #e4e9f2;
  --panel: rgba(255, 255, 255, 0.93);
  --blue: #275cf3;
  --blue-dark: #1747d6;
  --navy: #101a33;
  --green: #138a5b;
  --amber: #c97414;
  --red: #c8404d;
  --shadow: 0 18px 55px rgba(32, 55, 99, 0.1);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: linear-gradient(145deg, #f7f9fd 0%, #eef3fb 100%); }
button, input, select { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; white-space: nowrap !important; }

.ambient { position: fixed; border-radius: 50%; filter: blur(6px); pointer-events: none; opacity: 0.55; }
.ambient-one { width: 420px; height: 420px; top: -180px; right: -100px; background: radial-gradient(circle, rgba(77, 117, 255, 0.2), transparent 68%); }
.ambient-two { width: 360px; height: 360px; bottom: -160px; left: -120px; background: radial-gradient(circle, rgba(71, 203, 174, 0.13), transparent 70%); }

.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 28px; position: relative; z-index: 1; }
.login-card { width: min(430px, 100%); padding: 44px; border: 1px solid rgba(222, 229, 240, 0.85); border-radius: 24px; background: rgba(255, 255, 255, 0.92); box-shadow: 0 28px 80px rgba(31, 54, 96, 0.14); backdrop-filter: blur(18px); }
.brand-mark { display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 28px; border-radius: 16px; color: white; font-size: 25px; font-weight: 800; background: linear-gradient(145deg, #315ff4, #1838a4); box-shadow: 0 12px 28px rgba(39, 92, 243, 0.3); }
.brand-mark.small { width: 42px; height: 42px; margin: 0; border-radius: 13px; font-size: 20px; }
.eyebrow { margin: 0 0 7px; color: #7e8aa0; font-size: 11px; font-weight: 800; letter-spacing: 0.15em; }
h1, h2 { margin: 0; color: var(--navy); letter-spacing: -0.03em; }
.login-card h1 { font-size: 32px; }
.login-copy { margin: 12px 0 30px; color: var(--muted); line-height: 1.65; }
label { display: grid; gap: 9px; color: #34415a; font-size: 13px; font-weight: 700; }
label span { color: #96a0b2; font-weight: 500; }
input, select { min-height: 43px; border: 1px solid #d9e0eb; border-radius: 11px; outline: none; background: #fbfcfe; color: var(--ink); padding: 0 13px; transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease; }
input:focus, select:focus { border-color: #7393fb; box-shadow: 0 0 0 3px rgba(39, 92, 243, 0.1); background: white; }
.password-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.field-hint { margin: 9px 0 0; color: #8b96a9; font-size: 12px; line-height: 1.55; }
.form-error { min-height: 20px; margin: 12px 0; color: var(--red); font-size: 13px; }

.primary-button, .secondary-button, .icon-button { min-height: 40px; border-radius: 10px; border: 1px solid transparent; padding: 0 16px; font-weight: 700; transition: transform 120ms ease, background 150ms ease, border-color 150ms ease, opacity 150ms ease; }
.primary-button { color: white; background: var(--blue); box-shadow: 0 8px 20px rgba(39, 92, 243, 0.18); }
.primary-button:hover { background: var(--blue-dark); }
.primary-button.danger-button { background: var(--red); box-shadow: 0 8px 20px rgba(200, 64, 77, 0.18); }
.primary-button.danger-button:hover { background: #ad2e3b; }
.secondary-button, .icon-button { color: #45536c; border-color: #dce3ee; background: white; }
.secondary-button:hover, .icon-button:hover { border-color: #bcc8db; background: #f8faff; }
.primary-button:active, .secondary-button:active, .icon-button:active { transform: translateY(1px); }
button:disabled { cursor: not-allowed; opacity: 0.5; }
.wide { width: 100%; }
.compact { min-height: 34px; padding: 0 12px; font-size: 12px; }

.app-shell { position: relative; z-index: 1; min-height: 100vh; }
.topbar { height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 max(28px, calc((100vw - 1440px) / 2)); border-bottom: 1px solid rgba(219, 226, 237, 0.82); background: rgba(255, 255, 255, 0.8); backdrop-filter: blur(18px); position: sticky; top: 0; z-index: 5; }
.brand-block, .header-actions, .page-heading, .toolbar, .pagination, .dialog-heading, .dialog-actions, .connection { display: flex; align-items: center; }
.brand-block { gap: 13px; }
.brand-block h1 { font-size: 18px; }
.brand-block .eyebrow { font-size: 9px; margin-bottom: 3px; }
.header-actions { gap: 14px; }
.connection { gap: 8px; color: #65728a; font-size: 12px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #21a66f; box-shadow: 0 0 0 4px rgba(33, 166, 111, 0.12); }
.content { width: min(1440px, calc(100% - 56px)); margin: 0 auto; padding: 42px 0 60px; }
.view-tabs { display: inline-flex; gap: 4px; margin-bottom: 30px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, 0.78); box-shadow: 0 6px 18px rgba(43, 63, 101, 0.045); }
.view-tab { min-height: 38px; padding: 0 17px; border: 0; border-radius: 9px; color: #68758d; background: transparent; font-size: 13px; font-weight: 800; }
.view-tab:hover { color: #34425a; background: #f4f7fc; }
.view-tab.active { color: #214fcf; background: #eaf0ff; box-shadow: 0 2px 8px rgba(39, 92, 243, 0.09); }
.admin-view { min-width: 0; }
.page-heading { justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.page-heading h2 { font-size: 30px; }
.page-heading p:last-child { margin: 9px 0 0; color: var(--muted); font-size: 14px; }
.page-actions { display: flex; align-items: center; gap: 9px; }

.summary-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.summary-card { min-height: 135px; padding: 21px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); box-shadow: 0 8px 24px rgba(43, 63, 101, 0.045); position: relative; overflow: hidden; }
.summary-card::after { content: ""; position: absolute; width: 76px; height: 76px; top: -28px; right: -25px; border-radius: 50%; background: currentColor; opacity: 0.08; }
.summary-card span { display: block; color: #69768c; font-size: 12px; font-weight: 700; }
.summary-card strong { display: block; margin-top: 11px; color: var(--navy); font-size: 34px; line-height: 1; letter-spacing: -0.04em; }
.summary-card small { display: block; margin-top: 10px; color: #9aa4b5; font-size: 11px; }
.summary-card.total { color: var(--blue); }
.summary-card.unused { color: #68758d; }
.summary-card.active { color: var(--green); }
.summary-card.warning { color: var(--amber); }
.summary-card.expired { color: var(--red); }

.panel { border: 1px solid var(--line); border-radius: 18px; background: var(--panel); box-shadow: var(--shadow); overflow: hidden; }
.policy-status { margin-bottom: 16px; padding: 13px 15px; border: 1px solid #dfe5ee; border-radius: 12px; color: #637087; background: #f9fbfe; font-size: 12px; line-height: 1.55; }
.policy-status.loading { color: #3155bc; border-color: #cad7fb; background: #f3f6ff; }
.policy-status.success { color: #126947; border-color: #bfe8d6; background: #edfaf5; }
.policy-status.warning { color: #805218; border-color: #f2dfbf; background: #fff8eb; }
.policy-status.error { color: #a9323f; border-color: #f0c4c9; background: #fff3f4; }
.policy-summary-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.policy-summary-card { min-width: 0; min-height: 112px; padding: 18px; border: 1px solid var(--line); border-radius: 15px; background: var(--panel); box-shadow: 0 8px 24px rgba(43, 63, 101, 0.04); }
.policy-summary-card span { display: block; color: #7b879b; font-size: 11px; font-weight: 800; }
.policy-summary-card strong { display: block; overflow: hidden; margin-top: 11px; color: var(--navy); font-size: 18px; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.policy-summary-card small { display: block; overflow: hidden; margin-top: 8px; color: #98a2b3; font-size: 10px; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.policy-panel { overflow: visible; }
.policy-toolbar { border-radius: 18px 18px 0 0; background: rgba(255, 255, 255, 0.82); }
.policy-toolbar .search-wrap { min-width: 280px; }
.policy-groups { display: grid; gap: 18px; padding: 18px; }
.policy-placeholder { min-height: 220px; display: grid; place-items: center; color: #8b96a8; text-align: center; }
.policy-placeholder.error { color: var(--red); }
.policy-thresholds { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 13px 14px; border: 1px solid #dbe3f1; border-radius: 12px; color: #647189; background: #f8faff; font-size: 11px; }
.policy-thresholds strong { margin-right: 5px; color: #34425a; }
.policy-thresholds span { padding: 5px 8px; border-radius: 8px; background: white; }
.policy-section { display: grid; gap: 11px; }
.policy-section + .policy-section { padding-top: 17px; border-top: 1px solid var(--line); }
.policy-section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.policy-section-heading h3 { margin: 0; color: #263550; font-size: 16px; }
.policy-section-heading p { margin: 5px 0 0; color: #8994a6; font-size: 11px; line-height: 1.5; }
.policy-section-heading > span { flex: 0 0 auto; padding: 5px 9px; border-radius: 999px; color: #3155bc; background: #edf2ff; font-size: 10px; font-weight: 800; }
.policy-section-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 9px; }
.policy-group { overflow: hidden; border: 1px solid #dfe5ee; border-radius: 11px; background: #fbfcfe; }
.policy-group[open] { background: white; }
.policy-group summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 45px; padding: 0 13px; color: #44516a; cursor: pointer; list-style-position: inside; }
.policy-group summary:hover { background: #f6f8fc; }
.policy-group summary strong { font-size: 12px; }
.policy-group summary span { color: #939daf; font-size: 10px; font-weight: 700; }
.policy-tag-list { display: flex; flex-wrap: wrap; gap: 7px; padding: 0 13px 13px; }
.policy-tag { display: inline-flex; max-width: 100%; overflow-wrap: anywhere; padding: 5px 8px; border: 1px solid #dce4f5; border-radius: 8px; color: #3155bc; background: #f2f6ff; font: 11px/1.35 "Cascadia Code", Consolas, monospace; }
.tag-candidate-panel { margin-bottom: 18px; }
.tag-candidate-list { display: grid; gap: 0; }
.tag-candidate-item { display: grid; grid-template-columns: minmax(440px, 1fr) minmax(500px, auto); align-items: center; gap: 18px; padding: 17px 18px; border-bottom: 1px solid #edf0f5; }
.tag-candidate-item:last-child { border-bottom: 0; }
.tag-candidate-item:hover { background: #fafbfe; }
.tag-candidate-main { display: grid; gap: 8px; min-width: 0; }
.tag-candidate-title { display: flex; align-items: center; gap: 9px; min-width: 0; }
.tag-candidate-title code { overflow: hidden; color: #243657; font: 700 13px/1.4 "Cascadia Code", Consolas, monospace; text-overflow: ellipsis; white-space: nowrap; }
.tag-candidate-main > small { color: #9aa4b5; font-size: 10px; }
.tag-candidate-evidence { display: grid; gap: 6px; }
.tag-evidence-group { display: grid; grid-template-columns: minmax(140px, 0.72fr) minmax(260px, 1.28fr); align-items: center; gap: 9px; padding: 8px 9px; border: 1px solid #e4e9f1; border-radius: 9px; background: #fbfcfe; }
.tag-evidence-group > div { display: grid; gap: 2px; }
.tag-evidence-group strong { color: #3e4d66; font-size: 10px; }
.tag-evidence-group small { color: #929daf; font-size: 9px; line-height: 1.35; }
.tag-evidence-group p { display: flex; flex-wrap: wrap; gap: 5px; margin: 0; }
.tag-evidence-group p span { padding: 3px 6px; border-radius: 6px; color: #68758b; background: #eef2f7; font-size: 9px; font-weight: 700; }
.tag-evidence-group.unavailable p { color: #a1aaba; font-size: 9px; }
.tag-review-badge { flex: 0 0 auto; padding: 4px 8px; border-radius: 999px; font-size: 10px; font-weight: 800; }
.tag-review-badge.PENDING { color: #805218; background: #fff2dc; }
.tag-review-badge.APPROVED { color: #087d51; background: #e5f7ef; }
.tag-review-badge.REJECTED { color: #b43a47; background: #fdebed; }
.tag-draft-check { display: inline-flex; }
.tag-draft-check input { width: 17px; height: 17px; min-height: 0; margin: 0; padding: 0; accent-color: var(--blue); }
.tag-candidate-review { display: grid; grid-template-columns: minmax(145px, 190px) minmax(155px, 230px) auto auto; align-items: center; gap: 7px; }
.tag-candidate-review select { min-width: 0; }
.tag-reject-button { color: var(--red); }
.tag-draft-panel { padding: 20px; }
.tag-draft-heading, .tag-draft-actions { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.tag-draft-heading { margin-bottom: 15px; }
.tag-draft-heading h3 { margin: 0; color: #263550; font-size: 18px; }
.tag-draft-heading > span { padding: 6px 10px; border-radius: 999px; color: #3155bc; background: #edf2ff; font-size: 11px; font-weight: 800; }
.tag-draft-fields { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(220px, 0.7fr); gap: 14px; }
.tag-draft-current { display: grid; align-content: center; gap: 4px; min-height: 72px; padding: 11px 13px; border: 1px solid #d9e0eb; border-radius: 11px; background: #fbfcfe; }
.tag-draft-current span, .tag-draft-current small { color: #8b96a9; font-size: 10px; }
.tag-draft-current strong { color: #34415a; font-size: 13px; }
.tag-draft-actions p { margin: 0; color: #7a879b; font-size: 11px; line-height: 1.5; }
.toolbar { gap: 10px; padding: 16px; border-bottom: 1px solid var(--line); }
.search-wrap { flex: 1; min-width: 220px; position: relative; }
.search-wrap span { position: absolute; left: 13px; top: 50%; transform: translateY(-52%); color: #8b97a9; font-size: 20px; }
.search-wrap input { width: 100%; padding-left: 40px; }
.toolbar select { min-width: 130px; }
.refresh-button { min-width: 66px; }
.table-wrap { min-height: 360px; overflow-x: auto; position: relative; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { height: 44px; padding: 0 16px; color: #8a95a8; background: #f8fafd; border-bottom: 1px solid var(--line); text-align: left; font-size: 11px; font-weight: 800; letter-spacing: 0.04em; white-space: nowrap; }
td { padding: 15px 16px; border-bottom: 1px solid #edf0f5; vertical-align: middle; color: #48556c; }
tbody tr:hover { background: #fafbfe; }
tbody tr:last-child td { border-bottom: 0; }
.key-preview { display: grid; gap: 5px; }
.key-preview code { color: #223252; font-family: "Cascadia Code", Consolas, monospace; font-size: 12px; font-weight: 700; }
.key-preview small, .subtle { color: #98a2b3; font-size: 11px; }
.license-note { display: block; max-width: 250px; overflow: hidden; color: #52617a; font-size: 11px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 5px 9px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: currentColor; }
.badge.UNUSED { color: #617089; background: #edf1f6; }
.badge.ACTIVE { color: #087d51; background: #e5f7ef; }
.badge.DISABLED { color: #aa6514; background: #fff2df; }
.badge.EXPIRED, .badge.REVOKED { color: #b43a47; background: #fdebed; }
.plan-stack { display: grid; gap: 4px; }
.plan-stack strong { color: #34425a; font-size: 12px; }
.device-count { display: inline-flex; min-width: 45px; justify-content: center; border: 1px solid #dce3ec; border-radius: 8px; padding: 5px 8px; color: #4d5b72; background: #fafbfc; font-weight: 700; }
.actions-column { text-align: right; }
.row-actions { display: flex; justify-content: flex-end; gap: 6px; white-space: nowrap; }
.row-button { min-height: 30px; padding: 0 9px; border-radius: 8px; border: 1px solid #dce3ed; background: white; color: #4e5d75; font-size: 11px; font-weight: 700; }
.row-button:hover { color: var(--blue); border-color: #aebff7; background: #f5f7ff; }
.row-button.danger:hover { color: var(--red); border-color: #efb8bf; background: #fff7f8; }
.row-button.permanent-delete { color: var(--red); border-color: #efb8bf; background: #fff7f8; }
.row-button.permanent-delete:hover { color: white; border-color: var(--red); background: var(--red); }
.empty-state, .loading-state { min-height: 315px; display: grid; place-items: center; align-content: center; gap: 8px; color: #8b96a8; text-align: center; }
.empty-state strong { color: #43516a; }
.empty-icon { font-size: 32px; color: #a6b0c1; }
.pagination { justify-content: space-between; padding: 13px 16px; border-top: 1px solid var(--line); color: #7a8699; font-size: 12px; }
.pagination div { display: flex; gap: 7px; }

dialog { width: min(650px, calc(100% - 30px)); max-height: calc(100vh - 40px); padding: 0; border: 0; border-radius: 20px; background: transparent; box-shadow: 0 35px 100px rgba(20, 31, 55, 0.28); }
#createDialog, #personalizationDialog, #policyPackImportDialog { width: min(820px, calc(100% - 30px)); }
dialog::backdrop { background: rgba(18, 27, 45, 0.46); backdrop-filter: blur(4px); }
.dialog-card { margin: 0; padding: 26px; background: white; overflow: auto; }
.dialog-heading { justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 22px; }
.dialog-heading h2 { font-size: 23px; }
.dialog-heading p:last-child { margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.close-button { width: 34px; height: 34px; padding: 0; border: 0; border-radius: 9px; color: #78859a; background: #f1f4f8; font-size: 22px; }
.notice, .success-notice { border-radius: 12px; margin-bottom: 20px; padding: 13px 15px; font-size: 12px; }
.notice { display: grid; gap: 3px; color: #805218; border: 1px solid #f2dfbf; background: #fff8eb; }
.success-notice { color: #126947; border: 1px solid #bfe8d6; background: #edfaf5; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 17px; }
.form-grid .full-span { grid-column: 1 / -1; }
.scope-fieldset { min-width: 0; margin: 0; padding: 14px; border: 1px solid #dfe5ee; border-radius: 12px; background: #fbfcfe; }
.scope-fieldset legend { padding: 0 6px; color: #34415a; font-size: 13px; font-weight: 800; }
.scope-fieldset legend span { color: #96a0b2; font-weight: 500; }
.scope-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.scope-option { display: flex; align-items: center; gap: 11px; min-width: 0; padding: 12px; border: 1px solid #dfe5ee; border-radius: 10px; background: white; cursor: pointer; }
.scope-option:hover { border-color: #b7c6f8; background: #f8faff; }
.scope-option input { width: 18px; height: 18px; min-height: 0; flex: 0 0 auto; padding: 0; accent-color: var(--blue); }
.scope-option > span { display: grid; gap: 3px; min-width: 0; color: #34415a; }
.scope-option strong { font-size: 13px; }
.scope-option small { color: #8b96a9; font-size: 11px; font-weight: 500; line-height: 1.35; }
.scope-option.selected { border-color: #b7c6f8; background: #f2f6ff; }
.scope-option.history-limited { border-color: #ead6ae; background: #fffaf0; }
.scope-option.history-limited small { color: #9a6b20; }
.taxonomy-summary { margin: 0 0 10px; color: #7a879b; font-size: 11px; line-height: 1.5; }
.category-tree { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; max-height: 360px; overflow: auto; padding-right: 4px; }
.taxonomy-loading { padding: 18px; color: #7a879b; text-align: center; }
.scope-invalid { color: #a52f3d; background: #fff0f1; }
.scope-badges { display: flex; flex-wrap: wrap; gap: 4px; }
.scope-badge { display: inline-flex; width: fit-content; padding: 3px 7px; border-radius: 999px; color: #3155bc; background: #edf2ff; font-size: 10px; font-weight: 800; }
.scope-empty { color: #98a2b3; font-size: 11px; }
.dialog-actions { justify-content: flex-end; gap: 9px; margin-top: 24px; }
.dialog-actions.spread { justify-content: space-between; }
.dialog-actions.spread > div { display: flex; gap: 9px; }
.policy-import-file { display: grid; gap: 9px; padding: 15px; border: 1px solid #dfe5ee; border-radius: 12px; color: #34415a; background: #fbfcfe; font-size: 13px; font-weight: 800; }
.policy-import-file input { width: 100%; min-height: 44px; padding: 8px; border-style: dashed; background: white; font-weight: 500; }
.policy-import-file span { color: #8b96a9; font-size: 11px; font-weight: 500; line-height: 1.5; }
.policy-import-preview { display: grid; gap: 13px; margin-top: 4px; padding: 16px; border: 1px solid #bfe8d6; border-radius: 14px; background: #f5fcf9; }
.policy-import-title, .policy-import-route { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.policy-import-title > div { display: grid; gap: 4px; min-width: 0; }
.policy-import-title span { color: #16805a; font-size: 10px; font-weight: 900; letter-spacing: 0.06em; }
.policy-import-title strong { overflow: hidden; color: #263550; font-size: 16px; text-overflow: ellipsis; white-space: nowrap; }
.policy-import-title small { flex: 0 0 auto; color: #69768c; font-size: 11px; font-weight: 800; }
.policy-import-route { justify-content: flex-start; padding: 10px 11px; border-radius: 10px; color: #66738a; background: white; font-size: 11px; overflow-wrap: anywhere; }
.policy-import-route b { color: #2c62e8; }
.policy-import-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.policy-import-stats article { display: grid; grid-template-columns: 1fr auto auto; align-items: baseline; gap: 7px; min-width: 0; padding: 11px; border: 1px solid #dfe7e3; border-radius: 10px; background: white; }
.policy-import-stats article > span { grid-column: 1 / -1; color: #7a879b; font-size: 10px; font-weight: 800; }
.policy-import-stats strong { color: #263550; font-size: 17px; }
.policy-import-stats small { color: #7b879b; font-size: 9px; line-height: 1.4; overflow-wrap: anywhere; }
.policy-import-stats small:last-child:not(.negative) { grid-column: 2 / -1; text-align: right; }
.positive { color: #16805a !important; }
.negative { color: #b33a48 !important; }
.policy-import-already { margin: 0; padding: 10px 12px; border-radius: 9px; color: #805218; background: #fff5df; font-size: 11px; font-weight: 700; }
.policy-import-invalid { margin: 0; padding: 11px 12px; border: 1px solid #f0c4c9; border-radius: 9px; color: #a9323f; background: #fff3f4; font-size: 11px; font-weight: 700; line-height: 1.55; }
.policy-import-diff { overflow: hidden; border: 1px solid #dfe5ee; border-radius: 10px; background: white; }
.policy-import-diff summary { padding: 11px 12px; color: #40506a; cursor: pointer; font-size: 11px; font-weight: 800; }
.policy-import-diff > div { display: grid; gap: 8px; max-height: 230px; overflow: auto; padding: 0 12px 12px; }
.policy-import-diff article { padding: 10px; border-radius: 8px; background: #f8fafd; }
.policy-import-diff article strong { color: #34425a; font-size: 11px; }
.policy-import-diff article p { margin: 6px 0 0; font: 10px/1.55 "Cascadia Code", Consolas, monospace; overflow-wrap: anywhere; }
.key-output { max-height: 330px; overflow: auto; margin: 0; padding: 17px; border: 1px solid #dfe5ee; border-radius: 12px; color: #253552; background: #f7f9fc; font: 13px/1.8 "Cascadia Code", Consolas, monospace; user-select: all; white-space: pre-wrap; }
.key-output.single-key { font-size: 16px; text-align: center; letter-spacing: 0.035em; }
.device-card { min-height: 300px; }
.device-list { display: grid; gap: 10px; max-height: 430px; overflow: auto; }
.device-item { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 15px; padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: #fbfcfe; }
.device-main { display: grid; gap: 5px; }
.device-main strong { color: #34425a; font-size: 13px; }
.device-meta { color: #8792a5; font-size: 11px; line-height: 1.6; }
.device-revoked { color: var(--red); font-size: 11px; font-weight: 800; }
.action-dialog { width: min(480px, calc(100% - 30px)); }
.action-card { min-height: 260px; }
.action-dialog-message { min-height: 48px; margin: -4px 0 20px; color: #58667d; font-size: 14px; line-height: 1.7; white-space: pre-line; }
.action-card label { margin-top: 4px; }
.action-card .form-error { margin-bottom: 0; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 20; max-width: min(380px, calc(100% - 48px)); padding: 13px 16px; border-radius: 11px; color: white; background: #18233a; box-shadow: 0 14px 38px rgba(20, 32, 57, 0.25); font-size: 13px; opacity: 0; transform: translateY(10px); pointer-events: none; transition: opacity 180ms ease, transform 180ms ease; }
.toast.visible { opacity: 1; transform: translateY(0); }
.toast.error { background: #a9323f; }

@media (max-width: 1050px) {
  .summary-grid { grid-template-columns: repeat(3, 1fr); }
  .policy-summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .policy-section-groups { grid-template-columns: 1fr; }
  .toolbar { flex-wrap: wrap; }
  .search-wrap { flex-basis: 100%; }
  .tag-candidate-item { grid-template-columns: 1fr; }
  .tag-candidate-review { grid-template-columns: minmax(140px, 1fr) minmax(160px, 1.3fr) auto auto; }
}

@media (max-width: 700px) {
  .topbar { height: auto; min-height: 72px; padding: 14px 18px; }
  .connection { display: none; }
  .content { width: min(100% - 28px, 1440px); padding-top: 28px; }
  .page-heading { align-items: flex-end; }
  .page-heading h2 { font-size: 25px; }
  .page-heading p:last-child { display: none; }
  .page-actions { flex-wrap: wrap; justify-content: flex-end; }
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .policy-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary-card { min-height: 115px; padding: 17px; }
  .summary-card strong { font-size: 29px; }
  .toolbar select { flex: 1; min-width: 120px; }
  .form-grid { grid-template-columns: 1fr; }
  .scope-grid { grid-template-columns: 1fr; }
  .category-tree { grid-template-columns: 1fr; }
  .policy-import-stats { grid-template-columns: 1fr; }
  .tag-candidate-review { grid-template-columns: 1fr 1fr; }
  .tag-evidence-group { grid-template-columns: 1fr; }
  .tag-draft-fields { grid-template-columns: 1fr; }
  .tag-draft-actions { align-items: stretch; flex-direction: column; }
  .tag-draft-actions .primary-button { width: 100%; }
  .dialog-card { padding: 21px; }
  .dialog-actions.spread { align-items: stretch; flex-direction: column; }
  .dialog-actions.spread > div { justify-content: flex-end; }
  .login-card { padding: 32px 25px; }
}

@media (max-width: 480px) {
  .view-tabs { width: 100%; }
  .view-tab { flex: 1; padding: 0 10px; }
  .policy-summary-grid { grid-template-columns: 1fr; }
  .page-actions { width: 100%; justify-content: flex-start; }
  .tag-candidate-item { padding: 15px; }
  .tag-candidate-review { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
}
