:root {
  --navy-950: #0a1c38;
  --navy-900: #10264a;
  --navy-800: #183665;
  --ink: #172033;
  --ink-soft: #687489;
  --paper: #f2f5f8;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --line: #dfe5ec;
  --line-strong: #ccd5df;
  --accent: #ff6b35;
  --accent-dark: #df4f1c;
  --accent-pale: #fff0e9;
  --blue: #2563eb;
  --blue-pale: #eaf1ff;
  --green: #16876c;
  --green-pale: #e6f5f0;
  --warning: #b66a0a;
  --warning-pale: #fff4dd;
  --danger: #c84242;
  --shadow-sm: 0 1px 2px rgba(16, 26, 46, .05), 0 4px 14px rgba(16, 26, 46, .04);
  --shadow-lg: 0 22px 60px rgba(16, 26, 46, .12);
  --radius: 12px;
}

* { box-sizing: border-box; }
html { background: var(--paper); color: var(--ink); }
body {
  margin: 0;
  min-width: 320px;
  font-family: "HarmonyOS Sans SC", "MiSans", "Source Han Sans SC", "PingFang SC", sans-serif;
  background:
    radial-gradient(circle at 82% 0%, rgba(37, 99, 235, .07), transparent 25rem),
    var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
button, select, textarea, input { font: inherit; }
button, select { cursor: pointer; }
button:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 3px solid rgba(37, 99, 235, .25);
  outline-offset: 2px;
}

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 238px 1fr; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  width: 238px;
  padding: 22px 15px 18px;
  display: flex;
  flex-direction: column;
  color: #1f2d42;
  background:
    radial-gradient(circle at 0% 0%, rgba(37, 99, 235, .045), transparent 260px),
    linear-gradient(180deg, #f1f5fa 0%, #e9f0f7 100%);
  border-right: 0;
  box-shadow: 8px 0 28px rgba(31, 52, 80, .06);
}
.sidebar::after {
  content: "";
  position: absolute;
  right: 0;
  top: 22px;
  width: 1px;
  height: 92px;
  display: none;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 2px 7px 23px; }
.brand-mark {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: white;
  background: linear-gradient(145deg, #ff7b4b, #ed511b);
  box-shadow: 0 6px 16px rgba(255, 107, 53, .17);
  font-weight: 800;
  font-size: 18px;
}
.brand strong { display: block; font-size: 14px; font-weight: 750; letter-spacing: .015em; }
.brand strong { color: #1e2f46; }
.brand small, .environment-card small {
  display: block;
  margin-top: 4px;
  color: #7488a4;
  font-size: 8px;
  font-weight: 650;
  letter-spacing: .16em;
}
.main-nav {
  min-height: 0;
  margin: 8px -5px 12px 0;
  padding-right: 5px;
  display: grid;
  align-content: start;
  gap: 4px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(74, 103, 139, .24) transparent;
}
.nav-link {
  position: relative;
  appearance: none;
  width: 100%;
  min-height: 43px;
  padding: 9px 12px;
  display: flex;
  align-items: center;
  gap: 11px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #33445a;
  text-align: left;
  font-size: 13px;
  font-weight: 510;
  transition: color .16s ease, background .16s ease;
}
.sidebar .nav-group-start { margin-top: 12px; }
.sidebar .nav-group-start::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  top: -7px;
  height: 1px;
  background: rgba(74, 108, 151, .12);
}
.nav-link:hover { color: var(--blue); background: rgba(37, 99, 235, .06); }
.nav-link.active {
  color: var(--blue);
  background: linear-gradient(100deg, rgba(37, 99, 235, .11), rgba(37, 99, 235, .06));
  box-shadow: none;
  font-weight: 650;
}
.sidebar .nav-link.active::before { display: none; }
.nav-link.active::before {
  content: "";
  position: absolute;
  left: -15px;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: #60a5fa;
  box-shadow: 0 0 14px rgba(96, 165, 250, .62);
}
.nav-icon {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: transparent;
  color: #667b96;
  font-size: 10px;
  font-weight: 800;
  transition: color .16s ease, transform .16s ease;
}
.nav-link:hover .nav-icon { transform: translateY(-1px) scale(1.06); }
.nav-link.active .nav-icon { color: var(--blue); background: transparent; }
.environment-card {
  flex: 0 0 auto;
  margin-top: auto;
  padding: 13px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border: 0;
  border-top: 1px solid rgba(74, 108, 151, .13);
  border-radius: 0;
  background: transparent;
}
.environment-card strong { font-size: 11px; font-weight: 600; color: #354962; }
.status-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  margin-top: 4px;
  border-radius: 50%;
  background: #42ca91;
  box-shadow: 0 0 0 4px rgba(66, 202, 145, .11), 0 0 12px rgba(66, 202, 145, .35);
}

.workspace { grid-column: 2; min-width: 0; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  height: 88px;
  padding: 16px 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 0;
  background: rgba(247, 249, 252, .86);
  box-shadow: 0 8px 22px rgba(31, 52, 80, .055);
  backdrop-filter: blur(18px) saturate(1.3);
}
.eyebrow {
  margin: 0 0 4px;
  color: #5f7899;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .14em;
}
h1, h2, h3 { margin-top: 0; color: var(--ink); font-weight: 760; letter-spacing: -.025em; }
h1 { margin-bottom: 0; font-size: 25px; line-height: 1.2; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.role-switcher[hidden] { display: none !important; }
.role-switcher { display: flex; align-items: center; gap: 8px; color: var(--ink-soft); font-size: 10px; }
.role-switcher select {
  min-width: 118px;
  padding: 9px 28px 9px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}
.assistant-button {
  padding: 9px 14px 9px 9px;
  border: 0;
  border-radius: 9px;
  color: white;
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
  box-shadow: 0 8px 20px rgba(37, 99, 235, .21);
  font-size: 12px;
  font-weight: 700;
  transition: transform .18s ease, box-shadow .18s ease;
}
.assistant-button:hover { transform: translateY(-1px); box-shadow: 0 11px 24px rgba(37, 99, 235, .28); }
.assistant-button span {
  display: inline-grid;
  place-items: center;
  width: 23px;
  height: 23px;
  margin-right: 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, .16);
  font-size: 9px;
}
.avatar {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 2px solid white;
  border-radius: 10px;
  color: #315b99;
  background: #eaf1fb;
  box-shadow: var(--shadow-sm);
  font-size: 13px;
  font-weight: 800;
}

.content { width: 100%; max-width: 1520px; margin: 0 auto; padding: 28px 34px 52px; }
.content.content--flush { max-width: none; height: calc(100vh - 88px); padding: 0; }
.page-intro { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.page-intro h2 { margin-bottom: 6px; font-size: 23px; }
.page-intro p { margin: 0; color: var(--ink-soft); font-size: 12px; line-height: 1.7; }
.source-chip {
  padding: 7px 10px;
  white-space: nowrap;
  border: 1px solid #cbd8ed;
  border-radius: 999px;
  color: #315b99;
  background: var(--blue-pale);
  font-size: 9px;
  font-weight: 650;
}
.source-chip::before { content: "●"; margin-right: 7px; color: var(--blue); }

.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.metric-card {
  position: relative;
  min-height: 128px;
  padding: 19px 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(145deg, #ffffff, #fbfcfe);
  box-shadow: var(--shadow-sm);
  animation: card-in .38s both;
}
.metric-card:nth-child(2) { animation-delay: .04s; }
.metric-card:nth-child(3) { animation-delay: .08s; }
.metric-card:nth-child(4) { animation-delay: .12s; }
.metric-card::before { content: ""; position: absolute; left: 0; top: 0; width: 100%; height: 3px; background: linear-gradient(90deg, var(--blue), #56a5ff); }
.metric-card:nth-child(2)::before { background: linear-gradient(90deg, var(--accent), #ff9a6c); }
.metric-card:nth-child(3)::before { background: linear-gradient(90deg, #8957e5, #b38aff); }
.metric-card:nth-child(4)::before { background: linear-gradient(90deg, var(--green), #4ac39f); }
.metric-card::after { content: attr(data-index); position: absolute; right: 14px; top: 14px; color: #e7ecf2; font-size: 30px; font-weight: 850; letter-spacing: -.08em; }
.metric-label { color: var(--ink-soft); font-size: 10px; font-weight: 650; }
.metric-value { display: block; margin: 12px 0 5px; font-size: 32px; line-height: 1; letter-spacing: -.04em; }
.metric-note { color: var(--ink-soft); font-size: 9px; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, .75fr); gap: 16px; }
.panel { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.panel-head { min-height: 57px; padding: 15px 18px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, #fff, #fbfcfd); }
.panel-head h3 { margin: 0; font-size: 15px; }
.panel-head small { color: var(--ink-soft); font-size: 9px; }
.panel-body { padding: 17px 18px; }
.project-list { display: grid; gap: 3px; }
.project-row { display: grid; grid-template-columns: minmax(180px,1.6fr) minmax(130px,1fr) 140px 62px; gap: 15px; align-items: center; padding: 14px 4px; border-bottom: 1px solid #edf0f4; transition: background .16s ease; }
.project-row:hover { background: var(--surface-soft); }
.project-row:last-child { border-bottom: 0; }
.project-name strong { display: block; font-size: 12px; }
.project-name small, .muted { color: var(--ink-soft); font-size: 9px; }
.progress-track { height: 6px; overflow: hidden; border-radius: 10px; background: #e7ecf2; }
.progress-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), #58a0ff); }
.progress-number { text-align: right; color: #3d4b60; font-family: "SFMono-Regular", Consolas, monospace; font-size: 11px; }
.status-pill { display: inline-block; padding: 4px 8px; border-radius: 999px; color: var(--green); background: var(--green-pale); font-size: 9px; font-weight: 650; }
.status-pill.warning, .status-pill.urgent { color: var(--danger); background: #ffeded; }
.notice-list { list-style: none; margin: 0; padding: 0; }
.notice-list li { display: grid; grid-template-columns: 42px 1fr; gap: 10px; padding: 13px 2px; border-bottom: 1px solid #edf0f4; font-size: 11px; line-height: 1.55; }
.notice-list li:last-child { border: 0; }
.notice-list time { color: var(--accent-dark); font-family: "SFMono-Regular", Consolas, monospace; font-size: 9px; font-weight: 700; }

.data-table-wrap { overflow-x: auto; }
.data-table { width: 100%; min-width: 720px; border-collapse: collapse; }
.data-table th { padding: 12px 14px; color: #657187; background: #f4f7fa; border-bottom: 1px solid var(--line); font-size: 9px; font-weight: 750; letter-spacing: .06em; text-align: left; }
.data-table td { padding: 14px; border-bottom: 1px solid #edf0f4; font-size: 11px; vertical-align: top; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover td { background: #f8faff; }
.primary-text { color: #15233a; font-weight: 700; }
.money { font-family: "SFMono-Regular", Consolas, monospace; font-weight: 750; }
.toolbar { display: flex; gap: 9px; margin-bottom: 14px; }
.search-input { flex: 1; max-width: 560px; padding: 11px 13px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--surface); outline: none; }
.search-input:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37, 99, 235, .10); }
.primary-button { padding: 10px 17px; border: 0; border-radius: 9px; color: white; background: var(--blue); box-shadow: 0 7px 16px rgba(37, 99, 235, .16); font-weight: 650; }
.empty, .error-state, .loading-state { padding: 60px 20px; color: var(--ink-soft); text-align: center; }
.error-state { color: var(--danger); }

.embedded-app-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 13px; }
.embedded-app-head h2 { margin: 3px 0 6px; font-size: 23px; }
.embedded-app-head p { margin: 0; color: var(--ink-soft); font-size: 11px; }
.external-link-button { display: inline-flex; align-items: center; justify-content: center; padding: 9px 13px; border: 1px solid var(--line-strong); border-radius: 8px; color: #344156; background: var(--surface); box-shadow: var(--shadow-sm); text-decoration: none; white-space: nowrap; font-size: 10px; font-weight: 650; }
.external-link-button:hover { color: var(--blue); border-color: #9eb8e6; background: var(--blue-pale); }
.embedded-app-notice { display: flex; align-items: center; gap: 9px; margin-bottom: 9px; padding: 9px 12px; border: 1px solid #f0d7aa; border-radius: 8px; color: #80581c; background: var(--warning-pale); font-size: 10px; }
.embedded-app-notice .status-dot { flex: 0 0 auto; background: #e8a12f; box-shadow: 0 0 0 4px rgba(232, 161, 47, .11); }
.embedded-app-notice--ai { color: #215f51; border-color: #bcded3; background: var(--green-pale); }
.embedded-app-notice--ai .status-dot { background: #28a77f; box-shadow: 0 0 0 4px rgba(40, 167, 127, .11); }
.embedded-app-frame-wrap { min-height: 620px; height: calc(100vh - 238px); overflow: hidden; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-lg); }
.embedded-app-frame-wrap--flush { min-height: 0; height: 100%; border: 0; border-radius: 0; box-shadow: none; }
.embedded-app-frame-wrap--ai { background: #080b0c; }
.embedded-app-frame { display: block; width: 100%; height: 100%; border: 0; background: white; }
.assistant-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 16px; min-height: 610px; }
.assistant-conversations, .assistant-chat { min-width: 0; overflow: hidden; }
.assistant-conversations { padding: 14px; background: rgba(255,255,255,.88); }
.assistant-sidebar-head, .assistant-chat-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.assistant-sidebar-head { padding: 4px 2px 13px; border-bottom: 1px solid var(--line); }
.assistant-sidebar-head h3, .assistant-chat-head h3 { margin: 3px 0 0; font-size: 16px; }
.assistant-sidebar-head .eyebrow, .assistant-chat-head .eyebrow { margin: 0; }
.assistant-sidebar-head .primary-button { padding: 7px 10px; font-size: 12px; white-space: nowrap; }
.assistant-conversation-list { display: grid; gap: 5px; padding-top: 10px; }
.assistant-conversation-item { display: grid; grid-template-columns: minmax(0, 1fr) 24px; align-items: stretch; border: 1px solid transparent; border-radius: 9px; }
.assistant-conversation-item:hover, .assistant-conversation-item.active { background: var(--blue-pale); border-color: #c9dafd; }
.assistant-conversation-open { min-width: 0; padding: 10px 8px; border: 0; background: transparent; text-align: left; color: var(--ink); }
.assistant-conversation-open strong, .assistant-conversation-open small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.assistant-conversation-open strong { font-size: 13px; font-weight: 650; }
.assistant-conversation-open small { margin-top: 4px; color: var(--ink-soft); font-size: 10px; }
.assistant-conversation-delete { border: 0; background: transparent; color: #9aa5b5; font-size: 18px; opacity: .35; }
.assistant-conversation-item:hover .assistant-conversation-delete { opacity: 1; }
.assistant-chat { display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; min-height: 610px; background: var(--surface); }
.assistant-chat-head { padding: 16px 18px; border-bottom: 1px solid var(--line); }
.assistant-messages { min-height: 0; overflow-y: auto; padding: 20px clamp(14px, 4vw, 42px); background: linear-gradient(180deg, #fbfcfe, #f7f9fc); }
.assistant-empty { display: grid; place-items: center; align-content: center; min-height: 220px; color: var(--ink-soft); text-align: center; }
.assistant-empty strong { color: var(--ink); font-size: 17px; }
.assistant-empty p { margin: 8px 0 0; font-size: 13px; }
.assistant-empty--small { min-height: 160px; font-size: 12px; line-height: 1.8; }
.assistant-empty--small small { color: var(--ink-soft); }
.assistant-message { display: flex; gap: 10px; max-width: 86%; margin: 0 0 17px; align-items: flex-start; }
.assistant-message.user { margin-left: auto; flex-direction: row-reverse; }
.assistant-message-role { display: grid; place-items: center; width: 28px; height: 28px; flex: 0 0 auto; border-radius: 9px; color: #fff; background: var(--blue); font-size: 11px; font-weight: 700; }
.assistant-message.assistant .assistant-message-role { background: var(--accent); }
.assistant-message-content { padding: 10px 13px; border: 1px solid var(--line); border-radius: 4px 12px 12px 12px; background: #fff; font-size: 13px; line-height: 1.7; box-shadow: var(--shadow-sm); }
.assistant-message.user .assistant-message-content { border-color: #c9dafd; border-radius: 12px 4px 12px 12px; background: var(--blue-pale); }
.assistant-thinking { margin: 0 0 16px 38px; color: var(--ink-soft); font-size: 12px; }
.assistant-error { margin: 8px 0; padding: 10px 12px; border-radius: 8px; color: var(--danger); background: #fff1f1; font-size: 12px; }
.assistant-composer { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 14px 18px 7px; border-top: 1px solid var(--line); background: #fff; }
.assistant-composer textarea { width: 100%; resize: vertical; min-height: 44px; max-height: 120px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 9px; color: var(--ink); background: var(--surface-soft); }
.assistant-composer .primary-button { align-self: end; min-height: 44px; }
.assistant-hint { margin: 0; padding: 0 18px 12px; color: var(--ink-soft); font-size: 11px; }
.hermes-page { min-height: calc(100vh - 130px); }
.hermes-chat { min-height: calc(100vh - 245px); border-top: 3px solid var(--accent); }
.hermes-chat .assistant-messages { background: linear-gradient(155deg, #fbfcfe 0%, #f5f8fb 58%, #eef6f2 100%); }
.assistant-message-content p { margin: 0 0 8px; }
.assistant-message-content p:last-child { margin-bottom: 0; }
.assistant-message-content ul { margin: 5px 0 8px; padding-left: 20px; }
.assistant-message-content code { padding: 2px 5px; border-radius: 4px; background: #eef2f7; font-family: "SFMono-Regular", Consolas, monospace; font-size: .92em; }
.assistant-markdown-table { max-width: 100%; margin: 4px 0 10px; overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
.assistant-markdown-table table { width: 100%; min-width: 420px; border-collapse: collapse; }
.assistant-markdown-table th, .assistant-markdown-table td { padding: 8px 10px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.assistant-markdown-table th:last-child, .assistant-markdown-table td:last-child { border-right: 0; }
.assistant-markdown-table tr:last-child td { border-bottom: 0; }
.assistant-markdown-table th { color: #43516a; background: #f0f4f8; font-size: 11px; }
.mobile-nav { display: none; }
.mobile-more-sheet { display: none; }
.admin-metrics { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; margin-bottom: 15px; }
.admin-metrics article { padding: 16px 18px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); box-shadow: var(--shadow-sm); }
.admin-metrics span { color: var(--ink-soft); font-size: 9px; }
.admin-metrics strong { display: block; margin-top: 7px; font-size: 24px; }
.admin-directory { margin-bottom: 15px; }
.admin-toolbar { display: flex; gap: 9px; padding: 13px 16px; border-bottom: 1px solid var(--line); background: var(--surface-soft); }
.admin-select { min-width: 125px; padding: 8px 28px 8px 10px; border: 1px solid var(--line-strong); border-radius: 8px; color: var(--ink); background: white; font-size: 10px; }
.admin-table { min-width: 900px; }
.admin-table td { vertical-align: middle; }
.admin-switch { display: flex; align-items: center; gap: 6px; color: var(--ink-soft); font-size: 10px; }
.admin-save { padding: 7px 11px; border: 1px solid #a9c1e9; border-radius: 7px; color: var(--blue); background: var(--blue-pale); font-size: 10px; font-weight: 700; }
.admin-save:disabled { opacity: .6; }
.admin-row-actions { display: flex; gap: 6px; }
.admin-permission-open, .admin-reset { padding: 7px 11px; border: 1px solid var(--line-strong); border-radius: 7px; color: var(--ink); background: var(--surface); font-size: 10px; font-weight: 700; white-space: nowrap; }
.admin-permission-open:hover, .admin-reset:hover { border-color: #9bb6df; color: var(--blue); background: var(--blue-pale); }
.admin-permission-open:disabled, .admin-reset:disabled { opacity: .55; }
.admin-permissions { margin-bottom: 15px; overflow: hidden; }
.admin-permission-head { align-items: center; }
.admin-permission-empty { padding: 34px 20px; color: var(--ink-soft); text-align: center; }
.admin-permission-empty strong { display: block; margin-bottom: 7px; color: var(--ink); font-size: 15px; }
.admin-permission-empty p { margin: 0; font-size: 11px; }
.admin-permission-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); }
.admin-module-toggle { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 72px; padding: 14px 17px; background: var(--surface); cursor: pointer; }
.admin-module-toggle:hover { background: var(--surface-soft); }
.admin-module-toggle strong, .admin-module-toggle small { display: block; }
.admin-module-toggle strong { font-size: 12px; }
.admin-module-toggle small { margin-top: 5px; color: var(--ink-soft); font-size: 9px; }
.admin-module-toggle .admin-switch { flex: 0 0 auto; }
.admin-permission-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 16px; border-top: 1px solid var(--line); }
.admin-audit { margin-bottom: 20px; }

@keyframes card-in {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1050px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .project-row { grid-template-columns: minmax(180px,1.6fr) 1fr 62px; }
  .project-row > :nth-child(2) { display: none; }
}

@media (max-width: 760px) {
  body { padding-bottom: 65px; }
  .app-shell { display: block; }
  .sidebar { display: none; }
  .workspace { width: 100%; }
  .topbar { height: 72px; padding: 11px 14px; }
  .topbar h1 { font-size: 19px; }
  .role-switcher span, .assistant-button { display: none; }
  .role-switcher select { max-width: 112px; min-width: 0; font-size: 10px; }
  .content { padding: 18px 12px 28px; }
  .content.content--flush { height: calc(100vh - 72px - 65px); padding: 0; }
  .page-intro, .embedded-app-head { align-items: flex-start; flex-direction: column; }
  .embedded-app-frame-wrap { min-height: 560px; height: calc(100vh - 260px); border-radius: 10px; }
  .assistant-layout { grid-template-columns: 1fr; min-height: 0; }
  .assistant-conversations { min-height: 0; }
  .assistant-conversation-list { max-height: 180px; overflow-y: auto; }
  .assistant-chat { min-height: 560px; }
  .source-chip { white-space: normal; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 9px; }
  .admin-metrics { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .admin-toolbar { align-items: stretch; flex-direction: column; }
  .admin-permission-grid { grid-template-columns: 1fr; }
  .admin-permission-actions { align-items: stretch; flex-direction: column; }
  .admin-permission-actions .primary-button { width: 100%; }
  .metric-card { min-height: 118px; padding: 16px 14px; }
  .metric-value { font-size: 28px; }
  .project-row { grid-template-columns: 1fr 50px; }
  .project-row > :nth-child(2), .project-row > :nth-child(3) { display: none; }
  .mobile-nav { position: fixed; z-index: 30; inset: auto 0 0; height: 65px; padding: 5px 7px max(5px, env(safe-area-inset-bottom)); display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: rgba(10, 16, 32, .96); backdrop-filter: blur(14px); }
  .mobile-nav .nav-link { justify-content: center; flex-direction: column; gap: 2px; min-height: 54px; padding: 4px 2px; color: #b8c7e0; font-size: 9px; text-align: center; }
  .mobile-nav .nav-icon { width: 22px; height: 22px; }
  .mobile-nav .nav-link.active { color: white; background: transparent; border-color: transparent; }
  .mobile-nav .nav-link.active::before { left: 30%; right: 30%; top: auto; bottom: -5px; width: auto; height: 3px; border-radius: 3px 3px 0 0; }
  .mobile-more-sheet { position: absolute; left: 8px; right: 8px; bottom: 65px; padding: 9px; grid-template-columns: repeat(2, 1fr); gap: 4px; border: 1px solid rgba(255,255,255,.10); border-radius: 12px; background: var(--navy-900); box-shadow: 0 -16px 45px rgba(10,16,32,.28); }
  .mobile-more-sheet.open { display: grid; }
  .mobile-more-sheet .nav-link { align-items: flex-start; padding: 9px; }
}
