/* ================================================================
   Policies — Enterprise Governance Console (AgentOS)
   Self-contained: no external CSS/JS. White / blue / slate.
   ================================================================ */
*, *::before, *::after { box-sizing: border-box; }

:root {
  --color-primary: #2563EB;
  --color-primary-hover: #1D4ED8;
  --color-primary-light: #EFF6FF;
  --bg-body: #F1F5F9;
  --bg-sidebar: #FFFFFF;
  --bg-main: #F8FAFC;
  --bg-card: #FFFFFF;
  --bg-input: #F1F5F9;
  --bg-hover: #F1F5F9;
  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-muted: #64748B;
  --text-inverse: #FFFFFF;
  --border-light: #E2E8F0;
  --border-medium: #CBD5E1;
  --color-success: #10B981;
  --color-warning: #D97706;
  --color-error: #DC2626;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-full: 9999px;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 16px 48px rgba(15, 23, 42, 0.18);
  --ease-out: cubic-bezier(0.33, 1, 0.68, 1);
}

html.dark {
  --color-primary-light: #123653;
  --bg-body: #111111;
  --bg-sidebar: #1E1E1E;
  --bg-main: #1E1E1E;
  --bg-card: #252526;
  --bg-input: #2D2D2D;
  --bg-hover: #2D2D2D;
  --text-primary: #FFFFFF;
  --text-secondary: #CCCCCC;
  --text-muted: #A6A6A6;
  --border-light: #3E3E3E;
  --border-medium: #5A5A5A;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.55);
}

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg-body);
  color: var(--text-primary);
  font-size: 0.875rem;
  -webkit-font-smoothing: antialiased;
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}

:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }

[hidden] { display: none !important; }

/* ---------- 3-column shell: sidebars fixed, main scrolls ---------- */
.app-layout {
  display: grid;
  grid-template-columns: 220px 1fr 300px;
  height: 100vh;
  overflow: hidden;
}

.sidebar {
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px 14px;
  overflow-y: auto;
}

.sidebar-top { display: flex; flex-direction: column; gap: 8px; }

.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 8px; margin-bottom: 12px;
  text-decoration: none; color: inherit;
}

.brand-logo { width: 34px; height: 34px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }

.brand-name { font-weight: 700; font-size: 1.05rem; letter-spacing: -0.01em; }

.btn-new-task {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 10px 16px; margin-bottom: 8px;
  background: var(--color-primary); color: #fff; border: 0;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans); font-size: 0.875rem; font-weight: 600;
  cursor: pointer; text-decoration: none;
  transition: background 0.2s var(--ease-out), transform 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
}

.btn-new-task:hover { background: var(--color-primary-hover); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3); }

.sidebar-nav { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; width: 100%;
  min-height: 42px; line-height: 1.4;
  border: 0; background: transparent; border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font-sans); font-size: 0.875rem; font-weight: 500;
  cursor: pointer; text-decoration: none; text-align: left;
  transition: background 0.15s var(--ease-out), color 0.15s var(--ease-out);
}

.nav-item:hover { background: var(--bg-hover); color: var(--text-primary); }

.nav-item.active { background: var(--color-primary-light); color: var(--color-primary); font-weight: 600; }

.nav-item.active svg { stroke: var(--color-primary); }

.sidebar-bottom { padding-top: 16px; border-top: 1px solid var(--border-light); }

.workspace-info { display: flex; align-items: center; gap: 10px; }

.workspace-icon {
  width: 32px; height: 32px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-input); border-radius: var(--radius-sm);
  color: var(--text-secondary);
}

.workspace-text { display: flex; flex-direction: column; min-width: 0; }

.workspace-name { font-size: 0.78rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.workspace-plan { font-size: 0.72rem; color: var(--text-muted); }

/* ---------- Main (independent scroll) ---------- */
.main-content {
  display: flex; flex-direction: column;
  min-width: 0; height: 100vh; overflow: hidden;
  background: var(--bg-main);
}

.page-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: 20px 28px 12px; flex-shrink: 0;
}

.page-head h1 { margin: 0; font-size: 1.35rem; letter-spacing: -0.01em; }

.page-sub { margin: 4px 0 0; font-size: 0.83rem; color: var(--text-muted); }

.page-head-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

/* ---------- Buttons / inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-sans); font-size: 0.85rem; font-weight: 600;
  padding: 9px 18px; border-radius: var(--radius-sm);
  cursor: pointer; border: 0;
  transition: background 0.2s var(--ease-out), transform 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
}

.btn:active { transform: translateY(0) scale(0.98); }

.btn-primary { background: var(--color-primary); color: #fff; box-shadow: 0 1px 3px rgba(37, 99, 235, 0.2); }

.btn-primary:hover { background: var(--color-primary-hover); box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25); }

.btn-secondary { background: var(--bg-input); border: 1px solid var(--border-light); color: var(--text-secondary); }

.btn-secondary:hover { background: var(--bg-hover); color: var(--text-primary); border-color: var(--border-medium); }

.btn-danger { background: rgba(220, 38, 38, 0.08); border: 1px solid rgba(220, 38, 38, 0.25); color: var(--color-error); }

.btn-danger:hover { background: rgba(220, 38, 38, 0.15); }

.btn-sm { padding: 6px 12px; font-size: 0.78rem; }

.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; flex-shrink: 0;
  border-radius: 50%; border: 1px solid var(--border-light);
  background: var(--bg-card); color: var(--text-secondary); cursor: pointer;
}

.icon-btn:hover { background: var(--bg-hover); color: var(--text-primary); }

.icon-moon { display: none; }
html.dark .icon-sun { display: none; }
html.dark .icon-moon { display: block; }

.LangSwitch { display: inline-flex; border: 1px solid var(--border-light); border-radius: var(--radius-full); overflow: hidden; background: var(--bg-card); flex-shrink: 0; }

.LangSwitch-btn { border: 0; background: none; padding: 6px 10px; font-family: var(--font-sans); font-size: 0.72rem; font-weight: 700; color: var(--text-muted); cursor: pointer; }

.LangSwitch-btn[aria-pressed="true"] { background: var(--color-primary); color: #fff; }

.select, .text-input, textarea.text-input {
  font-family: var(--font-sans); font-size: 0.82rem;
  color: var(--text-primary);
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 8px 10px; outline: none;
}

.select:focus, .text-input:focus { border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12); }

/* ---------- Toolbar ---------- */
.toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 0 28px 12px; flex-shrink: 0;
}

.search-box {
  display: flex; align-items: center; gap: 8px; flex: 1; min-width: 180px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 0 12px; color: var(--text-muted);
}

.search-box:focus-within { border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12); }

.search-box input {
  flex: 1; border: 0; background: none; outline: none;
  font-family: var(--font-sans); font-size: 0.85rem;
  color: var(--text-primary); padding: 9px 0; min-width: 0;
}

.search-box input::placeholder { color: var(--text-muted); }

/* ---------- Scroll region: grid + detail ---------- */
.policy-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 0 28px 24px; }

.policy-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

@media (max-width: 1400px) {
  .policy-grid { grid-template-columns: repeat(2, 1fr); }
}

.policy-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px;
  cursor: pointer; text-align: left;
  font: inherit; color: inherit;
  display: flex; flex-direction: column; gap: 8px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s var(--ease-out), box-shadow 0.15s var(--ease-out), transform 0.15s var(--ease-out);
}

.policy-card:hover { border-color: var(--color-primary); box-shadow: 0 4px 14px rgba(37, 99, 235, 0.12); transform: translateY(-1px); }

.policy-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.policy-icon {
  width: 32px; height: 32px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--color-primary-light);
  color: var(--color-primary);
}

.policy-name { margin: 0; font-size: 0.92rem; font-weight: 700; line-height: 1.35; }

.policy-cat {
  align-self: flex-start;
  font-size: 0.7rem; font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  padding: 3px 9px; border-radius: var(--radius-full);
  white-space: nowrap;
}

.policy-desc {
  margin: 0; font-size: 0.8rem; color: var(--text-secondary); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.policy-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-top: auto; padding-top: 8px;
  border-top: 1px solid var(--border-light);
  font-size: 0.75rem;
}

.status-dot { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }

.status-dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }

.status-dot.st-active { color: #059669; }
html.dark .status-dot.st-active { color: #34D399; }
.status-dot.st-draft { color: var(--text-muted); }
.status-dot.st-draft::before { background: transparent; border: 1.5px solid currentColor; }
.status-dot.st-disabled { color: var(--color-error); }

.policy-ver { font-family: ui-monospace, Consolas, monospace; color: var(--text-muted); font-weight: 600; }

.priority-badge {
  font-size: 0.7rem; font-weight: 700;
  padding: 3px 9px; border-radius: var(--radius-full);
  background: var(--bg-input); color: var(--text-secondary);
  border: 1px solid var(--border-light);
}

.priority-badge.pr-high { background: rgba(220, 38, 38, 0.08); color: #DC2626; border-color: rgba(220, 38, 38, 0.25); }
.priority-badge.pr-medium { background: rgba(217, 119, 6, 0.1); color: var(--color-warning); border-color: rgba(217, 119, 6, 0.25); }

/* ---------- Detail (in main) ---------- */
.policy-detail { display: flex; flex-direction: column; gap: 14px; }

.detail-back-row { display: flex; align-items: center; }

.detail-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}

.detail-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

.detail-title-row h2 { margin: 0; font-size: 1.15rem; }

.detail-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; font-size: 0.78rem; color: var(--text-muted); }

.section-label {
  display: block; margin: 16px 0 8px;
  font-size: 0.72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-muted);
}

.section-label:first-child { margin-top: 0; }

.desc-text { margin: 0; font-size: 0.85rem; color: var(--text-secondary); line-height: 1.6; }

.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; margin: 0; font-size: 0.83rem; }

.kv dt { color: var(--text-muted); font-weight: 500; }

.kv dd { margin: 0; font-weight: 600; }

.scope-group { margin-bottom: 10px; }

.scope-group > span { display: block; font-size: 0.78rem; font-weight: 700; margin-bottom: 6px; }

.scope-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }

.scope-list li { display: flex; align-items: center; gap: 8px; font-size: 0.83rem; }

.scope-allow { color: #059669; font-weight: 700; }
html.dark .scope-allow { color: #34D399; }
.scope-deny { color: var(--text-muted); font-weight: 700; }

.rule-row {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 10px 12px; margin-bottom: 8px;
  display: grid; grid-template-columns: 34px 1fr; gap: 10px;
  background: var(--bg-card);
}

.rule-num {
  font-family: ui-monospace, Consolas, monospace;
  font-weight: 700; font-size: 0.8rem; color: var(--text-muted);
}

.rule-action { font-size: 0.78rem; font-weight: 700; margin-bottom: 2px; }

.rule-allow { color: #059669; }
html.dark .rule-allow { color: #34D399; }
.rule-deny { color: #DC2626; }
.rule-approval { color: var(--color-warning); }

.rule-text { font-size: 0.83rem; font-weight: 600; }

.rule-target { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }

.history-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }

.history-list li {
  display: flex; align-items: center; gap: 10px;
  font-size: 0.83rem;
  font-family: ui-monospace, Consolas, monospace;
}

.detail-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Empty state ---------- */
.empty-state {
  padding: 48px 24px; text-align: center; color: var(--text-muted);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}

.empty-title { margin: 8px 0 0; font-size: 0.95rem; font-weight: 700; color: var(--text-primary); }

.empty-sub { margin: 0 0 8px; font-size: 0.82rem; }

/* ---------- Right context panel (mirrors dashboard) ---------- */
.right-panel {
  background: var(--bg-card);
  border-left: 1px solid var(--border-light);
  overflow-y: auto;
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rp-section {
  padding: 14px 0;
  border-bottom: 1px solid var(--border-light);
}

.rp-section:last-child {
  border-bottom: none;
}

.rp-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.rp-section-header svg {
  color: var(--text-muted);
}

.rp-section-header h4 {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
  flex: 1;
}

.rp-count {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--color-primary);
  background: var(--color-primary-light);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.progress-track {
  height: 8px;
  background: var(--bg-input);
  border-radius: 4px;
  overflow: hidden;
  margin: 2px 0 10px;
}

.progress-fill {
  height: 100%;
  width: 0;
  background: var(--color-primary);
  border-radius: 4px;
  transition: width 0.3s var(--ease-out);
}

.rp-mini-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.rp-mini-grid > div {
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 8px 4px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rp-mini-grid strong { font-size: 0.95rem; }

.rp-mini-grid span { font-size: 0.68rem; color: var(--text-muted); font-weight: 600; }

.rp-agents-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rp-agent-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}

.rp-agent-item:hover {
  background: var(--bg-hover);
}

.rp-agent-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.rp-agent-name {
  flex: 1;
  font-size: 0.82rem;
  color: var(--text-primary);
  font-weight: 500;
}

.rp-agent-name {
  flex: 1;
  font-size: 0.82rem;
  color: var(--text-primary);
  font-weight: 500;
}

.rp-sources-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rp-sources-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  padding: 4px 0;
}

.source-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.rp-tools-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.tool-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 4px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
}

.tool-item:hover {
  background: var(--bg-hover);
}

.tool-item span {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-align: center;
  font-weight: 500;
}

.tool-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.tool-blue { background: #EFF6FF; color: #2563EB; }
.tool-green { background: #ECFDF5; color: #059669; }
.tool-purple { background: #F5F3FF; color: #7C3AED; }
.tool-amber { background: #FEF3C7; color: #D97706; }
.tool-rose { background: #FFF1F2; color: #E11D48; }

/* ---------- Drawer / modal / toast ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(15, 23, 42, 0.45);
  animation: fade-in 0.18s var(--ease-out);
}

@keyframes fade-in { from { opacity: 0; } }

.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 61;
  width: min(430px, 100vw);
  background: var(--bg-card);
  border-left: 1px solid var(--border-light);
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
  animation: drawer-in 0.22s var(--ease-out);
}

@keyframes drawer-in { from { transform: translateX(40px); opacity: 0; } }

.drawer-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 20px; border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}

.drawer-head h2 { margin: 0; font-size: 1rem; }

.drawer-body { flex: 1; overflow-y: auto; padding: 16px 20px; }

.drawer-foot {
  display: flex; gap: 10px; justify-content: flex-end;
  padding: 14px 20px; border-top: 1px solid var(--border-light);
  flex-shrink: 0;
}

.drawer-foot:empty { display: none; }

.form-group { margin-bottom: 14px; }

.form-group > label { display: block; margin-bottom: 6px; font-size: 0.78rem; font-weight: 600; }

.form-group .text-input, .form-group textarea.text-input, .form-group .select { width: 100%; }

textarea.text-input { min-height: 70px; resize: vertical; line-height: 1.5; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.rule-editor {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 10px; margin-bottom: 8px;
  display: flex; flex-direction: column; gap: 8px;
  background: var(--bg-main);
}

.rule-editor .form-row { grid-template-columns: 1fr 1fr; }

.rule-remove { align-self: flex-end; }

.modal {
  position: fixed; z-index: 62;
  left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(420px, calc(100vw - 32px));
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 22px;
  animation: modal-in 0.18s var(--ease-out);
}

@keyframes modal-in { from { transform: translate(-50%, -48%) scale(0.97); opacity: 0; } }

.modal h2 { margin: 0 0 8px; font-size: 1.02rem; }

.modal p { margin: 0 0 18px; font-size: 0.85rem; color: var(--text-secondary); line-height: 1.55; overflow-wrap: anywhere; }

.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }

.toast-wrap {
  position: fixed; right: 20px; bottom: 20px; z-index: 70;
  display: flex; flex-direction: column; gap: 8px;
}

.toast {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-left: 3px solid var(--color-success);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  padding: 10px 14px; font-size: 0.83rem; font-weight: 500;
  max-width: 340px;
  animation: toast-in 0.2s var(--ease-out);
}

.toast.error { border-left-color: var(--color-error); }

.toast svg { flex-shrink: 0; }

.toast.success svg { color: var(--color-success); }
.toast.error svg { color: var(--color-error); }

@keyframes toast-in { from { transform: translateX(20px); opacity: 0; } }

/* ---------- Responsive ---------- */
@media (max-width: 1400px) {
  .app-layout { grid-template-columns: 220px 1fr 260px; }
}

@media (max-width: 1200px) {
  .app-layout { grid-template-columns: 64px 1fr; }
  .right-panel { display: none; }
  .sidebar { padding: 16px 8px; }
  .brand-name, .btn-new-task span, .nav-item span, .workspace-text { display: none; }
  .btn-new-task, .nav-item { justify-content: center; }
  .policy-grid { grid-template-columns: repeat(2, 1fr); }
  .page-head, .toolbar { padding-left: 16px; padding-right: 16px; }
  .policy-scroll { padding: 0 16px 20px; }
}

@media (max-width: 640px) {
  .app-layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .policy-grid { grid-template-columns: 1fr; }
  .page-head h1 { font-size: 1.15rem; }
  .form-row { grid-template-columns: 1fr; }
}

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

/* Smooth page entry (all app pages share the same motion) */
@keyframes page-in { from { opacity: 0; transform: translateY(6px); } }

.main-content { animation: page-in 0.28s ease-out; }
